gwnavgeneration/boundary/boundaryvertex.h Source File

boundaryvertex.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 
10 
11 // primary contact: GUAL - secondary contact: NOBODY
12 #ifndef GwNavGen_BoundaryVertex_H
13 #define GwNavGen_BoundaryVertex_H
14 
16 
17 namespace Kaim
18 {
19 
20 class BoundaryEdge;
21 
22 /*
23 Internal class to BoundaryGraph.
24 This class has no constructor for performance purpose. Be careful.
25 */
26 class BoundaryVertex
27 {
28  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
29 public:
30  void Init(const NavBoundaryPos& pos, KyFloat32 altitude, KyUInt32 index);
31 
32  void ComputeStaticStatus();
33 
34  bool IsStatic() const;
35  bool IsDiscontinuity() const;
36  bool IsNextToDiscontinuity() const;
37 
38  const ExclBoundaryPos& Pos() const;
39 
40  //needed in NavFloorBuilder (find())
41  bool operator==(const BoundaryVertex& rhs) const;
42  bool operator!=(const BoundaryVertex& rhs) const;
43 
44 public:
45  ExclBoundaryPos m_exclBoundaryPos; // relative to exclusivePixelBox
46  KyFloat32 m_altitude;
47 
48  /* |
49  // 3
50  // \/
51  // --0-> V < 2--
52  // /\
53  // 1
54  // |
55  */
56  BoundaryEdge* m_ins[4];
57 
58  /* /\
59  // 1
60  // |
61  // <-2---V---0->
62  // |
63  // 3
64  // \/
65  */
66  BoundaryEdge* m_outs[4];
67 
68  BoundaryVertexStaticStatus m_staticStatus;
69  KyUInt32 m_index;
70 };
71 
72 KY_INLINE bool BoundaryVertex::IsStatic() const { return m_staticStatus == BoundaryVertexStaticStatus_Static /*|| IsDiscontinuity()*/; }
73 KY_INLINE bool BoundaryVertex::IsDiscontinuity() const { return m_staticStatus == BoundaryVertexStaticStatus_FeatureDiscontinuity; }
74 KY_INLINE const ExclBoundaryPos& BoundaryVertex::Pos() const { return m_exclBoundaryPos; }
75 KY_INLINE bool BoundaryVertex::operator!=(const BoundaryVertex& rhs) const { return !(*this == rhs); }
76 KY_INLINE bool BoundaryVertex::operator==(const BoundaryVertex& rhs) const
77 {
78  return rhs.m_exclBoundaryPos == m_exclBoundaryPos && rhs.m_altitude == m_altitude && rhs.m_index == m_index;
79 }
80 
81 
82 } // namespace Kaim
83 
84 
85 #endif
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
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43