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

The DtVrfNavAreaManager manages all of the nav areas currently created in the sim.

Classes

struct  navAreaExtentData
 

Public Member Functions

 DtVrfNavAreaManager (DtSimulationServices *manager)
 
virtual ~DtVrfNavAreaManager ()
 
virtual bool init ()
 
virtual void tick ()
 
virtual void unloadAllNavData ()
 
virtual void revertNavData ()
 
virtual void pauseNavDataRegeneration ()
 
virtual void resumeNavDataRegeneration ()
 
virtual void addNavArea (DtNavArea *a)
 
virtual DtNavArealoadNavArea (DtNavArea::NavAreaId id, const DtFilename &filename)
 
virtual DtNavArealoadNavDataForObject (DtNavArea::NavAreaId id, const DtFilename &filename, const DtSimObject *simObject)
 
virtual void loadAllNavData (bool *dataAvailable=0)
 
virtual DtNavArea::NavAreaId nextNavAreaId ()
 
virtual void addNavAreaAboutToBeRemovedCallback (DtNavAreaRemovalCallbackFcn fcn, void *usrData) const
 
virtual void removeNavAreaAboutToBeRemovedCallback (DtNavAreaRemovalCallbackFcn fcn, void *usrData) const
 
virtual void setBlockingNavDataLoad (bool b)
 
virtual void sendNavDataStatus ()
 
virtual void processNavQueues ()
 
virtual void processSimObjectDeleted (const DtSimObject *simObject)
 
virtual void invokeAreaAboutToBeDeletedCallbacks (DtNavArea *)
 
void processUnloadTerrain ()
 
virtual void updateSimOperationStatus ()
 
virtual void setTerrainInterface (DtTerrainInterface *terrainInterface)
 
virtual DtTerrainInterfaceterrainInterface ()
 
void loadObjectNavData (const DtSimObject *simObject)
 
void removeObjectNavData (const DtSimObject *simObject)
 
DtNavAreaareaForObject (const DtSimObject *simObject) const
 
virtual DtNavAreafindNavAreaForLocation (const DtVector &localPosition, const DtString &profile, const DtSimObject *=0, bool *dataAvailable=0)
 
virtual std::vector< DtNavArea * > findNavAreasForLocation (const DtVector &localPosition, const DtString &profile, const DtSimObject *=0, bool *dataAvailable=0, const DtAttachedTerrain *terrainAttachedTo=0)
 
virtual std::vector< DtNavArea * > findNavAreasForArea (const DtLocalVertexList *boundingArea, const DtString &profile, const DtSimObject *=0, bool *dataAvailable=0)
 
virtual DtNavAreafindNavAreaForArea (const DtLocalVertexList *area, const DtString &profile, const DtSimObject *=0, bool *dataAvailable=0)
 
virtual std::vector< DtNavArea * > findNavAreasForLocation (const DtVector &localPosition) const
 

Static Public Member Functions

static void tickCallback (void *args)
 
static void setGamewareWorkingMemorySize (int sizeInMb)
 
static void setRegenerateNavigationDataAtRuntime (bool regen)
 
static void setMaxRegenerationThreads (int threads)
 
static void setNumberOfNavQueueProcessingThreads (int threads)
 
static void setRegenerationDelay (double delay)
 
static void setQueryTimeBudget (double ms)
 
static void setRegenerationFileDirectory (const DtFilename &dir)
 

Public Attributes

DtNavGenerationThreadCountermyNavGenThreadCounter
 

Static Public Attributes

static int theGamewareWorkingMemorySize
 
static bool theRegenerateNavDataAtRuntime
 
static int theMaxRegenerationThreads
 
static int theNumberOfNavQueueProcessingThreads
 
static double theRegenerationDelay
 
static double theQueryTimeBudget
 
static DtFilename theRegenerationFileDirectory
 

Protected Types

typedef std::vector< DtNavArea * > DtNavAreas
 
typedef std::map< DtUUID,
DtNavArea * > 
DtObjectNavAreaMap
 
typedef DtCallbackList
< DtNavArea * > 
NavAreaAboutToBeRemovedList
 

Protected Attributes

DtTerrainInterfacemyTerrainInterface
 
std::map< DtNavArea::NavAreaId,
navAreaExtentData
myNavAreaExtents
 
DtNavAreas myNavAreas
 
DtObjectNavAreaMap myObjectNavAreas
 
bool myNavigationInitialized
 
DtSimulationServicesmySimulationServices
 
Coordinate_SystemmyObjectCoordSys
 
bool myBlockingNavLoad
 
DtNavArea::NavAreaId myNextNavAreaId
 
NavAreaAboutToBeRemovedList myNavAreaAboutToRemRemovedList
 
tbb::spin_mutex myNavAreaExtentsMutex
 
tbb::spin_rw_mutex myNavAreaMutex
 
tbb::spin_rw_mutex myObjectNavAreaMutex
 
DtVrfCallbackQueuemyNavQueryProcessingParallelQueue
 
std::atomic< boolmyContinueProcessing
 
std::atomic< boolmyProcessingStopped
 
tbb::task_arena myNavAreaArena
 
tbb::task_group myNavAreaTaskGroup
 
boost::signals2::connection myUnloadTerrainConnection
 
bool myRegenInTempDirectory
 
bool myNavRegenerating = false
 
bool myNavOperations = false
 
virtual void processGenericRecordLoaded (makArchives::DtGenericTerrainRecord *record)
 
static void genericRecordLoadedCallback (makArchives::DtGenericTerrainRecord *record, void *user)
 
virtual void processRequestNavAreaStatus ()
 
static void requestNavAreaStatusCallback (DtSimMessage *, void *usr)
 
virtual void processRequestSimObjectDebugPortsCallback (DtUUID uuid)
 
static void requestSimObjectDebugPortsCallback (DtSimMessage *msg, void *usr)
 
virtual void processNavigationRegenUpdate ()
 
static void navigationRegenUpdateCallback (void *usr)
 

Member Typedef Documentation

typedef std::vector<DtNavArea*> DtVrfNavAreaManager::DtNavAreas
protected

Constructor & Destructor Documentation

DtVrfNavAreaManager::DtVrfNavAreaManager ( DtSimulationServices manager)
virtual DtVrfNavAreaManager::~DtVrfNavAreaManager ( )
virtual

destructor

Member Function Documentation

static void DtVrfNavAreaManager::tickCallback ( void *  args)
static
virtual bool DtVrfNavAreaManager::init ( )
virtual

Registers a callback on DtIfRequestNavAreaDebugPorts messages.

virtual void DtVrfNavAreaManager::tick ( )
virtual

Ticks each nav area, in parallel unless configured otherwise.

virtual void DtVrfNavAreaManager::setTerrainInterface ( DtTerrainInterface terrainInterface)
virtual

The terrain interface used by this nav area manager.

virtual DtTerrainInterface* DtVrfNavAreaManager::terrainInterface ( )
inlinevirtual

The terrain interface used by this nav area manager.

static void DtVrfNavAreaManager::genericRecordLoadedCallback ( makArchives::DtGenericTerrainRecord record,
void *  user 
)
static

Callback to processes terrain records indicating nav areas to be loaded. Prepares the area for loading when first requested.

virtual void DtVrfNavAreaManager::processGenericRecordLoaded ( makArchives::DtGenericTerrainRecord record)
virtual

Callback to processes terrain records indicating nav areas to be loaded. Prepares the area for loading when first requested.

void DtVrfNavAreaManager::loadObjectNavData ( const DtSimObject simObject)

Manage nav data attached to entities, such as ships or other large objects that can be traversed by smaller entities.

void DtVrfNavAreaManager::removeObjectNavData ( const DtSimObject simObject)

Manage nav data attached to entities, such as ships or other large objects that can be traversed by smaller entities.

DtNavArea* DtVrfNavAreaManager::areaForObject ( const DtSimObject simObject) const

Manage nav data attached to entities, such as ships or other large objects that can be traversed by smaller entities.

virtual void DtVrfNavAreaManager::unloadAllNavData ( )
virtual

Clears all nav areas from the manager. Used when the terrain is being closed.

virtual void DtVrfNavAreaManager::revertNavData ( )
virtual

Reverts all loaded nav data to defaults.

virtual void DtVrfNavAreaManager::pauseNavDataRegeneration ( )
virtual

Pauses all nav data regeneration until resumeNavDataRegeneration() is called.

virtual void DtVrfNavAreaManager::resumeNavDataRegeneration ( )
virtual

Resumes nav data regeneration if paused.

virtual void DtVrfNavAreaManager::addNavArea ( DtNavArea a)
virtual

Called after loading the data for a nav area. Does not actually load any data, just gives ownership to the manager. Typically only called internally.

virtual DtNavArea* DtVrfNavAreaManager::loadNavArea ( DtNavArea::NavAreaId  id,
const DtFilename &  filename 
)
virtual

Loads nav data for an area from the given file, assigns it the given id, and then calls addNavArea to add it to the manager. Typically only called internally.

virtual DtNavArea* DtVrfNavAreaManager::loadNavDataForObject ( DtNavArea::NavAreaId  id,
const DtFilename &  filename,
const DtSimObject simObject 
)
virtual

Loads nav data for an area on a sim object from the given file, assigns it the given id, and then calls addNavArea to add it to the manager. Typically only called internally.

virtual void DtVrfNavAreaManager::loadAllNavData ( bool dataAvailable = 0)
virtual

Loads all nav data (if any). Typically only called internally.

virtual DtNavArea::NavAreaId DtVrfNavAreaManager::nextNavAreaId ( )
virtual

Returns a new unique nav area id. Typically only called internally.

virtual DtNavArea* DtVrfNavAreaManager::findNavAreaForLocation ( const DtVector localPosition,
const DtString profile,
const DtSimObject = 0,
bool dataAvailable = 0 
)
virtual

Returns the nav area (if any) that contains a given location and matches the specified profile. The profile must be the name of a valid profile defined in navigationProfiles.mtl. Standard profile names are "lifeform" and "ground-platform". If there is a parentObject, only nav areas that are attached to parentObject are considered. If parentObject is null, then nav areas on the terrain are considered. If the profile is a null string, nav areas for all profiles are considered to be matching.

virtual std::vector<DtNavArea*> DtVrfNavAreaManager::findNavAreasForLocation ( const DtVector localPosition,
const DtString profile,
const DtSimObject = 0,
bool dataAvailable = 0,
const DtAttachedTerrain terrainAttachedTo = 0 
)
virtual

Returns the nav area (if any) that contains a given location and matches the specified profile. The profile must be the name of a valid profile defined in navigationProfiles.mtl. Standard profile names are "lifeform" and "ground-platform". If there is a parentObject, only nav areas that are attached to parentObject are considered. If parentObject is null, then nav areas on the terrain are considered. If the profile is a null string, nav areas for all profiles are considered to be matching.

virtual std::vector<DtNavArea*> DtVrfNavAreaManager::findNavAreasForArea ( const DtLocalVertexList boundingArea,
const DtString profile,
const DtSimObject = 0,
bool dataAvailable = 0 
)
virtual

Returns the nav area (if any) that contains a given location and matches the specified profile. The profile must be the name of a valid profile defined in navigationProfiles.mtl. Standard profile names are "lifeform" and "ground-platform". If there is a parentObject, only nav areas that are attached to parentObject are considered. If parentObject is null, then nav areas on the terrain are considered. If the profile is a null string, nav areas for all profiles are considered to be matching.

virtual DtNavArea* DtVrfNavAreaManager::findNavAreaForArea ( const DtLocalVertexList area,
const DtString profile,
const DtSimObject = 0,
bool dataAvailable = 0 
)
virtual

Returns the nav area (if any) that contains a given location and matches the specified profile. The profile must be the name of a valid profile defined in navigationProfiles.mtl. Standard profile names are "lifeform" and "ground-platform". If there is a parentObject, only nav areas that are attached to parentObject are considered. If parentObject is null, then nav areas on the terrain are considered. If the profile is a null string, nav areas for all profiles are considered to be matching.

virtual std::vector<DtNavArea*> DtVrfNavAreaManager::findNavAreasForLocation ( const DtVector localPosition) const
virtual

Will only check currently loaded nav areas and will return regardless of matching profile.

virtual void DtVrfNavAreaManager::addNavAreaAboutToBeRemovedCallback ( DtNavAreaRemovalCallbackFcn  fcn,
void *  usrData 
) const
virtual

Add a callback for when a nav area is about to be removed.

virtual void DtVrfNavAreaManager::removeNavAreaAboutToBeRemovedCallback ( DtNavAreaRemovalCallbackFcn  fcn,
void *  usrData 
) const
virtual

Remove a previously registered callback for notification when a new area is about to be removed.

virtual void DtVrfNavAreaManager::setBlockingNavDataLoad ( bool  b)
virtual

If set to true, nav data loading blocks and loads immediately. Otherwise, nav data loading occurs in a separate thread and may not be immediately available on request.

static void DtVrfNavAreaManager::requestNavAreaStatusCallback ( DtSimMessage ,
void *  usr 
)
static

If navArea debugging is on, sends debug info for all navAreas.

virtual void DtVrfNavAreaManager::processRequestNavAreaStatus ( )
virtual

If navArea debugging is on, sends debug info for all navAreas.

static void DtVrfNavAreaManager::requestSimObjectDebugPortsCallback ( DtSimMessage msg,
void *  usr 
)
static

Callback to processes a request for the nav debug ports.

virtual void DtVrfNavAreaManager::processRequestSimObjectDebugPortsCallback ( DtUUID  uuid)
virtual

Callback to processes a request for the nav debug ports.

virtual void DtVrfNavAreaManager::sendNavDataStatus ( )
virtual

Sends the current nav data status.

virtual void DtVrfNavAreaManager::processNavQueues ( )
virtual

Should only be called by the parallel nav queue processing threads.

static void DtVrfNavAreaManager::setGamewareWorkingMemorySize ( int  sizeInMb)
static

Set navigation configuration.

static void DtVrfNavAreaManager::setRegenerateNavigationDataAtRuntime ( bool  regen)
static

Set navigation configuration.

static void DtVrfNavAreaManager::setMaxRegenerationThreads ( int  threads)
static

Set navigation configuration.

static void DtVrfNavAreaManager::setNumberOfNavQueueProcessingThreads ( int  threads)
static

Set navigation configuration.

static void DtVrfNavAreaManager::setRegenerationDelay ( double  delay)
static

Set navigation configuration.

static void DtVrfNavAreaManager::setQueryTimeBudget ( double  ms)
static

Set navigation configuration.

static void DtVrfNavAreaManager::setRegenerationFileDirectory ( const DtFilename &  dir)
static

Set navigation configuration.

virtual void DtVrfNavAreaManager::processSimObjectDeleted ( const DtSimObject simObject)
virtual

Processes the deletion of a sim object that has its own nav data.

virtual void DtVrfNavAreaManager::invokeAreaAboutToBeDeletedCallbacks ( DtNavArea )
virtual

Invoke callbacks when a nav area is removed.

static void DtVrfNavAreaManager::navigationRegenUpdateCallback ( void *  usr)
static

Callback to send status on navigation regeneration.

virtual void DtVrfNavAreaManager::processNavigationRegenUpdate ( )
virtual

Callback to send status on navigation regeneration.

void DtVrfNavAreaManager::processUnloadTerrain ( )
virtual void DtVrfNavAreaManager::updateSimOperationStatus ( )
virtual

Member Data Documentation

int DtVrfNavAreaManager::theGamewareWorkingMemorySize
static
bool DtVrfNavAreaManager::theRegenerateNavDataAtRuntime
static
int DtVrfNavAreaManager::theMaxRegenerationThreads
static
int DtVrfNavAreaManager::theNumberOfNavQueueProcessingThreads
static
double DtVrfNavAreaManager::theRegenerationDelay
static
double DtVrfNavAreaManager::theQueryTimeBudget
static
DtFilename DtVrfNavAreaManager::theRegenerationFileDirectory
static
DtTerrainInterface* DtVrfNavAreaManager::myTerrainInterface
protected
std::map<DtNavArea::NavAreaId, navAreaExtentData> DtVrfNavAreaManager::myNavAreaExtents
protected
DtNavAreas DtVrfNavAreaManager::myNavAreas
protected
DtObjectNavAreaMap DtVrfNavAreaManager::myObjectNavAreas
protected
bool DtVrfNavAreaManager::myNavigationInitialized
protected
DtSimulationServices* DtVrfNavAreaManager::mySimulationServices
protected
Coordinate_System* DtVrfNavAreaManager::myObjectCoordSys
protected

Coord system used for nav datas on embarked objects.

bool DtVrfNavAreaManager::myBlockingNavLoad
protected
DtNavArea::NavAreaId DtVrfNavAreaManager::myNextNavAreaId
protected
DtNavGenerationThreadCounter* DtVrfNavAreaManager::myNavGenThreadCounter
NavAreaAboutToBeRemovedList DtVrfNavAreaManager::myNavAreaAboutToRemRemovedList
mutableprotected
tbb::spin_mutex DtVrfNavAreaManager::myNavAreaExtentsMutex
protected
tbb::spin_rw_mutex DtVrfNavAreaManager::myNavAreaMutex
mutableprotected
tbb::spin_rw_mutex DtVrfNavAreaManager::myObjectNavAreaMutex
mutableprotected
DtVrfCallbackQueue* DtVrfNavAreaManager::myNavQueryProcessingParallelQueue
protected
std::atomic<bool> DtVrfNavAreaManager::myContinueProcessing
protected
std::atomic<bool> DtVrfNavAreaManager::myProcessingStopped
protected
tbb::task_arena DtVrfNavAreaManager::myNavAreaArena
protected
tbb::task_group DtVrfNavAreaManager::myNavAreaTaskGroup
protected
boost::signals2::connection DtVrfNavAreaManager::myUnloadTerrainConnection
protected
bool DtVrfNavAreaManager::myRegenInTempDirectory
protected
bool DtVrfNavAreaManager::myNavRegenerating = false
protected
bool DtVrfNavAreaManager::myNavOperations = false
protected

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)