gwnavgeneration/generator/navcellgenerator.h Source File

navcellgenerator.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_NavCellGenerator_H
10 #define GwNavGen_NavCellGenerator_H
11 
12 
17 
18 namespace Kaim
19 {
20 
21 class GeneratorSystem;
22 class DynamicRasterCell;
23 class DynamicNavRasterCell;
24 class DynamicNavCellHeightField;
25 class BoundaryGraph;
26 class InputCellBlob;
27 class GeneratorSectorBuilder;
28 class GeneratorSector;
29 class NavCellBlob;
30 class CellGenerator;
31 class NavTag;
32 
33 // NavCellGenerator is where most of the effective generation algorithms are run.
34 class NavCellGenerator
35 {
36  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
37 public:
38  NavCellGenerator(CellGenerator* cellGenerator, const KyArrayPOD<const InputCellBlob*>& inputCells);
39  ~NavCellGenerator();
40 
41  // clears all the m_dynamic temporary data ...
42  void ClearGenerationData();
43 
44  KyResult GenerateRawNavCell(BlobHandler<NavCellBlob>& handler);
45 
46  bool IsEmpty() const { return m_isEmpty; }
47 
48 private:
49  void ComputeUniqueNavTagArray();
50  void AddUniqueNavTag(const NavTag& tag);
51  KyUInt32 GetUniqueNavTagIndex(const NavTag& tag) const;
52 
53  KyResult GenerateRaster();
54  KyResult GenerateNavRaster();
55  KyResult GenerateHeightField();
56  KyResult GenerateBoundaries();
57  KyResult GenerateNavCellFromBoundaries();
58 
59  void BuildEmptyNavCellBlobIfNone();
60 
61 private:
62  // Allocated and maintained by the cellGenerator
63  CellGenerator* m_cellGenerator;
64  const KyArrayPOD<const InputCellBlob*>* m_inputCells;
65  KyArrayTLS_POD<KyUInt32> m_connexIdxToNavTagIdxArray;
66  KyArrayTLS_POD<const NavTag*> m_navTagArray; // Array of pointer is a bit weird but we have lifetime guarantees: point ot inputCells m_taggedTriangle3is m_navTag
67 
68  // dynamic (navgen) data. Allocated and maintained by the navcellGenerator
69  DynamicRasterCell* m_dynamicRaster;
70  DynamicNavRasterCell* m_dynamicNavRaster;
71  DynamicNavCellHeightField* m_navcellHeightField;
72  BoundaryGraph* m_boundaryGraph;
73 
74  bool m_isEmpty;
75 
76  BlobHandler<NavCellBlob>* m_navCellHandler;
77 };
78 
79 
80 }
81 
82 
83 #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
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