gwnavgeneration/boundary/boundaryvertex.h Source File

boundaryvertex.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
8 
10 
11 namespace Kaim
12 {
13 
14 class BoundaryEdge;
15 
16 // Internal class to BoundaryGraph.
17 // This class has no constructor for performance purpose. Be careful.
18 class BoundaryVertex
19 {
20  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
21 public:
22  void Init(const NavBoundaryPos& pos, KyFloat32 altitude, KyUInt32 index);
23 
24  void ComputeStaticStatus();
25 
26  bool IsStatic() const { return m_staticStatus == BoundaryVertexStaticStatus_Static; }
27 
28  bool IsDiscontinuity() const { return m_staticStatus == BoundaryVertexStaticStatus_FeatureDiscontinuity; }
29 
30  bool IsNextToDiscontinuity() const;
31 
32  const ExclBoundaryPos& Pos() const { return m_exclBoundaryPos; }
33 
34  // needed in NavFloorBuilder (find())
35  bool operator==(const BoundaryVertex& rhs) const
36  {
37  return rhs.m_exclBoundaryPos == m_exclBoundaryPos && rhs.m_altitude == m_altitude && rhs.m_index == m_index;
38  }
39 
40  bool operator!=(const BoundaryVertex& rhs) const { return !(*this == rhs); }
41 
42 public:
43  ExclBoundaryPos m_exclBoundaryPos; // relative to exclusivePixelBox
44  KyFloat32 m_altitude;
45 
46  // m_ins // m_outs //
47  // | // ^ //
48  // 3 // 1 //
49  // v // | //
50  // --0-> V <-2-- // <-2---V---0-> //
51  // ^ // | //
52  // 1 // 3 //
53  // | // v //
54 
55  BoundaryEdge* m_ins[4];
56  BoundaryEdge* m_outs[4];
57 
58  BoundaryVertexStaticStatus m_staticStatus;
59  KyUInt32 m_index;
60 };
61 
62 } // namespace Kaim
63 
64 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
float KyFloat32
float
Definition: types.h:32