osgEarth 2.1.1
Public Types | Public Member Functions | Public Attributes

anonymous_namespace{FeatureGeometryIndex.cpp}::Collector Struct Reference

List of all members.

Public Types

typedef
FeatureGeometryIndexBuilder::PrimSetFeatureIdMap 
IdMap

Public Member Functions

 Collector (const IdMap &ids, FeatureGeometryIndex::FeatureRecords &recs)
void apply (osg::Geode &geode)

Public Attributes

FeatureGeometryIndex::FeatureRecords_recs
const
FeatureGeometryIndexBuilder::PrimSetFeatureIdMap
_ids

Detailed Description

Definition at line 99 of file FeatureGeometryIndex.cpp.


Member Typedef Documentation

typedef FeatureGeometryIndexBuilder::PrimSetFeatureIdMap anonymous_namespace{FeatureGeometryIndex.cpp}::Collector::IdMap

Definition at line 101 of file FeatureGeometryIndex.cpp.


Constructor & Destructor Documentation

anonymous_namespace{FeatureGeometryIndex.cpp}::Collector::Collector ( const IdMap ids,
FeatureGeometryIndex::FeatureRecords recs 
) [inline]

Definition at line 103 of file FeatureGeometryIndex.cpp.

            : osg::NodeVisitor( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN ),
              _recs( recs ),
              _ids( ids ) { }

Member Function Documentation

void anonymous_namespace{FeatureGeometryIndex.cpp}::Collector::apply ( osg::Geode &  geode) [inline]

Definition at line 108 of file FeatureGeometryIndex.cpp.

        {
            for( unsigned i=0; i<geode.getNumDrawables(); ++i )
            {
                osg::Geometry* geom = geode.getDrawable(i)->asGeometry();
                if ( geom )
                {
                    for( unsigned j=0; j<geom->getNumPrimitiveSets(); ++j )
                    {
                        osg::PrimitiveSet* primSet = geom->getPrimitiveSet(j);

                        IdMap::const_iterator k = _ids.find( primSet );
                        if ( k != _ids.end() )
                        {
                            FeatureID fid = k->second;
                            FeatureGeometryRecord& rec = _recs[fid];
                            rec._geode = &geode;
                            rec._primSetsByGeometry[geom].push_back( primSet );
                        }
                    }
                }
            }
            traverse( geode );
        }

Member Data Documentation

const FeatureGeometryIndexBuilder::PrimSetFeatureIdMap& anonymous_namespace{FeatureGeometryIndex.cpp}::Collector::_ids

Definition at line 134 of file FeatureGeometryIndex.cpp.

FeatureGeometryIndex::FeatureRecords& anonymous_namespace{FeatureGeometryIndex.cpp}::Collector::_recs

Definition at line 133 of file FeatureGeometryIndex.cpp.


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