gwnavgeneration/generator/generatorintegercoords.h Source File

generatorintegercoords.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 // primary contact: GUAL - secondary contact: NOBODY
9 #ifndef GwNavGen_GeneratorIntegerCoords_H
10 #define GwNavGen_GeneratorIntegerCoords_H
11 
12 
14 
15 
16 namespace Kaim
17 {
18 
19 class GeneratorSystem;
20 
21 class GeneratorIntegerCoords
22 {
23  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavDataGen)
24 
25 public:
26  GeneratorIntegerCoords();
27 
28  void Init(KyFloat32 normalizedRasterPrecision);
29 
30  bool IsTriangleTooBig(const Vec3f& A, const Vec3f& B, const Vec3f& C) const;
31 
32  bool AreTriangleCoordinatesValid(const Vec3f& A, const Vec3f& B, const Vec3f& C) const;
33 
34  bool IsCoordinateValid(const Vec3f& pos) const;
35 
36  KyFloat32 IntToMeter_Dist(KyUInt32 intValue) const
37  {
38  return IntCoordSystem::IntToNavigation_Dist(intValue, m_normalizedRasterPrecision);
39  }
40 
41  KyUInt32 MeterToInt_Dist(KyFloat32 coordInMeter) const
42  {
43  return IntCoordSystem::NavigationToInt_Dist(coordInMeter, m_normalizedRasterPrecision);
44  }
45 
46  void IntToMeter_Pos(const Vec2i& intPos, Vec2f& pos) const
47  {
48  pos.x = IntToMeter_Dist(intPos.x);
49  pos.y = IntToMeter_Dist(intPos.y);
50  }
51 
52  void IntToMeter_Pos(const Vec3i& intPos, Vec3f& pos) const
53  {
54  pos.x = IntToMeter_Dist(intPos.x);
55  pos.y = IntToMeter_Dist(intPos.y);
56  pos.z = IntToMeter_Dist(intPos.z);
57  }
58 
59  void MeterToInt_Pos(const Vec2f& pos, Vec2i& intPos) const
60  {
61  intPos.x = MeterToInt_Dist(pos.x);
62  intPos.y = MeterToInt_Dist(pos.y);
63  }
64 
65  void MeterToInt_Pos(const Vec3f& pos, Vec3i& intPos) const
66  {
67  intPos.x = MeterToInt_Dist(pos.x);
68  intPos.y = MeterToInt_Dist(pos.y);
69  intPos.z = MeterToInt_Dist(pos.z);
70  }
71 
72 public:
73  KyFloat32 m_normalizedRasterPrecision;
74  KyFloat32 m_maxTriangleSquareLength;
75 };
76 
77 }
78 
79 
80 #endif
81 
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