|
osgEarth 2.1.1
|
Inheritance diagram for osgEarth::Features::FeaturesToNodeFilter:
Collaboration diagram for osgEarth::Features::FeaturesToNodeFilter:Public Member Functions | |
| virtual osg::Node * | push (FeatureList &input, FilterContext &context)=0 |
| const osg::Matrixd & | local2world () const |
| const osg::Matrixd & | world2local () const |
Protected Member Functions | |
| void | computeLocalizers (const FilterContext &context) |
| osg::Node * | delocalize (osg::Node *node) const |
| osg::Group * | delocalizeAsGroup (osg::Node *node) const |
| osg::Group * | createDelocalizeGroup () const |
Protected Attributes | |
| osg::Matrixd | _world2local |
| osg::Matrixd | _local2world |
Base class for a filter that converts features into an osg Node.
| void FeaturesToNodeFilter::computeLocalizers | ( | const FilterContext & | context | ) | [protected] |
Definition at line 27 of file Filter.cpp.
{
if ( context.getSession()->getMapInfo().isGeocentric() )
{
const SpatialReference* geogSRS = context.profile()->getSRS()->getGeographicSRS();
GeoExtent geodExtent = context.extent()->transform( geogSRS );
if ( geodExtent.width() < 180.0 )
{
osg::Vec3d centroid, centroidECEF;
geodExtent.getCentroid( centroid.x(), centroid.y() );
geogSRS->transformToECEF( centroid, centroidECEF );
_local2world = ECEF::createInverseRefFrame( centroidECEF );
_world2local.invert( _local2world );
}
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| osg::Group * FeaturesToNodeFilter::createDelocalizeGroup | ( | ) | const [protected] |
Definition at line 63 of file Filter.cpp.
{
osg::Group* group = _local2world.isIdentity() ?
new osg::Group() :
new osg::MatrixTransform( _local2world );
return group;
}
Here is the caller graph for this function:| osg::Node * FeaturesToNodeFilter::delocalize | ( | osg::Node * | node | ) | const [protected] |
Parents the node with a localizer group if necessary
Definition at line 45 of file Filter.cpp.
{
if ( !_local2world.isIdentity() )
return delocalizeAsGroup( node );
else
return node;
}
Here is the caller graph for this function:| osg::Group * FeaturesToNodeFilter::delocalizeAsGroup | ( | osg::Node * | node | ) | const [protected] |
Definition at line 54 of file Filter.cpp.
{
osg::Group* group = createDelocalizeGroup();
if ( node )
group->addChild( node );
return group;
}
| const osg::Matrixd& osgEarth::Features::FeaturesToNodeFilter::local2world | ( | ) | const [inline] |
Definition at line 61 of file Filter.
{ return _local2world; }
| virtual osg::Node* osgEarth::Features::FeaturesToNodeFilter::push | ( | FeatureList & | input, |
| FilterContext & | context | ||
| ) | [pure virtual] |
| const osg::Matrixd& osgEarth::Features::FeaturesToNodeFilter::world2local | ( | ) | const [inline] |
Definition at line 63 of file Filter.
{ return _world2local; }
osg::Matrixd osgEarth::Features::FeaturesToNodeFilter::_local2world [protected] |
osg::Matrixd osgEarth::Features::FeaturesToNodeFilter::_world2local [protected] |
1.7.3