gwnavgeneration/generator/cellgenerator.h Source File

cellgenerator.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 
8 #pragma once
9 
10 
18 
19 
20 namespace Kaim
21 {
22 
23 class GeneratorSystem;
24 class GeneratorNavDataElement;
25 class NavCellBlob;
26 
27 // Gathers inputs (array of InputCellBlob) and outputs (NavCellBlob) that are involved in the ("non-filtered" aka "Raw") NavCell Generation.
28 // CellGenerator are created just before calling the Generator parallel_for, and are discarded just after.
29 class CellGenerator
30 {
31  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavDataGen)
32 
33 public:
34  CellGenerator() : m_sys(nullptr), m_navCellHandler(nullptr) {}
35 
36  void Init(GeneratorSystem* sys, const CellPos& cellPos, BlobHandler<NavCellBlob>* navCellHandler);
37 
38  void ReserveInputCellArray(KyUInt32 count) { m_inputCells.Reserve(count); }
39 
40  void AddInputCell(const InputCellBlob* inputCellBlob) { m_inputCells.PushBack(inputCellBlob); }
41 
42  // GenerateRawNavCell() is the function in m_sys->m_parallelForInterface->ParallelFor()
43  KyResult GenerateRawNavCell();
44 
45  const CellDesc& Desc() const { return m_cellDesc; }
46  GeneratorSystem* Sys() { return m_sys; }
47  CellGeneratorProfiling& CellProfiling() { return m_cellProfiling; }
48 
49 public:
50  GeneratorSystem* m_sys;
51  CellDesc m_cellDesc;
52  KyArrayPOD<const InputCellBlob*> m_inputCells; // input
53  BlobHandler<NavCellBlob>* m_navCellHandler; // output
54  CellGeneratorProfiling m_cellProfiling;
55 };
56 
57 
58 }
59 
60 
Vec2i CellPos
A type that represents the position of a cell within a 2D grid.
Definition: navmeshtypes.h:30
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#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
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17