osgEarth 2.1.1
|
Public Member Functions | |
FeatureModelSource (const FeatureModelSourceOptions &options=FeatureModelSourceOptions()) | |
virtual void | initialize (const std::string &referenceURI, const osgEarth::Map *map) |
virtual osg::Node * | createNode (ProgressCallback *progress) |
virtual FeatureNodeFactory * | createFeatureNodeFactory ()=0 |
void | setFeatureSource (FeatureSource *source) |
FeatureSource * | getFeatureSource () |
virtual const FeatureModelSourceOptions & | getFeatureModelOptions () const |
const osgEarth::Map * | getMap () const |
virtual osg::Referenced * | createBuildData () |
virtual osg::Object * | cloneType () const |
virtual osg::Object * | clone (const osg::CopyOp &) const |
virtual bool | isSameKindAs (const osg::Object *obj) const |
virtual const char * | className () const |
virtual const char * | libraryName () const |
Protected Member Functions | |
virtual | ~FeatureModelSource () |
Protected Attributes | |
osg::ref_ptr< FeatureSource > | _features |
osg::ref_ptr< const Map > | _map |
const FeatureModelSourceOptions | _options |
osg::ref_ptr< FeatureNodeFactory > | _factory |
A ModelSource that renders Feature data from a FeatureSource.
Definition at line 165 of file FeatureModelSource.
FeatureModelSource::FeatureModelSource | ( | const FeatureModelSourceOptions & | options = FeatureModelSourceOptions() | ) |
Constructs a new feature model source with the provided options.
Definition at line 109 of file FeatureModelSource.cpp.
: ModelSource( options ), _options( options ) { // the data source from which to pull features: if ( _options.featureSource().valid() ) { _features = _options.featureSource().get(); } else if ( _options.featureOptions().isSet() ) { _features = FeatureSourceFactory::create( _options.featureOptions().value() ); if ( !_features.valid() ) { OE_WARN << "FeatureModelSource - no valid feature source provided" << std::endl; } } }
virtual osgEarth::Features::FeatureModelSource::~FeatureModelSource | ( | ) | [inline, protected, virtual] |
DTOR is protected to prevent this object from being allocated on the stack
Definition at line 211 of file FeatureModelSource.
{ }
virtual const char* osgEarth::Features::FeatureModelSource::className | ( | ) | const [inline, virtual] |
Reimplemented from osgEarth::ModelSource.
Definition at line 205 of file FeatureModelSource.
{ return "FeatureModelSource"; }
virtual osg::Object* osgEarth::Features::FeatureModelSource::clone | ( | const osg::CopyOp & | ) | const [inline, virtual] |
Reimplemented from osgEarth::ModelSource.
Definition at line 203 of file FeatureModelSource.
{ return 0; } // clone() not appropriate
virtual osg::Object* osgEarth::Features::FeatureModelSource::cloneType | ( | ) | const [inline, virtual] |
Reimplemented from osgEarth::ModelSource.
Definition at line 202 of file FeatureModelSource.
{ return 0; } // cloneType() not appropriate
virtual osg::Referenced* osgEarth::Features::FeatureModelSource::createBuildData | ( | ) | [inline, virtual] |
Creates an implementation-specific data object to be passed to buildNodeForStyle
Definition at line 197 of file FeatureModelSource.
{ return NULL; }
virtual FeatureNodeFactory* osgEarth::Features::FeatureModelSource::createFeatureNodeFactory | ( | ) | [pure virtual] |
Implemented in anonymous_namespace{FeatureGeomModelSource.cpp}::FeatureGeomModelSource, anonymous_namespace{FeatureLabelModelSource.cpp}::FeatureLabelModelSource, and anonymous_namespace{FeatureStencilModelSource.cpp}::FeatureStencilModelSource.
osg::Node * FeatureModelSource::createNode | ( | ProgressCallback * | progress | ) | [virtual] |
Subclass implements this method to create the mode node.
Implements osgEarth::ModelSource.
Definition at line 159 of file FeatureModelSource.cpp.
{ if ( !_factory.valid() ) _factory = createFeatureNodeFactory(); if ( !_factory.valid() ) return 0L; if ( !_features.valid() || !_features->getFeatureProfile() ) { OE_WARN << LC << "Invalid feature source" << std::endl; return 0L; } Session* session = new Session( _map.get(), _options.styles().get() ); FeatureModelGraph* graph = new FeatureModelGraph( _features.get(), _options, _factory.get(), session ); return graph; }
virtual const FeatureModelSourceOptions& osgEarth::Features::FeatureModelSource::getFeatureModelOptions | ( | ) | const [inline, virtual] |
Reimplemented in anonymous_namespace{FeatureStencilModelSource.cpp}::FeatureStencilModelSource.
Definition at line 192 of file FeatureModelSource.
{ return _options; }
FeatureSource* osgEarth::Features::FeatureModelSource::getFeatureSource | ( | ) | [inline] |
The underlying feature source.
Definition at line 190 of file FeatureModelSource.
{ return _features.get(); }
const osgEarth::Map* osgEarth::Features::FeatureModelSource::getMap | ( | ) | const [inline] |
Definition at line 194 of file FeatureModelSource.
{ return _map.get(); }
void FeatureModelSource::initialize | ( | const std::string & | referenceURI, |
const osgEarth::Map * | map | ||
) | [virtual] |
Initialize the NodeSource.
Reimplemented from osgEarth::ModelSource.
Reimplemented in anonymous_namespace{FeatureGeomModelSource.cpp}::FeatureGeomModelSource, anonymous_namespace{FeatureLabelModelSource.cpp}::FeatureLabelModelSource, and anonymous_namespace{FeatureStencilModelSource.cpp}::FeatureStencilModelSource.
Definition at line 142 of file FeatureModelSource.cpp.
virtual bool osgEarth::Features::FeatureModelSource::isSameKindAs | ( | const osg::Object * | obj | ) | const [inline, virtual] |
Reimplemented from osgEarth::ModelSource.
Definition at line 204 of file FeatureModelSource.
{ return dynamic_cast<const FeatureModelSource*>(obj)!=NULL; }
virtual const char* osgEarth::Features::FeatureModelSource::libraryName | ( | ) | const [inline, virtual] |
Reimplemented from osgEarth::ModelSource.
Definition at line 206 of file FeatureModelSource.
{ return "osgEarthFeatures"; }
void FeatureModelSource::setFeatureSource | ( | FeatureSource * | source | ) |
osg::ref_ptr<FeatureNodeFactory> osgEarth::Features::FeatureModelSource::_factory [protected] |
Definition at line 216 of file FeatureModelSource.
osg::ref_ptr<FeatureSource> osgEarth::Features::FeatureModelSource::_features [protected] |
Definition at line 213 of file FeatureModelSource.
osg::ref_ptr<const Map> osgEarth::Features::FeatureModelSource::_map [protected] |
Definition at line 214 of file FeatureModelSource.
const FeatureModelSourceOptions osgEarth::Features::FeatureModelSource::_options [protected] |
Reimplemented from osgEarth::ModelSource.
Reimplemented in anonymous_namespace{FeatureGeomModelSource.cpp}::FeatureGeomModelSource, anonymous_namespace{FeatureLabelModelSource.cpp}::FeatureLabelModelSource, and anonymous_namespace{FeatureStencilModelSource.cpp}::FeatureStencilModelSource.
Definition at line 215 of file FeatureModelSource.