osgEarth 2.1.1
|
Public Member Functions | |
MultiGeometry () | |
MultiGeometry (const GeometryCollection &parts) | |
MultiGeometry (const MultiGeometry &rhs) | |
virtual Type | getType () const |
virtual Type | getComponentType () const |
virtual int | getTotalPointCount () const |
virtual unsigned | getNumComponents () const |
virtual unsigned | getNumGeometries () const |
virtual Geometry * | cloneAs (const Geometry::Type &newType) const |
virtual bool | isValid () const |
virtual Bounds | getBounds () const |
GeometryCollection & | getComponents () |
const GeometryCollection & | getComponents () const |
Protected Attributes | |
GeometryCollection | _parts |
A collection of multiple geometries (aka, a "multi-part" geometry).
osgEarth::Symbology::MultiGeometry::MultiGeometry | ( | ) | [inline] |
MultiGeometry::MultiGeometry | ( | const GeometryCollection & | parts | ) |
Definition at line 592 of file Geometry.cpp.
: _parts( parts ) { //nop }
MultiGeometry::MultiGeometry | ( | const MultiGeometry & | rhs | ) |
Geometry * MultiGeometry::cloneAs | ( | const Geometry::Type & | newType | ) | const [virtual] |
Converts this geometry to another type. This function will return "this" if the type is the same, and will return NULL if the conversion is impossible.
Reimplemented from osgEarth::Symbology::Geometry.
Definition at line 635 of file Geometry.cpp.
{ MultiGeometry* multi = new MultiGeometry(); for( GeometryCollection::const_iterator i = _parts.begin(); i != _parts.end(); ++i ) { Geometry* part = i->get()->cloneAs( i->get()->getType() ); if ( part ) multi->getComponents().push_back( part ); } return multi; }
Bounds MultiGeometry::getBounds | ( | ) | const [virtual] |
Gets the bounds of this geometry
Reimplemented from osgEarth::Symbology::Geometry.
Definition at line 624 of file Geometry.cpp.
{ Bounds bounds; for( GeometryCollection::const_iterator i = _parts.begin(); i != _parts.end(); ++i ) { bounds.expandBy( i->get()->getBounds() ); } return bounds; }
GeometryCollection& osgEarth::Symbology::MultiGeometry::getComponents | ( | ) | [inline] |
const GeometryCollection& osgEarth::Symbology::MultiGeometry::getComponents | ( | ) | const [inline] |
Geometry::Type MultiGeometry::getComponentType | ( | ) | const [virtual] |
Reimplemented from osgEarth::Symbology::Geometry.
Definition at line 599 of file Geometry.cpp.
{ // dicey. return _parts.size() > 0 ? _parts.front()->getType() : TYPE_UNKNOWN; }
virtual unsigned osgEarth::Symbology::MultiGeometry::getNumComponents | ( | ) | const [inline, virtual] |
Gets the total number of geometry components
Reimplemented from osgEarth::Symbology::Geometry.
Definition at line 302 of file Geometry.
{ return _parts.size(); }
unsigned MultiGeometry::getNumGeometries | ( | ) | const [virtual] |
Gets the total number of geometries; it is the total of all parts of all components. Also can be seen as the number of Geometry objects that would be returned by a full GeometryIterator.
Reimplemented from osgEarth::Symbology::Geometry.
Definition at line 615 of file Geometry.cpp.
int MultiGeometry::getTotalPointCount | ( | ) | const [virtual] |
Gets the total number of points in this geometry.
Reimplemented from osgEarth::Symbology::Geometry.
Definition at line 606 of file Geometry.cpp.
virtual Type osgEarth::Symbology::MultiGeometry::getType | ( | ) | const [inline, virtual] |
Implements osgEarth::Symbology::Geometry.
Definition at line 299 of file Geometry.
{ return Geometry::TYPE_MULTI; }
bool MultiGeometry::isValid | ( | ) | const [virtual] |
Reimplemented from osgEarth::Symbology::Geometry.
Definition at line 647 of file Geometry.cpp.