osgEarth 2.1.1
Public Types | Public Member Functions | Protected Attributes

osgEarth::Symbology::MarkerSymbol Class Reference

Inheritance diagram for osgEarth::Symbology::MarkerSymbol:
Collaboration diagram for osgEarth::Symbology::MarkerSymbol:

List of all members.

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

Detailed Description

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.


Member Enumeration Documentation

Controls the placements of models.

Enumerator:
PLACEMENT_CENTROID 

Places one model instance at the centroid of the feature.

PLACEMENT_VERTEX 

Places a model instance at each feature point.

PLACEMENT_INTERVAL 

Places model instances at regular intervals within/along the feature geometry, according to density.

PLACEMENT_RANDOM 

Scatters model instances randomly within/along feature, according to density.

Definition at line 40 of file MarkerSymbol.


Constructor & Destructor Documentation

MarkerSymbol::MarkerSymbol ( const Config conf = Config())

Definition at line 24 of file MarkerSymbol.cpp.

                                               :
Symbol     ( conf ),
_placement ( PLACEMENT_CENTROID ),
_density   ( 25.0f ),
_randomSeed( 0 )
{
    mergeConfig( conf );
}

Here is the call graph for this function:


Member Function Documentation

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; }

Here is the caller graph for this function:

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;
}

Here is the call graph for this function:

osg::Image* osgEarth::Symbology::MarkerSymbol::getImage ( ) const [inline]

Definition at line 83 of file MarkerSymbol.

{ return _image.get(); }

Here is the caller graph for this function:

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" );
}

Here is the call graph for this function:

Here is the caller graph for this function:

optional<Placement>& osgEarth::Symbology::MarkerSymbol::placement ( ) [inline]

How to map feature geometry to model placement. (default is PLACEMENT_CENTROID)

Definition at line 64 of file MarkerSymbol.

{ return _placement; }

Here is the caller graph for this function:

const optional<Placement>& osgEarth::Symbology::MarkerSymbol::placement ( ) const [inline]

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; }

Here is the caller graph for this function:

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; }

Here is the caller graph for this function:

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; }

Here is the caller graph for this function:

const optional<StringExpression>& osgEarth::Symbology::MarkerSymbol::url ( ) const [inline]

Definition at line 61 of file MarkerSymbol.

{ return _url; }        

Member Data Documentation

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.

Definition at line 98 of file MarkerSymbol.

Definition at line 95 of file MarkerSymbol.

Definition at line 94 of file MarkerSymbol.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines