![]() |
VR-Forces 4.0.4 Class Documentation
|
DtTerrain is a facade around terrain functionality. More...

Public Types | |
| typedef std::list < DtTerrainPatch * > | TerrainPatches |
| typedef std::list < DtFeatureLayer * > | FeatureLayers |
| typedef std::map< int, makArchives::DtTerrainOperationRecord > | TerrainOperationsMap |
| Map of terrain operation ids, to terrain operations. | |
Public Member Functions | |
| DtTerrain (DtDe &de, DtAgentManagerInterface &sceneManagerInterface) | |
| CTOR. | |
| ~DtTerrain () | |
| DTOR. | |
| virtual void | clear () |
| 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). | |
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) |
| Populate a DtTerrain from a DtTerrainRecord. Called by loadTerrain(). | |
Terrain Patch methods | |
| virtual DtTerrainPatch & | addTerrainPatch (const makArchives::DtTerrainPatchRecord &rec) |
| Create and add a new terrain patch driver. | |
| virtual DtTerrainPatch & | addTerrainPatch (const std::string &terrainDefinitionName) |
| Create and add a new terrain patch driver. | |
| virtual DtTerrainPatch * | findTerrainPatch (const std::string &terrainDefinitionName) |
| Return the DtTerrainPatchObjectAgent with the name terrainName. | |
| virtual DtTerrainPatch * | findTerrainPatch (DtUniqueID id) |
| Return the DtTerrainPatchObjectAgent with the unique id. | |
| virtual bool | removeTerrainPatch (const std::string &terrainDefinitionName) |
| Find and delete a terrain. | |
| const TerrainPatches & | terrainPatches () const |
| Get the terrain drivers. | |
| TerrainPatches & | terrainPatches () |
| Get the terrain drivers. | |
Terrain Operation methods | |
| virtual const TerrainOperationsMap & | terrainOperationsMap () const |
Feature Layer methods | |
| virtual DtFeatureLayer & | addFeatureLayer (const makArchives::DtFeatureLayerRecord &rec) |
| Add a feature layer. | |
| virtual DtFeatureLayer & | addFeatureLayer (const std::string &featureLayerFilename) |
| Create and add a DtFeatureLayer. | |
| virtual void | removeFeatureLayer (const std::string &featureLayerFilename) |
| Remove a feature layer. Emits signal_terrainPatchToBeDeleted. | |
| virtual const FeatureLayers & | featureLayers () const |
| Accessor for FeatureLayers. | |
| virtual FeatureLayers & | featureLayers () |
| Accessor for FeatureLayers. | |
| virtual DtFeatureLayer * | findFeatureLayer (const std::string &featureLayerFilename) |
| Return the DtFeatureLayer with the name featureLayerFilename. | |
Prop methods | |
| std::string | generatePropName (const std::string &propType) |
| Generate a unique name for the prop. | |
Forest methods | |
| virtual DtForest & | forest () |
| 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. | |
Protected Attributes | |
| DtDe & | myDe |
| DtTerrainSignaler & | mySignaler |
| DtAgentManagerInterface & | myAgentManagerInterface |
| TerrainPatches | myTerrainPatches |
| FeatureLayers | myFeatureLayers |
| DtForest | myForest |
| TerrainOperationsMap | myTerrainOperationsMap |
| int | myNextTerrainOperationId |
| bool | myGlobalScaleFlag |
| PropNameMap | myPropNameMap |
DtTerrain is a facade around terrain functionality.
| typedef std::list<DtTerrainPatch*> makVrv::DtTerrain::TerrainPatches |
| typedef std::list<DtFeatureLayer*> makVrv::DtTerrain::FeatureLayers |
| typedef std::map<int, makArchives::DtTerrainOperationRecord> makVrv::DtTerrain::TerrainOperationsMap |
Map of terrain operation ids, to terrain operations.
typedef std::map<std::string,int> makVrv::DtTerrain::PropNameMap [protected] |
| makVrv::DtTerrain::DtTerrain | ( | DtDe & | de, |
| DtAgentManagerInterface & | sceneManagerInterface | ||
| ) |
CTOR.
DTOR.
| virtual void makVrv::DtTerrain::clear | ( | ) | [virtual] |
Clear the terrain.
| 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.
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().
| virtual void makVrv::DtTerrain::setFromRecord | ( | const makArchives::DtTerrainRecord & | rec | ) | [virtual] |
Populate a DtTerrain from a DtTerrainRecord. Called by loadTerrain().
| 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.
| const TerrainPatches& makVrv::DtTerrain::terrainPatches | ( | ) | const |
Get the terrain drivers.
Do not add or remove terrains while iterating.
Get the terrain drivers.
Do not add or remove terrains while iterating.
| virtual const TerrainOperationsMap& makVrv::DtTerrain::terrainOperationsMap | ( | ) | const [virtual] |
| virtual DtFeatureLayer& makVrv::DtTerrain::addFeatureLayer | ( | const makArchives::DtFeatureLayerRecord & | rec | ) | [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 | ) | [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().
| 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.
| 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
| 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.
DtDe& makVrv::DtTerrain::myDe [protected] |
DtTerrainSignaler& makVrv::DtTerrain::mySignaler [protected] |
TerrainPatches makVrv::DtTerrain::myTerrainPatches [protected] |
FeatureLayers makVrv::DtTerrain::myFeatureLayers [protected] |
DtForest makVrv::DtTerrain::myForest [protected] |
int makVrv::DtTerrain::myNextTerrainOperationId [protected] |
bool makVrv::DtTerrain::myGlobalScaleFlag [protected] |
PropNameMap makVrv::DtTerrain::myPropNameMap [protected] |