gwnavruntime/channel/bubblearray.h Source File

bubblearray.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 #ifndef Navigation_BubbleArray_H
8 #define Navigation_BubbleArray_H
9 
10 
14 
15 
16 namespace Kaim
17 {
18 
19 class World;
20 class BubbleArrayDisplayConfig;
21 
24 {
25 public:
26  BubbleArray();
27  ~BubbleArray();
28 
29  //-------------------- Array wrapping methods --------------------
30 
31  void Clear();
32  void Reserve(KyUInt32 bubbleCount);
33  void Resize(KyUInt32 bubbleCount);
34  void PushBack(const Bubble& bubble);
35  void Append(const BubbleArray& other);
36 
37  bool IsEmpty() const;
38  KyUInt32 GetCount() const;
39 
40  Bubble& At(KyUInt32 nodeIdx);
41  const Bubble& At(KyUInt32 nodeIdx) const;
42 
43  Bubble& operator[](KyUInt32 nodeIdx);
44  const Bubble& operator[](KyUInt32 nodeIdx) const;
45 
46 
47  //-------------------- Specific methods --------------------
48  void SendVisualDebug(World* world, const BubbleArrayDisplayConfig& displayConfig, const char* listBaseName = "",
49  const char* groupName = "BubbleArray", KyUInt32 visualDebugId = KyUInt32MAXVAL) const;
50 
51 private:
52  KyArray<Bubble> m_bubbleArray;
53 };
54 
55 KY_INLINE BubbleArray::BubbleArray() {}
56 KY_INLINE BubbleArray::~BubbleArray(){ Clear(); }
57 
58 KY_INLINE void BubbleArray::Clear() { m_bubbleArray.Clear(); }
59 KY_INLINE void BubbleArray::Reserve(KyUInt32 bubbleCount) { m_bubbleArray.Reserve(bubbleCount); }
60 KY_INLINE void BubbleArray::Resize(KyUInt32 bubbleCount) { m_bubbleArray.Resize(bubbleCount); }
61 KY_INLINE void BubbleArray::PushBack(const Bubble& bubble) { m_bubbleArray.PushBack(bubble); }
62 KY_INLINE void BubbleArray::Append(const BubbleArray& other) { m_bubbleArray.Append(other.m_bubbleArray); }
63 KY_INLINE bool BubbleArray::IsEmpty() const { return m_bubbleArray.IsEmpty(); }
64 KY_INLINE KyUInt32 BubbleArray::GetCount() const { return m_bubbleArray.GetCount(); }
65 KY_INLINE Bubble& BubbleArray::At(KyUInt32 nodeIdx) { return m_bubbleArray.At(nodeIdx); }
66 KY_INLINE const Bubble& BubbleArray::At(KyUInt32 nodeIdx) const { return m_bubbleArray.At(nodeIdx); }
67 KY_INLINE Bubble& BubbleArray::operator[](KyUInt32 nodeIdx) { return m_bubbleArray[nodeIdx]; }
68 KY_INLINE const Bubble& BubbleArray::operator[](KyUInt32 nodeIdx) const { return m_bubbleArray[nodeIdx]; }
69 
70 
71 class BubbleArrayPersistentDisplayListIds
72 {
73 public:
74  BubbleArrayPersistentDisplayListIds();
75  ~BubbleArrayPersistentDisplayListIds() {}
76 
77  void Initialize(World* world);
78  void Release();
79 
80 public:
81  World* m_world;
82  bool m_singleFrame;
83 
84  KyUInt32 m_displayListId_Bubbles;
85  KyUInt32 m_displayListId_BubbleIdx;
86 };
87 
88 class BubbleArrayDisplayConfig
89 {
90 public:
91  BubbleArrayDisplayConfig() { SetDefaults(); }
92 
93  void SetDefaults();
94 
95  VisualShapeColor m_bubbleColor_CCW;
96  VisualShapeColor m_bubbleColor_CW;
97  VisualColor m_bubbleIdxColor;
98 
99  KyUInt32 m_diskSubdivision;
100  KyFloat32 m_verticalOffset;
101 
102  BubbleArrayPersistentDisplayListIds m_persistentDisplayListIds;
103 };
104 
105 } // namespace Kaim
106 
107 #endif // Navigation_BubbleArray_H
This class encapsulate an array of Bubbles.
Definition: bubblearray.h:23
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:118
This class is a runtime container for Gameware Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:54
This class represents a circle with potential rotation limitation.
Definition: bubble.h:35
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
#define KyUInt32MAXVAL
The maximum value that can be stored in the KyUInt32 variable type.
Definition: types.h:226
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43