void LocalGeometryNode::clamp(osg::Node* graph, const Terrain* terrain) { if (terrain && graph) { GeometryClamper clamper; clamper.setTerrainPatch( graph ); clamper.setTerrainSRS( terrain ? terrain->getSRS() : 0L ); clamper.setPreserveZ( _clampRelative ); clamper.setOffset( getPosition().alt() ); this->accept( clamper ); } }
void FeatureNode::clamp(const Terrain* terrain, osg::Node* patch) { if ( terrain && patch ) { const AltitudeSymbol* alt = getStyle().get<AltitudeSymbol>(); bool relative = alt && alt->clamping() == alt->CLAMP_RELATIVE_TO_TERRAIN && alt->technique() == alt->TECHNIQUE_SCENE; GeometryClamper clamper; clamper.setTerrainPatch( patch ); clamper.setTerrainSRS( terrain->getSRS() ); clamper.setPreserveZ( relative ); this->accept( clamper ); this->dirtyBound(); } }
void FeatureNode::clamp(osg::Node* graph, const Terrain* terrain) { if ( terrain && graph ) { const AltitudeSymbol* alt = getStyle().get<AltitudeSymbol>(); if (alt && alt->technique() != alt->TECHNIQUE_SCENE) return; bool relative = alt && alt->clamping() == alt->CLAMP_RELATIVE_TO_TERRAIN && alt->technique() == alt->TECHNIQUE_SCENE; float offset = alt ? alt->verticalOffset()->eval() : 0.0f; GeometryClamper clamper; clamper.setTerrainPatch( graph ); clamper.setTerrainSRS( terrain->getSRS() ); clamper.setPreserveZ( relative ); clamper.setOffset( offset ); this->accept( clamper ); } }