osgEarth 2.1.1
|
Public Member Functions | |
FeatureSource (const ConfigOptions &options=ConfigOptions()) | |
const FeatureProfile * | getFeatureProfile () const |
const FeatureSourceOptions & | getFeatureSourceOptions () const |
virtual FeatureCursor * | createFeatureCursor (const Symbology::Query &query=Symbology::Query())=0 |
virtual bool | isWritable () const |
virtual bool | deleteFeature (FeatureID fid) |
virtual int | getFeatureCount () const |
virtual Feature * | getFeature (FeatureID fid) |
virtual const FeatureSchema & | getSchema () const |
virtual bool | insertFeature (Feature *feature) |
virtual Geometry::Type | getGeometryType () const |
virtual bool | hasEmbeddedStyles () const |
const FeatureFilterList & | getFilters () const |
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 |
virtual void | initialize (const std::string &referenceURI)=0 |
Protected Member Functions | |
virtual const FeatureProfile * | createFeatureProfile ()=0 |
virtual | ~FeatureSource () |
Private Attributes | |
const FeatureSourceOptions | _options |
osg::ref_ptr< const FeatureProfile > | _featureProfile |
OpenThreads::Mutex | _createMutex |
Friends | |
class | Map |
class | FeatureSourceFactory |
A FeatureSource is a pluggable object that generates Features, and optionally, styling information to go along with them.
Definition at line 88 of file FeatureSource.
FeatureSource::FeatureSource | ( | const ConfigOptions & | options = ConfigOptions() | ) |
Constructs a new feature source with the provided read/write options.
Definition at line 139 of file FeatureSource.cpp.
: _options( options ) { //nop }
virtual osgEarth::Features::FeatureSource::~FeatureSource | ( | ) | [inline, protected, virtual] |
DTOR is protected to prevent this object from being allocated on the stack.
Definition at line 207 of file FeatureSource.
{ }
virtual const char* osgEarth::Features::FeatureSource::className | ( | ) | const [inline, virtual] |
Reimplemented in osgEarth::Features::FeatureListSource.
Definition at line 186 of file FeatureSource.
{ return "FeatureSource"; }
virtual osg::Object* osgEarth::Features::FeatureSource::clone | ( | const osg::CopyOp & | ) | const [inline, virtual] |
Definition at line 184 of file FeatureSource.
{ return 0; } // clone() not appropriate
virtual osg::Object* osgEarth::Features::FeatureSource::cloneType | ( | ) | const [inline, virtual] |
Definition at line 183 of file FeatureSource.
{ return 0; } // cloneType() not appropriate
virtual FeatureCursor* osgEarth::Features::FeatureSource::createFeatureCursor | ( | const Symbology::Query & | query = Symbology::Query() | ) | [pure virtual] |
Creates a cursor that iterates over all the features corresponding to the specified query.
Caller takes ownership of the returned object.
Implemented in OGRFeatureSource, WFSFeatureSource, osgEarth::Features::FeatureListSource, and osgEarth::Features::VirtualFeatureSource.
virtual const FeatureProfile* osgEarth::Features::FeatureSource::createFeatureProfile | ( | ) | [protected, pure virtual] |
Creates and returns a metadata structure describing the features in a named feature class. This method is called by the public function getFeatureProfile() in this same object to create the metadata structure.
Implemented in OGRFeatureSource, WFSFeatureSource, osgEarth::Features::FeatureListSource, and osgEarth::Features::VirtualFeatureSource.
virtual bool osgEarth::Features::FeatureSource::deleteFeature | ( | FeatureID | fid | ) | [inline, virtual] |
Deletes the feature with the given FID
Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::FeatureListSource.
Definition at line 125 of file FeatureSource.
{ return false; }
Gets the Feature with the given FID
Reimplemented in OGRFeatureSource, WFSFeatureSource, osgEarth::Features::FeatureListSource, and osgEarth::Features::VirtualFeatureSource.
Definition at line 139 of file FeatureSource.
{ return 0L; }
virtual int osgEarth::Features::FeatureSource::getFeatureCount | ( | ) | const [inline, virtual] |
Gets the number of features in this FeatureSource
Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::FeatureListSource.
Definition at line 132 of file FeatureSource.
{ return -1; }
const FeatureProfile * FeatureSource::getFeatureProfile | ( | ) | const |
Gets a reference to the metadata that describes features that you can get from this FeatureSource. A valid feature profile indiciates that the feature source successfully initialized.
Definition at line 146 of file FeatureSource.cpp.
{ if ( !_featureProfile.valid() ) { FeatureSource* nonConstThis = const_cast<FeatureSource*>(this); ScopedLock<Mutex> doubleCheckLock( nonConstThis->_createMutex ); { if ( !_featureProfile.valid() ) { // caching pattern nonConstThis->_featureProfile = nonConstThis->createFeatureProfile(); } } } return _featureProfile.get(); }
const FeatureSourceOptions& osgEarth::Features::FeatureSource::getFeatureSourceOptions | ( | ) | const [inline] |
Gets the options that were passed into this object's CTOR.
Definition at line 106 of file FeatureSource.
{ return _options; }
const FeatureFilterList & FeatureSource::getFilters | ( | ) | const |
Accesses the list of feature filters that will transform features before they are returned in a feature cursor.
Definition at line 165 of file FeatureSource.cpp.
virtual Geometry::Type osgEarth::Features::FeatureSource::getGeometryType | ( | ) | const [inline, virtual] |
Gets the Geometry type of the FeatureSource
Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::FeatureListSource.
Definition at line 159 of file FeatureSource.
{ return Geometry::TYPE_UNKNOWN; }
const FeatureSchema & FeatureSource::getSchema | ( | ) | const [virtual] |
Gets the FeatureSchema for this FeatureSource. If the schema doesn't publish a source, this might be empty.
Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::VirtualFeatureSource.
Definition at line 171 of file FeatureSource.cpp.
{ static FeatureSchema s_emptySchema; return s_emptySchema; }
virtual bool osgEarth::Features::FeatureSource::hasEmbeddedStyles | ( | ) | const [inline, virtual] |
Returns true if this source creates features with embedded style information. By default, this is false (features are not expected to carry their own style definitions).
Reimplemented in osgEarth::Features::FeatureListSource.
Definition at line 169 of file FeatureSource.
{ return false; }
virtual void osgEarth::Features::FeatureSource::initialize | ( | const std::string & | referenceURI | ) | [pure virtual] |
Initialize the FeatureSource. The profile should be computed and set here using setProfile()
Implemented in OGRFeatureSource, WFSFeatureSource, osgEarth::Features::FeatureListSource, and osgEarth::Features::VirtualFeatureSource.
virtual bool osgEarth::Features::FeatureSource::insertFeature | ( | Feature * | feature | ) | [inline, virtual] |
Inserts the given feature into the FeatureSource
Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::FeatureListSource.
Definition at line 152 of file FeatureSource.
{ return false; }
virtual bool osgEarth::Features::FeatureSource::isSameKindAs | ( | const osg::Object * | obj | ) | const [inline, virtual] |
Definition at line 185 of file FeatureSource.
{ return dynamic_cast<const FeatureSource*>(obj)!=NULL; }
virtual bool osgEarth::Features::FeatureSource::isWritable | ( | ) | const [inline, virtual] |
Whether this FeatureSource supports inserting and deleting features
Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::FeatureListSource.
Definition at line 119 of file FeatureSource.
{ return false; }
virtual const char* osgEarth::Features::FeatureSource::libraryName | ( | ) | const [inline, virtual] |
Reimplemented in osgEarth::Features::FeatureListSource.
Definition at line 187 of file FeatureSource.
{ return "osgEarthFeatures"; }
friend class FeatureSourceFactory [friend] |
Definition at line 216 of file FeatureSource.
friend class Map [friend] |
Definition at line 215 of file FeatureSource.
OpenThreads::Mutex osgEarth::Features::FeatureSource::_createMutex [private] |
Definition at line 213 of file FeatureSource.
osg::ref_ptr<const FeatureProfile> osgEarth::Features::FeatureSource::_featureProfile [private] |
Definition at line 212 of file FeatureSource.
const FeatureSourceOptions osgEarth::Features::FeatureSource::_options [private] |
Reimplemented in OGRFeatureSource, and WFSFeatureSource.
Definition at line 210 of file FeatureSource.