osgEarth 2.1.1
Public Member Functions | Private Attributes

osgEarth::Symbology::ConstSegmentIterator Class Reference

List of all members.

Public Member Functions

 ConstSegmentIterator (const Geometry *verts, bool closedLoop)
bool hasMore () const
Segment next ()

Private Attributes

const Vec3dVector_verts
Vec3dVector::const_iterator _iter
bool _done
bool _closeLoop

Detailed Description

Definition at line 383 of file Geometry.


Constructor & Destructor Documentation

ConstSegmentIterator::ConstSegmentIterator ( const Geometry verts,
bool  closedLoop 
)

Definition at line 779 of file Geometry.cpp.

                                                                                  :
_verts(&verts->asVector()),
_closeLoop(closeLoop),
_iter(verts->begin())
{
    _done = _verts->size() < 2;
}

Member Function Documentation

bool osgEarth::Symbology::ConstSegmentIterator::hasMore ( ) const [inline]

Definition at line 387 of file Geometry.

{ return !_done; }

Here is the caller graph for this function:

Segment ConstSegmentIterator::next ( )

Definition at line 788 of file Geometry.cpp.

{
    osg::Vec3d p0 = *_iter++;
    if ( _iter == _verts->end() ) 
    {
        _iter = _verts->begin();
        _done = true;
    }
    else if ( _iter+1 == _verts->end() && !_closeLoop )
    {
        _done = true;
    }

    return Segment( p0, *_iter );
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 394 of file Geometry.

Definition at line 393 of file Geometry.

Vec3dVector::const_iterator osgEarth::Symbology::ConstSegmentIterator::_iter [private]

Definition at line 392 of file Geometry.

Definition at line 391 of file Geometry.


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