osgEarth 2.1.1
Public Member Functions | Protected Member Functions | Protected Attributes

osgEarth::Util::Annotation::GeometryNode Class Reference

Inheritance diagram for osgEarth::Util::Annotation::GeometryNode:
Collaboration diagram for osgEarth::Util::Annotation::GeometryNode:

List of all members.

Public Member Functions

 GeometryNode (Geometry *geom, const Style &style)
 GeometryNode (MapNode *mapNode, Geometry *geom, const Style &style, bool draped=true)
template<typename T >
T * getOrCreateParent ()

Protected Member Functions

void init ()

Protected Attributes

osg::ref_ptr< Geometry_geom
Style _style
osg::ref_ptr< osg::Group > _parent

Detailed Description

Simple node that renders a Geometry into a scene graph node. The coordinates of the geometry are explicit; there is no association with spatial reference or a map. You can use this object to create a geometry for use in a local tangent plane coordinate system.

Definition at line 151 of file Annotation.


Constructor & Destructor Documentation

GeometryNode::GeometryNode ( Geometry geom,
const Style style 
)

Definition at line 151 of file Annotation.cpp.

                                               :
DrapeableNode( NULL ),
_geom        ( geom ),
_style       ( style )
{
    init();
}

Here is the call graph for this function:

GeometryNode::GeometryNode ( MapNode mapNode,
Geometry geom,
const Style style,
bool  draped = true 
)

Definition at line 160 of file Annotation.cpp.

                                                 :
DrapeableNode( mapNode, draped ),
_geom        ( geom ),
_style       ( style )
{
    init();
}

Here is the call graph for this function:


Member Function Documentation

template<typename T >
T* osgEarth::Util::Annotation::GeometryNode::getOrCreateParent ( ) [inline]

Gets or creates a parent node for the internal draped node. Typically you would use this to install a Transform node atop the draped node.

Definition at line 163 of file Annotation.

        {
            if ( _parent.valid() )
            {
                return static_cast<T*>( _parent.get() );
            }
            else
            {
                T* p = new T();
                _parent = p;
                if ( getNode() )
                {
                    p->addChild( getNode() );
                    setNode( _parent.get() );
                }
                return p;
            }
        }

Here is the call graph for this function:

void GeometryNode::init ( ) [protected]

Definition at line 172 of file Annotation.cpp.

{
    FeatureList features;
    features.push_back( new Feature(_geom.get(), _style) );
    BuildGeometryFilter bg;
    // no worky.
        FilterContext context;
    osg::Node* node = bg.push( features, context );
    //osg::Node* node = bg.getNode();
    setNode( node );
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 185 of file Annotation.

osg::ref_ptr<osg::Group> osgEarth::Util::Annotation::GeometryNode::_parent [protected]

Definition at line 187 of file Annotation.

Definition at line 186 of file Annotation.


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