9 #ifndef GwNavGen_NavGenProj_H
10 #define GwNavGen_NavGenProj_H
17 #include "LabEngine/base/filesystem.h"
32 class MirroredOBJProducer;
38 class NavGenProjGeometry;
39 class NavGenProjPdgInput;
40 class NavGenProjTagVolume;
41 class NavGenProjClientInput;
42 class NavGenProjSector;
43 class NavGenProjMirrorOptions;
44 class NavGenProjExclusiveSectors;
83 KyResult AddTagVolume(
const Vec3f* polylinePoints,
int pointArraySize,
const DynamicNavTag& navTag,
float minAltitude,
float maxAltitude);
98 void SetOutputDir(
const char* outputBaseDir,
const char* relativeOutputDir);
124 int GetSectorCount()
const;
127 int GetSeedPointCount()
const;
137 std::string GetAbsolutePath(
const char* path);
139 std::string GetGeneratorInputOutputFilename()
143 std::string genIOFileName = m_navGenProjFileNameWithoutDirOrExtension;
144 genIOFileName +=
".GenIO";
145 return genIOFileName;
158 bool CanUseMirrorOptions();
159 void RemoveMirrorOptions();
161 void ParseNavGenProjDoc(TiXmlNode* root);
162 void ParseNavGenProjChildNode(TiXmlNode* pChild);
166 static TiXmlNode* GetOrCreateFolderNode(TiXmlNode* node,
const char* folderName);
168 static bool GetParam(TiXmlNode* node,
const char *elementName,
float& value);
169 static bool GetParam(TiXmlNode* node,
const char *elementName,
int& value);
170 static bool GetParam(TiXmlNode* node,
const char *elementName,
unsigned int& value);
171 static bool GetParam(TiXmlNode* node,
const char *elementName,
unsigned int& value,
const KyArray<String>& enumNames);
172 static bool GetParam(TiXmlNode* node,
const char *elementName,
bool& value);
173 static bool GetParam(TiXmlNode* node,
const char *paramName, std::string& param);
174 static bool GetParam(TiXmlNode* node,
const char *paramName,
Kaim::CellPos& pos);
175 static bool GetParam(TiXmlNode* node,
const char *paramName,
Kaim::Vec3f& pos);
177 static void SetParam(TiXmlNode* folder,
const char* paramName,
float param);
178 static void SetParam(TiXmlNode* folder,
const char* paramName,
int param);
179 static void SetParam(TiXmlNode* folder,
const char* paramName,
unsigned int param);
180 static void SetParam(TiXmlNode* folder,
const char* paramName,
unsigned int param,
const KyArray<String>& enumNames);
181 static void SetParam(TiXmlNode* folder,
const char* paramName,
bool param);
182 static void SetParam(TiXmlNode* folder,
const char *paramName,
const std::string& param);
183 static void SetParam(TiXmlNode* folder,
const char *paramName,
const Kaim::CellPos& pos);
184 static void SetParam(TiXmlNode* folder,
const char *paramName,
const Kaim::Vec3f& pos);
186 static void ReadNavTag(TiXmlNode* node, DynamicNavTag& navTag);
188 static void ReadColor(TiXmlNode* node,
VisualColor& color);
191 static void WriteNavTag(TiXmlNode* node,
const DynamicNavTag& navTag,
bool writeOnlyBlindData =
false);
193 static void WriteColor(TiXmlNode* node,
const KyUInt32* color);
197 void ParseOutputDir(TiXmlNode* node);
198 void ParseSectors(TiXmlNode* sectorsNode);
199 void CreateSector(TiXmlNode* sectorNode);
200 void ParseTagVolumes(TiXmlNode* tagVolumesNode);
201 void CreateTagVolume(TiXmlNode* tagVolumeNode);
202 void ParseSeedPoints(TiXmlNode* seedpointsNode);
203 void CreateSeedPoint(TiXmlNode* seedpointNode);
204 void CreateMirrorOptions(TiXmlNode* node);
206 KyResult GenerateMirroredObj(
const char* absoluteOutputBaseDir,
const char* relativeOutputDir);
207 KyResult GenerateObj(
const char* absoluteOutputBaseDir,
const char* relativeOutputDir);
209 Kaim::Ptr<Kaim::Generator> CreateGenerator(Kaim::Ptr<Kaim::GeneratorInputProducer> producer);
210 void InitInputGeometry(Kaim::Ptr<Kaim::GeneratorSector> sector,
NavGenProjSector* navGenProjSector);
211 void InitSeedAndTag(Kaim::Ptr<Kaim::GeneratorSector> sector,
NavGenProjSector* navGenProjSector);
214 void ConfigGeneratorSector(Kaim::Ptr<Kaim::GeneratorSector> sector,
NavGenProjSector* navGenProjSector);
215 void InitGeneratorInputOutput(
Kaim::GeneratorInputOutput& generatorInputOutput,
const char* absoluteOutputBaseDir,
const char* relativeOutputDir);
216 KyResult RunGenerator(Kaim::Ptr<Kaim::Generator> generator,
Kaim::GeneratorInputOutput& generatorInputOutput,
const char* absoluteOutputBaseDir,
const char* relativeOutputDir);
221 std::vector<NavGenProjSector*> m_sectors;
222 std::vector<NavGenProjTagVolume*> m_tagVolumes;
223 std::vector<NavGenProjExclusiveSectors*> m_arrayOfExclusiveSectors;
224 std::vector<NavGenProjSeedPoint> m_seedPoints;
242 char m_navGenProjFileNameWithoutDirOrExtension[LabEngine::Paths::PathMax];
void ClearAllSpecificCellsToGenerate()
For internal use.
void SetAbstractGraphConfig(const GeneratorAbstractGraphParameters &abstractGraphParams)
Sets up the NavGenProjConfig that will be used when generating AbstractGraphs from this NavGenProj...
KyResult Save(const char *fileName)
Saves the data in this NavGenProj object to a file on disk with the specfied path and file name...
char m_navGenProjDirectory[LabEngine::Paths::PathMax]
absolute directory of the NavGenProj file all files in the navGenProj file are relative to this m_nav...
Definition: NavGenProj.h:246
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
The NavGenProj class is a representation of the input data required for the standalone NavData genera...
Definition: NavGenProj.h:49
char m_relativeOutputDir[LabEngine::Paths::PathMax]
content of
Definition: NavGenProj.h:242
This class is used to store parameters if a sector must be mirrored cf.
Definition: NavGenProjMirrorOptions.h:24
This class is used by the NavGenProj to store configuration parameters required by the NavData genera...
Definition: NavGenProjConfig.h:24
An instance of this class is used to represent each seedpoint in a NavGenProj.
Definition: NavGenProjSeedPoint.h:23
This class maintains the mapping between the system of coordinate axes used internally within the gam...
Definition: coordsystem.h:144
char m_outputBaseDir[LabEngine::Paths::PathMax]
content of
Definition: NavGenProj.h:240
The MirroredOBJProducer class is a concrete implementation of GeneratorInputProducer that can read th...
Definition: mirroredobjproducer.h:48
#define KY_NULL
Null value.
Definition: types.h:247
Represents a single RGBA color.
Definition: visualcolor.h:19
void SetNavGenProjAbsoluteFileName(const char *navGenProjAbsoluteFileName)
Sets the navGenProj absolute fileName this is only used to implement GetAbsolutePath() set generatorI...
void SetDatabaseIndex(KyUInt32 dabaseIndex)
Set and get the database name and index for current generation.
String m_genIOFilename
.GenIO file to use based on the specified outputDir, m_generatorParams and m_generatorRunOptions will...
Definition: NavGenProjConfig.h:53
KyResult AddTagVolume(const Vec3f *polylinePoints, int pointArraySize, const DynamicNavTag &navTag, float minAltitude, float maxAltitude)
Adds a new tag volume to the NavGenProj.
An instance of this class is used to represent each input geometry file in a NavGenProj.
Definition: NavGenProjSector.h:27
This class defines a two-dimensional vector whose coordinates are stored using 32-bit integers...
Definition: vec2i.h:26
Definition: gamekitcrowddispersion.h:20
The KyGuid class represents a globally unique ID.
Definition: kyguid.h:22
KyResult Load(const char *fileName)
Loads the data contained in the .NavGenProj with the specfied path and file name into this NavGenProj...
The GeneratorParameters class contains configuration parameters that control the characteristics of t...
Definition: generatorparameters.h:75
void AddSpecificCellToGenerate(int posx, int posy)
If at least one specific cell is added, the generation will only generate these cells.
KyResult Generate(const char *forcedOutputBaseDir=0, const char *forcedRelativeOutputDir=0)
Generates NavData NavGenProj.
The GeneratorRunOptions class contains configuration parameters that control the way in which the Gen...
Definition: generatorrunoptions.h:49
void SetConfig(const GeneratorParameters ¶ms, const GeneratorRunOptions &runOptions, const CoordSystem &coordSystem)
Sets up the NavGenProjConfig that will be used when generating NavData from this NavGenProj.
void AddSeedPoint(float x, float y, float z)
Add a seed point to the navGenProj.
void 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 w...
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
void Clear()
Clears all information maintained by this object.
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23
Definition: mirroredobjproducer.h:24