12 #ifndef GwNavGen_BoundarySimplifyPolyline_H
13 #define GwNavGen_BoundarySimplifyPolyline_H
25 class BoundarySimplifyVertex
29 BoundarySimplifyVertex() : m_vertex(
KY_NULL), m_inSmallEdge(KY_NULL), m_outSmallEdge(KY_NULL) {}
31 BoundarySimplifyVertex(BoundaryEdge* inSmallEdge, BoundaryVertex* vertex, BoundaryEdge* outSmallEdge)
33 m_pos.x = (
KyFloat32)vertex->m_exclBoundaryPos.x;
34 m_pos.y = (
KyFloat32)vertex->m_exclBoundaryPos.y;
35 m_pos.z = vertex->m_altitude;
37 m_inSmallEdge = inSmallEdge;
38 m_outSmallEdge = outSmallEdge;
43 BoundaryVertex* m_vertex;
44 BoundaryEdge* m_inSmallEdge;
45 BoundaryEdge* m_outSmallEdge;
48 typedef SharedPoolList<BoundarySimplifyVertex>::NodePool BoundaryVertexPool;
49 typedef SharedPoolList<BoundarySimplifyVertex> BoundaryVertexList;
50 typedef SharedPoolList<BoundarySimplifyVertex>::Iterator BoundaryVertexListIterator;
51 typedef SharedPoolList<BoundarySimplifyVertex>::ConstIterator BoundaryVertexListConstIterator;
53 class BoundarySimplifyPolyline
57 typedef BoundarySimplifyVertex Vertex;
60 BoundarySimplifyPolyline(BoundaryVertexPool* pool) : m_vertices(pool)
62 Init(
KyUInt32MAXVAL, ContourWinding_Unset, BoundaryEdgeType_Unset, PolylineCycleStatus_Unset);
65 void Init(
KyUInt32 index, ContourWinding contourWinding, BoundaryEdgeType edgeType, BoundaryPolylineCycleStatus cycle)
68 m_contourWinding = contourWinding;
69 m_edgeType = edgeType;
71 m_cycleStatus = cycle;
75 void AddVertex(BoundaryEdge* inEdge, BoundaryVertex* vertex, BoundaryEdge* outEdge)
77 BoundarySimplifyVertex simplifyVertex(inEdge, vertex, outEdge);
78 m_vertices.PushBack(simplifyVertex);
81 PutEdgeInPolyline(inEdge);
84 PutEdgeInPolyline(outEdge);
87 void PutEdgeInPolyline(BoundaryEdge* edge)
89 edge->m_simplifyPolyline =
this;
90 edge->m_simplifyPolylineOrder = BoundaryOrder_Straight;
94 edge->m_pair->m_simplifyPolyline =
this;
95 edge->m_pair->m_simplifyPolylineOrder = BoundaryOrder_Reverse;
101 BoundaryVertexList m_vertices;
102 ContourWinding m_contourWinding;
103 BoundaryEdgeType m_edgeType;
104 BoundaryPolylineCycleStatus m_cycleStatus;
105 BoundarySimplifyPolyline* m_next;
#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
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
#define KyUInt32MAXVAL
The maximum value that can be stored in the KyUInt32 variable type.
Definition: types.h:226
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43