osgEarth 2.1.1
|
Public Member Functions | |
CentroidFilter () | |
virtual FilterContext | push (FeatureList &input, FilterContext &context) |
Replaces each feature's geometry with a single-point centroid.
Definition at line 34 of file CentroidFilter.
CentroidFilter::CentroidFilter | ( | ) |
Definition at line 28 of file CentroidFilter.cpp.
{
//NOP
}
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; }