osgEarth 2.1.1
|
Public Member Functions | |
virtual void | parseStyle (const Config &conf, KMLContext &cx, Style &style) |
virtual void | parseCoords (const Config &conf, KMLContext &cx) |
Definition at line 26 of file KML_Polygon.
void KML_Polygon::parseCoords | ( | const Config & | conf, |
KMLContext & | cx | ||
) | [virtual] |
Reimplemented from KML_Geometry.
Definition at line 30 of file KML_Polygon.cpp.
{ Polygon* poly = new Polygon(); Config outerConf = conf.child("outerboundaryis"); if ( !outerConf.empty() ) { Config outerRingConf = outerConf.child("linearring"); if ( !outerRingConf.empty() ) { KML_LinearRing outer; outer.parseCoords( outerRingConf, cx ); if ( outer._geom.valid() ) { dynamic_cast<Ring*>(outer._geom.get())->rewind( Ring::ORIENTATION_CCW ); poly->reserve( outer._geom->size() ); std::copy( outer._geom->begin(), outer._geom->end(), std::back_inserter(*poly) ); } } ConfigSet innerConfs = conf.children("innerboundaryis"); for( ConfigSet::const_iterator i = innerConfs.begin(); i != innerConfs.end(); ++i ) { Config innerRingConf = i->child("linearring"); if ( !innerRingConf.empty() ) { KML_LinearRing inner; inner.parseCoords( innerRingConf, cx ); if ( inner._geom.valid() ) { Geometry* innerGeom = inner._geom.get(); dynamic_cast<Ring*>(innerGeom)->rewind( Ring::ORIENTATION_CW ); poly->getHoles().push_back( dynamic_cast<Ring*>(innerGeom) ); } } } } _geom = poly; }
void KML_Polygon::parseStyle | ( | const Config & | conf, |
KMLContext & | cx, | ||
Style & | style | ||
) | [virtual] |
Reimplemented from KML_Geometry.
Definition at line 24 of file KML_Polygon.cpp.
{ KML_Geometry::parseStyle(conf, cx, style); }