osgEarth 2.1.1
|
Public Member Functions | |
LineString (int capacity=0) | |
LineString (const LineString &rhs) | |
LineString (const Vec3dVector *toCopy) | |
double | getLength () const |
bool | getSegment (double length, osg::Vec3d &start, osg::Vec3d &end) |
virtual Type | getType () const |
virtual bool | isValid () const |
An ordered set of points forming a single contiguous line string.
osgEarth::Symbology::LineString::LineString | ( | int | capacity = 0 | ) | [inline] |
LineString::LineString | ( | const LineString & | rhs | ) |
Definition at line 359 of file Geometry.cpp.
: Geometry( rhs ) { //nop }
LineString::LineString | ( | const Vec3dVector * | toCopy | ) |
Definition at line 365 of file Geometry.cpp.
: Geometry( data ) { //nop }
double LineString::getLength | ( | ) | const |
Definition at line 372 of file Geometry.cpp.
{ double length = 0; for (unsigned int i = 0; i < size()-1; ++i) { osg::Vec3d current = (*this)[i]; osg::Vec3d next = (*this)[i+1]; length += (next - current).length(); } return length; }
bool LineString::getSegment | ( | double | length, |
osg::Vec3d & | start, | ||
osg::Vec3d & | end | ||
) |
Definition at line 385 of file Geometry.cpp.
{ double pos = 0; for (unsigned int i = 0; i < size()-1; ++i) { osg::Vec3d current = (*this)[i]; osg::Vec3d next = (*this)[i+1]; pos += (next - current).length(); if (pos > length) { start = current; end = next; return true; } } return false; }
virtual Type osgEarth::Symbology::LineString::getType | ( | ) | const [inline, virtual] |
Implements osgEarth::Symbology::Geometry.
Definition at line 209 of file Geometry.
{ return Geometry::TYPE_LINESTRING; }
virtual bool osgEarth::Symbology::LineString::isValid | ( | ) | const [inline, virtual] |
Reimplemented from osgEarth::Symbology::Geometry.
Definition at line 210 of file Geometry.
{ return size() >= 2; }