gwnavruntime/pathfollower/circlearcsplinecomputerinputblob.h Source File

circlearcsplinecomputerinputblob.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: LAPA - secondary contact: NOBODY
9 
10 #ifndef Navigation_CircleArcSplineComputerInputBlob_H
11 #define Navigation_CircleArcSplineComputerInputBlob_H
12 
16 
20 
21 
22 namespace Kaim
23 {
24 
25 // Internal:
26 // A blob containing all the necessary information to replay a CircleArcSplineComputer.
27 // This is typically used to replay error cases.
28 class CircleArcSplineComputerInputBlob
29 {
30  KY_ROOT_BLOB_CLASS(Runtime, CircleArcSplineComputerInputBlob, 0)
31 
32 public:
33  CircleArcSplineComputerInputBlob() {}
34 
35 public:
36  ChannelBlob m_channel;
37 
38  SplineComputationConfigBlob m_splineConfig;
39 
40  Vec3f m_startPosition;
41  Vec3f m_endPosition;
42 
43  Vec2f m_startConstraint;
44  Vec2f m_endConstraint;
45 
46  KyUInt32 m_startIndex;
47  KyUInt32 m_endIndex;
48 };
49 
50 inline void SwapEndianness(Endianness::Target e, CircleArcSplineComputerInputBlob& self)
51 {
52  SwapEndianness(e, self.m_channel);
53  SwapEndianness(e, self.m_splineConfig);
54  SwapEndianness(e, self.m_startPosition);
55  SwapEndianness(e, self.m_endPosition);
56  SwapEndianness(e, self.m_startConstraint);
57  SwapEndianness(e, self.m_endConstraint);
58  SwapEndianness(e, self.m_startIndex);
59  SwapEndianness(e, self.m_endIndex);
60 }
61 
62 
63 
64 class CircleArcSplineComputerInputBlobBuilder : public BaseBlobBuilder<CircleArcSplineComputerInputBlob>
65 {
66  KY_CLASS_WITHOUT_COPY(CircleArcSplineComputerInputBlobBuilder)
67 
68 public:
69  CircleArcSplineComputerInputBlobBuilder(const CircleArcSplineComputer* computer)
70  : m_computer(computer)
71  {}
72 
73  virtual void DoBuild()
74  {
75  BLOB_BUILD(m_blob->m_channel, ChannelBlobBuilder(m_computer->m_startSection.GetChannel()));
76  BLOB_BUILD(m_blob->m_splineConfig, SplineConfigBlobBuilder(m_computer->m_splineConfig));
77  BLOB_SET(m_blob->m_startPosition, m_computer->m_startPosition);
78  BLOB_SET(m_blob->m_endPosition, m_computer->m_endPosition);
79  BLOB_SET(m_blob->m_startConstraint, m_computer->m_startConstraint);
80  BLOB_SET(m_blob->m_endConstraint, m_computer->m_endConstraint);
81  BLOB_SET(m_blob->m_startIndex, m_computer->m_startSection.GetSectionIdx());
82  BLOB_SET(m_blob->m_endIndex, m_computer->m_endSection.GetSectionIdx());
83  }
84 
85 private:
86  const CircleArcSplineComputer* m_computer;
87 };
88 
89 
90 } // namespace Kaim
91 
92 #endif // Navigation_CircleArcSplineComputerInputBlob_H
#define BLOB_SET(blob, value)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:136
#define BLOB_BUILD(blob, builder)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:189
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
CircleArcSplineComputerInputBlob * m_blob
The blob maintained by this builder. Only modify using the macros listed under DoBuild().
Definition: baseblobbuilder.h:117
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36