9 #ifndef GwNavGen_Generator_H
10 #define GwNavGen_Generator_H
36 class IParallelForInterface;
37 class CollisionInterfaceFactory;
38 class NavMeshElementBlob;
39 class GeneratorSectorBuilder;
40 class GeneratorNavDataElement;
59 class Generator :
public RefCountBaseNTS<Generator, MemStat_NavDataGen>
63 friend class NavDataIndexBlobBuilder_FromGenerator;
77 Ptr<ITlsAlloc> tlsAlloc = KY_NULL,
100 void SetOutputDirectory(const
char* absoluteOutputBaseDir, const
char* relativeOutputDir);
125 GeneratorSystem& Sys() {
return m_sys; }
126 const KyArray<Ptr<GeneratorSectorBuilder> >& GetSectorBuilders()
const {
return m_sectorBuilders; }
129 void ClearGeneratedData();
132 KyResult AddSector(Ptr<GeneratorSector> sector);
134 void Init(Ptr<IParallelForInterface> parallelFor, Ptr<ITlsAlloc> tlsAlloc, Ptr<ICollisionInterface> visibilityInterface);
136 KyResult GenerateInit(GeneratorInputOutput& generatorInputOutput);
138 bool CheckSysConfig()
const;
142 void MakeGlobalGrid();
143 void MakeNavDataElements();
145 KyResult PerformSeedOrSurfaceFiltering();
146 KyResult PerformIntegrationOfTagvolumes();
147 KyResult MakeOutputBlobAggregates();
148 void ComputeStatistics();
150 KyResult UpdateAndSaveGeneratorInputOutput();
152 void AddInputCellInfosContributingToSingleGuid(
153 KyUInt32 mainIdx,
const InputCellInfoArrayAtPos* inputCellInfoArrayAtPos, InputCellInfoArrayAtPos* contributingInputCellInfoArrayAtPos);
156 void UpdateGeneratorInputOutput();
157 KyResult SaveGeneratorInputOutput();
158 KyResult SaveDatabaseDescriptorIndex();
160 KyResult ProduceSectorInputs_FromChangedPatchs();
161 KyResult ProduceSectorInputs_FromSectorsOverlappingWithChangedPatches();
162 KyResult ProduceSectorInputs_FromChangedSectors();
163 KyResult ProduceSectorInputs_FromSectorsOverlappingWithChangedRegularSectors();
165 void MakeNavDataElementsAtCellPos(
const InputCellInfoArrayAtPos* cellsAtPos);
166 void RemoveInputTilesTempDir();
171 void RemoveInputTilesPartTempDir();
174 Ptr<GeneratorInputProducer> m_producer;
175 Ptr<IGeneratorGlue> m_generatorGlue;
179 GeneratorSectorList m_sectorList;
180 InputCellInfoGrid m_inputCellGrid;
183 GeneratorProfiling m_generatorProfiling;
188 template <
class OSTREAM>
191 os << KY_LOG_BIG_TITLE_BEGIN(
"",
"Generator Configuration Info");
194 os << m_sys.Config();
195 os << m_sys.RunOptions();
197 for (
KyUInt32 sectorIdx = 0; sectorIdx < m_sectorBuilders.GetCount(); ++sectorIdx)
199 os << KY_LOG_SMALL_TITLE_BEGIN(
"",
"Sector " << sectorIdx <<
" Info");
200 m_sectorBuilders[sectorIdx]->LogConfiguration(os);
201 os << KY_LOG_SMALL_TITLE_END(
"",
"Sector " << sectorIdx <<
" Info");
204 os << KY_LOG_BIG_TITLE_END(
"",
"Generator Configuration Info");
Base interface for a class that opens a file on disk.
Definition: fileopener.h:35
The GeneratorReport class encapsulates a detailed report of all activities carried out during a call ...
Definition: generatorreport.h:113
Provides an abstract base interface for an object that can treat computational jobs in parallel...
Definition: iparallelforinterface.h:43
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
const GeneratorReport & GetGeneratorReport() const
Retrieves a detailed record of the results of the last call to Generate().
Definition: generator.h:137
KyResult Generate(GeneratorInputOutput &config)
Launch the generation of the sectors stored in config, using the config parameters and runOptions als...
const String & GetAbsoluteOutputDirectory() const
returns absoluteOutputBaseDir/relativeOutputDir set by SetOutputDirectory()
Definition: generator.h:114
GeneratorSystem gathers everything that is global across a generation: configuration, options...
Definition: generatorsystem.h:46
The Generator is the principal class in the NavData generation system.
Definition: generator.h:61
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:118
#define KY_NULL
Null value.
Definition: types.h:247
An abstract interface for an object that can perform collision queries.
Definition: icollisioninterface.h:26
const GeneratorProfiling & GetGeneratorProfiling() const
Get some profiling information about the time taken by the various steps of the generation.
Definition: generator.h:140
Definition: gamekitcrowddispersion.h:20
The GeneratorParameters class contains configuration parameters that control the characteristics of t...
Definition: generatorparameters.h:75
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
Simple default implementation of an object that opens a file on disk.
Definition: fileopener.h:59
This class is a wrapper around an array of KyGuid objects.
Definition: generatorguidcompound.h:22
void SetFileOpener(FileOpenerBase *fileOpener)
Sets the Kaim::FileOpenerBase derived class that will be used to open any files.
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
void SetOutputDirectory(const char *absoluteOutputBaseDir, const char *relativeOutputDir)
Sets the directory used for the generation.
void LogConfiguration(OSTREAM &os)
Creates a detailed record of all configuration parameters and sector information, and writes the reco...
Definition: generator.h:217
Provides an abstract base interface for a class that the Generator can invoke in order to retrieve ob...
Definition: igeneratorglue.h:35