osgEarth 2.1.1
Public Member Functions | Protected Attributes

osgEarth::Features::VirtualFeatureSource Class Reference

Inheritance diagram for osgEarth::Features::VirtualFeatureSource:
Collaboration diagram for osgEarth::Features::VirtualFeatureSource:

List of all members.

Public Member Functions

 VirtualFeatureSource ()
void add (FeatureSource *source, FeaturePredicate *predicate)
virtual FeatureCursorcreateFeatureCursor (const Query &query)
virtual void initialize (const std::string &referenceURI)
virtual const FeatureProfilecreateFeatureProfile ()
virtual const FeatureSchemagetSchema () const
virtual FeaturegetFeature (FeatureID id)

Protected Attributes

FeatureSourceMappingVector _sources

Detailed Description

Definition at line 52 of file VirtualFeatureSource.


Constructor & Destructor Documentation

osgEarth::Features::VirtualFeatureSource::VirtualFeatureSource ( ) [inline]

Construct a new virtual feature source

Definition at line 56 of file VirtualFeatureSource.

{ }

Member Function Documentation

void VirtualFeatureSource::add ( FeatureSource source,
FeaturePredicate predicate 
)

Adds a feature source/predicate mapping. This FeatureSource will draw from "source" and filter based on the predicate.

Definition at line 109 of file VirtualFeatureSource.cpp.

{
    _sources.push_back( FeatureSourceMapping(source, predicate) );
    dirty();
}
FeatureCursor * VirtualFeatureSource::createFeatureCursor ( const Query query) [virtual]

Creates a cursor that iterates over all the features corresponding to the specified query.

Caller takes ownership of the returned object.

Implements osgEarth::Features::FeatureSource.

Definition at line 116 of file VirtualFeatureSource.cpp.

{
    return new VirtualFeatureCursor( _sources, query );
}
const FeatureProfile * VirtualFeatureSource::createFeatureProfile ( ) [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.

Implements osgEarth::Features::FeatureSource.

Definition at line 131 of file VirtualFeatureSource.cpp.

{
    if ( _sources.size() > 0 )
        return _sources.front()._source->getFeatureProfile();
    else
        return 0L;
}
virtual Feature* osgEarth::Features::VirtualFeatureSource::getFeature ( FeatureID  fid) [inline, virtual]

Gets the Feature with the given FID

Returns:
The Feature with the given FID or NULL if not found.

Reimplemented from osgEarth::Features::FeatureSource.

Definition at line 69 of file VirtualFeatureSource.

{ return 0L; }
const FeatureSchema & VirtualFeatureSource::getSchema ( ) const [virtual]

Gets the FeatureSchema for this FeatureSource. If the schema doesn't publish a source, this might be empty.

Reimplemented from osgEarth::Features::FeatureSource.

Definition at line 140 of file VirtualFeatureSource.cpp.

{
  static FeatureSchema s_emptySchema;

  return _sources.size() > 0 ?_sources.front()._source->getSchema() : s_emptySchema;
}
void VirtualFeatureSource::initialize ( const std::string &  referenceURI) [virtual]

Initialize the FeatureSource. The profile should be computed and set here using setProfile()

Implements osgEarth::Features::FeatureSource.

Definition at line 122 of file VirtualFeatureSource.cpp.

{
    for( FeatureSourceMappingVector::iterator i = _sources.begin(); i != _sources.end(); ++i )
    {
        i->_source->initialize( referenceURI );
    }
}

Member Data Documentation

Definition at line 72 of file VirtualFeatureSource.


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