gwnavgeneration/generator/generatorrunoptions.h Source File

generatorrunoptions.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 #pragma once
8 
18 
19 namespace Kaim
20 {
21 
22 class BlobAggregate;
23 
24 
25 class GeneratorRunOptionsBlob
26 {
27  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
28  KY_ROOT_BLOB_CLASS(Generator, GeneratorRunOptionsBlob, 0)
29  KY_CLASS_WITHOUT_COPY(GeneratorRunOptionsBlob)
30 public:
31  GeneratorRunOptionsBlob() {}
32  BlobFieldArray m_fields;
33 };
34 inline void SwapEndianness(Endianness::Target e, GeneratorRunOptionsBlob& self)
35 {
36  SwapEndianness(e, self.m_fields);
37 }
38 
39 
44 {
45  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
46 
47 public:
48  enum { Version = 0 };
49 
50 public:
52  void Clear();
53  void SetDefaultValues() { Clear(); }
54 
57 
60 
63  void AddCellToBuild(const CellPos& pos) { m_intermediateFiles.Add(pos); }
64 
68 
70  bool DoReallyUseVisualDebug() const { return !DoReallyUseMultiCore() && m_visualDebugOptions.IsActive(); }
71 
72  void BuildBlob(BlobHandler<GeneratorRunOptionsBlob>& handler) const;
73  KyResult ReadBlob(const GeneratorRunOptionsBlob& blob);
74  KyResult ReadFromAggregate(BlobAggregate& aggregate);
75 
76  void InitBlobFieldsMapping(BlobFieldsMapping& mapping);
77  void InitBlobFieldsMapping(BlobFieldsMapping& mapping) const;
78 
79 public:
84 
89 
93 
97 
101 
105 
109 
116 
121 
127 
131 
135 
140 
145 
149 
153 
157 
159  GeneratorVisualDebugOptions m_visualDebugOptions;
160 
163 };
164 
165 template <class OSTREAM>
166 inline OSTREAM& operator<<(OSTREAM& os, GeneratorRunOptions& runOptions)
167 {
168  os << KY_LOG_SMALL_TITLE_BEGIN("", "GeneratorRunOptions");
169 
170  os << "generationRevision : " << runOptions.m_generationRevision << Endl;
171  os << "doSaveGeneratorInputOutput : " << runOptions.m_doSaveGeneratorInputOutput << Endl;
172  os << "generatorInputOuputSaveFileName : " << runOptions.m_generatorInputOuputSaveFileName << Endl;
173  os << "doMultiCore : " << runOptions.m_doMultiCore << Endl;
174  os << "doWriteNavDataFiles : " << runOptions.m_doWriteNavDataFiles << Endl;
175  os << "doWriteColDataFiles : " << runOptions.m_doWriteColDataFiles << Endl;
176  os << "doWriteDataIndexFile : " << runOptions.m_doWriteDataIndexFile << Endl;
177  os << "doEnableLimitedMemoryMode : " << runOptions.m_doEnableLimitedMemoryMode << Endl;
178  os << "limitedMemoryModeTileSizeInNbCells : " << runOptions.m_limitedMemoryModeTileSizeInNbCells << Endl;
179  os << "outputFilesEndianness : " << runOptions.m_outputFilesEndianness << Endl;
180  os << "doUseTlsIfAvailable : " << runOptions.m_doUseTlsIfAvailable << Endl;
181  os << "doProfile : " << runOptions.m_doProfile << Endl;
182  os << "doLogConfiguration : " << runOptions.m_doLogConfiguration << Endl;
183  os << "doLogReport : " << runOptions.m_doLogReport << Endl;
184  os << "doLogReportDetails : " << runOptions.m_doLogReportDetails << Endl;
185  os << "doLogPerSectorReport : " << runOptions.m_doLogPerSectorReport << Endl;
186 
187  os << KY_LOG_SMALL_TITLE_END("", "GeneratorRunOptions");
188 
189  return os;
190 }
191 
192 
193 class GeneratorRunOptionsBlobBuilder : public BaseBlobBuilder<GeneratorRunOptionsBlob>
194 {
195 public:
196  GeneratorRunOptionsBlobBuilder(const GeneratorRunOptions* runOptions) : m_runOptions(runOptions) {}
197 private:
198  virtual void DoBuild();
199  const GeneratorRunOptions* m_runOptions;
200 };
201 
202 
203 } // namespace Kaim
204 
205 
bool DoReallyUseMultiCore() const
Indicates whether or not the Generator will actually use parallel processing.
Definition: generatorrunoptions.h:67
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
KyUInt32 m_limitedMemoryModeTileSizeInNbCells
Size of the internally used tiles for large scale generations and/or running generation with low memo...
Definition: generatorrunoptions.h:120
String m_generatorInputOuputSaveFileName
FileName of the saved GeneratorInputOutput.
Definition: generatorrunoptions.h:92
bool DoReallyUseVisualDebug() const
For internal use.
Definition: generatorrunoptions.h:70
void Clear()
Reset members as if the object was freshly constructed.
Definition: generatorrunoptions.cpp:21
GeneratorVisualDebugOptions m_visualDebugOptions
For internal use. Do not modify.
Definition: generatorrunoptions.h:159
bool m_doWriteColDataFiles
Determines whether or not .ColData files are written.
Definition: generatorrunoptions.h:104
The BlobHandler class is a top-level mechanism for serializing blobs between objects in memory and fi...
Definition: blobhandler.h:40
IntermediateFilesConfig m_intermediateFiles
Contains configuration parameters that relate to the generation of intermediate data files...
Definition: generatorrunoptions.h:162
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
KyUInt32 m_outputFilesEndianness
Determines the endianness of the final output files.
Definition: generatorrunoptions.h:126
void AddCellToBuild(const CellPos &pos)
Restricts NavData generation to the specified cell, and generates intermediate data for that cell...
Definition: generatorrunoptions.h:63
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
bool m_doWriteDataIndexFile
Determines whether or not the .DataIndex file is written.
Definition: generatorrunoptions.h:108
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
bool m_doLogReportDetails
Determines whether or not the Generator will log verbose details in its report for each run...
Definition: generatorrunoptions.h:148
bool m_doLogReport
Determines whether or not the Generator will log a report the results of each run.
Definition: generatorrunoptions.h:144
This class provides information about Autodesk Navigation version.
Definition: version.h:17
const IntermediateFilesConfig & Intermediates() const
Read accessor for m_intermediateFiles.
Definition: generatorrunoptions.h:56
bool m_doLogPerSectorReport
Determines whether or not the Generator will log per Sector information in its report for each run...
Definition: generatorrunoptions.h:152
KyUInt32 m_generationRevision
Incremented each time a Generator operates on the GeneratorInputOutput.
Definition: generatorrunoptions.h:83
Navigation return code class.
Definition: types.h:108
bool m_doLogProgress
Determines whether or not the Generator will log the progress of the Generation, useful from very lon...
Definition: generatorrunoptions.h:156
bool IsEnabled() const
Returns true if at least one intermediate file is to be created.
Definition: intermediatefilesconfig.h:33
2d vector using KyInt32
Definition: vec2i.h:18
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
bool m_doEnableLimitedMemoryMode
Determines whether or not the input geometry consumption is buffered to avoid exceeding the memory li...
Definition: generatorrunoptions.h:115
IntermediateFilesConfig & Intermediates()
Const read accessor for m_intermediateFiles.
Definition: generatorrunoptions.h:59
The GeneratorRunOptions class contains configuration parameters that control the way in which the Gen...
Definition: generatorrunoptions.h:43
bool m_doSaveGeneratorInputOutput
Determines whether or not the Generator saves the GeneratorInputOutput content.
Definition: generatorrunoptions.h:88
bool m_doWriteNavDataFiles
Determines whether or not .NavData files are written.
Definition: generatorrunoptions.h:100
The IntermediateFilesConfig class is used by GeneratorRunOptions to store configuration parameters th...
Definition: intermediatefilesconfig.h:18
bool m_doUseTlsIfAvailable
Determines whether or not the Generator uses thread local storage when an ITlsAlloc object is provide...
Definition: generatorrunoptions.h:130
void SetDefaultValues()
alias for Clear()
Definition: generatorrunoptions.h:53
bool m_doLogConfiguration
Determines whether or not the Generator will log its configuration parameters in its report for each ...
Definition: generatorrunoptions.h:139
bool m_doProfile
Determines whether or not the Generator will profile its CPU performance.
Definition: generatorrunoptions.h:134
bool m_doMultiCore
Determines whether or not the NavData generation system spreads computations across all available CPU...
Definition: generatorrunoptions.h:96