33 class IParallelForInterface;
34 class CollisionInterfaceFactory;
35 class NavMeshElementBlob;
36 class GeneratorSectorBuilder;
37 class GeneratorNavDataElement;
56 class Generator :
public RefCountBaseNTS<Generator, MemStat_NavDataGen>
60 friend class NavDataIndexBlobBuilder_FromGenerator;
74 Generator(Ptr<GeneratorInputProducer> producer,
75 Ptr<IParallelForInterface> parallelForInterface =
nullptr,
76 Ptr<ITlsAlloc> tlsAlloc =
nullptr,
77 Ptr<ICollisionInterface> collisionInterface =
nullptr);
82 Generator(Ptr<GeneratorInputProducer> producer, Ptr<IGeneratorGlue> generatorGlue);
99 void SetOutputDirectory(
const char* absoluteOutputBaseDir,
const char* relativeOutputDir);
124 const KyArray<Ptr<GeneratorSectorBuilder> >& GetSectorBuilders()
const {
return m_sectorBuilders; }
127 void ClearGeneratedData();
130 KyResult AddSector(Ptr<GeneratorSector> sector);
132 void Init(Ptr<IParallelForInterface> parallelFor, Ptr<ITlsAlloc> tlsAlloc, Ptr<ICollisionInterface> collisionInterface);
134 KyResult GenerateInit(GeneratorInputOutput& generatorInputOutput);
135 bool CheckUserConfig(
const GeneratorParameters& config)
const;
136 bool CheckSysConfig()
const;
140 void MakeGlobalGrid();
141 void MakeNavDataElements();
143 KyResult PerformSeedOrSurfaceFiltering();
144 KyResult PerformIntegrationOfTagvolumes();
145 KyResult MakeOutputBlobAggregates();
146 void ComputeStatistics();
148 KyResult UpdateAndSaveGeneratorInputOutput();
150 void AddInputCellInfosContributingToSingleGuid(
151 KyUInt32 mainIdx,
const InputCellInfoArrayAtPos* inputCellInfoArrayAtPos, InputCellInfoArrayAtPos* contributingInputCellInfoArrayAtPos);
153 bool IsGuidCompoundExclusive(
const GeneratorGuidCompound& guidCompound)
const;
154 void UpdateGeneratorInputOutput();
155 KyResult SaveGeneratorInputOutput();
156 KyResult SaveDatabaseDescriptorIndex();
158 KyResult ProduceSectorInputs_FromChangedPatchs();
159 KyResult ProduceSectorInputs_FromSectorsOverlappingWithChangedPatches();
160 KyResult ProduceSectorInputs_FromChangedSectors();
161 KyResult ProduceSectorInputs_FromSectorsOverlappingWithChangedRegularSectors();
163 void MakeNavDataElementsAtCellPos(
const InputCellInfoArrayAtPos* cellsAtPos);
164 void RemoveInputTilesTempDir();
169 void RemoveInputTilesPartTempDir();
172 Ptr<GeneratorInputProducer> m_producer;
173 Ptr<IGeneratorGlue> m_generatorGlue;
174 GeneratorSystem m_sys;
175 DefaultFileOpener m_defaultFileOpener;
176 KyArray<Ptr<GeneratorSectorBuilder> > m_sectorBuilders;
177 GeneratorSectorList m_sectorList;
178 InputCellInfoGrid m_inputCellGrid;
179 KyArray<GeneratorGuidCompound> m_exclusiveGuids;
180 GeneratorReport m_report;
181 GeneratorProfiling m_generatorProfiling;
182 KyArray<CellPos> m_patchedCellPositions;
186 template <
class OSTREAM>
189 os << KY_LOG_BIG_TITLE_BEGIN(
"",
"Generator Configuration Info");
192 os << m_sys.Config();
193 os << m_sys.RunOptions();
195 for (
KyUInt32 sectorIdx = 0; sectorIdx < m_sectorBuilders.GetCount(); ++sectorIdx)
197 os << KY_LOG_SMALL_TITLE_BEGIN(
"",
"Sector " << sectorIdx <<
" Info");
198 m_sectorBuilders[sectorIdx]->LogConfiguration(os);
199 os << KY_LOG_SMALL_TITLE_END(
"",
"Sector " << sectorIdx <<
" Info");
202 os << KY_LOG_BIG_TITLE_END(
"",
"Generator Configuration Info");
Base interface for a class that opens a file on disk.
Definition: fileopener.h:30
The GeneratorReport class encapsulates a detailed report of all activities carried out during a call ...
Definition: generatorreport.h:106
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
const GeneratorReport & GetGeneratorReport() const
Retrieves a detailed record of the results of the last call to Generate().
Definition: generator.h:116
KyResult Generate(GeneratorInputOutput &config)
Launch the generation of the sectors stored in config, using the config parameters and runOptions als...
Definition: generator.cpp:220
const String & GetAbsoluteOutputDirectory() const
returns absoluteOutputBaseDir/relativeOutputDir set by SetOutputDirectory()
Definition: generator.h:102
GeneratorSystem gathers everything that is global across a generation: configuration, options...
Definition: generatorsystem.h:45
The Generator is the principal class in the NavData generation system.
Definition: generator.h:56
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Navigation return code class.
Definition: types.h:108
const GeneratorProfiling & GetGeneratorProfiling() const
Get some profiling information about the time taken by the various steps of the generation.
Definition: generator.h:119
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Generator(Ptr< GeneratorInputProducer > producer, Ptr< IParallelForInterface > parallelForInterface=nullptr, Ptr< ITlsAlloc > tlsAlloc=nullptr, Ptr< ICollisionInterface > collisionInterface=nullptr)
Constructs a new Generator initialized with the provided information.
Definition: generator.cpp:42
void SetFileOpener(FileOpenerBase *fileOpener)
Sets the Kaim::FileOpenerBase derived class that will be used to open any files.
Definition: generator.cpp:71
void SetOutputDirectory(const char *absoluteOutputBaseDir, const char *relativeOutputDir)
Sets the directory used for the generation.
Definition: generator.cpp:65
void LogConfiguration(OSTREAM &os)
Creates a detailed record of all configuration parameters and sector information, and writes the reco...
Definition: generator.h:187