osgEarth 2.1.1
|
Public Types | |
enum | CullingTechnique { CULL_BY_CROPPING, CULL_BY_CENTROID } |
Public Member Functions | |
GriddingPolicy (const Config &conf=Config()) | |
bool | enabled () const |
virtual Config | getConfig () const |
virtual void | fromConfig (const Config &conf) |
optional< double > & | cellSize () |
const optional< double > & | cellSize () const |
optional< CullingTechnique > & | cullingTechnique () |
const optional < CullingTechnique > & | cullingTechnique () const |
optional< bool > & | spatializeGroups () |
const optional< bool > & | spatializeGroups () const |
optional< bool > & | clusterCulling () |
const optional< bool > & | clusterCulling () const |
Protected Attributes | |
optional< double > | _cellSize |
optional< CullingTechnique > | _cullingTechnique |
optional< bool > | _spatializeGroups |
optional< bool > | _clusterCulling |
Defines how to grid and crop feature data when creating a model.
Definition at line 35 of file FeatureGridder.
Definition at line 38 of file FeatureGridder.
{ /* crop a feature's shape to the oundaries of the grid cell; default for lines */ CULL_BY_CROPPING, /* include a feature in the cell only if its centroid is in the cell; default for polygons and points */ CULL_BY_CENTROID };
Definition at line 36 of file FeatureGridder.cpp.
: _cellSize( DBL_MAX ), _cullingTechnique( GriddingPolicy::CULL_BY_CENTROID ), _spatializeGroups( true ), _clusterCulling( false ) { fromConfig( conf ); }
optional<double>& osgEarth::Features::GriddingPolicy::cellSize | ( | ) | [inline] |
The maximum size (width and height) of each square grid cell.
Definition at line 61 of file FeatureGridder.
{ return _cellSize; }
const optional<double>& osgEarth::Features::GriddingPolicy::cellSize | ( | ) | const [inline] |
Definition at line 62 of file FeatureGridder.
{ return _cellSize; }
const optional<bool>& osgEarth::Features::GriddingPolicy::clusterCulling | ( | ) | const [inline] |
Definition at line 74 of file FeatureGridder.
{ return _clusterCulling; }
optional<bool>& osgEarth::Features::GriddingPolicy::clusterCulling | ( | ) | [inline] |
Whether to install cluster cullers on the grid cell nodes
Definition at line 73 of file FeatureGridder.
{ return _clusterCulling; }
optional<CullingTechnique>& osgEarth::Features::GriddingPolicy::cullingTechnique | ( | ) | [inline] |
The technique to use to figure out how to include a feature in a cell.
Definition at line 65 of file FeatureGridder.
{ return _cullingTechnique; }
const optional<CullingTechnique>& osgEarth::Features::GriddingPolicy::cullingTechnique | ( | ) | const [inline] |
Definition at line 66 of file FeatureGridder.
{ return _cullingTechnique; }
bool osgEarth::Features::GriddingPolicy::enabled | ( | ) | const [inline] |
void GriddingPolicy::fromConfig | ( | const Config & | conf | ) | [virtual] |
Definition at line 66 of file FeatureGridder.cpp.
{ conf.getIfSet( PROP_CELL_SIZE, _cellSize ); // read the culling technique if ( conf.hasValue( PROP_CULLING_TECHNIQUE ) ) { if ( conf.value( PROP_CULLING_TECHNIQUE ) == "crop" ) _cullingTechnique = CULL_BY_CROPPING; else if ( conf.value( PROP_CULLING_TECHNIQUE ) == "centroid" ) _cullingTechnique = CULL_BY_CENTROID; } // spatial optimization conf.getIfSet<bool>( PROP_SPATIALIZE_GROUPS, _spatializeGroups ); // cluster culling conf.getIfSet<bool>( PROP_CLUSTER_CULLING, _clusterCulling ); }
Config GriddingPolicy::getConfig | ( | ) | const [virtual] |
Definition at line 46 of file FeatureGridder.cpp.
{ Config conf; conf.updateIfSet( PROP_CELL_SIZE, _cellSize ); if ( _cullingTechnique.isSet() ) { if ( _cullingTechnique == CULL_BY_CROPPING ) conf.update( PROP_CULLING_TECHNIQUE, "crop" ); else if ( _cullingTechnique == CULL_BY_CENTROID ) conf.update( PROP_CULLING_TECHNIQUE, "centroid" ); } conf.updateIfSet( PROP_SPATIALIZE_GROUPS, _spatializeGroups ); conf.updateIfSet( PROP_CLUSTER_CULLING, _clusterCulling ); return conf; }
const optional<bool>& osgEarth::Features::GriddingPolicy::spatializeGroups | ( | ) | const [inline] |
Definition at line 70 of file FeatureGridder.
{ return _spatializeGroups; }
optional<bool>& osgEarth::Features::GriddingPolicy::spatializeGroups | ( | ) | [inline] |
Whether to run the optimizer's spatialize-groups pass on the gridded geometry
Definition at line 69 of file FeatureGridder.
{ return _spatializeGroups; }
optional<double> osgEarth::Features::GriddingPolicy::_cellSize [protected] |
Definition at line 77 of file FeatureGridder.
optional<bool> osgEarth::Features::GriddingPolicy::_clusterCulling [protected] |
Definition at line 80 of file FeatureGridder.
Definition at line 78 of file FeatureGridder.
optional<bool> osgEarth::Features::GriddingPolicy::_spatializeGroups [protected] |
Definition at line 79 of file FeatureGridder.