gwnavgeneration/boundary/boundarypixel.h Source File

boundarypixel.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 
11 
12 namespace Kaim
13 {
14 
15 class BoundaryEdge;
16 
17 // There is one BoundaryPixel for each NavRasterPixel.
18 class BoundaryPixel
19 {
20  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
21 public:
22  BoundaryPixel(): m_navRasterPixel(nullptr), m_floorColor(PixelColor_Unset), m_connexIdx(KyUInt32MAXVAL), m_isOutside(false)
23  {
24  for (CardinalDir dir = 0; dir < 4; ++dir)
25  m_edges[dir] = nullptr;
26  }
27 
28  void Init(const NavRasterPixel* navRasterPixel, bool isOutside)
29  {
30  m_navRasterPixel = navRasterPixel;
31  m_floorColor = navRasterPixel->m_floorColor;
32  m_connexIdx = navRasterPixel->m_connexIdx;
33  m_isOutside = isOutside;
34  }
35 
36  KyUInt32 GetFeatureMask(CardinalDir dir) const
37  {
38  KY_ASSERT(m_navRasterPixel != nullptr);
39  return m_navRasterPixel->GetFeatureMask(dir);
40  }
41 
42 public:
43  const NavRasterPixel* m_navRasterPixel;
44  PixelColor m_floorColor;
45  KyUInt32 m_connexIdx;
46  bool m_isOutside;
47 
48  // +---1=N---+
49  // | |
50  // 2=W 0=E
51  // | |
52  // +---3=S---+
53  BoundaryEdge* m_edges[4];
54 };
55 
56 
57 }
58 
59 
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
#define KyUInt32MAXVAL
KyUInt32 max value
Definition: types.h:68