osgEarth 2.1.1
Public Types | Public Member Functions | Protected Attributes

osgEarth::Features::GriddingPolicy Class Reference

Collaboration diagram for osgEarth::Features::GriddingPolicy:

List of all members.

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

Detailed Description

Defines how to grid and crop feature data when creating a model.

Definition at line 35 of file FeatureGridder.


Member Enumeration Documentation

Enumerator:
CULL_BY_CROPPING 
CULL_BY_CENTROID 

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

Constructor & Destructor Documentation

GriddingPolicy::GriddingPolicy ( const Config conf = Config())

Definition at line 36 of file FeatureGridder.cpp.

Here is the call graph for this function:


Member Function Documentation

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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]

Definition at line 52 of file FeatureGridder.

{ return _cellSize.isSet() && *_cellSize > 0.0; }

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

Config GriddingPolicy::getConfig ( ) const [virtual]

Definition at line 46 of file FeatureGridder.cpp.

Here is the call graph for this function:

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

Member Data Documentation

Definition at line 77 of file FeatureGridder.

Definition at line 80 of file FeatureGridder.

Definition at line 78 of file FeatureGridder.

Definition at line 79 of file FeatureGridder.


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