gwnavgeneration/generator/generatorrunoptions.h Source File

generatorrunoptions.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 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 
8 // primary contact: GUAL - secondary contact: LASI
9 #ifndef GwNavGen_GeneratorRunOptions_H
10 #define GwNavGen_GeneratorRunOptions_H
11 
12 
22 
23 
24 namespace Kaim
25 {
26 
27 class BlobAggregate;
28 
29 
30 class GeneratorRunOptionsBlob
31 {
32  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
33  KY_ROOT_BLOB_CLASS(Generator, GeneratorRunOptionsBlob, 0)
34  KY_CLASS_WITHOUT_COPY(GeneratorRunOptionsBlob)
35 public:
36  GeneratorRunOptionsBlob() {}
37  BlobFieldArray m_fields;
38 };
39 inline void SwapEndianness(Endianness::Target e, GeneratorRunOptionsBlob& self)
40 {
41  SwapEndianness(e, self.m_fields);
42 }
43 
44 
48 class GeneratorRunOptions
49 {
50  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
51 
52 public:
53  enum { Version = 0 };
54 
55 public:
57  void Clear();
58  void SetDefaultValues() { Clear(); }
59 
62 
65 
68  void AddCellToBuild(const CellPos& pos) { m_intermediateFiles.Add(pos); }
69 
73 
75  bool DoReallyUseVisualDebug() const { return !DoReallyUseMultiCore() && m_visualDebugOptions.IsActive(); }
76 
77  void BuildBlob(BlobHandler<GeneratorRunOptionsBlob>& handler) const;
78  KyResult ReadBlob(const GeneratorRunOptionsBlob& blob);
79  KyResult ReadFromAggregate(BlobAggregate& aggregate);
80 
81  void InitBlobFieldsMapping(BlobFieldsMapping& mapping);
82  void InitBlobFieldsMapping(BlobFieldsMapping& mapping) const;
83 
84 public:
89 
94 
98 
101  bool m_doMultiCore;
102 
106 
110 
117 
122 
128 
132 
135  bool m_doProfile;
141 
145  bool m_doLogReport;
146 
150 
157  bool m_doLogProgress;
160  GeneratorVisualDebugOptions m_visualDebugOptions;
161 
164 };
165 
166 template <class OSTREAM>
167 inline OSTREAM& operator<<(OSTREAM& os, GeneratorRunOptions& runOptions)
168 {
169  os << KY_LOG_SMALL_TITLE_BEGIN("", "GeneratorRunOptions");
170 
171  os << "generationRevision : " << runOptions.m_generationRevision << Endl;
172  os << "doSaveGeneratorInputOutput : " << runOptions.m_doSaveGeneratorInputOutput << Endl;
173  os << "generatorInputOuputSaveFileName : " << runOptions.m_generatorInputOuputSaveFileName << Endl;
174  os << "doMultiCore : " << runOptions.m_doMultiCore << Endl;
175  os << "doWriteNavDataFiles : " << runOptions.m_doWriteNavDataFiles << Endl;
176  os << "doWriteColDataFiles : " << runOptions.m_doWriteColDataFiles << 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 #endif // GwNavGen_GeneratorRunOptions_H
206 
bool DoReallyUseMultiCore() const
Indicates whether or not the Generator will actually use parallel processing.
Definition: generatorrunoptions.h:75
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
KyUInt32 m_limitedMemoryModeTileSizeInNbCells
Size of the internally used tiles for large scale generations and/or running generation with low memo...
Definition: generatorrunoptions.h:130
String m_generatorInputOuputSaveFileName
FileName of the saved GeneratorInputOutput.
Definition: generatorrunoptions.h:103
bool DoReallyUseVisualDebug() const
For internal use.
Definition: generatorrunoptions.h:78
void Clear()
Reset members as if the object was freshly constructed.
GeneratorVisualDebugOptions m_visualDebugOptions
For internal use. Do not modify.
Definition: generatorrunoptions.h:169
bool m_doWriteColDataFiles
Determines whether or not .ColData files are written.
Definition: generatorrunoptions.h:115
The BlobHandler class is a top-level mechanism for serializing blobs between objects in memory and fi...
Definition: blobhandler.h:45
IntermediateFilesConfig m_intermediateFiles
Contains configuration parameters that relate to the generation of intermediate data files...
Definition: generatorrunoptions.h:172
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
KyUInt32 m_outputFilesEndianness
Determines the endianness of the final output files.
Definition: generatorrunoptions.h:136
void AddCellToBuild(const CellPos &pos)
Restricts NavData generation to the specified cell, and generates intermediate data for that cell...
Definition: generatorrunoptions.h:71
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
bool m_doLogReportDetails
Determines whether or not the Generator will log verbose details in its report for each run...
Definition: generatorrunoptions.h:158
bool m_doLogReport
Determines whether or not the Generator will log a report the results of each run.
Definition: generatorrunoptions.h:154
This class provides information about Gameware Navigation version.
Definition: version.h:20
const IntermediateFilesConfig & Intermediates() const
Read accessor for m_intermediateFiles.
Definition: generatorrunoptions.h:64
bool m_doLogPerSectorReport
Determines whether or not the Generator will log per Sector information in its report for each run...
Definition: generatorrunoptions.h:162
KyUInt32 m_generationRevision
Incremented each time a Generator operates on the GeneratorInputOutput.
Definition: generatorrunoptions.h:93
bool m_doLogProgress
Determines whether or not the Generator will log the progress of the Generation, useful from very lon...
Definition: generatorrunoptions.h:166
bool IsEnabled() const
Returns true if at least one intermediate file is to be created.
Definition: intermediatefilesconfig.h:39
This class defines a two-dimensional vector whose coordinates are stored using 32-bit integers...
Definition: vec2i.h:26
Definition: gamekitcrowddispersion.h:20
bool m_doEnableLimitedMemoryMode
Determines whether or not the input geometry consumption is buffered to avoid exceeding the memory li...
Definition: generatorrunoptions.h:124
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
BaseBlobBuilder is an abstract base class that builds a blob within a contiguous block of memory...
Definition: baseblobbuilder.h:30
The GeneratorRunOptions class contains configuration parameters that control the way in which the Gen...
Definition: generatorrunoptions.h:49
bool m_doSaveGeneratorInputOutput
Determines whether or not the Generator saves the GeneratorInputOutput content.
Definition: generatorrunoptions.h:99
bool m_doWriteNavDataFiles
Determines whether or not .NavData files are written.
Definition: generatorrunoptions.h:111
The IntermediateFilesConfig class is used by GeneratorRunOptions to store configuration parameters th...
Definition: intermediatefilesconfig.h:23
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
bool m_doUseTlsIfAvailable
Determines whether or not the Generator uses thread local storage when an ITlsAlloc object is provide...
Definition: generatorrunoptions.h:140
void SetDefaultValues()
alias for Clear()
Definition: generatorrunoptions.h:61
bool m_doLogConfiguration
Determines whether or not the Generator will log its configuration parameters in its report for each ...
Definition: generatorrunoptions.h:149
bool m_doProfile
Determines whether or not the Generator will profile its CPU performance.
Definition: generatorrunoptions.h:144
bool m_doMultiCore
Determines whether or not the NavData generation system spreads computations across all available CPU...
Definition: generatorrunoptions.h:107