osgEarth 2.1.1
Public Member Functions

osgEarth::Features::CentroidFilter Class Reference

Inheritance diagram for osgEarth::Features::CentroidFilter:
Collaboration diagram for osgEarth::Features::CentroidFilter:

List of all members.

Public Member Functions

 CentroidFilter ()
virtual FilterContext push (FeatureList &input, FilterContext &context)

Detailed Description

Replaces each feature's geometry with a single-point centroid.

Definition at line 34 of file CentroidFilter.


Constructor & Destructor Documentation

CentroidFilter::CentroidFilter ( )

Definition at line 28 of file CentroidFilter.cpp.

{
    //NOP
}

Member Function Documentation

FilterContext CentroidFilter::push ( FeatureList input,
FilterContext context 
) [virtual]

Implements osgEarth::Features::FeatureFilter.

Definition at line 34 of file CentroidFilter.cpp.

{
    for( FeatureList::iterator i = features.begin(); i != features.end(); ++i )
    {
        Feature* f = i->get();
        
        Geometry* geom = f->getGeometry();
        if ( !geom )
            continue;

        PointSet* newGeom = new PointSet();
        newGeom->push_back( geom->getBounds().center() );

        f->setGeometry( newGeom );
    }

    return context;
}

Here is the call graph for this function:

Here is the caller graph for this function:


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