gwnavruntime/navmesh/identifiers/stitch1to1edgelink.h Source File

stitch1to1edgelink.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 
9 // ---------- Primary contact: JUBA - secondary contact: NOBODY
10 #ifndef Navigation_Stitch1To1EdgeLink_H
11 #define Navigation_Stitch1To1EdgeLink_H
12 
14 
15 namespace Kaim
16 {
17 
19 // Stitch1To1EdgeLink
21 
22 class Stitch1To1EdgeLink
23 {
24  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
25 
26 public:
28  Stitch1To1EdgeLink();
29 
33  Stitch1To1EdgeLink(NavFloor* navFloor, KyUInt32 stitch1To1EdgeIdx);
34 
38  void Set(NavFloor* navFloor, KyUInt32 stitch1To1EdgeIdx);
39 
41  bool IsValid() const;
42 
43  void Invalidate();
44 
45  bool operator==(const Stitch1To1EdgeLink& rhs) const;
46  bool operator!=(const Stitch1To1EdgeLink& rhs) const;
47 
48  // ---------------------------------- Member Functions for valid instance ----------------------------------
51 
54  NavFloor* GetNavFloor() const;
55 
58  const NavFloorBlob* GetNavFloorBlob() const;
59 
60 public:
61  NavFloor* m_navFloor;
62  KyUInt16 m_stitch1To1EdgeIdx;
63  KyUInt16 m_correspondingOfStitch1To1Idx;
64 };
65 
66 
67 
68 KY_INLINE Stitch1To1EdgeLink::Stitch1To1EdgeLink() : m_navFloor(), m_stitch1To1EdgeIdx(KyUInt16MAXVAL), m_correspondingOfStitch1To1Idx(KyUInt16MAXVAL) {}
69 
70 KY_INLINE Stitch1To1EdgeLink::Stitch1To1EdgeLink(NavFloor* navFloor, NavHalfEdgeIdx stitch1To1EdgeIdx) :
71 m_navFloor(navFloor), m_stitch1To1EdgeIdx((CompactNavHalfEdgeIdx)stitch1To1EdgeIdx), m_correspondingOfStitch1To1Idx(KyUInt16MAXVAL) {}
72 
73 KY_INLINE void Stitch1To1EdgeLink::Set(NavFloor* navFloor, NavHalfEdgeIdx stitch1To1EdgeIdx)
74 {
75  m_navFloor = navFloor;
76  m_stitch1To1EdgeIdx = (CompactNavHalfEdgeIdx)stitch1To1EdgeIdx;
77  m_correspondingOfStitch1To1Idx = KyUInt16MAXVAL;
78 }
79 
80 KY_INLINE bool Stitch1To1EdgeLink::IsValid() const { return m_navFloor != KY_NULL && m_stitch1To1EdgeIdx != KyUInt16MAXVAL; }
81 KY_INLINE void Stitch1To1EdgeLink::Invalidate() { m_navFloor = KY_NULL; m_stitch1To1EdgeIdx = KyUInt16MAXVAL; m_correspondingOfStitch1To1Idx = KyUInt16MAXVAL; }
82 
83 KY_INLINE bool Stitch1To1EdgeLink::operator==(const Stitch1To1EdgeLink& rhs) const { return m_navFloor == rhs.m_navFloor && m_stitch1To1EdgeIdx == rhs.m_stitch1To1EdgeIdx;}
84 KY_INLINE bool Stitch1To1EdgeLink::operator!=(const Stitch1To1EdgeLink& rhs) const { return !(*this == rhs); }
85 
86 KY_INLINE NavFloor* Stitch1To1EdgeLink::GetNavFloor() const { return m_navFloor; }
87 KY_INLINE const NavFloorBlob* Stitch1To1EdgeLink::GetNavFloorBlob() const { return m_navFloor->GetNavFloorBlob(); }
88 }
89 
90 #endif //Navigation_Stitch1To1EdgeLink_H
91 
KyUInt32 NavHalfEdgeIdx
An index that uniquely identifies a single edge of a triangle within the set of edges owned by a NavF...
Definition: navmeshtypes.h:87
#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
#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