osgEarth 2.1.1
|
Public Types | |
enum | Placement { PLACEMENT_CENTROID, PLACEMENT_VERTEX, PLACEMENT_INTERVAL, PLACEMENT_RANDOM } |
Public Member Functions | |
MarkerSymbol (const Config &conf=Config()) | |
optional< StringExpression > & | url () |
const optional < StringExpression > & | url () const |
optional< Placement > & | placement () |
const optional< Placement > & | placement () const |
optional< float > & | density () |
const optional< float > & | density () const |
optional< NumericExpression > & | scale () |
const optional < NumericExpression > & | scale () const |
optional< unsigned > & | randomSeed () |
const optional< unsigned > & | randomSeed () const |
void | setImage (osg::Image *image) |
osg::Image * | getImage () const |
void | setModel (osg::Node *node) |
osg::Node * | getNode () const |
virtual Config | getConfig () const |
virtual void | mergeConfig (const Config &conf) |
Protected Attributes | |
optional< StringExpression > | _url |
optional< NumericExpression > | _scale |
optional< Placement > | _placement |
optional< float > | _density |
optional< unsigned > | _randomSeed |
osg::ref_ptr< osg::Image > | _image |
osg::ref_ptr< osg::Node > | _node |
The MarkerSymbol describes replacement of geometry with "markers". A marker it another object like a 3D model (node) or an image.
Definition at line 34 of file MarkerSymbol.
Controls the placements of models.
Definition at line 40 of file MarkerSymbol.
Definition at line 24 of file MarkerSymbol.cpp.
: Symbol ( conf ), _placement ( PLACEMENT_CENTROID ), _density ( 25.0f ), _randomSeed( 0 ) { mergeConfig( conf ); }
optional<float>& osgEarth::Symbology::MarkerSymbol::density | ( | ) | [inline] |
For PLACEMENT_RANDOM/INTERVAL, the scattering density in instances per sqkm
Definition at line 68 of file MarkerSymbol.
{ return _density; }
const optional<float>& osgEarth::Symbology::MarkerSymbol::density | ( | ) | const [inline] |
Definition at line 69 of file MarkerSymbol.
{ return _density; }
Config MarkerSymbol::getConfig | ( | ) | const [virtual] |
Reimplemented from osgEarth::Symbology::Symbol.
Definition at line 34 of file MarkerSymbol.cpp.
{ Config conf = Symbol::getConfig(); conf.key() = "marker"; conf.addObjIfSet( "url", _url ); conf.addObjIfSet( "scale", _scale ); conf.addIfSet( "placement", "vertex", _placement, PLACEMENT_VERTEX ); conf.addIfSet( "placement", "interval", _placement, PLACEMENT_INTERVAL ); conf.addIfSet( "placement", "random", _placement, PLACEMENT_RANDOM ); conf.addIfSet( "density", _density ); conf.addIfSet( "random_seed", _randomSeed ); conf.addNonSerializable( "MarkerSymbol::image", _image.get() ); conf.addNonSerializable( "MarkerSymbol::node", _node.get() ); return conf; }
osg::Image* osgEarth::Symbology::MarkerSymbol::getImage | ( | ) | const [inline] |
Definition at line 83 of file MarkerSymbol.
{ return _image.get(); }
osg::Node* osgEarth::Symbology::MarkerSymbol::getNode | ( | ) | const [inline] |
Definition at line 87 of file MarkerSymbol.
{ return _node.get(); }
void MarkerSymbol::mergeConfig | ( | const Config & | conf | ) | [virtual] |
Definition at line 51 of file MarkerSymbol.cpp.
{ conf.getObjIfSet( "url", _url ); conf.getObjIfSet( "scale", _scale ); conf.getIfSet( "placement", "vertex", _placement, PLACEMENT_VERTEX ); conf.getIfSet( "placement", "interval", _placement, PLACEMENT_INTERVAL ); conf.getIfSet( "placement", "random", _placement, PLACEMENT_RANDOM ); conf.getIfSet( "density", _density ); conf.getIfSet( "random_seed", _randomSeed ); _image = conf.getNonSerializable<osg::Image>( "MarkerSymbol::image" ); _node = conf.getNonSerializable<osg::Node>( "MarkerSymbol::node" ); }
How to map feature geometry to model placement. (default is PLACEMENT_CENTROID)
Definition at line 64 of file MarkerSymbol.
{ return _placement; }
Definition at line 65 of file MarkerSymbol.
{ return _placement; }
optional<unsigned>& osgEarth::Symbology::MarkerSymbol::randomSeed | ( | ) | [inline] |
Seeding value for the randomizer
Definition at line 76 of file MarkerSymbol.
{ return _randomSeed; }
const optional<unsigned>& osgEarth::Symbology::MarkerSymbol::randomSeed | ( | ) | const [inline] |
Definition at line 77 of file MarkerSymbol.
{ return _randomSeed; }
const optional<NumericExpression>& osgEarth::Symbology::MarkerSymbol::scale | ( | ) | const [inline] |
Definition at line 73 of file MarkerSymbol.
{ return _scale; }
optional<NumericExpression>& osgEarth::Symbology::MarkerSymbol::scale | ( | ) | [inline] |
Model instance scale factor
Definition at line 72 of file MarkerSymbol.
{ return _scale; }
void osgEarth::Symbology::MarkerSymbol::setImage | ( | osg::Image * | image | ) | [inline] |
Explicit image to use for 2D icon placemet
Definition at line 82 of file MarkerSymbol.
{ _image = image; }
void osgEarth::Symbology::MarkerSymbol::setModel | ( | osg::Node * | node | ) | [inline] |
Explicit model to use for model placement
Definition at line 86 of file MarkerSymbol.
{ _node = node; }
optional<StringExpression>& osgEarth::Symbology::MarkerSymbol::url | ( | ) | [inline] |
URI of the model to use for substitution.
Definition at line 60 of file MarkerSymbol.
{ return _url; }
const optional<StringExpression>& osgEarth::Symbology::MarkerSymbol::url | ( | ) | const [inline] |
Definition at line 61 of file MarkerSymbol.
{ return _url; }
optional<float> osgEarth::Symbology::MarkerSymbol::_density [protected] |
Definition at line 97 of file MarkerSymbol.
osg::ref_ptr<osg::Image> osgEarth::Symbology::MarkerSymbol::_image [protected] |
Definition at line 100 of file MarkerSymbol.
osg::ref_ptr<osg::Node> osgEarth::Symbology::MarkerSymbol::_node [protected] |
Definition at line 101 of file MarkerSymbol.
Definition at line 96 of file MarkerSymbol.
optional<unsigned> osgEarth::Symbology::MarkerSymbol::_randomSeed [protected] |
Definition at line 98 of file MarkerSymbol.
Definition at line 95 of file MarkerSymbol.
Definition at line 94 of file MarkerSymbol.