![]() |
VR-Forces 5.0.3 Developer's Guide
|
This class is used to generate nav data for an area on a terrain.
Classes | |
| struct | NavEdgePoints |
| struct | NavPoint |
| struct | SectorGenerationThreadInfo |
| struct | TriangleCallbackInfo |
Static Public Member Functions | |
| static DtNavDataGenerator * | create () |
| static void | setCreator (DtNavDataGeneratorCreatorFcn creatorFcn) |
| static void | setNavDataDirectory (const DtFilename &navDataDir) |
| static const DtFilename & | navDataDirectory () |
| static DtFilename | replaceSubstrings (const DtFilename &original) |
Static Public Attributes | |
| static const double | LowCoverHeightCheck |
| static const double | HighCoverHeightCheck |
| static const unsigned | NumCoverCheckAngles |
| static const double | CoverChordLengthFactor |
Protected Member Functions | |
| DtNavDataGenerator () | |
| virtual void | loadPlugins (const std::set< DtFilename > &pluginFiles) |
| virtual void | unloadPlugins () |
| virtual bool | checkPluginVersion (DtDynamicLibrary *plugin) const |
| virtual void | doGenerateSector (SectorGenerationThreadInfo *sectorGenInfo) |
| virtual bool | shouldStop (SectorGenerationThreadInfo *sectorGenInfo) |
| virtual std::vector< DtVector > | calculateTransitionPointLocations () |
| virtual void | getProfileRandomIds (DtRwStringList &profiles, ProfileRandomIdMap &randomIds) |
| virtual bool | generateProfileNavData (const DtRwNavigationProfile *profile, DtString randomId) |
| virtual bool | generateSectorNavData (const DtRwNavigationProfile *profile, const DtNavSectorName §orName, NavDataOutputMap &outputData, SectorGenerationThreadInfo *sectorGenInfo=0) |
| virtual bool | generateTransitionPoints (const DtRwNavigationProfile *profile, Kaim::GeneratorInputOutput &generatorInputOutput, const DtString &randomId, const DtFilename &navDataOutputDir) |
| 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) |
| virtual bool | generateCoverPoints (const DtRwNavigationProfile *profile, Kaim::GeneratorInputOutput &generatorInputOutput, const DtString &randomId, const DtFilename &navDataOutputDir) |
| 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) |
| virtual bool | generateNavEdges (const DtRwNavigationProfile *profile, Kaim::GeneratorInputOutput &generatorInputOutput, const DtString &randomId, const DtFilename &navDataOutputDir) |
| 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) |
| virtual bool | computeSectorNavEdges (const DtRwNavigationProfile *profile, int sectorX, int sectorY, const DtExtent §orExtent, SectorGenerationThreadInfo *sectorGenInfo, std::list< NavEdgePoints > &navEdges) |
| virtual bool | generateNavPoints (const DtRwNavigationProfile *profile, Kaim::GeneratorInputOutput &generatorInputOutput, const DtString &randomId, const DtFilename &navDataOutputDir) |
| virtual bool | generateSectorNavPoints (const DtRwNavigationProfile *profile, Kaim::GeneratorSector *sector, const DtString &randomId, const DtFilename &navDataOutputDir=DtFilename::nullFilename(), std::vector< char > *buffer=0, SectorGenerationThreadInfo *sectorGenInfo=0) |
| virtual bool | computeSectorNavPoints (const DtRwNavigationProfile *profile, int sectorX, int sectorY, const DtExtent §orExtent, SectorGenerationThreadInfo *sectorGenInfo, std::list< NavPoint > &navPoints) |
| virtual void | setNumberOfProgressSteps (int steps) |
| 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 () |
| virtual DtOutputStream & | milestoneOutput () |
| virtual DtOutputStream & | notableOutput () |
| virtual DtOutputStream & | errorOutput () |
Static Protected Attributes | |
| static Mutex | theNavDataGenMutex |
| static DtFilename | theNavDataDir |
| static DtNavDataGeneratorCreatorFcn | theCreatorFcn |
Private Member Functions | |
| DtNavDataGenerator (const DtNavDataGenerator &) | |
| DtNavDataGenerator & | operator= (const DtNavDataGenerator &orig) |
Friends | |
| class | TbbintersectTransitionPoint |
| virtual void | processTriangle (DtTerrainTriangleStruct &triangle, DtNavTriangles &triangles) |
| static void | triangleCallback (DtTerrainTriangleStruct &triangle, void *usr) |
| virtual void | processTrianglesFinalize (int status, DtNavTriangles &triangles) |
| static void | trianglesFinalizeCallback (int status, void *usr) |
| 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, DtNavDataGenerator *navGenerator, int sectorX, int sectorY, unsigned edgeTag, std::list< NavEdgePoints > *edges, SectorGenerationThreadInfo *threadInfo, void *usr) |
A function to generate a nav edge from a dynamic terrain feature. For every dynamic terrain feature of a configured type (specified in the navigation profile), a registered function will be called to produce a new nav edge. The function is provided the dynamic terrain feature information, the DtNavDataGenerator, the sector coordinates, and a recommended tag to be used for the edge. The edges parameter should be updated to add any new nav edges that should be generated. Should return true if any edges were added and false otherwise.
| typedef bool(* DtNavDataGenerator::FeatureDataNavEdgeFunction)(const MAKVRinTerra::DtFeature &feature, DtNavDataGenerator *navGenerator, int sectorX, int sectorY, unsigned edgeTag, std::list< NavEdgePoints > *edges, SectorGenerationThreadInfo *threadInfo, void *usr) |
A function to generate a nav edge from a terrain feature. For every terrain feature of a configured type (specified in the navigation profile), a registered function will be called to produce a new nav edge. The function is provided the terrain feature information, the DtNavDataGenerator, the sector coordinates, and a recommended tag to be used for the edge. The edges parameter should be updated to add any new nav edges that should be generated. Should return true if any edges were added and false otherwise.
| typedef bool(* DtNavDataGenerator::GeneralNavEdgeFunction)(DtNavDataGenerator *navGenerator, int sectorX, int sectorY, unsigned edgeTag, std::list< NavEdgePoints > *edges, SectorGenerationThreadInfo *threadInfo, void *usr) |
A function to generate nav edges on a given sector. This is a general function that is not based on terrain feature data or dynamic terrain features, and can be used to implement a new custom algorithm. When enabled in the navigation profile, the function will be called once for each sector. The function is provided the DtNavDataGenerator, the sector coordinates, and a recommended tag to be used for the edge. The edges parameter should be updated to add any new nav edges that should be generated. Should return true if any edges were added and false otherwise.
| typedef std::pair<DynamicTerrainNavEdgeFunction, void*> DtNavDataGenerator::DynamicTerrainNavEdgeFunctionInfo |
| typedef std::pair<FeatureDataNavEdgeFunction, void*> DtNavDataGenerator::FeatureDataNavEdgeFunctionInfo |
| typedef std::pair<GeneralNavEdgeFunction, void*> DtNavDataGenerator::GeneralNavEdgeFunctionInfo |
| typedef bool(* DtNavDataGenerator::DynamicTerrainNavPointFunction)(const DtRwDynamicTerrainInformation &dynTerrInfo, DtNavDataGenerator *navGenerator, int sectorX, int sectorY, unsigned pointTag, std::list< NavPoint > *points, SectorGenerationThreadInfo *threadInfo, void *usr) |
A function to generate a nav point from a dynamic terrain feature. For every dynamic terrain feature of a configured type (specified in the navigation profile), a registered function will be called to produce a new nav point. The function is provided the dynamic terrain feature information, the DtNavDataGenerator, the sector coordinates, and a recommended tag to be used for the point. The points parameter should be updated to add any new nav points that should be generated. Should return true if any points were added and false otherwise.
| typedef bool(* DtNavDataGenerator::FeatureDataNavPointFunction)(const MAKVRinTerra::DtFeature &feature, DtNavDataGenerator *navGenerator, int sectorX, int sectorY, unsigned pointTag, std::list< NavPoint > *points, SectorGenerationThreadInfo *threadInfo, void *usr) |
A function to generate a nav point from a terrain feature. For every terrain feature of a configured type (specified in the navigation profile), a registered function will be called to produce a new nav point. The function is provided the terrain feature information, the DtNavDataGenerator, the sector coordinates, and a recommended tag to be used for the point. The points parameter should be updated to add any new nav points that should be generated. Should return true if any points were added and false otherwise.
| typedef bool(* DtNavDataGenerator::GeneralNavPointFunction)(DtNavDataGenerator *navGenerator, int sectorX, int sectorY, unsigned pointTag, std::list< NavPoint > *points, SectorGenerationThreadInfo *threadInfo, void *usr) |
A function to generate nav points on a given sector. This is a general function that is not based on terrain feature data or dynamic terrain features, and can be used to implement a new custom algorithm. When enabled in the navigation profile, the function will be called once for each sector. The function is provided the DtNavDataGenerator, the sector coordinates, and a recommended tag to be used for the point. The points parameter should be updated to add any new nav points that should be generated. Should return true if any points were added and false otherwise.
| typedef std::pair<DynamicTerrainNavPointFunction, void*> DtNavDataGenerator::DynamicTerrainNavPointFunctionInfo |
| typedef std::pair<FeatureDataNavPointFunction, void*> DtNavDataGenerator::FeatureDataNavPointFunctionInfo |
| typedef std::pair<GeneralNavPointFunction, void*> DtNavDataGenerator::GeneralNavPointFunctionInfo |
|
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. The navigation profiles can specify types of dynamic terrain features that should result in nav edge generation. The profile specifies the function to be called, by a unique name, but the function must be registered using this method.
| void DtNavDataGenerator::addNavEdgeFromFeatureDataFunction | ( | const DtString & | name, |
| FeatureDataNavEdgeFunction | fcn, | ||
| void * | usr | ||
| ) |
Registers a function to be used to generate nav edges from terrain feature data. The navigation profiles can specify types of terrain features that should result in nav edge generation. The profile specifies the function to be called, by a unique name, but the function must be registered using this method.
| void DtNavDataGenerator::addGeneralNavEdgeFunction | ( | const DtString & | name, |
| GeneralNavEdgeFunction | fcn, | ||
| void * | usr | ||
| ) |
Registers a function to be used to generate nav edges. The navigation profiles can specify any general nav edge functions that should be called. The profile specifies the function to be called, by a unique name, but the function must be registered using this method.
| void DtNavDataGenerator::addNavPointFromDynamicTerrainFunction | ( | const DtString & | name, |
| DynamicTerrainNavPointFunction | fcn, | ||
| void * | usr | ||
| ) |
Registers a function to be used to generate nav points from dynamic terrain features. The navigation profiles can specify types of dynamic terrain features that should result in nav point generation. The profile specifies the function to be called, by a unique name, but the function must be registered using this method.
| void DtNavDataGenerator::addNavPointFromFeatureDataFunction | ( | const DtString & | name, |
| FeatureDataNavPointFunction | fcn, | ||
| void * | usr | ||
| ) |
Registers a function to be used to generate nav points from terrain feature data. The navigation profiles can specify types of terrain features that should result in nav point generation. The profile specifies the function to be called, by a unique name, but the function must be registered using this method.
| void DtNavDataGenerator::addGeneralNavPointFunction | ( | const DtString & | name, |
| GeneralNavPointFunction | fcn, | ||
| void * | usr | ||
| ) |
Registers a function to be used to generate nav points. The navigation profiles can specify any general nav point functions that should be called. The profile specifies the function to be called, by a unique name, but the function must be registered using this method.
|
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 |
Stops all current nav data generation.
|
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.
|
virtual |
Returns the terrain interface.
| MAKVRinTerra::DtFeatureGeometry& DtNavDataGenerator::extentFeatureGeometry | ( | ) |
Returns a feature geometry of the nav area extents.
| MAKVRinTerra::DtFeatureGeometry& DtNavDataGenerator::extentFeatureGeometry | ( | int | sectorX, |
| int | sectorY | ||
| ) |
Returns a feature geometry of the nav sector extents.
|
virtual |
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.
|
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 |
Loads the specified plugins.
|
protectedvirtual |
Unloads previously loaded plugins.
|
protectedvirtual |
Verifies the plugin version is correct.
|
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 |
Callback to handle processing of a triangle for nav generation.
|
staticprotected |
Callback to handle finalization of triangle processing for nav generation.
|
protectedvirtual |
Callback to handle finalization of triangle processing for nav generation.
|
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 |
Computes nav edges for a single sector.
|
protectedvirtual |
Generates nav points for the entire nav area for the specified profile and saves the output to the specified directory.
|
protectedvirtual |
Generates nav 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 |
Computes nav points for a single sector.
|
protectedvirtual |
These methods are used to output specially formated progress strings.
|
protectedvirtual |
These methods are used to output specially formated progress strings.
|
protectedvirtual |
These methods are used to output specially formated progress strings.
|
protectedvirtual |
These methods are used to output specially formated progress strings.
|
protectedvirtual |
These methods are used to output specially formated progress strings.
|
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.
|
friend |
|
static |
|
static |
|
static |
|
static |
|
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.
|
staticprotected |
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 |
The directory in which we will regenerate nav data at runtime.
|
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 |
Functions used to create nav edges using a user defined algorithm that does not use dynamic terrain features or terrain feature data.
|
protected |
Functions used to create nav points from dynamic terrain features.
|
protected |
Functions used to create nav points from terrain feature data.
|
protected |
Functions used to create nav points using a user defined algorithm that does not use dynamic terrain features or terrain feature data.
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
Tbb arena to limit number of threads.