gwnavruntime/navgraph/navgraphlink.h Source File

navgraphlink.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: JUBA - secondary contact: LAPA
9 
10 #ifndef Navigation_NavGraphLink_H
11 #define Navigation_NavGraphLink_H
12 
16 
17 namespace Kaim
18 {
19 
20 class NavGraphLink
21 {
22  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
23 
24 public:
25  NavGraphLink(const NavGraphVertexRawPtr& navGraphVertexRawPtr);
26 
27  void Set(const NavTriangleRawPtr& triangleRawPtr);
28 
29  bool IsValid() const { return GetIndexInCollection() != KyUInt16MAXVAL; }
30 
31  KyUInt32 GetIndexInCollection() const;
32  void SetIndexInCollection(KyUInt32 indexInCollection);
33 
34 public:
35  KyUInt16 m_indexInFloorCollection; // for remove O(1) in the collection of the NavFloor
36 
37  NavGraphVertexRawPtr m_navGraphVertexRawPtr;
38  NavTriangleRawPtr m_navTriangleRawPtr;
39 };
40 
41 KY_INLINE NavGraphLink::NavGraphLink(const NavGraphVertexRawPtr& navGraphVertexRawPtr) :
42  m_indexInFloorCollection(KyUInt16MAXVAL),
43  m_navGraphVertexRawPtr(navGraphVertexRawPtr)
44 {}
45 
46 KY_INLINE void NavGraphLink::Set(const NavTriangleRawPtr& triangleRawPtr) { m_navTriangleRawPtr = triangleRawPtr; }
47 
48 KY_INLINE KyUInt32 NavGraphLink::GetIndexInCollection() const { return m_indexInFloorCollection; }
49 KY_INLINE void NavGraphLink::SetIndexInCollection(KyUInt32 indexInCollection) { m_indexInFloorCollection = (KyUInt16)indexInCollection; }
50 
51 }
52 
53 #endif // Navigation_NavGraphLink_H
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
#define KyUInt16MAXVAL
The maximum value that can be stored in the KyUInt16 variable type.
Definition: types.h:230
unsigned short KyUInt16
Type used internally to represent an unsigned 16-bit integer.
Definition: types.h:40
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36