osgEarth 2.1.1
|
Public Member Functions | |
Polygon (int capacity=0) | |
Polygon (const Polygon &rhs) | |
Polygon (const Vec3dVector *toCopy) | |
virtual Type | getType () const |
virtual int | getTotalPointCount () const |
virtual unsigned | getNumGeometries () const |
virtual bool | contains2D (double x, double y) const |
virtual void | open () |
RingCollection & | getHoles () |
const RingCollection & | getHoles () const |
Protected Attributes | |
RingCollection | _holes |
A Polygon is a geometry that consists of one outer boundary Ring, and zero or more inner "hole" rings. The boundary ring is would CCW, and the inner "holes" are wound CW.
osgEarth::Symbology::Polygon::Polygon | ( | int | capacity = 0 | ) | [inline] |
Polygon::Polygon | ( | const Polygon & | rhs | ) |
Polygon::Polygon | ( | const Vec3dVector * | toCopy | ) |
Definition at line 542 of file Geometry.cpp.
: Ring( data ) { //nop }
bool Polygon::contains2D | ( | double | x, |
double | y | ||
) | const [virtual] |
Reimplemented from osgEarth::Symbology::Ring.
Definition at line 558 of file Geometry.cpp.
{ // first check the outer ring if ( !Ring::contains2D(x, y) ) return false; // then check each inner ring (holes). Point has to be inside the outer ring, // but NOT inside any of the holes for( RingCollection::const_iterator i = _holes.begin(); i != _holes.end(); ++i ) { if ( i->get()->contains2D(x, y) ) return false; } return true; }
const RingCollection& osgEarth::Symbology::Polygon::getHoles | ( | ) | const [inline] |
RingCollection& osgEarth::Symbology::Polygon::getHoles | ( | ) | [inline] |
virtual unsigned osgEarth::Symbology::Polygon::getNumGeometries | ( | ) | const [inline, 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 273 of file Geometry.
{ return 1 + _holes.size(); }
int Polygon::getTotalPointCount | ( | ) | const [virtual] |
Gets the total number of points in this geometry.
Reimplemented from osgEarth::Symbology::Geometry.
Definition at line 549 of file Geometry.cpp.
{ int total = Ring::getTotalPointCount(); for( RingCollection::const_iterator i = _holes.begin(); i != _holes.end(); ++i ) total += i->get()->getTotalPointCount(); return total; }
virtual Type osgEarth::Symbology::Polygon::getType | ( | ) | const [inline, virtual] |
Reimplemented from osgEarth::Symbology::Ring.
Definition at line 270 of file Geometry.
{ return Geometry::TYPE_POLYGON; }
void Polygon::open | ( | ) | [virtual] |
Reimplemented from osgEarth::Symbology::Ring.
Definition at line 576 of file Geometry.cpp.
{ Ring::open(); for( RingCollection::const_iterator i = _holes.begin(); i != _holes.end(); ++i ) (*i)->open(); }
RingCollection osgEarth::Symbology::Polygon::_holes [protected] |