Kaim::NavGenProj Class Reference

#include <NavGenProj.h>

Class Description

The NavGenProj class is a representation of the input data required for the standalone NavData generation tools supplied with Gameware Navigation to generate NavData for a terrain.

Public Member Functions

void AddSeedPoint (float x, float y, float z)
 
void AddSpecificCellToGenerate (int posx, int posy)
 
KyResult AddTagVolume (const Vec3f *polylinePoints, int pointArraySize, const DynamicNavTag &navTag, float minAltitude, float maxAltitude)
 
void Clear ()
 
KyResult Generate (const char *forcedOutputBaseDir=0, const char *forcedRelativeOutputDir=0)
 
KyResult Load (const char *fileName)
 
KyResult Save (const char *fileName)
 
void SetAbstractGraphConfig (const GeneratorAbstractGraphParameters &abstractGraphParams)
 
void SetConfig (const GeneratorParameters &params, const GeneratorRunOptions &runOptions, const CoordSystem &coordSystem)
 
void SetDatabaseIndex (KyUInt32 dabaseIndex)
 
void SetNavGenProjAbsoluteFileName (const char *navGenProjAbsoluteFileName)
 
void SetOutputDir (const char *outputBaseDir, const char *relativeOutputDir)
 

Public Attributes

char m_navGenProjDirectory [LabEngine::Paths::PathMax]
 
char m_outputBaseDir [LabEngine::Paths::PathMax]
 
char m_relativeOutputDir [LabEngine::Paths::PathMax]
 

For internal use only

void ClearAllSpecificCellsToGenerate ()
 
bool CanUseMirrorOptions ()
 
void RemoveMirrorOptions ()
 
void ParseNavGenProjDoc (TiXmlNode *root)
 
void ParseNavGenProjChildNode (TiXmlNode *pChild)
 
static TiXmlNode * GetOrCreateFolderNode (TiXmlNode *node, const char *folderName)
 
static bool GetParam (TiXmlNode *node, const char *elementName, float &value)
 
static bool GetParam (TiXmlNode *node, const char *elementName, int &value)
 
static bool GetParam (TiXmlNode *node, const char *elementName, unsigned int &value)
 
static bool GetParam (TiXmlNode *node, const char *elementName, unsigned int &value, const KyArray< String > &enumNames)
 
static bool GetParam (TiXmlNode *node, const char *elementName, bool &value)
 
static bool GetParam (TiXmlNode *node, const char *paramName, std::string &param)
 
static bool GetParam (TiXmlNode *node, const char *paramName, Kaim::CellPos &pos)
 
static bool GetParam (TiXmlNode *node, const char *paramName, Kaim::Vec3f &pos)
 
static void SetParam (TiXmlNode *folder, const char *paramName, float param)
 
static void SetParam (TiXmlNode *folder, const char *paramName, int param)
 
static void SetParam (TiXmlNode *folder, const char *paramName, unsigned int param)
 
static void SetParam (TiXmlNode *folder, const char *paramName, unsigned int param, const KyArray< String > &enumNames)
 
static void SetParam (TiXmlNode *folder, const char *paramName, bool param)
 
static void SetParam (TiXmlNode *folder, const char *paramName, const std::string &param)
 
static void SetParam (TiXmlNode *folder, const char *paramName, const Kaim::CellPos &pos)
 
static void SetParam (TiXmlNode *folder, const char *paramName, const Kaim::Vec3f &pos)
 
static void ReadNavTag (TiXmlNode *node, DynamicNavTag &navTag)
 
static void ReadBlindData (TiXmlNode *node, Kaim::KyArrayPOD< KyUInt32 > &blindDataArray)
 
static void ReadColor (TiXmlNode *node, VisualColor &color)
 
static void ReadPoints (TiXmlNode *node, Kaim::KyArrayPOD< Vec3f > &points)
 
static void WriteNavTag (TiXmlNode *node, const DynamicNavTag &navTag, bool writeOnlyBlindData=false)
 
static void WriteBlindData (TiXmlNode *node, const Kaim::KyArrayPOD< KyUInt32 > &blindDataArray)
 
static void WriteColor (TiXmlNode *node, const KyUInt32 *color)
 
static void WritePoints (TiXmlNode *node, const Kaim::KyArrayPOD< Vec3f > &points)
 

Member Function Documentation

void Kaim::NavGenProj::AddSeedPoint ( float  x,
float  y,
float  z 
)

Add a seed point to the navGenProj.

void Kaim::NavGenProj::AddSpecificCellToGenerate ( int  posx,
int  posy 
)

If at least one specific cell is added, the generation will only generate these cells.

This is useful to parameterize/debug a specific cell without regenerating the whole world.

KyResult Kaim::NavGenProj::AddTagVolume ( const Vec3f polylinePoints,
int  pointArraySize,
const DynamicNavTag &  navTag,
float  minAltitude,
float  maxAltitude 
)

Adds a new tag volume to the NavGenProj.

Parameters
polylinePointsAn array of points in 3D space that form a two-dimensional horizontal outline for the volume. This list of points should be specified in counter-clockwise order as seen from above. It should be closed (i.e. the last point in the list should be the same as the first point), but if it is not closed, the first point will be automatically copied to the end of the list to close it.
pointArraySizeThe number of Vec3f objects in the polylinePoints array.
navTagThe associated NavTag
minAltitudeThe altitude of the bottom surface of the tag volume.
maxAltitudeThe altitude of the top surface of the tag volume.
void Kaim::NavGenProj::Clear ( )

Clears all information maintained by this object.

void Kaim::NavGenProj::ClearAllSpecificCellsToGenerate ( )

For internal use.

KyResult Kaim::NavGenProj::Generate ( const char *  forcedOutputBaseDir = 0,
const char *  forcedRelativeOutputDir = 0 
)

Generates NavData NavGenProj.

Parameters
forcedOutputBaseDirif different from NULL, the
<outputDir><baseDir> 
element will be ignored and forcedOutputBaseDir will be used instead
forcedRelativeOutputDirif different from NULL, the
<outputDir><relativeDir> 
element will be ignored and forcedRelativeOutputDir will be used instead
KyResult Kaim::NavGenProj::Load ( const char *  fileName)

Loads the data contained in the .NavGenProj with the specfied path and file name into this NavGenProj object.

Any relative file paths contained in the .NavGenProj are interpreted relative to the directory currently set for m_navGenProjDirectory. After loading, the base directory of the NavGenProj is automatically set to the directory that contains the saved file.

KyResult Kaim::NavGenProj::Save ( const char *  fileName)

Saves the data in this NavGenProj object to a file on disk with the specfied path and file name.

The base directory of the NavGenProj is automatically set to the directory that contains the saved file.

void Kaim::NavGenProj::SetAbstractGraphConfig ( const GeneratorAbstractGraphParameters &  abstractGraphParams)

Sets up the NavGenProjConfig that will be used when generating AbstractGraphs from this NavGenProj.

void Kaim::NavGenProj::SetConfig ( const GeneratorParameters params,
const GeneratorRunOptions runOptions,
const CoordSystem coordSystem 
)

Sets up the NavGenProjConfig that will be used when generating NavData from this NavGenProj.

Parameters
paramsSets the value maintained in NavGenProjConfig::m_generatorParams.
runOptionsSets the value maintained in NavGenProjConfig::m_runOptions.
coordSystemSets the value maintained in NavGenProjConfig::m_coordSystem.
void Kaim::NavGenProj::SetDatabaseIndex ( KyUInt32  dabaseIndex)

Set and get the database name and index for current generation.

void Kaim::NavGenProj::SetNavGenProjAbsoluteFileName ( const char *  navGenProjAbsoluteFileName)

Sets the navGenProj absolute fileName this is only used to implement GetAbsolutePath() set generatorInputOutput.m_runOptions.m_generatorInputOuputSaveFileName set sectorNames.

void Kaim::NavGenProj::SetOutputDir ( const char *  outputBaseDir,
const char *  relativeOutputDir 
)

Sets the outputDir, with a base path and a relative path, i.e where the Kaim::Generator outputs are written if no forcedOutputBaseDir and forcedRelativeOutputDir are provided to generate.

Member Data Documentation

char Kaim::NavGenProj::m_navGenProjDirectory[LabEngine::Paths::PathMax]

absolute directory of the NavGenProj file all files in the navGenProj file are relative to this m_navGenProjDirectory

char Kaim::NavGenProj::m_outputBaseDir[LabEngine::Paths::PathMax]

content of

<outputDir><baseDir>...</baseDir></outputDir> 

that is relative to m_navGenProjDirectory, or absolute but stored there as an absolute path

char Kaim::NavGenProj::m_relativeOutputDir[LabEngine::Paths::PathMax]

content of

<outputDir><relativeDir>...</relativeDir></outputDir> 

, relative to

<outputDir><baseDir> 

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