gwnavruntime/navgraph/blobs/navgrapharray.h Source File

navgrapharray.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: LASI - secondary contact: GUAL
9 #ifndef Navigation_NavGraphArray_H
10 #define Navigation_NavGraphArray_H
11 
13 
14 namespace Kaim
15 {
16 
17 class NavGraphArray
18 {
19  KY_ROOT_BLOB_CLASS(NavData, NavGraphArray, 0)
20  KY_CLASS_WITHOUT_COPY(NavGraphArray)
21 
22 public:
23  NavGraphArray() {}
24 
25  KyUInt32 ComputeVertexCount() const
26  {
27  KyUInt32 count = 0;
28  const BlobRef<NavGraphBlob>* navGraphs = m_navGraphs.GetValues();
29  for (KyUInt32 graphIdx = 0; graphIdx < m_navGraphs.GetCount(); ++graphIdx)
30  {
31  count += navGraphs[graphIdx].Ptr()->GetVertexCount();
32  }
33  return count;
34  }
35 
36  KyUInt32 ComputeEdgeCount() const
37  {
38  KyUInt32 count = 0;
39  const BlobRef<NavGraphBlob>* navGraphs = m_navGraphs.GetValues();
40  for (KyUInt32 graphIdx = 0; graphIdx < m_navGraphs.GetCount(); ++graphIdx)
41  {
42  count += navGraphs[graphIdx].Ptr()->GetEdgeCount();
43  }
44  return count;
45  }
46 
47  KyUInt32 ComputeNavTagCount() const
48  {
49  KyUInt32 count = 0;
50  const BlobRef<NavGraphBlob>* navGraphs = m_navGraphs.GetValues();
51  for (KyUInt32 graphIdx = 0; graphIdx < m_navGraphs.GetCount(); ++graphIdx)
52  {
53  count += navGraphs[graphIdx].Ptr()->GetNavTagCount();
54  }
55  return count;
56  }
57 
58  KyUInt32 ComputeVertexToConnectCount() const
59  {
60  KyUInt32 count = 0;
61  const BlobRef<NavGraphBlob>* navGraphs = m_navGraphs.GetValues();
62  for (KyUInt32 graphIdx = 0; graphIdx < m_navGraphs.GetCount(); ++graphIdx)
63  {
64  count += navGraphs[graphIdx].Ptr()->GetVertexToConnectCount();
65  }
66  return count;
67  }
68 
69 public:
70  KyUInt32 m_visualDebugId;
71  KyUInt32 m_databaseIndex;
72  BlobArray<BlobRef<NavGraphBlob> > m_navGraphs;
73 };
74 inline void SwapEndianness(Endianness::Target e, NavGraphArray& self)
75 {
76  SwapEndianness(e, self.m_visualDebugId);
77  SwapEndianness(e, self.m_databaseIndex);
78  SwapEndianness(e, self.m_navGraphs);
79 }
80 
81 } // namespace Kaim
82 
83 
84 #endif // Navigation_NavGraphArray_H
85 
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36