VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
makVrv::DtAddTerrainPatchManager Class Reference

The add terrain patch manager is used to add one or more terrain patches to the current terrain. The manager is used by the add terrain patch dialog and the terrain editor to add one or more terrain patches while ensuring:

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

Classes

class  TerrainPatchFile
 

Public Types

enum  AlphaToCoverageState { AlphaToCoverageState::USE_GLOBAL, AlphaToCoverageState::FORCE_OFF, AlphaToCoverageState::FORCE_ON }
 
enum  TerrainCoordinateSystemEnum {
  TerrainCoordinateSystemEnum::None, TerrainCoordinateSystemEnum::Geocentric, TerrainCoordinateSystemEnum::UTM, TerrainCoordinateSystemEnum::Lambert,
  TerrainCoordinateSystemEnum::FlatEarth, TerrainCoordinateSystemEnum::Cartesian
}
 
enum  AddTerrainPatchStatus {
  AddTerrainPatchStatus::NoError, AddTerrainPatchStatus::LimitedSupportFileType, AddTerrainPatchStatus::UnsupportedFileType, AddTerrainPatchStatus::ProcessHeaderFailed,
  AddTerrainPatchStatus::MoreThanOneOsgEarthTerrainPatch
}
 

Public Member Functions

virtual void addFilePaths (const std::vector< std::string > &filePaths)
 
virtual bool terrainPatchAddStatus (const std::string &filePath, AddTerrainPatchStatus &status) const
 
virtual void removeFilePaths (const std::vector< std::string > &filePaths)
 
virtual void removeAllFilePaths ()
 
virtual std::vector< std::string > filePathsToAdd () const
 
virtual void setDdsFlip (const std::string &filePath, bool ddsFlip)
 
virtual void setAlphaToCoverage (const std::string &filePath, AlphaToCoverageState a2cState)
 
virtual void setIndirectEnabled (const std::string &filePath, bool enabled)
 
virtual void addTerrainPatches ()
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtAddTerrainPatchManagerinstance (DtDe &de)
 
static void registerInstance (DtDe &de, DtAddTerrainPatchManager *instance)
 
static
DtAddTerrainPatchManager::TerrainCoordinateSystemEnum 
coordSysStrToEnum (const std::string &coordSys)
 
static DtUnicode statusDisplayText (AddTerrainPatchStatus addStatus)
 

Public Attributes

boost::signalslib::signal
< void(std::map< std::string,
TerrainPatchFile > filesToAdd)> 
signal_terrainPatchesToAddUpdated
 
boost::signalslib::signal
< void(const std::string
&filePath, bool flipDds)> 
signal_ddsFlipEnabledUpdated
 
boost::signalslib::signal
< void(const std::string
&filePath, bool
indirectEnabled)> 
signal_indirectRenderingEnabledUpdated
 
boost::signalslib::signal
< void(const std::string
&filePath,
AlphaToCoverageState a2cState)> 
signal_alphaToCoverageStateUpdated
 
boost::signalslib::signal
< void(const std::string
&coordSysType, const
std::string &coordSysParams)> 
signal_coordinateSystemUpdated
 

Protected Member Functions

 DtAddTerrainPatchManager (DtDe &de)
 
virtual bool isOsgEarthTerrain (const std::string &fileName)
 
virtual bool processTerrainPatchHeader (const std::string &filePath, AddTerrainPatchStatus &msg)
 
virtual void slot_terrainPatchCreated (DtTerrainPatchObject &terrainPatchObject)
 
virtual void slot_terrainPatchAboutToBeDeleted (DtTerrainPatchObject &terrainPatchObject)
 
virtual void enforceOnlyOneOsgEarthTerrainPatchConstraint ()
 

Protected Attributes

DtDemyDe
 
DtSignalConnectionManager myConnections
 
bool myOsgEarthTerrainPatchToBeAdded
 
bool myTerrainHasOsgEarthTerrainPatch
 
std::map< std::string,
TerrainPatchFile
myFilesToAdd
 

Member Enumeration Documentation

The possible states of alpha to coverage for a terrain patch.

Enumerator
USE_GLOBAL 
FORCE_OFF 
FORCE_ON 

An enumeration for the possible coordinate systems for the terrain.

Enumerator
None 
Geocentric 
UTM 
Lambert 
FlatEarth 
Cartesian 

An enumeration for the possible statuses a terrain patch can have when being added.

Enumerator
NoError 
LimitedSupportFileType 
UnsupportedFileType 
ProcessHeaderFailed 
MoreThanOneOsgEarthTerrainPatch 

Constructor & Destructor Documentation

makVrv::DtAddTerrainPatchManager::DtAddTerrainPatchManager ( DtDe de)
protected

CTOR.

Member Function Documentation

virtual void makVrv::DtAddTerrainPatchManager::addFilePaths ( const std::vector< std::string > &  filePaths)
virtual

Add the passed in file paths to the working list of terrain patches to add to the terrain. Depending on the format, each file can specify one or more terrain patches and the file is processed to determine whether or not it is valid and if the format is supported or not.

virtual bool makVrv::DtAddTerrainPatchManager::terrainPatchAddStatus ( const std::string &  filePath,
AddTerrainPatchStatus status 
) const
virtual

Get the add status of a file path, by reference, from the working list of terrain patches to add to the terrain. This function returns false if the passed in filePath is not in the working list of terrain patches to add to the terrain and leaves the status parameter unchanged. Otherwise, this function returns true and updates the status parameter with the add status of the passed in filePath.

virtual void makVrv::DtAddTerrainPatchManager::removeFilePaths ( const std::vector< std::string > &  filePaths)
virtual

Remove the passed in file paths from the working list of terrain patches to add to the terrain.

virtual void makVrv::DtAddTerrainPatchManager::removeAllFilePaths ( )
virtual

Clear the working list of terrain patches to add to the terrain.

virtual std::vector<std::string> makVrv::DtAddTerrainPatchManager::filePathsToAdd ( ) const
virtual

Returns a vector of the current working list of file path strings to add.

virtual void makVrv::DtAddTerrainPatchManager::setDdsFlip ( const std::string &  filePath,
bool  ddsFlip 
)
virtual

Set whether or not to flip any DDS textures that are present for the one or more terrain patches to be loaded with the passed in file path. This function does nothing if the passed in file path does not exist in the current working list of file paths to process or if the file path cannot be processed.

virtual void makVrv::DtAddTerrainPatchManager::setAlphaToCoverage ( const std::string &  filePath,
AlphaToCoverageState  a2cState 
)
virtual

Set the alpha to coverage state to use for the one or more terrain patches to be loaded with the passed in file path. This function does nothing if the passed in file path does not exist in the current working list of file paths to process or if the file path cannot be processed.

virtual void makVrv::DtAddTerrainPatchManager::setIndirectEnabled ( const std::string &  filePath,
bool  enabled 
)
virtual

Set whether or not to enable indirect rendering for the one or more terrain patches to be loaded with the passed in file path. This function does nothing if the passed in file path does not exist in the current working list of file paths to process or if the file path cannot be processed.

virtual void makVrv::DtAddTerrainPatchManager::addTerrainPatches ( )
virtual

Adds the working list of terrain patches to add to the terrain. This function clears the working list of terrain patches after they have been added. This function does not add terrain patches that were not processed successfully.

static DtAddTerrainPatchManager& makVrv::DtAddTerrainPatchManager::instance ( DtDe de)
static

Returns a reference to the DtAddTerrainPatchManager instance.

static void makVrv::DtAddTerrainPatchManager::registerInstance ( DtDe de,
DtAddTerrainPatchManager instance 
)
static

Register a new dockable manager instance and replace the default.

static DtAddTerrainPatchManager::TerrainCoordinateSystemEnum makVrv::DtAddTerrainPatchManager::coordSysStrToEnum ( const std::string &  coordSys)
static

Helper method for getting the enum for a coordinate system string.

static DtUnicode makVrv::DtAddTerrainPatchManager::statusDisplayText ( AddTerrainPatchStatus  addStatus)
static

Return a readable string of the passed in status enumeration value.

virtual bool makVrv::DtAddTerrainPatchManager::isOsgEarthTerrain ( const std::string &  fileName)
protectedvirtual

Determine if a terrain file is an osg earth terrain.

Returns
returns true if the terrain is an osg earth terrain.
virtual bool makVrv::DtAddTerrainPatchManager::processTerrainPatchHeader ( const std::string &  filePath,
AddTerrainPatchStatus msg 
)
protectedvirtual

Parse the header for the provided file by looking for a corresponding registered DtHeaderParser, based on extension. The parser is used to retrieve the terrain patches to add for that file and for retrieving terrain specific settings, if any. The terrain specific settings include the coordinate system to use and the offset for the coordinate system's origin. If a corresponding parser is not registered with the DtHeaderParserFactory, the terrain patch will be loaded with default values. The function returns the status of adding a file path as one or more terrain patches via the msg reference parameter.

virtual void makVrv::DtAddTerrainPatchManager::slot_terrainPatchCreated ( DtTerrainPatchObject terrainPatchObject)
protectedvirtual

Used to determine if a osgEarth terrain patch has been added to the terrain and updates the internal myTerrainHasOsgEarthTerrainPatch flag.

virtual void makVrv::DtAddTerrainPatchManager::slot_terrainPatchAboutToBeDeleted ( DtTerrainPatchObject terrainPatchObject)
protectedvirtual

Used to determine if a osgEarth terrain patch has been removed from the terrain and updates the internal myTerrainHasOsgEarthTerrainPatch flag.

virtual void makVrv::DtAddTerrainPatchManager::enforceOnlyOneOsgEarthTerrainPatchConstraint ( )
protectedvirtual

Updates the AddTerrainPatchStatus of the entire working list of terrain patches to add to the terrain to enforce the following constraint:

  • There can only be one osgEarth terrain patch loaded for a terrain

Member Data Documentation

boost::signalslib::signal<void(std::map<std::string, TerrainPatchFile> filesToAdd)> makVrv::DtAddTerrainPatchManager::signal_terrainPatchesToAddUpdated
boost::signalslib::signal<void(const std::string& filePath, bool flipDds)> makVrv::DtAddTerrainPatchManager::signal_ddsFlipEnabledUpdated
boost::signalslib::signal<void(const std::string& filePath, bool indirectEnabled)> makVrv::DtAddTerrainPatchManager::signal_indirectRenderingEnabledUpdated
boost::signalslib::signal<void(const std::string& filePath, AlphaToCoverageState a2cState)> makVrv::DtAddTerrainPatchManager::signal_alphaToCoverageStateUpdated
boost::signalslib::signal<void(const std::string& coordSysType, const std::string& coordSysParams)> makVrv::DtAddTerrainPatchManager::signal_coordinateSystemUpdated
DtDe& makVrv::DtAddTerrainPatchManager::myDe
protected
DtSignalConnectionManager makVrv::DtAddTerrainPatchManager::myConnections
protected
bool makVrv::DtAddTerrainPatchManager::myOsgEarthTerrainPatchToBeAdded
protected
bool makVrv::DtAddTerrainPatchManager::myTerrainHasOsgEarthTerrainPatch
protected
std::map<std::string, TerrainPatchFile> makVrv::DtAddTerrainPatchManager::myFilesToAdd
protected

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)