gwnavgeneration/boundary/boundaryedge.h Source File

boundaryedge.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 
12 
13 namespace Kaim
14 {
15 
16 class BoundaryVertex;
17 class BoundaryPixel;
18 class BoundaryContour;
19 class BoundarySimplifyPolyline;
20 class BoundarySimplifiedEdge;
21 
22 class BoundaryEdge
23 {
24  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
25 public:
26  void Init(CardinalDir dir, BoundaryEdgeType type, bool isInside, KyUInt32 leftColor, KyUInt32 leftNavTagIdx, KyUInt32 index);
27 
28  void ComputeNextEdge();
29 
30  bool IsInContour() const { return m_contour != nullptr; }
31 
32  bool IsOutside() const { return m_isOutside; }
33 
34  bool HasDiscontinuityVertex() const
35  {
36  return (m_vertex[0] != nullptr && m_vertex[0]->IsDiscontinuity()) ||
37  (m_vertex[1] != nullptr && m_vertex[1]->IsDiscontinuity());
38  }
39 
40 public:
41  KyUInt32 m_index;
42 
43  CardinalDir m_orientation;
44  BoundaryEdgeType m_type;
45  BoundaryVertex* m_vertex[2];
46  KyUInt32 m_leftColor;
47  KyUInt32 m_leftConnexIdx;
48  bool m_isOutside;
49  BoundaryEdge* m_pair;
50 
51  // contour related
52  BoundaryContour* m_contour;
53  BoundaryEdge* m_next;
54 
55  // simplifyPolyline related
56  BoundarySimplifyPolyline* m_simplifyPolyline;
57  BoundaryOrder m_simplifyPolylineOrder;
58 
59  // simplifiedEdge related
60  BoundarySimplifiedEdge* m_simplifiedEdge;
61 };
62 
63 
64 KY_INLINE void BoundaryEdge::Init(CardinalDir dir, BoundaryEdgeType type, bool isOutside, KyUInt32 leftColor, KyUInt32 leftNavTagIdx, KyUInt32 index)
65 {
66  m_index = index;
67  m_orientation = dir;
68  m_type = type;
69  m_vertex[0] = nullptr;
70  m_vertex[1] = nullptr;
71  m_leftColor = leftColor;
72  m_leftConnexIdx = leftNavTagIdx;
73  m_isOutside = isOutside;
74  m_pair = nullptr;
75  m_contour = nullptr;
76  m_next = nullptr;
77  m_simplifyPolyline = nullptr;
78  m_simplifyPolylineOrder = BoundaryOrder_Unset;
79  m_simplifiedEdge = nullptr;
80 }
81 
82 }
83 
84 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
KyUInt32 CardinalDir
Defines a type that refers to one of the cardinal points on the compass:
Definition: cardinaldir.h:15
#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