VR-Forces 4.10 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 Member Functions | Protected Attributes | Private Member Functions | Friends
makVrv::DtTerrainPatch Class Reference

A container for a single piece of terrain, containing settings needed to recreate it. More...

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

Public Types

enum  GdbSurface {
  AsphaltOrOtherHardSurface =0, Boulder =1, Building =2, CultivatedFields =3,
  DeepBrook =4, DeepLake =5, DeepPond =6, DeepRiver =7,
  DeepStream =8, DirtRoad =9, DryGround =10, EuroRailRoad =11,
  Flimsy =12, Forest =13, Grass =14, GravelRoad =15,
  Icy =16, IcyGround =17, Moon =18, Mud =19,
  MuddyRoad =20, Ocean =21, Orchards =22, PavedRoad =23,
  Rock =24, Sand =25, ShallowBrook =26, ShallowLake =27,
  ShallowPond =28, ShallowRiver =29, ShallowStream =30, SnowGround =31,
  SoftSoil =32, Swamp =33, Tree =34, USRailRoad =35,
  UndefinedSoilType =36, Unspecified =37, UnspecifiedBodyOfWater =38, UnspecifiedCulturalFeature =39,
  UnspecifiedEnvStateGround =40, WetGround =41
}
 GDB Surface IDs. More...
 
- Public Types inherited from makVrv::DtTerrainLayer
typedef std::map< DtUniqueID,
DtProp * > 
PropMap
 List of props. More...
 
typedef boost::unordered_set
< std::string > 
PropNameSet
 Set of prop names. More...
 

Public Member Functions

virtual ~DtTerrainPatch ()
 DTOR. More...
 
DtDede ()
 Get the de. More...
 
const DtDede () const
 Get the de. More...
 
void setIsMinimapOnly (bool onlyForMinimap)
 set the flag that indicates that this patch should only appear in the minimap modelset More...
 
bool isMinimapOnly () const
 Is this patch only used by the minimap? More...
 
DtOverlaySettingsoverlaySettings ()
 Get the overlay settings. More...
 
const DtOverlaySettingsoverlaySettings () const
 Get the overlay settings. More...
 
DtTerrainTreeSettingsterrainTreeSettings ()
 Get the terrain tree settings. More...
 
const DtTerrainTreeSettingsterrainTreeSettings () const
 Get the terrain tree settings. More...
 
const
makArchives::DtTerrainPatchRecord::ExtractionOperations
extractionOperations () const
 ExtractionOperations accessor. More...
 
const
makArchives::DtTerrainPatchRecord::OceanExtractionOperations
oceanExtractionOperations () const
 OceanExtractionOperations accessor. More...
 
void extractNodesToTrees (std::string const &searchExp, bool isRegEx, std::string const &treeSpecies)
 Extract all trees fitting searchExp on this terrain patch and replace them with treeSpecies (not currently used) this is use when trees models are extracted by props. More...
 
DtTerrainPatchRecord methods
virtual void getRecord (makArchives::DtTerrainPatchRecord &rec) const
 Fill out a DtTerrainRecord with the current terrain info. More...
 
virtual void setFromRecord (const makArchives::DtTerrainPatchRecord &rec)
 Populate a DtTerrainPatch from a DtTerrainPatchRecord. More...
 
Accessors
const std::string & definition () const
 Get the definition. More...
 
DtUniqueID uniqueID () const
 Get the unique id of the terrain patch object (from the agent). More...
 
DtTerrainPatchObjectAgent * findObjectAgent ()
 Get the terrain patch object agent; note that this may return NULL if the patch did not create a patch object (which can happen if the patch is designated for the minimap modelset and that modelset isn't realized. More...
 
const DtTerrainPatchObjectAgent * findObjectAgent () const
 
Surface visibility settings
void setSurfaceVisible (int surfaceId, bool state)
 Set a surface's visibility. More...
 
bool surfaceVisible (int surfaceId)
 Check a surface's visibility. More...
 
DtSurfacesSettings::SurfaceIdList
const & 
surfaceIds ()
 Get a list of all surface IDs for this terrain patch. More...
 
void loadSurfacesSettings ()
 Load the surfaces settings from a file. More...
 
Prop management
virtual void setExtractedNodeAsPropModel (DtProp *prop, bool setObjectPosition=false)
 Make the prop's model be the extracted nodes via the prop's search expression and index. More...
 
virtual int countNodes (const std::string &rules) const
 Count the number of nodes matching the rules. More...
 
virtual void extractNodes (const std::string &rule, bool isRegEx)
 Extract nodes from the terrain patch using a given rule. More...
 
virtual void moveNode (DtSceneObjectAgent *objectDriver, DtModelAgent *model, const std::string &rule, unsigned int index)
 Move a node located by the rule + index into a model and sets the location of the object to the location of the node. More...
 
virtual void addExtractNodeOperation (std::string const &searchExp, bool isRegEx, std::string const &propType, unsigned int count)
 Add a prop extraction rule. More...
 
void extractNodesToProps (const std::string &exp, bool isRegEx, const std::string &type, const std::string &modelDefinition)
 Wrapper around extractProps for the benefit of executeExtractionOperation. More...
 
void extractNodesToSpeedTrees (const std::string &exp, bool isRegEx, const std::string &modelDefinition)
 Wrapper around extract external references as speed trees. More...
 
void executeExtractionOperation (const makArchives::DtExtractionOperationRecord &extractionRec)
 Execute a single extraction operation. More...
 
Static Ocean management
virtual void requestOceanExtraction (const std::string &rule, bool isRegEx)
 requestOceanExtraction() is called from the GUI. More...
 
virtual void extractOceanNodes (const std::string &rule, bool isRegEx)
 Extract ocean nodes from the terrain patch using a given rule. More...
 
virtual void addOceanExtractNodeOperation (std::string const &searchExp, bool isRegEx)
 Add a ocean extraction rule. More...
 
virtual void addOceanExtractNodeOperationIfExtracted (std::string const &searchExp, bool isRegEx)
 Conditionally add an ocean extraction rule. More...
 
void executeOceanExtractionOperation (const makArchives::DtOceanExtractionOperationRecord &extractionRec)
 Execute a single extraction operation. More...
 
virtual void extractSpeedTreeNodes (const std::string &rule, const bool isRegEx, const std::string &stModelDefinition)
 Extract osg nodes from the terrain patch using a given rule and replace them by speed trees models. More...
 
void executeSpeedTreeExtractionOperation (const makArchives::DtSpeedTreeExtractionOperationRecord &extractionRec)
 Execute a single speed tree extraction operation. More...
 
virtual void addSpeedTreeExtractOperation (std::string const &searchExp, bool isRegEx, const std::string &modelDefinition)
 Add a speed tree extraction operation to the historic records. More...
 
- Public Member Functions inherited from makVrv::DtTerrainLayer
 DtTerrainLayer (DtDe &de, DtAgentManagerInterface &sceneInterface)
 CTOR. More...
 
virtual ~DtTerrainLayer ()
 DTOR. More...
 
virtual void addProp (DtProp *prop)
 Add prop based on the DtPropRecord. More...
 
virtual bool addPropFromRecord (const makArchives::DtPropRecord &record)
 Add prop based on the DtPropRecord. More...
 
virtual DtPropfindProp (DtUniqueID id)
 Finds a pointer to the prop on the feature layer with the same identifiers as the passed in prop. More...
 
virtual bool destroyProp (DtUniqueID id)
 Destroys the prop with the unique name. More...
 
const PropMapprops () const
 Get the container of props associated with the layer. More...
 
const PropNameSetpropNames () const
 Get the set of prop names used in this layer. More...
 
void selectionChanged (const DtSelectionManager::IdSet &selected, const DtSelectionManager::IdSet &de)
 

Protected Member Functions

 DtTerrainPatch (DtDe &de, DtAgentManagerInterface &sceneInterface, const std::string &terrainDefinition, bool minimapOnly=false)
 Protected CTOR, use DtTerrainPatchCreator to create an instance of this class. More...
 
void onTerrainPatchObjectAvailable (DtUniqueID id)
 Slot for signaling when a patch has an object. More...
 
void executeExtractionOperations (const makArchives::DtTerrainPatchRecord::ExtractionOperations &ops)
 Execute all extraction operations. More...
 
void executeOceanExtractionOperations (const makArchives::DtTerrainPatchRecord::OceanExtractionOperations &ops)
 Execute all ocean extraction operations. More...
 
void executeSpeedTreeExtractionOperations (const makArchives::DtTerrainPatchRecord::SpeedTreeExtractionOperations &ops)
 Execute all speed tree extraction operations. More...
 
void createPropsFromRecord (const makArchives::DtPropSettingsRecord &propSettings)
 Restore settings for extracted props. More...
 
void getPropSettingsRecord (makArchives::DtPropSettingsRecord &record) const
 Create a prop settings record from all props owned by this patch. More...
 
void setPatchObjectTerrainTreeData (DtTerrainPatchObject &tpo)
 Set tree data (randomization) for this terrain patch object based on the DtTerrainPatch record. More...
 
void createPropsFromExtraction (DtTerrainPatchObject &tpo, makArchives::DtPropRecord *protoTypeRecord, const std::string &exp, bool isRegEx, const std::vector< std::string > &matches)
 Create props from an extraction. More...
 
virtual void slot_oceanNodesExtracted (DtTerrainPatchObject &tpo, bool extracted, std::string const &searchExp, bool isRegEx)
 This slot is connected to the terrain patch signaler's signal_oceanNodesExtracted when a request for ocean extraction is initiated. More...
 

Protected Attributes

std::string myDefinition
 
DtTerrainPatchObjectAgent * myTerrainAgent
 
DtOverlaySettings myOverlaySettings
 
DtSurfacesSettings mySurfacesSettings
 
DtTerrainTreeSettings myTerrainTreeSettings
 
makArchives::DtTerrainPatchRecord::ExtractionOperations myExtractionHistory
 
makArchives::DtTerrainPatchRecord::OceanExtractionOperations myOceanExtractionHistory
 
makArchives::DtTerrainPatchRecord::SpeedTreeExtractionOperations mySpeedTreeExtrationHistory
 
bool myIsMinimapOnly
 
- Protected Attributes inherited from makVrv::DtTerrainLayer
DtDemyDe
 
DtAgentManagerInterfacemySceneInterface
 

Private Member Functions

 DtTerrainPatch (const DtTerrainPatch &copy)
 
DtTerrainPatchoperator= (const DtTerrainPatch &copy)
 

Friends

class DtTerrainPatchCreator
 

Additional Inherited Members

- Public Attributes inherited from makVrv::DtTerrainLayer
boost::signalslib::signal
< void(const
DtSelectionManager::IdSet
&selected, const
DtSelectionManager::IdSet
&deselected)> 
signal_currentSelectionChanged
 Emited when the current selection changes. More...
 

Detailed Description

A container for a single piece of terrain, containing settings needed to recreate it.

Member Enumeration Documentation

GDB Surface IDs.

Enumerator
AsphaltOrOtherHardSurface 
Boulder 
Building 
CultivatedFields 
DeepBrook 
DeepLake 
DeepPond 
DeepRiver 
DeepStream 
DirtRoad 
DryGround 
EuroRailRoad 
Flimsy 
Forest 
Grass 
GravelRoad 
Icy 
IcyGround 
Moon 
Mud 
MuddyRoad 
Ocean 
Orchards 
PavedRoad 
Rock 
Sand 
ShallowBrook 
ShallowLake 
ShallowPond 
ShallowRiver 
ShallowStream 
SnowGround 
SoftSoil 
Swamp 
Tree 
USRailRoad 
UndefinedSoilType 
Unspecified 
UnspecifiedBodyOfWater 
UnspecifiedCulturalFeature 
UnspecifiedEnvStateGround 
WetGround 

Constructor & Destructor Documentation

virtual makVrv::DtTerrainPatch::~DtTerrainPatch ( )
virtual

DTOR.

makVrv::DtTerrainPatch::DtTerrainPatch ( const DtTerrainPatch copy)
private
makVrv::DtTerrainPatch::DtTerrainPatch ( DtDe de,
DtAgentManagerInterface sceneInterface,
const std::string &  terrainDefinition,
bool  minimapOnly = false 
)
protected

Protected CTOR, use DtTerrainPatchCreator to create an instance of this class.

Member Function Documentation

DtTerrainPatch& makVrv::DtTerrainPatch::operator= ( const DtTerrainPatch copy)
private
virtual void makVrv::DtTerrainPatch::getRecord ( makArchives::DtTerrainPatchRecord rec) const
virtual

Fill out a DtTerrainRecord with the current terrain info.

virtual void makVrv::DtTerrainPatch::setFromRecord ( const makArchives::DtTerrainPatchRecord rec)
virtual

Populate a DtTerrainPatch from a DtTerrainPatchRecord.

const std::string& makVrv::DtTerrainPatch::definition ( ) const

Get the definition.

DtUniqueID makVrv::DtTerrainPatch::uniqueID ( ) const

Get the unique id of the terrain patch object (from the agent).

DtTerrainPatchObjectAgent* makVrv::DtTerrainPatch::findObjectAgent ( )

Get the terrain patch object agent; note that this may return NULL if the patch did not create a patch object (which can happen if the patch is designated for the minimap modelset and that modelset isn't realized.

const DtTerrainPatchObjectAgent* makVrv::DtTerrainPatch::findObjectAgent ( ) const
DtDe& makVrv::DtTerrainPatch::de ( )
inline

Get the de.

const DtDe& makVrv::DtTerrainPatch::de ( ) const
inline

Get the de.

void makVrv::DtTerrainPatch::setIsMinimapOnly ( bool  onlyForMinimap)

set the flag that indicates that this patch should only appear in the minimap modelset

bool makVrv::DtTerrainPatch::isMinimapOnly ( ) const

Is this patch only used by the minimap?

DtOverlaySettings& makVrv::DtTerrainPatch::overlaySettings ( )

Get the overlay settings.

const DtOverlaySettings& makVrv::DtTerrainPatch::overlaySettings ( ) const

Get the overlay settings.

DtTerrainTreeSettings& makVrv::DtTerrainPatch::terrainTreeSettings ( )

Get the terrain tree settings.

const DtTerrainTreeSettings& makVrv::DtTerrainPatch::terrainTreeSettings ( ) const

Get the terrain tree settings.

const makArchives::DtTerrainPatchRecord::ExtractionOperations& makVrv::DtTerrainPatch::extractionOperations ( ) const

ExtractionOperations accessor.

const makArchives::DtTerrainPatchRecord::OceanExtractionOperations& makVrv::DtTerrainPatch::oceanExtractionOperations ( ) const

OceanExtractionOperations accessor.

void makVrv::DtTerrainPatch::setSurfaceVisible ( int  surfaceId,
bool  state 
)

Set a surface's visibility.

bool makVrv::DtTerrainPatch::surfaceVisible ( int  surfaceId)

Check a surface's visibility.

DtSurfacesSettings::SurfaceIdList const& makVrv::DtTerrainPatch::surfaceIds ( )

Get a list of all surface IDs for this terrain patch.

void makVrv::DtTerrainPatch::loadSurfacesSettings ( )

Load the surfaces settings from a file.

virtual void makVrv::DtTerrainPatch::setExtractedNodeAsPropModel ( DtProp prop,
bool  setObjectPosition = false 
)
virtual

Make the prop's model be the extracted nodes via the prop's search expression and index.

Parameters
setObjectPositionsets the position of the prop to the location of extracted nodes
virtual int makVrv::DtTerrainPatch::countNodes ( const std::string &  rules) const
virtual

Count the number of nodes matching the rules.

virtual void makVrv::DtTerrainPatch::extractNodes ( const std::string &  rule,
bool  isRegEx 
)
virtual

Extract nodes from the terrain patch using a given rule.

virtual void makVrv::DtTerrainPatch::moveNode ( DtSceneObjectAgent *  objectDriver,
DtModelAgent *  model,
const std::string &  rule,
unsigned int  index 
)
virtual

Move a node located by the rule + index into a model and sets the location of the object to the location of the node.

virtual void makVrv::DtTerrainPatch::addExtractNodeOperation ( std::string const &  searchExp,
bool  isRegEx,
std::string const &  propType,
unsigned int  count 
)
virtual

Add a prop extraction rule.

void makVrv::DtTerrainPatch::extractNodesToProps ( const std::string &  exp,
bool  isRegEx,
const std::string &  type,
const std::string &  modelDefinition 
)

Wrapper around extractProps for the benefit of executeExtractionOperation.

void makVrv::DtTerrainPatch::extractNodesToSpeedTrees ( const std::string &  exp,
bool  isRegEx,
const std::string &  modelDefinition 
)

Wrapper around extract external references as speed trees.

void makVrv::DtTerrainPatch::executeExtractionOperation ( const makArchives::DtExtractionOperationRecord extractionRec)

Execute a single extraction operation.

virtual void makVrv::DtTerrainPatch::requestOceanExtraction ( const std::string &  rule,
bool  isRegEx 
)
virtual

requestOceanExtraction() is called from the GUI.

If any extraction actually happens, and extraction operation will be registered for saving out to file

virtual void makVrv::DtTerrainPatch::extractOceanNodes ( const std::string &  rule,
bool  isRegEx 
)
virtual

Extract ocean nodes from the terrain patch using a given rule.

virtual void makVrv::DtTerrainPatch::addOceanExtractNodeOperation ( std::string const &  searchExp,
bool  isRegEx 
)
virtual

Add a ocean extraction rule.

This is used when loading a .mtf file to track existing extraction operations

virtual void makVrv::DtTerrainPatch::addOceanExtractNodeOperationIfExtracted ( std::string const &  searchExp,
bool  isRegEx 
)
virtual

Conditionally add an ocean extraction rule.

This is used by requestOceanExtraction(). It prevents operations that won't do anything from being added to the ocean extraction operation list

void makVrv::DtTerrainPatch::executeOceanExtractionOperation ( const makArchives::DtOceanExtractionOperationRecord extractionRec)

Execute a single extraction operation.

virtual void makVrv::DtTerrainPatch::extractSpeedTreeNodes ( const std::string &  rule,
const bool  isRegEx,
const std::string &  stModelDefinition 
)
virtual

Extract osg nodes from the terrain patch using a given rule and replace them by speed trees models.

void makVrv::DtTerrainPatch::executeSpeedTreeExtractionOperation ( const makArchives::DtSpeedTreeExtractionOperationRecord extractionRec)

Execute a single speed tree extraction operation.

virtual void makVrv::DtTerrainPatch::addSpeedTreeExtractOperation ( std::string const &  searchExp,
bool  isRegEx,
const std::string &  modelDefinition 
)
virtual

Add a speed tree extraction operation to the historic records.

void makVrv::DtTerrainPatch::extractNodesToTrees ( std::string const &  searchExp,
bool  isRegEx,
std::string const &  treeSpecies 
)

Extract all trees fitting searchExp on this terrain patch and replace them with treeSpecies (not currently used) this is use when trees models are extracted by props.

void makVrv::DtTerrainPatch::onTerrainPatchObjectAvailable ( DtUniqueID  id)
protected

Slot for signaling when a patch has an object.

void makVrv::DtTerrainPatch::executeExtractionOperations ( const makArchives::DtTerrainPatchRecord::ExtractionOperations ops)
protected

Execute all extraction operations.

Warning
This will delete ops.
void makVrv::DtTerrainPatch::executeOceanExtractionOperations ( const makArchives::DtTerrainPatchRecord::OceanExtractionOperations ops)
protected

Execute all ocean extraction operations.

Warning
This will delete ops.
void makVrv::DtTerrainPatch::executeSpeedTreeExtractionOperations ( const makArchives::DtTerrainPatchRecord::SpeedTreeExtractionOperations ops)
protected

Execute all speed tree extraction operations.

Warning
This will delete ops.
void makVrv::DtTerrainPatch::createPropsFromRecord ( const makArchives::DtPropSettingsRecord propSettings)
protected

Restore settings for extracted props.

void makVrv::DtTerrainPatch::getPropSettingsRecord ( makArchives::DtPropSettingsRecord record) const
protected

Create a prop settings record from all props owned by this patch.

void makVrv::DtTerrainPatch::setPatchObjectTerrainTreeData ( DtTerrainPatchObject tpo)
protected

Set tree data (randomization) for this terrain patch object based on the DtTerrainPatch record.

void makVrv::DtTerrainPatch::createPropsFromExtraction ( DtTerrainPatchObject tpo,
makArchives::DtPropRecord protoTypeRecord,
const std::string &  exp,
bool  isRegEx,
const std::vector< std::string > &  matches 
)
protected

Create props from an extraction.

Expects the terrain patch object the props came from, a prototype prop record, the search expression, whether the search expression was a regexp, and the list of search expression matches

virtual void makVrv::DtTerrainPatch::slot_oceanNodesExtracted ( DtTerrainPatchObject tpo,
bool  extracted,
std::string const &  searchExp,
bool  isRegEx 
)
protectedvirtual

This slot is connected to the terrain patch signaler's signal_oceanNodesExtracted when a request for ocean extraction is initiated.

If the signal raised is true, an ocean extraction operation will be added to the extraction list

Friends And Related Function Documentation

friend class DtTerrainPatchCreator
friend

Member Data Documentation

std::string makVrv::DtTerrainPatch::myDefinition
protected
DtTerrainPatchObjectAgent* makVrv::DtTerrainPatch::myTerrainAgent
protected
DtOverlaySettings makVrv::DtTerrainPatch::myOverlaySettings
protected
DtSurfacesSettings makVrv::DtTerrainPatch::mySurfacesSettings
protected
DtTerrainTreeSettings makVrv::DtTerrainPatch::myTerrainTreeSettings
protected
makArchives::DtTerrainPatchRecord::ExtractionOperations makVrv::DtTerrainPatch::myExtractionHistory
protected
makArchives::DtTerrainPatchRecord::OceanExtractionOperations makVrv::DtTerrainPatch::myOceanExtractionHistory
protected
makArchives::DtTerrainPatchRecord::SpeedTreeExtractionOperations makVrv::DtTerrainPatch::mySpeedTreeExtrationHistory
protected
bool makVrv::DtTerrainPatch::myIsMinimapOnly
protected

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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)