VR-Forces 4.6.1 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 Attributes
DtTerrainImplementation Class Reference

This is the abstract base class for all terrain implementations. More...

Inheritance diagram for DtTerrainImplementation:
Inheritance graph
[legend]

Public Types

typedef boost::function< void(const
makVrv::DtDynamicTerrainFeature &)> 
DtDynamicTerrainQueryCallback

Public Member Functions

 DtTerrainImplementation (DtConsoleCommandManager *cmdManager)
virtual ~DtTerrainImplementation ()
virtual
MAKVRinTerra::DtFeatureDatabase
featureDatabase ()
 Access feature database.
virtual const
MAKVRinTerra::DtFeatureDatabase
featureDatabase () const
virtual
MAKVRinTerra::DtFeatureContext
featureContext ()
 Access feature context.
virtual const
MAKVRinTerra::DtFeatureContext
featureContext () const
virtual void init ()
 Called immediately after creation.
virtual void finishedLoading (const MAKVRinTerra::DtProj &proj)
 Called after terrain loaded successfully.
virtual bool loadTerrain (const makArchives::DtGenericTerrainRecord &rec)=0
 Loads a terrain given the terrain record.
virtual void shutdown (bool block=true)
 Shutdown the terrain.
virtual const Coordinate_SystemcoordinateSystem () const =0
virtual double modelHeightDifferencesFromAppearances (int oldApp, int newApp) const
 If supported by the implementation, return the height difference from the currently loaded model as a transition from the old appearance to the new appearance.
virtual bool createFromExtent (const Dt3dBoundingVolume &)
 Creates an extent from the given extent. Not all implementations will support this.
virtual bool loadModel (const DtFilename &, const DtEntityType &t=DtEntityType())
 Defaults to loading terrain for gdb.
virtual DtTerrainInterfaceConfigconfigurationOptions ()
virtual const
DtTerrainInterfaceConfig
configurationOptions () const
virtual bool chordIntersect (const DtChord &chord, DtVrfChordIntersectionRecord &record, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false, int flags=0) const =0
 Returns topmost intersection of chord with terrain in record.
virtual bool allIntersectsAlongChord (const DtChord &chord, DtVrfChordIntersectRecordList &intList, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false, int flags=0) const =0
 Returns all intersections of chord with terrain.
virtual void preloadTerrainAreas (const DtTerrainPagingGeometryList &preloadGeometry)
 Specifies a list of terrain areas that should be preloaded by the terrain implementation, in the case of a paging or streaming terrain source.
virtual bool dataAvailable (const DtTerrainPagingGeometryList &geometry)
 Returns true if all of the terrain which intersects the geometry list is paged in.
virtual const
DtTerrainCapabilities
terrainCapabilities () const =0
virtual void setIntersectDataLoadExpireTime (const double &expireTime)
 No-op.
virtual void expireDataLoadRequestsBeforeTime (const double &currentTime)
 No-op.
virtual void processTrianglesInArea (DtTriangleOutputInterface &, const DtTerrainProcessPolygonsBox &) const =0
virtual void breakUpChords (const MAKVRinTerra::DtProj &, const DtChord &chord, std::vector< DtChord > &chords)
virtual bool hasFeatureContext () const
 Returns true if there is an active feature context.
virtual DtTerrainGeometryHandlecreateEntityGeometry (const DtFilename &file)
 Create geometry in the terrain which represents the entity.
virtual
DtDynamicTerrainRequestHandle 
addDynamicTerrainChangeRequest (double time, makVrv::DtDynamicTerrainChange *command)
 Add a dynamic terrain change request to the system.
virtual DtDynamicTerrainQueryHandle queryDynamicTerrainFeatures (const DtDynamicTerrainQueryCallback &callback, makVrv::DtDynamicTerrainGeometry *geometry=0, bool useOriginalGeometry=false)
 Install a query which will call the supplied callback on matching dynamic terrain features as they are paged in.
virtual void queryCurrentDynamicTerrainFeatures (const DtDynamicTerrainQueryCallback &callback, makVrv::DtDynamicTerrainGeometry *geometry=0, bool useOriginalGeometry=false)
virtual void cacheInformationForTerrainArea (unsigned minLOD, unsigned maxLOD, const DtExtent &cacheArea, double &estimatedTime, double &estimatedSize, std::vector< std::string > &elevationLayers, std::vector< std::string > &modelLayers, std::vector< std::string > &featureLayers) const
 Given the request information, return the estimation of how long, how large, and what will be cached.
virtual void cacheTerrainArea (int requestId, unsigned minLOD, unsigned maxLOD, const DtExtent &cacheArea, DtCacheProgressCallbackFunction fcn=0, void *usr=0)
 Call this to start the process of caching terain data (if supported for the open terrain) using the given request id and extent.
virtual void cancelCacheTerrainArea (int requestId)
 Call this routine to cancel a potential cache in progress.
virtual void setAssertOnBlockingTerrainCalls (bool assertBlock)
 Determines if an exception should be thrown if a blocking terrain call is made.
virtual bool assertOnBlockingTerrainCalls () const
virtual void setWarnOnBlockingTerrainCalls (bool warnBlock)
 Determines if a warning should be printed out if a blocking terrain call is made.
virtual bool warnOnBlockingTerrainCalls () const

Protected Attributes

DtTerrainInterfaceConfig myConfig
bool myAssertOnBlockingTerrainCalls
 Determines if an exception should be thrown if a blocking terrain call is made.
bool myWarnOnBlockingTerrainCalls
boost::scoped_ptr
< MAKVRinTerra::DtFeatureDatabase
myFeatureDatabase
boost::scoped_ptr
< MAKVRinTerra::DtFeatureContext
myFeatureContext

Detailed Description

This is the abstract base class for all terrain implementations.

A terrain implementation is used by the DtTerrainInterface to interact with a terrain representation.

Member Typedef Documentation

Constructor & Destructor Documentation

DtTerrainImplementation::DtTerrainImplementation ( DtConsoleCommandManager cmdManager)
virtual DtTerrainImplementation::~DtTerrainImplementation ( )
virtual

Member Function Documentation

virtual MAKVRinTerra::DtFeatureDatabase& DtTerrainImplementation::featureDatabase ( )
virtual

Access feature database.

Reimplemented in DtTerrainPassThroughLayer.

virtual const MAKVRinTerra::DtFeatureDatabase& DtTerrainImplementation::featureDatabase ( ) const
virtual

Reimplemented in DtTerrainPassThroughLayer.

virtual MAKVRinTerra::DtFeatureContext& DtTerrainImplementation::featureContext ( )
virtual

Access feature context.

Reimplemented in DtTerrainPassThroughLayer.

virtual const MAKVRinTerra::DtFeatureContext& DtTerrainImplementation::featureContext ( ) const
virtual

Reimplemented in DtTerrainPassThroughLayer.

virtual void DtTerrainImplementation::init ( )
virtual

Called immediately after creation.

virtual void DtTerrainImplementation::finishedLoading ( const MAKVRinTerra::DtProj proj)
virtual

Called after terrain loaded successfully.

Parameters
projDtProj object for local coordinate system.
virtual bool DtTerrainImplementation::loadTerrain ( const makArchives::DtGenericTerrainRecord rec)
pure virtual
virtual void DtTerrainImplementation::shutdown ( bool  block = true)
virtual

Shutdown the terrain.

Reimplemented in DtVantageTerrainImplementation, and DtTerrainPassThroughLayer.

virtual const Coordinate_System* DtTerrainImplementation::coordinateSystem ( ) const
pure virtual
virtual double DtTerrainImplementation::modelHeightDifferencesFromAppearances ( int  oldApp,
int  newApp 
) const
virtual

If supported by the implementation, return the height difference from the currently loaded model as a transition from the old appearance to the new appearance.

Reimplemented in DtVantageTerrainImplementation.

virtual bool DtTerrainImplementation::createFromExtent ( const Dt3dBoundingVolume &  )
virtual

Creates an extent from the given extent. Not all implementations will support this.

Reimplemented in DtGdbTerrainImplementation.

virtual bool DtTerrainImplementation::loadModel ( const DtFilename &  ,
const DtEntityType &  t = DtEntityType() 
)
virtual

Defaults to loading terrain for gdb.

Supply option entity for for use by implementation to mutate loaded model based on appearance

Reimplemented in DtVantageTerrainImplementation.

virtual DtTerrainInterfaceConfig& DtTerrainImplementation::configurationOptions ( )
virtual
virtual const DtTerrainInterfaceConfig& DtTerrainImplementation::configurationOptions ( ) const
virtual
virtual bool DtTerrainImplementation::chordIntersect ( const DtChord chord,
DtVrfChordIntersectionRecord record,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false,
int  flags = 0 
) const
pure virtual

Returns topmost intersection of chord with terrain in record.

Parameters
Input
chordthe chord to test
irtFlagspecifies what intersection data should be filled in for the record.
Output
recordthe results of the intersection
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If this parameter is specified and the required terrain data is not yet paged in, this call will return immediately and dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
flagsoptional flags to pass into the intersector. The flags are implementation dependent

Implemented in DtVantageTerrainImplementation, DtIntersectRecordPassThroughLayer, DtGdbTerrainImplementation, DtExtentTerrainImplementation, DtEllipsoidTerrainImplementation, and DtIntersectTimerPassThroughLayer.

virtual bool DtTerrainImplementation::allIntersectsAlongChord ( const DtChord chord,
DtVrfChordIntersectRecordList intList,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false,
int  flags = 0 
) const
pure virtual

Returns all intersections of chord with terrain.

Parameters
Input
chordthe chord to test
irtFlagspecifies what intersection data should be filled in for the record.
Output
intListthe results of the intersection
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If this parameter is specified and the required terrain data is not yet paged in, this call will return immediately and dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
flagsoptional flags to pass into the intersector. The flags are implementation dependent

Implemented in DtVantageTerrainImplementation, DtIntersectRecordPassThroughLayer, DtGdbTerrainImplementation, DtExtentTerrainImplementation, DtEllipsoidTerrainImplementation, and DtIntersectTimerPassThroughLayer.

virtual void DtTerrainImplementation::preloadTerrainAreas ( const DtTerrainPagingGeometryList preloadGeometry)
inlinevirtual

Specifies a list of terrain areas that should be preloaded by the terrain implementation, in the case of a paging or streaming terrain source.

The typical use of this is to specify parts of the terrain that are expected to be needed in the near future.

The terrain may not be loaded immediately upon making this call, and there is no guarantee that the terrain areas will be available for intersection immediately after making this call.

Parameters
preloadGeometryA list of the geometric areas that should be preloaded. They can be specified using any of the subclasses of DtTerrainPagingGeometry.
Note
The geometry set with this call completely replaces any geometry previously set using this call.
The default implementation for this is a noop.

Reimplemented in DtVantageTerrainImplementation, and DtTerrainPassThroughLayer.

virtual bool DtTerrainImplementation::dataAvailable ( const DtTerrainPagingGeometryList geometry)
inlinevirtual

Returns true if all of the terrain which intersects the geometry list is paged in.

Reimplemented in DtVantageTerrainImplementation.

virtual const DtTerrainCapabilities* DtTerrainImplementation::terrainCapabilities ( ) const
pure virtual
Returns
A DtTerrainCapabilites structure that describes the capabilities of the currently loaded terrain.

Implemented in DtTerrainPassThroughLayer, DtVantageTerrainImplementation, DtGdbTerrainImplementation, DtExtentTerrainImplementation, and DtEllipsoidTerrainImplementation.

virtual void DtTerrainImplementation::setAssertOnBlockingTerrainCalls ( bool  assertBlock)
virtual

Determines if an exception should be thrown if a blocking terrain call is made.

This can help to track down blocking terrain calls which are causing problems with a running simulation. Note that calling the blocking form of any terrain intersection function will cause an assertion; it is not necessary for the call to actually block and even non-paging implementations will assert. This is done to make it easier to find potential problems regardless of the particular terrain or location being used.

Returns
myAssertOnBlockingTerrainCalls
virtual bool DtTerrainImplementation::assertOnBlockingTerrainCalls ( ) const
virtual
virtual void DtTerrainImplementation::setWarnOnBlockingTerrainCalls ( bool  warnBlock)
virtual

Determines if a warning should be printed out if a blocking terrain call is made.

virtual bool DtTerrainImplementation::warnOnBlockingTerrainCalls ( ) const
virtual
virtual void DtTerrainImplementation::setIntersectDataLoadExpireTime ( const double expireTime)
inlinevirtual

No-op.

Override to set the default expiration time for data load requests generated by intersect calls that require data that has not yet been loaded (paged-in).

Parameters
expireTimeThe expiration time to be assigned to load data requests generated by intersect calls on the terrain implementation.

Reimplemented in DtVantageTerrainImplementation, and DtTerrainPassThroughLayer.

virtual void DtTerrainImplementation::expireDataLoadRequestsBeforeTime ( const double currentTime)
inlinevirtual

No-op.

Override to expire data load requests generated before the given time. See comment for #setIntersectLoadDataExpireTime.

Parameters
currentTimeThe time to compare to data load requests to determine if they should be expired rather than executed.

Reimplemented in DtVantageTerrainImplementation, and DtTerrainPassThroughLayer.

virtual void DtTerrainImplementation::processTrianglesInArea ( DtTriangleOutputInterface ,
const DtTerrainProcessPolygonsBox  
) const
pure virtual
virtual void DtTerrainImplementation::breakUpChords ( const MAKVRinTerra::DtProj ,
const DtChord chord,
std::vector< DtChord > &  chords 
)
virtual

Reimplemented in DtVantageTerrainImplementation.

virtual bool DtTerrainImplementation::hasFeatureContext ( ) const
virtual

Returns true if there is an active feature context.

virtual DtTerrainGeometryHandle* DtTerrainImplementation::createEntityGeometry ( const DtFilename &  file)
inlinevirtual

Create geometry in the terrain which represents the entity.

Reimplemented in DtVantageTerrainImplementation.

virtual DtDynamicTerrainRequestHandle DtTerrainImplementation::addDynamicTerrainChangeRequest ( double  time,
makVrv::DtDynamicTerrainChange command 
)
inlinevirtual

Add a dynamic terrain change request to the system.

Parameters
timeTime at which this request takes place.
commandCommand which describes this change. Takes ownership.
geometryOnly change features which match this geometry. Takes ownership.
Return values
Handleobject for removing this request.

Reimplemented in DtVantageTerrainImplementation.

virtual DtDynamicTerrainQueryHandle DtTerrainImplementation::queryDynamicTerrainFeatures ( const DtDynamicTerrainQueryCallback callback,
makVrv::DtDynamicTerrainGeometry geometry = 0,
bool  useOriginalGeometry = false 
)
inlinevirtual

Install a query which will call the supplied callback on matching dynamic terrain features as they are paged in.

Callbacks can then be installed on the feature itself to monitor it for changes and page out.

Reimplemented in DtVantageTerrainImplementation.

virtual void DtTerrainImplementation::queryCurrentDynamicTerrainFeatures ( const DtDynamicTerrainQueryCallback callback,
makVrv::DtDynamicTerrainGeometry geometry = 0,
bool  useOriginalGeometry = false 
)
inlinevirtual

Reimplemented in DtVantageTerrainImplementation.

virtual void DtTerrainImplementation::cacheInformationForTerrainArea ( unsigned  minLOD,
unsigned  maxLOD,
const DtExtent cacheArea,
double estimatedTime,
double estimatedSize,
std::vector< std::string > &  elevationLayers,
std::vector< std::string > &  modelLayers,
std::vector< std::string > &  featureLayers 
) const
virtual

Given the request information, return the estimation of how long, how large, and what will be cached.

Reimplemented in DtVantageTerrainImplementation, and DtTerrainPassThroughLayer.

virtual void DtTerrainImplementation::cacheTerrainArea ( int  requestId,
unsigned  minLOD,
unsigned  maxLOD,
const DtExtent cacheArea,
DtCacheProgressCallbackFunction  fcn = 0,
void *  usr = 0 
)
virtual

Call this to start the process of caching terain data (if supported for the open terrain) using the given request id and extent.

Note that the extent coordinates are in lat/lon degrees (not radians). The callback is given to give progress on the load

Reimplemented in DtVantageTerrainImplementation, and DtTerrainPassThroughLayer.

virtual void DtTerrainImplementation::cancelCacheTerrainArea ( int  requestId)
virtual

Call this routine to cancel a potential cache in progress.

Reimplemented in DtVantageTerrainImplementation, DtExtentTerrainImplementation, and DtTerrainPassThroughLayer.

Member Data Documentation

DtTerrainInterfaceConfig DtTerrainImplementation::myConfig
protected
bool DtTerrainImplementation::myAssertOnBlockingTerrainCalls
protected

Determines if an exception should be thrown if a blocking terrain call is made.

This can help to track down blocking terrain calls which are causing problems with a running simulation.

bool DtTerrainImplementation::myWarnOnBlockingTerrainCalls
protected
boost::scoped_ptr<MAKVRinTerra::DtFeatureDatabase> DtTerrainImplementation::myFeatureDatabase
protected
boost::scoped_ptr<MAKVRinTerra::DtFeatureContext> DtTerrainImplementation::myFeatureContext
protected

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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)