17 #include <matrix/vlVector.h>
19 #include "boost/shared_ptr.hpp"
20 #include "boost/weak_ptr.hpp"
23 #include <tbb/spin_mutex.h>
60 typedef boost::shared_ptr<DtNavAreaQuery>
Ptr;
61 typedef boost::weak_ptr<DtNavAreaQuery>
WeakPtr;
70 virtual bool tick() = 0;
73 virtual bool success() = 0;
76 virtual bool navDataChanged() = 0;
79 virtual bool outOfWorkingMemory() = 0;
82 virtual bool hadComputationError() = 0;
85 virtual std::vector<DtVector> results() = 0;
91 virtual std::vector<DtVector>
debugPoints() {
return std::vector<DtVector>(); };
94 virtual void* internalQuery() = 0;
105 virtual bool tick() {
return true; };
111 virtual std::vector<DtVector>
results() {
return std::vector<DtVector>(); };
119 maxRegenerationThreads(2), regenerationDelay(2.5), queryTimeBudget(1),
120 regenerationFileDirectory() {};
124 int workingMemorySize;
235 typedef void (*DtSearchAreaPointCostModifierEvaluatorFcn)(
const DtVector& localPoint,
float* currentCost,
void* userData);
237 typedef void(*DtSectorRegenerationCb)(
void* userData);
243 static void setNavAreaCreatorFcn(DtNavAreaCreatorFcn fcn);
248 static bool navAreaDebuggingEnabled();
249 static void setNavAreaDebuggingEnabled(
bool enable);
256 bool parallelQueryQueueProcessing =
false,
257 std::vector<DtString> profiles = std::vector<DtString>()) = 0;
260 virtual NavAreaId navAreaId()
const = 0;
263 virtual void update(
float deltaTimeInSeconds) = 0;
267 virtual void processQueues() = 0;
275 virtual bool inNavArea(
const DtVector& localPos)
const = 0;
282 virtual bool validPosition(
const DtString& profile,
const DtVector& localPos,
288 virtual bool navTopoPosition(
const DtVector& localPosition,
293 virtual bool localPosition(
const DtVector& navPosition,
298 virtual bool navTopoVector(
const DtVector& localVector,
303 virtual bool localVector(
const DtVector& navPosition,
307 virtual bool validForProfile(
const DtString& profile)
const = 0;
309 virtual DtNavDataDebugInfo* debugInfo() = 0;
311 virtual void setExtent(
DtExtent* e) = 0;
316 virtual double areaWidth()
const = 0;
317 virtual double areaLength()
const = 0;
328 DtPointOfInterestEvaluatorFcn evalFcn = 0, DtPathCalculatedEvaluatorFcn pathFcn = 0,
329 void* evalFcnUserData = 0) = 0;
337 double propagationRadius = 200., DtPointOfInterestNavTagEvaluatorFcn evalFcn = 0,
338 DtPathCalculatedEvaluatorFcn pathFcn = 0,
void* evalFcnUserData = 0) = 0;
343 virtual void findNearbyNavEdgesUsingNavTags(
const DtString& profile,
double searchRadius,
344 const DtVector& fromFromHere,
const std::vector<DtInputNavTag>& navTagVals,
345 std::list<const DtNavEdge*>& result)
const = 0;
349 virtual void findVerticesUsingNavTags(
const DtString& profile,
double searchRadius,
350 const DtVector& fromFromHere,
const std::vector<DtInputNavTag>& navTagVals,
351 std::list<DtVector>& result)
const = 0;
358 double propagationRadius = 200., DtPointOfInterestEvaluatorFcn evalFcn = 0,
359 DtPathCalculatedEvaluatorFcn pathFcn = 0,
void* evalFcnUserData = 0) = 0;
363 virtual bool findInsidePositionFromOutsidePosition(
const DtString& profile,
364 double searchRadius,
double searchHeight,
const DtVector& fromFromHere,
365 DtVector& result,
int& halfEdgeType)
const = 0;
369 const std::vector<DtVector>& localDestinationPositions,
DtNavBot* searcher,
int tag = -1,
370 DtSearchAreaPointCostModifierEvaluatorFcn = 0, DtPointOfInterestEvaluatorFcn = 0,
371 DtPathCalculatedEvaluatorFcn = 0,
void* usrData = 0,
bool startMovingWhenFound =
false) = 0;
375 const DtVector& destination,
bool useAbstractGraphs =
true,
381 virtual bool findFarthestPositionAlongHeading(
const DtString& profile,
const DtVector& start,
382 double heading,
double maxDistance,
DtVector& result,
bool& reachedMaxDist)
const = 0;
386 virtual bool doesNavIntersectBetweenTwoPoints(
const DtString& profile,
const DtVector& start,
420 const DtVector& localAccessibilityPoint = DtVector::zero(),
421 double minRadius = -1,
422 double maxRadius = -1,
424 unsigned numberOfPoints = 1,
425 double minDistanceBetweenPoints = 0.0,
426 const DtString& placementRestriction = DtString::nullString(),
427 bool isStrict =
true,
428 bool tightlyPack =
false,
429 bool needLos =
false,
430 bool groundClamp =
false,
432 DtLocalPointUserEvalCallback callbackFcn = emptyCallback,
433 void* userData = 0) = 0;
436 virtual bool tagVolumesToBeIntegrated()
const = 0;
452 virtual std::vector<DtVector> searchInArea(
const DtString& profile,
453 const DtVector& startLocalPos,
double radius,
double postSpacing,
DtNavBot* searcher,
454 DtPointOfInterestEvaluatorFcn evalFcn = 0,
void* evalFcnUserData = 0,
int tag = -1)
const = 0;
457 virtual bool navTrianglesInArea(
const DtString& profile,
const DtVector& location,
double radius,
458 std::list<DtNavTriangleInfo>& triangles) = 0;
461 virtual unsigned newNavTagId() = 0;
464 virtual void associateNavTagIdWithObject(
unsigned tagVolumeId,
const DtUUID& objectUUID) = 0;
467 virtual void disassociateNavTagId(
unsigned navTagId) = 0;
471 virtual DtUUID uuidFromNavTagId(
unsigned navTagId)
const = 0;
475 virtual unsigned navTagVolumeIdFromUuid(
const DtUUID& objectUUID) = 0;
485 virtual void addSectorRegenerationCallback(DtSectorRegenerationCb cb,
void* usr) = 0;
486 virtual void removeSectorRegenerationCallback(DtSectorRegenerationCb cb,
void* usr) = 0;
492 const std::set<DtString>& profiles = std::set<DtString>()) = 0;
498 virtual void pauseNavDataRegeneration() = 0;
501 virtual void resumeNavDataRegeneration() = 0;
504 virtual bool revertNavData() = 0;
509 virtual unsigned addNavEdge(
const DtString& profile, std::vector<DtVector>& LocalPoints,
515 virtual unsigned addNavIEdge(
const DtString& profile, std::vector<DtVector>& LocalPoints, std::vector< std::vector<DtVector> >& localIPoints,
519 virtual void removeNavEdge(
unsigned edgeId) = 0;
524 virtual unsigned addCoverPoint(
const DtString& profile,
const DtVector& localPoint,
525 bool& creationComplete) = 0;
528 virtual bool isCoverPointCreated(
unsigned coverPointId) = 0;
531 virtual void removeCoverPoint(
unsigned coverPointId) = 0;
534 virtual unsigned numberOfPendingQueries()
const = 0;
539 virtual void printNavDataInfoForLocation(
const DtVector& location, std::ostream& strm)
const = 0;
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
This class is just used to count the nav generation threads to ensure we do not start too many thread...
Definition: navArea.h:161
Test class for providing a fast way for an entity to "walk" along the nav mesh. This is the abstract ...
Definition: persistentPointAlongHeadingQuery.h:11
DtNavAreaQuery()
Definition: navArea.h:63
DtNavTagExt navTagExt
Definition: navArea.h:229
bool regenerateAtRuntime
Whether nav data should be regenerated at runtime.
Definition: navArea.h:130
DtNavGenerationThreadCounter(unsigned maxThreads)
Definition: navArea.h:164
DtOnPathToGraphVertexComputedResult
Definition: navArea.h:43
virtual ~DtNavAreaQuery()
Definition: navArea.h:64
Definition: navArea.h:225
void releaseAllThreads()
Definition: navArea.h:191
virtual bool tick()
Main function for performing query processing.
Definition: navArea.h:105
virtual bool outOfWorkingMemory()
Returns true if the query failed due to a lack of working memory.
Definition: navArea.h:109
double queryTimeBudget
The time budget per frame for path queries in ms. Default value is 1.
Definition: navArea.h:127
virtual bool success()
Returns true if the query completed successfully.
Definition: navArea.h:106
DtNavAreaNullQuery()
Definition: navArea.h:101
virtual ~DtNavArea()
Definition: navArea.h:252
Query that can be used when there is no valid navData.
Definition: navArea.h:98
double regenerationDelay
Minimum delay between an event resulting in nav data regeneration and the start of the regeneration t...
Definition: navArea.h:137
const int DtNavDataTagAny
Tag for a nav vertex that indicates a transition point out of a nav area. The nav tag size will be 1 ...
Definition: navDataTag.h:23
Contains the DtUUID class declaration.
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
std::set< DtNavSectorName > DtNavSectorNames
Definition: navArea.h:51
virtual void cancel()
Definition: navArea.h:107
VR-Forces wrapper for Gameware NavTag. Note: This class keeps only a pointer to the data...
Definition: navDataTag.h:87
DtFilename regenerationFileDirectory
The directory in which nav data regeneration files should be stored.
Definition: navArea.h:140
const DtSimObject * attachedObject()
If this Nav Area is attached to a sim object, returns that object.
Definition: navArea.h:439
static bool theNavAreaDebuggingEnabled
Definition: navArea.h:544
static DtNavAreaCreatorFcn theNavAreaCreatorFcn
Definition: navArea.h:542
Definition: asyncJobServer.h:37
void releaseThread()
Definition: navArea.h:183
static const DtUUID & nullUUID()
unsigned NavAreaId
Definition: navArea.h:217
void setAttachedObject(const DtSimObject *object)
Sets the sim object his Nav Ara is attached to.
Definition: navArea.h:442
DtOnGraphVertexVisitedResult
Definition: navArea.h:34
Definition: coordSystem.h:54
virtual void * internalQuery(void)
A pointer to the internal query. Not generally used.
Definition: navArea.h:112
virtual ~DtNavRegenRequestIdData()
Definition: navArea.h:148
This class contains all the data and logic for navigation within a specific area. Nav Data may be loa...
Definition: navArea.h:206
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
Contains all the data and logic for navigation within a specific edge.
Definition: navEdge.h:18
virtual ~DtNavAreaNullQuery()
Definition: navArea.h:102
int port
Definition: navArea.h:212
This is just an abstract base class for the data contained in a DtNavRegenRequestId. The implementation of such an id is handled in a subclass.
Definition: navArea.h:145
bool(* DtNavBotPathLocationEvalFcn)(const DtNavTag &navTag, float slope, float elevationChange, float *costMultiplier, void *userData)
Definition: navBot.h:129
DtNavRegenRequestIdData(const DtNavRegenRequestIdData &)
Definition: navArea.h:152
DtTerrainInterface allows access to common terrain calls without having to know the terrain implement...
Definition: terrainInterface.h:99
boost::shared_ptr< DtNavAreaQuery > Ptr
Definition: navArea.h:60
virtual std::vector< DtVector > debugPoints()
A list of locations that may be generated to debug issues. May not relevant to all queries...
Definition: navArea.h:91
int maxRegenerationThreads
Maximum number of threads performing nav data regeneration at a time.
Definition: navArea.h:133
DtNavRegenRequestIdData()
Definition: navArea.h:151
const DtSimObject * myAttachedObject
Points to the host object if this navArea is attached to an object like a cultural feature or a large...
Definition: navArea.h:548
static const DtVariableBindingsList & nullVariableReference()
bool claimThread()
Definition: navArea.h:173
void setMaxThreads(unsigned maxThreads)
Definition: navArea.h:166
Class providing querying for entities in an extent within the nav mesh. This is the abstract base cla...
Definition: objectsCollectorInExtentQuery.h:11
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
unsigned myUsedThreads
Definition: navArea.h:199
Definition: navArea.h:209
virtual bool navDataChanged()
Returns true if the nav data has changed during this query.
Definition: navArea.h:108
DtNavAreaConfig()
Definition: navArea.h:118
#define DT_DLL_vrfNavigation
This file is used to determine how to build.
Definition: vrfNavigationDefines.h:26
Configuration options for DtNavArea.
Definition: navArea.h:116
DtString status
Definition: navArea.h:214
virtual double outputValue()
An output value that may be the result of this query. May not relevant to all queries.
Definition: navArea.h:88
DtNavTag navTag
Definition: navArea.h:222
Extended DtNavTag class that keeps a local copy of myData.
Definition: navDataTag.h:110
boost::weak_ptr< DtNavRegenRequestIdData > DtNavRegenRequestId
Id used as a handle for nav regen requests. This is just an abstract base class.
Definition: navArea.h:157
virtual bool hadComputationError()
Returns true if the query failed due to a computation error.
Definition: navArea.h:110
class DtLocalVertexList:
Definition: localVertexList.h:20
DtString navAreaName
Definition: navArea.h:211
std::vector< DtRwString > profiles
Definition: navArea.h:213
Definition: navArea.h:218
virtual std::vector< DtVector > results()
A list of locations that may be the result of this query.
Definition: navArea.h:111
boost::weak_ptr< DtNavAreaQuery > WeakPtr
Definition: navArea.h:61
virtual bool complete()
Returns true when the query has completed.
Definition: navArea.h:104
Base class for all asynchronous Nav Area queries. In this context asynchronous means non-blocking...
Definition: navArea.h:57
unsigned myMaxThreads
Definition: navArea.h:198
unsigned maxThreads() const
Definition: navArea.h:171