osgEarth 2.1.1
Public Member Functions

KML_Polygon Struct Reference

Inheritance diagram for KML_Polygon:
Collaboration diagram for KML_Polygon:

List of all members.

Public Member Functions

virtual void parseStyle (const Config &conf, KMLContext &cx, Style &style)
virtual void parseCoords (const Config &conf, KMLContext &cx)

Detailed Description

Definition at line 26 of file KML_Polygon.


Member Function Documentation

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;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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);
}

Here is the caller graph for this function:


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