gwnavgeneration/generator/cellgenerator.h Source File

cellgenerator.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_CellGenerator_H
10 #define GwNavGen_CellGenerator_H
11 
12 
20 
21 
22 namespace Kaim
23 {
24 
25 class GeneratorSystem;
26 class GeneratorNavDataElement;
27 class NavCellBlob;
28 
29 // Gathers inputs (array of InputCellBlob) and outputs (NavCellBlob) that are involved in the ("non-filtered" aka "Raw") NavCell Generation.
30 // CellGenerator are created just before calling the Generator parallel_for, and are discarded just after.
31 class CellGenerator
32 {
33  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavDataGen)
34 
35 public:
36  CellGenerator() : m_sys(KY_NULL), m_navCellHandler(KY_NULL) {}
37 
38  void Init(GeneratorSystem* sys, const CellPos& cellPos, BlobHandler<NavCellBlob>* navCellHandler);
39 
40  void ReserveInputCellArray(KyUInt32 count) { m_inputCells.Reserve(count); }
41 
42  void AddInputCell(const InputCellBlob* inputCellBlob) { m_inputCells.PushBack(inputCellBlob); }
43 
44  // GenerateRawNavCell() is the function in m_sys->m_parallelForInterface->ParallelFor()
45  KyResult GenerateRawNavCell();
46 
47  const CellDesc& Desc() const { return m_cellDesc; }
48  GeneratorSystem* Sys() { return m_sys; }
49  CellGeneratorProfiling& CellProfiling() { return m_cellProfiling; }
50 
51 public:
52  GeneratorSystem* m_sys;
53  CellDesc m_cellDesc;
54  KyArrayPOD<const InputCellBlob*> m_inputCells; // input
55  BlobHandler<NavCellBlob>* m_navCellHandler; // output
56  CellGeneratorProfiling m_cellProfiling;
57 };
58 
59 
60 }
61 
62 
63 #endif
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
Vec2i CellPos
A type that represents the position of a cell within a 2D grid.
Definition: navmeshtypes.h:33
#define KY_NULL
Null value.
Definition: types.h:247
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36