![]() |
VR-Forces 4.6.1 Class Documentation
|
This class is used to generate nav data for an area on a terrain. More...
Classes | |
| struct | EdgePoints |
| struct | SectorGenerationThreadInfo |
| struct | TriangleCallbackInfo |
Public Member Functions | |
| virtual | ~DtNavDataGenerator () |
| Destructor. | |
| virtual bool | initialize (DtTerrainInterface *terrainInterface, const DtFilename &navGenConfigFile, const DtFilename &runtimeConfigFile, const DtFilename &outputPath, const DtFilename &terrainFile, bool generateFeatureTagVolumes) |
| Initializer. Must be called prior to calling any generate function. Returns true on success. | |
| void | addNavEdgeFromDynamicTerrainFunction (const DtString &name, DynamicTerrainNavEdgeFunction fcn, void *usr) |
| Registers a function to be used to generate nav edges from dynamic terrain features. | |
| void | addNavEdgeFromFeatureDataFunction (const DtString &name, FeatureDataNavEdgeFunction fcn, void *usr) |
| Registers a function to be used to generate nav edges from terrain feature data. | |
| virtual void | setTransitionPointSpacing (double spacing) |
| Sets the spacing between transition points. Default is 3 m. | |
| virtual double | transitionPointSpacing () const |
| Gets the spacing between transition points. | |
| virtual bool | generate () |
| Generate full nav data to output files. | |
| virtual bool | generateSector (const DtNavSectorName §orName) |
| Generate nav data for a specific sector. | |
| virtual SectorGenerationStatus | getGenerateSectorStatus (const DtNavSectorName §orName, NavDataOutputMap &outputNavData) |
| Gets the status of sector generation. | |
| virtual const DtRwNavigationProfile * | profileConfig (const DtString &profileName) const |
| Returns the profile configuration for the profile matching the specified name. | |
| virtual const DtRwNavGenConfig * | navGenConfig () const |
| Returns the nav generation configuration. | |
Static Public Member Functions | |
| static DtNavDataGenerator * | create () |
| Creates a new DtNavDataGenerator. | |
| static void | setCreator (DtNavDataGeneratorCreatorFcn creatorFcn) |
| Sets the creator function. | |
| static void | setNavDataDirectory (const DtFilename &navDataDir) |
| Set the navData directory. Default is /navData. | |
| static const DtFilename & | navDataDirectory () |
| Get the navData directory. | |
| static DtFilename | replaceSubstrings (const DtFilename &original) |
| Replaces substrings such as $(nav-data-dir) in any file paths with the actual file path. | |
Protected Member Functions | |
| DtNavDataGenerator () | |
| Constructor. | |
| virtual void | doGenerateSector (SectorGenerationThreadInfo *sectorGenInfo) |
| Performs sector generation in a separate thread. | |
| virtual bool | shouldStop (SectorGenerationThreadInfo *sectorGenInfo) |
| Returns true if the thread should stop. | |
| virtual std::list< DtVector > | calculateTransitionPointLocations () |
| Finds transition point locations for exiting the nav area. | |
| virtual void | getProfileRandomIds (DtRwStringList &profiles, ProfileRandomIdMap &randomIds) |
| Finds existing random identifiers for each profile, or generates them if necessary. | |
| virtual bool | generateProfileNavData (const DtRwNavigationProfile *profile, DtString randomId) |
| Generates nav data to a file for a specified profile. | |
| virtual bool | generateSectorNavData (const DtRwNavigationProfile *profile, const DtNavSectorName §orName, NavDataOutputMap &outputData, SectorGenerationThreadInfo *sectorGenInfo=0) |
| Generates nav data to memory for specified sector. | |
| virtual bool | generateTransitionPoints (const DtRwNavigationProfile *profile, Kaim::GeneratorInputOutput &generatorInputOutput, const DtString &randomId, const DtFilename &navDataOutputDir) |
| Generates transition points for the entire nav area for the specified profile and saves the output to the specified directory. | |
| virtual bool | generateSectorTransitionPoints (const DtRwNavigationProfile *profile, Kaim::GeneratorSector *sector, const DtString &randomId, const DtFilename &navDataOutputDir=DtFilename::nullFilename(), std::vector< char > *buffer=0, SectorGenerationThreadInfo *sectorGenInfo=0) |
| Generates transition points for a single sector for the specified profile. | |
| virtual bool | generateCoverPoints (const DtRwNavigationProfile *profile, Kaim::GeneratorInputOutput &generatorInputOutput, const DtString &randomId, const DtFilename &navDataOutputDir) |
| Generates cover points for the entire nav area for the specified profile and saves the output to the specified directory. | |
| virtual bool | generateSectorCoverPoints (const DtRwNavigationProfile *profile, Kaim::GeneratorSector *sector, const DtString &randomId, const DtFilename &navDataOutputDir=DtFilename::nullFilename(), std::vector< char > *buffer=0, SectorGenerationThreadInfo *sectorGenInfo=0) |
| Generates cover points for a single sector for the specified profile. | |
| virtual bool | generateNavEdges (const DtRwNavigationProfile *profile, Kaim::GeneratorInputOutput &generatorInputOutput, const DtString &randomId, const DtFilename &navDataOutputDir) |
| Generates nav edges for the entire nav area for the specified profile and saves the output to the specified directory. | |
| virtual bool | generateSectorNavEdges (const DtRwNavigationProfile *profile, Kaim::GeneratorSector *sector, const DtString &randomId, const DtFilename &navDataOutputDir=DtFilename::nullFilename(), std::vector< char > *buffer=0, SectorGenerationThreadInfo *sectorGenInfo=0) |
| Generates nav edges for a single sector for the specified profile. | |
| virtual void | registerDefaultNavEdgeGenerationFunctions () |
| Registers the default nav edge generation functions. | |
| MAKVRinTerra::DtFeatureGeometry & | extentFeatureGeometry () |
| Returns a feature geometry of the nav area extents. | |
| MAKVRinTerra::DtFeatureGeometry & | extentFeatureGeometry (int sectorX, int sectorY) |
| Returns a feature geometry of the nav sector extents. | |
| virtual bool | terrainHeight (const DtPoint &p, double &height, double *min=0, double *max=0) const |
| Gets terrain height at point p. | |
| virtual void | setNumberOfProgressSteps (int steps) |
| These methods are used to output specially formated progress strings. | |
| virtual void | nextProgressStep (const DtString &stepName, int numSubSteps=0) |
| virtual void | nextProgressSubStep () |
| virtual void | progressComplete () |
| virtual void | outputProgress (const DtString &stepName=DtString::nullString()) |
| virtual DtOutputStream & | detailOutput () |
| These methods should be used instead of the standard VRL output streams. | |
| virtual DtOutputStream & | milestoneOutput () |
| Used to output important milestones in generation process. Font is large in GUI. | |
| virtual DtOutputStream & | notableOutput () |
| Used to output notable occurrences. Font is larger than normal, but smaller than milestone. | |
| virtual DtOutputStream & | errorOutput () |
| Used to output errors. | |
Static Protected Member Functions | |
| static bool | edgeFromIntersectionNormal (const DtRwDynamicTerrainInformation &dynTerrInfo, std::list< EdgePoints > *edges, int sectorX, int sectorY, unsigned edgeTag, void *usr) |
| Default functions used to create nav edges from dynamic terrain features. | |
| static bool | edgeFromPathFeature (const MAKVRinTerra::DtFeature &feature, std::list< EdgePoints > *edges, int sectorX, int sectorY, unsigned edgeTag, void *usr) |
| Default functions used to create nav edges from terrain feature data. | |
Protected Attributes | |
| DtRwNavRuntimeConfig | myNavRuntimeConfig |
| The runtime configuration for the nav. | |
| DtTerrainInterface * | myTerrainInterface |
| The terrain interface for the terrain on which nav data is being generated. | |
| DtNavigationGeneratorInput | myNavGenInput |
| The current input for the navigation generator. | |
| RwMutex | myNavGenInputMutex |
| Mutex for myNavGenInput. | |
| Mutex | myNavDataGenMutex |
| Mutex for the period when data is actually being generated. | |
| DtFilename | myNavGenConfigFile |
| The path of the navigation generator config file. | |
| DtFilename | myRuntimeConfigFile |
| The path of the runtime config file. | |
| DtFilename | myOutputPath |
| Where nav data files should be generated. | |
| DtFilename | myTerrainFile |
| The terrain file for which nav data is being generated. | |
| DtFeatureTagVolumeGenerator * | myFeatureTagVolumeGenerator |
| Whether feature tags will be generated. | |
| RwMutex | myFeatureTagVolumeGeneratorMutex |
| Mutex for myFeatureTagVolumeGenerator. | |
| double | myTransitionPointSpacing |
| The spacing to be used between transition points for exiting the nav area. | |
| SectorGenerationThreadMap | mySectorThreads |
| Sector generation threads by sector name. | |
| MAKVRinTerra::DtFeatureGeometry | myExtentFeatureGeometry |
| The nav area extents as a feature geometry. | |
| bool | myIsInitialized |
| Indicates whether initialize() has been successfully called. | |
| int | myNumberOfProgressSteps |
| int | myNumberOfProgressSubSteps |
| int | myCurrentProgressStep |
| int | myCurrentProgressSubStep |
| std::map< DtString, DynamicTerrainNavEdgeFunctionInfo > | myDynamicTerrainNavEdgeFunctions |
| Functions used to create nav edges from dynamic terrain features. | |
| std::map< DtString, FeatureDataNavEdgeFunctionInfo > | myFeatureDataNavEdgeFunctions |
| Functions used to create nav edges from terrain feature data. | |
| DtClock | myClock |
Static Protected Attributes | |
| static DtFilename | theNavDataDir |
| static DtNavDataGeneratorCreatorFcn | theCreatorFcn |
Private Member Functions | |
| DtNavDataGenerator (const DtNavDataGenerator &) | |
| Not implemented. | |
| DtNavDataGenerator & | operator= (const DtNavDataGenerator &orig) |
| Not implemented. | |
| virtual void | processTriangle (DtTerrainTriangleStruct &triangle, DtNavTriangles &triangles) |
| static void | triangleCallback (DtTerrainTriangleStruct &triangle, void *usr) |
| Callback to handle processing of a triangle for nav generation. | |
| virtual void | processTrianglesFinalize (int status, DtNavTriangles &triangles) |
| static void | trianglesFinalizeCallback (int status, void *usr) |
| Callback to handle finalization of triangle processing for nav generation. | |
This class is used to generate nav data for an area on a terrain.
| typedef tbb::queuing_rw_mutex DtNavDataGenerator::RwMutex |
| typedef tbb::mutex DtNavDataGenerator::Mutex |
| typedef std::map<DtNavSectorDataType, std::vector<char> > DtNavDataGenerator::NavDataOutputMap |
| typedef std::map<DtNavSectorName, SectorGenerationThreadInfo*> DtNavDataGenerator::SectorGenerationThreadMap |
| typedef std::map<DtString, DtString> DtNavDataGenerator::ProfileRandomIdMap |
| typedef DtNavDataGenerator*(* DtNavDataGenerator::DtNavDataGeneratorCreatorFcn)() |
| typedef bool(* DtNavDataGenerator::DynamicTerrainNavEdgeFunction)(const DtRwDynamicTerrainInformation &dynTerrInfo, std::list< EdgePoints > *edges, int sectorX, int sectorY, unsigned edgeTag, void *usr) |
| typedef bool(* DtNavDataGenerator::FeatureDataNavEdgeFunction)(const MAKVRinTerra::DtFeature &feature, std::list< EdgePoints > *edges, int sectorX, int sectorY, unsigned edgeTag, void *usr) |
| typedef std::pair<DynamicTerrainNavEdgeFunction, void*> DtNavDataGenerator::DynamicTerrainNavEdgeFunctionInfo |
| typedef std::pair<FeatureDataNavEdgeFunction, void*> DtNavDataGenerator::FeatureDataNavEdgeFunctionInfo |
|
virtual |
Destructor.
|
protected |
Constructor.
Protected since the DtNavDataGenerator should only be created using the create function.
|
private |
Not implemented.
|
static |
Creates a new DtNavDataGenerator.
If a creator function has been specified in setCreator it will be used. Otherwise creates a DtNavDataGenerator.
|
virtual |
Initializer. Must be called prior to calling any generate function. Returns true on success.
| void DtNavDataGenerator::addNavEdgeFromDynamicTerrainFunction | ( | const DtString & | name, |
| DynamicTerrainNavEdgeFunction | fcn, | ||
| void * | usr | ||
| ) |
Registers a function to be used to generate nav edges from dynamic terrain features.
| void DtNavDataGenerator::addNavEdgeFromFeatureDataFunction | ( | const DtString & | name, |
| FeatureDataNavEdgeFunction | fcn, | ||
| void * | usr | ||
| ) |
Registers a function to be used to generate nav edges from terrain feature data.
|
virtual |
Sets the spacing between transition points. Default is 3 m.
|
virtual |
Gets the spacing between transition points.
|
virtual |
Generate full nav data to output files.
Generation occurs in main thread, all other generation operations will be locked out until this call finishes. This is not intended to be called at runtime, but instead during offline generation.
|
virtual |
Generate nav data for a specific sector.
Generation occurs in a separate thread. To check progress and retrieve the resulting data, call getGenerateSectorStatus(sectorName).
|
virtual |
Gets the status of sector generation.
If generation completed successfully, the outputNavData will be filled with the resulting nav data.
|
virtual |
Returns the profile configuration for the profile matching the specified name.
|
virtual |
Returns the nav generation configuration.
|
static |
Sets the creator function.
|
static |
Set the navData directory. Default is /navData.
|
static |
Get the navData directory.
|
static |
Replaces substrings such as $(nav-data-dir) in any file paths with the actual file path.
|
protectedvirtual |
Performs sector generation in a separate thread.
|
protectedvirtual |
Returns true if the thread should stop.
Will also clean up sectorGenInfo if its threadShouldCleanUp flag is true.
|
staticprotected |
Callback to handle processing of a triangle for nav generation.
|
protectedvirtual |
|
staticprotected |
Callback to handle finalization of triangle processing for nav generation.
|
protectedvirtual |
|
protectedvirtual |
Finds transition point locations for exiting the nav area.
|
protectedvirtual |
Finds existing random identifiers for each profile, or generates them if necessary.
|
protectedvirtual |
Generates nav data to a file for a specified profile.
|
protectedvirtual |
Generates nav data to memory for specified sector.
|
protectedvirtual |
Generates transition points for the entire nav area for the specified profile and saves the output to the specified directory.
|
protectedvirtual |
Generates transition points for a single sector for the specified profile.
Output can be saved to a file if output directory is specified and/or to a buffer if it is specified.
|
protectedvirtual |
Generates cover points for the entire nav area for the specified profile and saves the output to the specified directory.
|
protectedvirtual |
Generates cover points for a single sector for the specified profile.
Output can be saved to a file if output directory is specified and/or to a buffer if it is specified.
|
protectedvirtual |
Generates nav edges for the entire nav area for the specified profile and saves the output to the specified directory.
|
protectedvirtual |
Generates nav edges for a single sector for the specified profile.
Output can be saved to a file if output directory is specified and/or to a buffer if it is specified.
|
protectedvirtual |
Registers the default nav edge generation functions.
|
staticprotected |
Default functions used to create nav edges from dynamic terrain features.
Tries to find a terrain intersection at the location of the dynamic terrain feature, then gets its normal. Designed for use with doors, in which case this should return the direction through which an entity can pass through the door. Returns false if no valid points could be found.
|
staticprotected |
Default functions used to create nav edges from terrain feature data.
Turns a path feature into nav edge(s), clipped to the specified sector.
|
protected |
Returns a feature geometry of the nav area extents.
|
protected |
Returns a feature geometry of the nav sector extents.
|
protectedvirtual |
Gets terrain height at point p.
Returns true if terrain intersection was found. If min or max are supplied they are updated if a value is found.
|
protectedvirtual |
These methods are used to output specially formated progress strings.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
These methods should be used instead of the standard VRL output streams.
Add formatting text for use in GUI.Used to output detailed generation info. Should be used for most general status updates.
|
protectedvirtual |
Used to output important milestones in generation process. Font is large in GUI.
|
protectedvirtual |
Used to output notable occurrences. Font is larger than normal, but smaller than milestone.
|
protectedvirtual |
Used to output errors.
|
private |
Not implemented.
|
protected |
The runtime configuration for the nav.
|
protected |
The terrain interface for the terrain on which nav data is being generated.
|
protected |
The current input for the navigation generator.
|
mutableprotected |
Mutex for myNavGenInput.
|
mutableprotected |
Mutex for the period when data is actually being generated.
|
protected |
The path of the navigation generator config file.
|
protected |
The path of the runtime config file.
|
protected |
Where nav data files should be generated.
|
protected |
The terrain file for which nav data is being generated.
|
protected |
Whether feature tags will be generated.
|
mutableprotected |
Mutex for myFeatureTagVolumeGenerator.
|
protected |
The spacing to be used between transition points for exiting the nav area.
Default is 3.
|
protected |
Sector generation threads by sector name.
|
protected |
The nav area extents as a feature geometry.
|
protected |
Indicates whether initialize() has been successfully called.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Functions used to create nav edges from dynamic terrain features.
|
protected |
Functions used to create nav edges from terrain feature data.
|
protected |
|
staticprotected |
|
staticprotected |