gwnavgeneration/boundary/boundarysimplifiedpolygon.h Source File

boundarysimplifiedpolygon.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_BoundarySimplifiedPolygon_H
13 #define GwNavGen_BoundarySimplifiedPolygon_H
14 
15 
19 
20 
21 namespace Kaim
22 {
23 
24 class BoundaryEdge;
25 class BoundaryVertex;
26 class BoundarySimplifiedContour;
27 class BoundarySimplifiedEdge;
28 class DynamicNavHalfEdge;
29 
30 class BoundarySimplifiedPolygon
31 {
32  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
33 public:
34  BoundarySimplifiedPolygon() : m_leftColor(PixelColor_Unset) {}
35 
36 public:
37  PixelColor m_leftColor;
38  KyArrayTLS_POD<BoundarySimplifiedContour*> m_simplifiedContours;
39 };
40 
41 class BoundarySimplifiedContour
42 {
43  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
44 public:
45  BoundarySimplifiedContour();
46 
47  void Init(KyUInt32 index, PixelColor leftColor, KyUInt32 leftNavTagIdx, BoundarySimplifiedPolygon* polygon);
48  void PushEdge(BoundarySimplifiedEdge* edge);
49 
50 public:
51  KyUInt32 m_index;
52  KyUInt32 m_edgeCount;
53  BoundarySimplifiedEdge* m_begin;
54  BoundarySimplifiedEdge* m_last;
55  ContourWinding m_winding;
56  PixelColor m_leftColor;
57  KyUInt32 m_leftConnexIdx;
58  BoundarySimplifiedPolygon* m_polygon;
59 };
60 
61 
62 class BoundarySimplifiedEdge
63 {
64  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
65 public:
66  enum BoundarySimplifiedEdge_Status
67  {
68  BoundarySimplifiedEdge_ACTIVE,
69  BoundarySimplifiedEdge_DISCARDED
70  };
71 
72  BoundarySimplifiedEdge();
73 
74  void Init(KyUInt32 index, BoundaryEdge* firstEdge, BoundaryEdge* lastEdge, BoundarySimplifiedContour* contour);
75 
76 public:
77  KyUInt32 m_index;
78  BoundaryEdgeType m_edgeType;
79  BoundaryEdge* m_firstEdge;
80  BoundaryEdge* m_lastEdge;
81  BoundaryVertex* m_vertex[2];
82  PixelColor m_leftColor;
83  KyUInt32 m_leftNavTagIdx;
84  BoundarySimplifiedContour* m_contour;
85  BoundarySimplifiedEdge* m_pair;
86  BoundarySimplifiedEdge* m_next;
87  KyFloat32 m_accumulatedInteriorPixelError;
88  KyFloat32 m_accumulatedExteriorPixelError;
89  KyFloat32 m_accumulatedSurfaceError;
90  BoundarySimplifiedEdge_Status m_status;
91  KyUInt32 m_edgeIdxInDynNavFloor;
92 };
93 
94 
95 }
96 
97 
98 #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