/* -*-c++-*- */
/* osgEarth - Geospatial SDK for OpenSceneGraph
* Copyright 2020 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see
*/
#pragma once
#include
#include
#include
namespace osgEarth
{
using namespace osgEarth;
/**
* Symbol that directs the GeometryCompiler to create extruded 3D geometry
* from 2D vector data.
*/
class OSGEARTH_EXPORT ExtrusionSymbol : public Symbol
{
public:
META_Object(osgEarth, ExtrusionSymbol);
ExtrusionSymbol(const ExtrusionSymbol& rhs,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
ExtrusionSymbol( const Config& conf =Config() );
/** dtor */
virtual ~ExtrusionSymbol() { }
/** Height to which to extrude geometry above the footprint (for HEIGHT_REFERENCE_Z)
or above MSL (for HEIGHT_REFERENCE_MSL) */
optional& height() { return _height; }
const optional& height() const { return _height; }
/** Simple expression to evaluate to get height */
optional& heightExpression() { return _heightExpr; }
const optional& heightExpression() const { return _heightExpr; }
/** Whether the top cap of the extruded geometry should be flat (default=true) */
optional& flatten() { return _flatten; }
const optional& flatten() const { return _flatten; }
/** Name of a style describing how to symbolize the extruded walls */
optional& wallStyleName() { return _wallStyleName; }
const optional& wallStyleName() const { return _wallStyleName; }
/** Name of a style describing how to symbolize the elevated rooftop */
optional& roofStyleName() { return _roofStyleName; }
const optional& roofStyleName() const { return _roofStyleName; }
/** Percentage by which to darken the color of the bottom of the walls relative
to the main wall color (default = 0.0, range = [0..1]) */
optional& wallGradientPercentage() { return _wallGradientPercentage; }
const optional& wallGradientPercentage() const { return _wallGradientPercentage; }
/** Percentage by which to shade the wells to simulate lighting [0..1] */
optional& wallShadePercentage() { return _wallShadePercentage; }
const optional& wallShadePercentage() const { return _wallShadePercentage; }
public:
virtual Config getConfig() const;
virtual void mergeConfig( const Config& conf );
static void parseSLD(const Config& c, class Style& style);
protected:
optional _height;
optional _flatten;
optional _heightExpr;
optional _wallStyleName;
optional _roofStyleName;
optional _wallGradientPercentage;
optional _wallShadePercentage;
};
} // namespace osgEarth