gwnavruntime/pathfollower/radiusprofile.h Source File

radiusprofile.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 // primary contact: LAPA - secondary contact: nobody
8 #ifndef Navigation_RadiusProfile_H
9 #define Navigation_RadiusProfile_H
10 
13 
14 
15 namespace Kaim
16 {
17 
18 class RadiusProfileBlob;
19 class RadiusProfileArrayBlob;
20 
21 
28 class RadiusProfile
29 {
30 public:
31  RadiusProfile() { SetDefaults(); }
32 
33  RadiusProfile(const char* name)
34  : m_name(name)
35  {}
36 
37  RadiusProfile(const RadiusProfile& other)
38  : m_name(other.m_name)
39  , m_radiusArray(other.m_radiusArray)
40  {}
41 
42  ~RadiusProfile() { Clear(); }
43 
44  void SetDefaults();
45 
46  // The new profile should have has many radius has current one.
47  // This function is only used in NavigationLab for simple visualdebug and command
48  void UpdateFromBlob(const RadiusProfileBlob& blob);
49 
50  void Clear() { m_radiusArray.Clear(); }
51  void PushBack(KyFloat32 radius) { m_radiusArray.PushBack(radius); }
52 
53  const char* GetName() const { return m_name.ToCStr(); }
54  KyUInt32 GetCount() const { return m_radiusArray.GetCount(); }
55  KyFloat32 GetRadius(KyUInt32 index) const { return m_radiusArray[index]; }
56 
57  void operator=(const RadiusProfile& other);
58  bool operator==(const RadiusProfile& other) const;
59  bool operator!=(const RadiusProfile& other) const { return !(*this == other); }
60 
61 public: // internal
62  void SortInIncreasingOrder();
63 
64 public:
65  String m_name;
66  KyArrayPOD<KyFloat32> m_radiusArray;
67 };
68 
69 
75 {
76 public:
77  RadiusProfileArray() { SetDefaults(); }
78  ~RadiusProfileArray() { Clear(); }
79 
80  void SetDefaults();
81 
82  // The new profileArray should have has many radius profile arrays with each has many radius has current one.
83  // This function is only used in NavigationLab for simple visualdebug and command
84  void UpdateFromBlob(const RadiusProfileArrayBlob& blob);
85 
86  void PushBack(const RadiusProfile& radiusProfile);
87 
88  KyUInt32 GetCount() const { return m_radiusProfileArray.GetCount(); }
89  const RadiusProfile& GetRadiusProfile(KyUInt32 index) const { return m_radiusProfileArray[index]; }
90  RadiusProfile& GetRadiusProfile(KyUInt32 index) { return m_radiusProfileArray[index]; }
91 
92  bool operator==(const RadiusProfileArray& other) const;
93  bool operator!=(const RadiusProfileArray& other) const { return !(*this == other); }
94 
95 private:
96  void Clear();
97 
98  KyArray<RadiusProfile> m_radiusProfileArray;
99  bool m_userDefinedProfile;
100 };
101 
102 } // namespace Kaim
103 
104 #endif // Navigation_RadiusProfile_H
RadiusProfile is an array of preferred radii.
Definition: radiusprofile.h:29
Definition: gamekitcrowddispersion.h:20
CircleArcSpline computer can compute several CircleArcSplines each corresponding to a specific Radius...
Definition: radiusprofile.h:80
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