VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtTerrain Class Reference

DtTerrain is a facade around terrain functionality. More...

Inheritance diagram for makVrv::DtTerrain:
Inheritance graph
[legend]

Public Types

typedef std::list
< DtTerrainPatch * > 
TerrainPatches
typedef std::list
< DtFeatureLayer * > 
FeatureLayers
typedef std::list< DtOceanLayer * > OceanLayers
typedef std::map< int,
makArchives::DtTerrainOperationRecord
TerrainOperationsMap
 Map of terrain operation ids, to terrain operations.

Public Member Functions

 DtTerrain (DtDe &de, DtAgentManagerInterface &sceneManagerInterface)
 CTOR.
virtual ~DtTerrain ()
 DTOR.
void clear (bool reload=false)
 Clear the terrain.
bool isPropNameUsed (const std::string &propName) const
 Checks whether a prop name is in use.
virtual bool getTerrainIntersection (double x, double y, double z, double upX, double upY, double upZ, double &retX, double &retY, double &retZ)
 Get the closest intersection to x,y,z.
virtual void clearElevationCache ()
 If any of the terrain's patch objects is using an elevation cache, clear them (otherwise do nothing).
virtual const std::string * findOptionalParameter (const std::string &name) const
 Find an optional parameter.
virtual void setOptionalParameter (const std::string &name, const std::string &value)
 Set an optional parameter.
virtual void setOptionalParameters (const makArchives::DtTerrainRecord::OptionalParameterMap &)
 Set an optional parameters.
virtual void removeOptionalParameter (const std::string &name)
 Remove an optional parameter.
const
makArchives::DtTerrainRecord::OptionalParameterMap
optionalParameters () const
 Get the optional parameters.
virtual const std::string & description ()
 Get the terrains's description.
virtual void setDescription (const std::string &description)
 Set the terrains's description.
virtual bool useICO () const
 Get the UseICO flag.
virtual void setUseICO (bool flag)
 Set the UseICO flag.
virtual unsigned int maxPagedLODs () const
 Get max paged LOD target.
virtual void setMaxPagedLODs (unsigned int maxPagedLODs)
 Set the max paged LOD target.
virtual bool reloadingTerrain ()
 is the terrain currently reloading
Terrain record methods
bool globalScaleTerrain () const
 Checks to see if the terrain is a global scale terrain.
void updateGlobalScaleTerrain ()
 Rechecks if the terrain is of global scale.
virtual void getRecord (makArchives::DtTerrainRecord &rec)
 Fill out a DtTerrainRecord with the current terrain info. Called by saveTerrain().
virtual void setFromRecord (const makArchives::DtTerrainRecord &rec, bool clearFirst=true)
 Populate a DtTerrain from a DtTerrainRecord.
virtual void reloadTerrain ()
 Request that the current terrain be reloaded.
Terrain Patch methods
virtual DtTerrainPatchaddTerrainPatch (const makArchives::DtTerrainPatchRecord &rec)
 Create and add a new terrain patch driver.
virtual DtTerrainPatchaddTerrainPatch (const std::string &terrainDefinitionName)
 Create and add a new terrain patch driver.
virtual DtTerrainPatchfindTerrainPatch (const std::string &terrainDefinitionName)
 Return the DtTerrainPatchObjectAgent with the name terrainName.
virtual DtTerrainPatchfindTerrainPatch (DtUniqueID id)
 Return the DtTerrainPatchObjectAgent with the unique id.
virtual bool removeTerrainPatch (const std::string &terrainDefinitionName)
 Find and delete a terrain.
const TerrainPatchesterrainPatches () const
 Get the terrain drivers.
TerrainPatchesterrainPatches ()
 Get the terrain drivers.
bool lightPointsEnabled () const
 Are we showing point lights on the terrain?
Terrain Operation methods
virtual const
TerrainOperationsMap
terrainOperationsMap () const
Feature Layer methods
virtual DtFeatureLayeraddFeatureLayer (const makArchives::DtFeatureLayerRecord &rec, makArchives::DtTerrainOperationRecord::TargetApplication target=makArchives::DtTerrainOperationRecord::VisualizationAndSimulation)
 Add a feature layer.
virtual DtFeatureLayeraddFeatureLayer (const std::string &featureLayerFilename, makArchives::DtTerrainOperationRecord::TargetApplication target=makArchives::DtTerrainOperationRecord::VisualizationAndSimulation)
 Create and add a DtFeatureLayer.
virtual void removeFeatureLayer (const std::string &featureLayerFilename)
 Remove a feature layer. Emits signal_terrainPatchToBeDeleted.
virtual const FeatureLayersfeatureLayers () const
 Accessor for FeatureLayers.
virtual FeatureLayersfeatureLayers ()
 Accessor for FeatureLayers.
virtual DtFeatureLayerfindFeatureLayer (const std::string &featureLayerFilename)
 Return the DtFeatureLayer with the name featureLayerFilename.
virtual DtStreamedFeatureLayerstreamedFeatureLayer ()
 return the streamed feature layer
virtual DtBuoyBeaconLayerbuoyBeaconLayer ()
 Return the buoy layer.
virtual DtDynamicFeatureLayerdynamicFeatureLayer ()
 Return the dynamic feature layer.
virtual DtNavigationLightManagernavigationLightManager ()
 Return the nav light manager.
virtual
DtNavigationFeatureManager
navigationDaymarkManager ()
 Return the nav daymark manager.
virtual
DtNavigationFeatureManager
navigationTopmarkManager ()
 Return the nav topmark manager.
Ocean Layer methods
virtual DtOceanLayeraddOceanLayer (const makArchives::DtOceanLayerRecord &rec)
 Add an ocean layer.
virtual DtOceanLayeraddOceanLayer (const std::string &layerName)
 Create and add a DtOceanLayer.
virtual void removeOceanLayer (const std::string &layerName)
 Remove a ocean layer. Emits signal_oceanLayerToBeDeleted.
virtual const OceanLayersoceanLayers () const
 Accessor for OceanLayers.
virtual OceanLayersoceanLayers ()
 Accessor for OceanLayers.
virtual DtOceanLayerfindOceanLayer (const std::string &layerName)
 Return the DtOceanLayer with the name layerName.
virtual void onOceanNodesExtracted (DtTerrainPatchObject &patchObject)
 Slot called when ocean nodes are extracted.
Prop methods
std::string generatePropName (const std::string &propType)
 Generate a unique name for the prop.
Forest methods
virtual DtForestforest ()
 Return the DtForestObjectDriver.
Export methods
virtual bool exportTerrainAndProps (const std::string &)
 Saves terrain geometry and props to specified file.

Protected Types

typedef std::map< std::string,
int
PropNameMap

Protected Member Functions

void executeTerrainOperation (const makArchives::DtTerrainOperationRecord &operation, const makArchives::DtTerrainRecord &terrainRec)
 Execute a terrain operation. For example, adding a terrain patch.
void addTerrainOperationRecord (const makArchives::DtTerrainOperationRecord &operation)
 Add a terrain operations record and emit signal_terrainOperationAdded.
void removeTerrainOperationRecord (const makArchives::DtTerrainOperationRecord &operation)
 Remove a previously added record.
void removeTerrainOperationRecord (int id)
 Removed a terrain operations record and emit signal_terrainOperationAdded.
void clearTerrainOperations ()
 Remove all terrain operations from myTerrainOperationsMap emitting signals.
void slot_handleIsDayChanged (bool isDay)
 Turn on and off the lights when the sky object says to.
virtual bool checkIfTerrainOperationRecordsMatch (const makArchives::DtTerrainOperationRecord &left, const makArchives::DtTerrainOperationRecord &right)
 Check if two DtTerrainOperationRecord match without comparing the application type field.

Protected Attributes

DtDemyDe
DtTerrainSignalermySignaler
DtAgentManagerInterfacemyAgentManagerInterface
TerrainPatches myTerrainPatches
FeatureLayers myFeatureLayers
OceanLayers myOceanLayers
DtForest myForest
DtBuoyBeaconLayermyBuoyLayer
DtStreamedFeatureLayermyStreamedFeatureLayer
DtDynamicFeatureLayermyDynamicFeatureLayer
DtNavigationLightManagermyNavigationLightManager
DtNavigationFeatureManagermyNavigationDaymarkManager
DtNavigationFeatureManagermyNavigationTopmarkManager
TerrainOperationsMap myTerrainOperationsMap
int myNextTerrainOperationId
bool myGlobalScaleFlag
PropNameMap myPropNameMap
makArchives::DtTerrainRecord::OptionalParameterMap myOptionalParameters
makArchives::DtTerrainRecord::GenericRecords myGenericRecords
std::string myDescription
bool myUseICO
unsigned int myMaxPagedLODs
bool myReloadingTerrain
DtTexturedQuadmyLogo

Additional Inherited Members

- Private Member Functions inherited from makVrv::DtSignalConnectionManager
 DtSignalConnectionManager ()
 CTOR.
virtual ~DtSignalConnectionManager ()
 DTOR.
void manageConnection (const boost::signalslib::connection &conn)
 Connect a signal.
DtSignalConnectionManageroperator+= (const boost::signalslib::connection &conn)
 Connect a signal.
int numberOfConnections () const
 Get the number of connections.
void disconnectSignals ()
 Disconnect all signals.
bool blockConnections (bool blocked)
 Blocks/unblocks connections.
bool blockConnection (int index, bool blocked)
 Blocks/unblocks connections.
bool connectionsBlocked () const
 check whether connections are blocked.
bool connectionBlocked (int index) const
 check whether connections are blocked.

Detailed Description

DtTerrain is a facade around terrain functionality.

Member Typedef Documentation

Map of terrain operation ids, to terrain operations.

typedef std::map<std::string,int> makVrv::DtTerrain::PropNameMap
protected

Constructor & Destructor Documentation

makVrv::DtTerrain::DtTerrain ( DtDe de,
DtAgentManagerInterface sceneManagerInterface 
)

CTOR.

virtual makVrv::DtTerrain::~DtTerrain ( )
virtual

DTOR.

Member Function Documentation

void makVrv::DtTerrain::clear ( bool  reload = false)

Clear the terrain.

If the terrain is being cleared because a reloadTerrain operation was requested, the reload flag will be set to true.

bool makVrv::DtTerrain::globalScaleTerrain ( ) const

Checks to see if the terrain is a global scale terrain.

Typically a global scale terrain takes a [nearly] complete representation of the globe.

void makVrv::DtTerrain::updateGlobalScaleTerrain ( )

Rechecks if the terrain is of global scale.

This function will emit the global scale changed signal from the signaler object if the scale changes.

virtual void makVrv::DtTerrain::getRecord ( makArchives::DtTerrainRecord rec)
virtual

Fill out a DtTerrainRecord with the current terrain info. Called by saveTerrain().

Reimplemented in makVrf::DtVrfTerrain.

virtual void makVrv::DtTerrain::setFromRecord ( const makArchives::DtTerrainRecord rec,
bool  clearFirst = true 
)
virtual

Populate a DtTerrain from a DtTerrainRecord.

Called by loadTerrain(). If the clearFirst flag is true, DtTerrain::clear() will be called before populating the new terrain

Reimplemented in makVrf::DtVrfTerrain.

virtual void makVrv::DtTerrain::reloadTerrain ( )
virtual

Request that the current terrain be reloaded.

virtual DtTerrainPatch& makVrv::DtTerrain::addTerrainPatch ( const makArchives::DtTerrainPatchRecord rec)
virtual

Create and add a new terrain patch driver.

If a terrain patch already exists with the same name, it is deleted. Do not delete this terrain patch via the returned pointer. Instead, use deleteTerrainPatch().

virtual DtTerrainPatch& makVrv::DtTerrain::addTerrainPatch ( const std::string &  terrainDefinitionName)
virtual

Create and add a new terrain patch driver.

If a terrain patch already exists with the same name, it is deleted. Do not delete this terrain patch via the returned pointer. Instead, use deleteTerrainPatch().

virtual DtTerrainPatch* makVrv::DtTerrain::findTerrainPatch ( const std::string &  terrainDefinitionName)
virtual

Return the DtTerrainPatchObjectAgent with the name terrainName.

virtual DtTerrainPatch* makVrv::DtTerrain::findTerrainPatch ( DtUniqueID  id)
virtual

Return the DtTerrainPatchObjectAgent with the unique id.

virtual bool makVrv::DtTerrain::removeTerrainPatch ( const std::string &  terrainDefinitionName)
virtual

Find and delete a terrain.

Returns
Whether the terrain was found and deleted.
const TerrainPatches& makVrv::DtTerrain::terrainPatches ( ) const

Get the terrain drivers.

Do not add or remove terrains while iterating.

TerrainPatches& makVrv::DtTerrain::terrainPatches ( )

Get the terrain drivers.

Do not add or remove terrains while iterating.

bool makVrv::DtTerrain::lightPointsEnabled ( ) const

Are we showing point lights on the terrain?

virtual const TerrainOperationsMap& makVrv::DtTerrain::terrainOperationsMap ( ) const
virtual

Add a feature layer.

Calls addFeatureLayer with a given name. It then initializes the feature layer using the provided record.

virtual DtFeatureLayer& makVrv::DtTerrain::addFeatureLayer ( const std::string &  featureLayerFilename,
makArchives::DtTerrainOperationRecord::TargetApplication  target = makArchives::DtTerrainOperationRecord::VisualizationAndSimulation 
)
virtual

Create and add a DtFeatureLayer.

If a DtFeatureLayer already exists with the same name, it is deleted. Do not delete this DtFeatureLayer via the returned pointer. Instead, use removeFeatureLayer().

Reimplemented in DtVrfTerrain.

virtual void makVrv::DtTerrain::removeFeatureLayer ( const std::string &  featureLayerFilename)
virtual

Remove a feature layer. Emits signal_terrainPatchToBeDeleted.

virtual const FeatureLayers& makVrv::DtTerrain::featureLayers ( ) const
virtual

Accessor for FeatureLayers.

virtual FeatureLayers& makVrv::DtTerrain::featureLayers ( )
virtual

Accessor for FeatureLayers.

virtual DtFeatureLayer* makVrv::DtTerrain::findFeatureLayer ( const std::string &  featureLayerFilename)
virtual

Return the DtFeatureLayer with the name featureLayerFilename.

virtual DtStreamedFeatureLayer& makVrv::DtTerrain::streamedFeatureLayer ( )
virtual

return the streamed feature layer

contains features streamed in and represented by 3d facades

virtual DtBuoyBeaconLayer& makVrv::DtTerrain::buoyBeaconLayer ( )
virtual

Return the buoy layer.

virtual DtDynamicFeatureLayer& makVrv::DtTerrain::dynamicFeatureLayer ( )
virtual

Return the dynamic feature layer.

The dynamic feature layer contains entities which utilize .meta files for configuring and updating specific nodes in a model based on node annotations or node names

virtual DtNavigationLightManager& makVrv::DtTerrain::navigationLightManager ( )
virtual

Return the nav light manager.

virtual DtNavigationFeatureManager& makVrv::DtTerrain::navigationDaymarkManager ( )
virtual

Return the nav daymark manager.

virtual DtNavigationFeatureManager& makVrv::DtTerrain::navigationTopmarkManager ( )
virtual

Return the nav topmark manager.

virtual DtOceanLayer& makVrv::DtTerrain::addOceanLayer ( const makArchives::DtOceanLayerRecord rec)
virtual

Add an ocean layer.

Calls addOceanLayer with a given name. It then initializes the ocean layer using the provided record.

virtual DtOceanLayer& makVrv::DtTerrain::addOceanLayer ( const std::string &  layerName)
virtual

Create and add a DtOceanLayer.

If a DtOceanLayer already exists with the same name, it is deleted. Do not delete this DtOceanLayer via the returned pointer. Instead, use removeOceanLayer().

virtual void makVrv::DtTerrain::removeOceanLayer ( const std::string &  layerName)
virtual

Remove a ocean layer. Emits signal_oceanLayerToBeDeleted.

virtual const OceanLayers& makVrv::DtTerrain::oceanLayers ( ) const
virtual

Accessor for OceanLayers.

virtual OceanLayers& makVrv::DtTerrain::oceanLayers ( )
virtual

Accessor for OceanLayers.

virtual DtOceanLayer* makVrv::DtTerrain::findOceanLayer ( const std::string &  layerName)
virtual

Return the DtOceanLayer with the name layerName.

virtual void makVrv::DtTerrain::onOceanNodesExtracted ( DtTerrainPatchObject patchObject)
virtual

Slot called when ocean nodes are extracted.

If there aren't any ocean layers, DtTerrain will create one when this is called.

std::string makVrv::DtTerrain::generatePropName ( const std::string &  propType)

Generate a unique name for the prop.

virtual DtForest& makVrv::DtTerrain::forest ( )
virtual

Return the DtForestObjectDriver.

This lazily creates one if it does not exist. There only needs to be one DtForestObjectDriver for the whole scene.

bool makVrv::DtTerrain::isPropNameUsed ( const std::string &  propName) const

Checks whether a prop name is in use.

virtual bool makVrv::DtTerrain::getTerrainIntersection ( double  x,
double  y,
double  z,
double  upX,
double  upY,
double  upZ,
double retX,
double retY,
double retZ 
)
virtual

Get the closest intersection to x,y,z.

Note that the up values may not be used in the case of osgEarth patches (it will use the normal to the surface at x,y,z).

virtual void makVrv::DtTerrain::clearElevationCache ( )
virtual

If any of the terrain's patch objects is using an elevation cache, clear them (otherwise do nothing).

Use after making a large number of successive calls, such as while extracting props from a shape file

virtual bool makVrv::DtTerrain::exportTerrainAndProps ( const std::string &  )
virtual

Saves terrain geometry and props to specified file.

This file will be saved in the format specified by the file extension. Currently only the .gdb extension is supported

virtual const std::string* makVrv::DtTerrain::findOptionalParameter ( const std::string &  name) const
virtual

Find an optional parameter.

These optional parameters are provided because VR-Vantage and VR-Forces want to be able to share terrain files, and this makes whole process simpler.

virtual void makVrv::DtTerrain::setOptionalParameter ( const std::string &  name,
const std::string &  value 
)
virtual

Set an optional parameter.

virtual void makVrv::DtTerrain::setOptionalParameters ( const makArchives::DtTerrainRecord::OptionalParameterMap )
virtual

Set an optional parameters.

This will overwrite any existing optional parameters.

virtual void makVrv::DtTerrain::removeOptionalParameter ( const std::string &  name)
virtual

Remove an optional parameter.

const makArchives::DtTerrainRecord::OptionalParameterMap& makVrv::DtTerrain::optionalParameters ( ) const

Get the optional parameters.

virtual const std::string& makVrv::DtTerrain::description ( )
virtual

Get the terrains's description.

virtual void makVrv::DtTerrain::setDescription ( const std::string &  description)
virtual

Set the terrains's description.

virtual bool makVrv::DtTerrain::useICO ( ) const
virtual

Get the UseICO flag.

virtual void makVrv::DtTerrain::setUseICO ( bool  flag)
virtual

Set the UseICO flag.

virtual unsigned int makVrv::DtTerrain::maxPagedLODs ( ) const
virtual

Get max paged LOD target.

virtual void makVrv::DtTerrain::setMaxPagedLODs ( unsigned int  maxPagedLODs)
virtual

Set the max paged LOD target.

virtual bool makVrv::DtTerrain::reloadingTerrain ( )
inlinevirtual

is the terrain currently reloading

void makVrv::DtTerrain::executeTerrainOperation ( const makArchives::DtTerrainOperationRecord operation,
const makArchives::DtTerrainRecord terrainRec 
)
protected

Execute a terrain operation. For example, adding a terrain patch.

void makVrv::DtTerrain::addTerrainOperationRecord ( const makArchives::DtTerrainOperationRecord operation)
protected

Add a terrain operations record and emit signal_terrainOperationAdded.

void makVrv::DtTerrain::removeTerrainOperationRecord ( const makArchives::DtTerrainOperationRecord operation)
protected

Remove a previously added record.

void makVrv::DtTerrain::removeTerrainOperationRecord ( int  id)
protected

Removed a terrain operations record and emit signal_terrainOperationAdded.

void makVrv::DtTerrain::clearTerrainOperations ( )
protected

Remove all terrain operations from myTerrainOperationsMap emitting signals.

void makVrv::DtTerrain::slot_handleIsDayChanged ( bool  isDay)
protected

Turn on and off the lights when the sky object says to.

virtual bool makVrv::DtTerrain::checkIfTerrainOperationRecordsMatch ( const makArchives::DtTerrainOperationRecord left,
const makArchives::DtTerrainOperationRecord right 
)
protectedvirtual

Check if two DtTerrainOperationRecord match without comparing the application type field.

Member Data Documentation

DtDe& makVrv::DtTerrain::myDe
protected
DtTerrainSignaler& makVrv::DtTerrain::mySignaler
protected
DtAgentManagerInterface& makVrv::DtTerrain::myAgentManagerInterface
protected
TerrainPatches makVrv::DtTerrain::myTerrainPatches
protected
FeatureLayers makVrv::DtTerrain::myFeatureLayers
protected
OceanLayers makVrv::DtTerrain::myOceanLayers
protected
DtForest makVrv::DtTerrain::myForest
protected
DtBuoyBeaconLayer* makVrv::DtTerrain::myBuoyLayer
protected
DtStreamedFeatureLayer* makVrv::DtTerrain::myStreamedFeatureLayer
protected
DtDynamicFeatureLayer* makVrv::DtTerrain::myDynamicFeatureLayer
protected
DtNavigationLightManager* makVrv::DtTerrain::myNavigationLightManager
protected
DtNavigationFeatureManager* makVrv::DtTerrain::myNavigationDaymarkManager
protected
DtNavigationFeatureManager* makVrv::DtTerrain::myNavigationTopmarkManager
protected
TerrainOperationsMap makVrv::DtTerrain::myTerrainOperationsMap
protected
int makVrv::DtTerrain::myNextTerrainOperationId
protected
bool makVrv::DtTerrain::myGlobalScaleFlag
protected
PropNameMap makVrv::DtTerrain::myPropNameMap
protected
makArchives::DtTerrainRecord::OptionalParameterMap makVrv::DtTerrain::myOptionalParameters
protected
makArchives::DtTerrainRecord::GenericRecords makVrv::DtTerrain::myGenericRecords
protected
std::string makVrv::DtTerrain::myDescription
protected
bool makVrv::DtTerrain::myUseICO
protected
unsigned int makVrv::DtTerrain::myMaxPagedLODs
protected
bool makVrv::DtTerrain::myReloadingTerrain
protected
DtTexturedQuad* makVrv::DtTerrain::myLogo
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)