INOS
cinosmovepathsegment.h
Go to the documentation of this file.
1//******************************************************************************
26//******************************************************************************
27#ifndef INC_CINOSMOVEPATHSEGMENT_H
28#define INC_CINOSMOVEPATHSEGMENT_H
29//------------------------------------------------------------------------------
30// includes
31//------------------------------------------------------------------------------
32//
33// system
34#include <inos.h>
35//
36// C++
37//
38// project
39//
40//------------------------------------------------------------------------------
41// class definition
42//------------------------------------------------------------------------------
43//
45{
46 //--- user interface ---------------------------------------------------
47
48 // public member functions
49 public :
50
52 double GetLength()
53 {
54 // return length
55 return m_dLength;
56 }
58 double GetLength_1()
59 {
60 // return length
61 return m_dLength_1;
62
63 }
65 uint32 GetId()
66 {
67 // return id
68 return m_uId;
69 }
70
72 uint32 GetFlags()
73 {
74 // return flags
75 return m_uFlags;
76 }
77
79 void SetFlags(uint32 auFlags)
80 {
81 // set flags
83 }
84
87 {
88 // check flag
89 return (m_uFlags & DF_INOS_MOVEPATH_FLAG_PURE_LINEAR);
90 }
91
94 {
95 // check flag
96 return (m_uFlags & DF_INOS_MOVEPATH_FLAG_PURE_RAPID);
97 }
98
99 //--- internals --------------------------------------------------------
100
101 protected :
103 uint32 m_uFlags;
105 double m_dLength;
109 uint32 m_uId;
110 //--- user interface ---------------------------------------------------
111
112 // public member functions
113 public :
114
116 virtual void GetPosition(double adP, TINOSMovePathVec& ovPos) = 0;
118 virtual void GetPositionFirst(TINOSMovePathVec& ovPos)
119 {
120 // set vector
121 ovPos = m_vStart;
122 }
124 virtual void GetPositionLast(TINOSMovePathVec& ovPos)
125 {
126 // get last position
127 ovPos = m_vEnd;
128 }
130 virtual void GetDerivative(uint32 auLevel, double adP, TINOSMovePathVec& ovDir) = 0;
132 virtual void GetD2max(TINOSMovePathVec& ovDir) = 0;
134 virtual void GetD3max(TINOSMovePathVec& ovDir) = 0;
136 virtual void GetDerivativeBgn(uint32 auLevel, TINOSMovePathVec& ovDir) = 0;
138 virtual void GetDerivativeEnd(uint32 auLevel, TINOSMovePathVec& ovDir) = 0;
139
142 {
143 // return pointer to next segment
144 return m_pNxtSegment;
145 }
146
149 {
150 // set pointer to next segment
152 }
153
156 {
157 // return pointer to previous segment
158 return m_pPrvSegment;
159 }
160
163 {
164 // set pointer to previous segment
166 }
167
168
170 uint32 GetInvolved()
171 {
172 // return mask of involved axes
173 return m_uInvolved;
174 }
175
177 double GetStart()
178 {
179 // return start
180 return m_dStart;
181 }
182
184 virtual void SetStart(double& adP)
185 {
186 m_dStart = adP;
187 adP += m_dLength;
188 m_dEnd = adP;
189 }
190
192 double GetEnd()
193 {
194 // return end
195 return m_dEnd;
196 }
197
200 {
201 // return tolerance
202 return m_dTolerance;
203 }
204
206 double GetVelocity()
207 {
208 // return velocity
209 return m_dVelocity;
210 }
211
214 {
215 // return mask
216 return m_uLengthMask;
217 }
218
220 virtual uint32 Check() = 0;
222 virtual uint32 Prepare(double& adP, uint32 uIncremental, TINOSMovePathVec& ovPos, double adEpsilon) = 0;
223
225 virtual void Recalc(double& adP, TINOSMovePathVec& ovStart, uint32 auInvolved, double adEpsilon) = 0;
226
229 {
230 // no
231 return false;
232 }
233
235 virtual bool IsEndBlendingAllowed()
236 {
237 // no
238 return false;
239 }
240
242 virtual bool IsContinuous(uint32 auLevel) = 0;
243
244 //--- internals --------------------------------------------------------
245
246 friend class CINOSMovePath;
247 friend class CINOSMovePathCurve;
248
249 // constructor / destructor
250 public :
253 {
254 // init segment
255 Init(0, DF_INOS_MOVEPATH_FLAG_PURE_LINEAR, DF_INOS_MOVEPATH_TOLERANCE_DEFAULT,
257 }
260 double adVelocity)
261 {
262 // init segment
263 Init(auId, auFlags|DF_INOS_MOVEPATH_FLAG_PURE_LINEAR, adTolerance, adVelocity);
264 }
267 {
268 }
269
270 // private members
271 private :
272
274 void Init (uint32 auId, uint32 auFlags, double adTolerance,
275 double adVelocity);
276 // protected members
277 protected :
290
292 double m_dStart;
294 double m_dEnd;
296 TINOSMovePathVec m_vStart;
298 TINOSMovePathVec m_vEnd;
299
304
305 // dynamic object handling
307};
308
309
310//------------------------------------------------------------------------------
311// end of file
312//------------------------------------------------------------------------------
313
314#endif // INC_CINOSMOVEPATHSEGMENT_H
#define DF_INOS_MOVEPATH_VELOCITY_DEFAULT
Definition cinosmovepath.h:51
#define DF_INOS_MOVEPATH_TOLERANCE_DEFAULT
Definition cinosmovepath.h:43
#define DECLARE_DYNAMIC(aClass)
Definition cinospartitionmemory.h:328
Definition cinosmcmodule.h:1900
Definition cinosmovepathcurve.h:56
Definition cinosmovepathsegment.h:45
double GetLength()
get segment length
Definition cinosmovepathsegment.h:52
TINOSMovePathVec m_vStart
segment start position vector
Definition cinosmovepathsegment.h:296
virtual bool IsContinuous(uint32 auLevel)=0
return true if segment is auLevel continuous
virtual void GetPosition(double adP, TINOSMovePathVec &ovPos)=0
get position at 'adP'
uint32 m_uFlags
segment flags
Definition cinosmovepathsegment.h:103
bool IsPureLinear()
return true if segment is pure linear
Definition cinosmovepathsegment.h:86
double GetLength_1()
get segment 1/length
Definition cinosmovepathsegment.h:58
virtual uint32 Prepare(double &adP, uint32 uIncremental, TINOSMovePathVec &ovPos, double adEpsilon)=0
prepare segment
void SetPrevious(CINOSMovePathSegment *apSegment)
set pointer to previous segment in chain
Definition cinosmovepathsegment.h:162
double GetStart()
get segment start
Definition cinosmovepathsegment.h:177
CINOSMovePathSegment * GetPrevious()
get pointer to previous segment in chain
Definition cinosmovepathsegment.h:155
double GetTolerance()
get segment tolerance
Definition cinosmovepathsegment.h:199
void SetFlags(uint32 auFlags)
set flags
Definition cinosmovepathsegment.h:79
uint32 GetInvolved()
get involved axes
Definition cinosmovepathsegment.h:170
double m_dTolerance
tolerance
Definition cinosmovepathsegment.h:287
uint32 m_uInvolved
involved axes
Definition cinosmovepathsegment.h:279
virtual void GetD3max(TINOSMovePathVec &ovDir)=0
get max 3rd derivative of segment
uint32 m_uId
segment id
Definition cinosmovepathsegment.h:109
virtual void SetStart(double &adP)
set segment start, adjusts segment end accordingly and sets adP to new end.
Definition cinosmovepathsegment.h:184
virtual void GetDerivative(uint32 auLevel, double adP, TINOSMovePathVec &ovDir)=0
get auLevel derivative at 'adP'
virtual ~CINOSMovePathSegment()
destructor
Definition cinosmovepathsegment.h:266
virtual void GetPositionFirst(TINOSMovePathVec &ovPos)
get start position
Definition cinosmovepathsegment.h:118
virtual bool IsEndBlendingAllowed()
return true if end blending allowed
Definition cinosmovepathsegment.h:235
uint32 GetId()
get segment id
Definition cinosmovepathsegment.h:65
CINOSMovePathSegment * m_pPrvSegment
pointer to previous segment in chain
Definition cinosmovepathsegment.h:303
uint32 m_uIncremental
incremental mask (bit = 1 -> corresponding part is incremental)
Definition cinosmovepathsegment.h:283
bool IsPureRapid()
return true if segment is pure linear
Definition cinosmovepathsegment.h:93
uint32 m_uAbsolute
absolute mask (bit = 1 -> corresponding part is absolute)
Definition cinosmovepathsegment.h:281
double m_dEnd
segment end position
Definition cinosmovepathsegment.h:294
double m_dLength_1
segment 1/length
Definition cinosmovepathsegment.h:107
CINOSMovePathSegment * GetNext()
get pointer to next segment in chain
Definition cinosmovepathsegment.h:141
virtual uint32 Check()=0
check segment integrity (called before added to curve)
virtual void GetDerivativeBgn(uint32 auLevel, TINOSMovePathVec &ovDir)=0
get auLevel derivative at segment begin
virtual void GetD2max(TINOSMovePathVec &ovDir)=0
get max 2nd derivative of segment
void SetNext(CINOSMovePathSegment *apSegment)
set pointer to next segment in chain
Definition cinosmovepathsegment.h:148
double m_dLength
segment length
Definition cinosmovepathsegment.h:105
double GetVelocity()
get segment velocity
Definition cinosmovepathsegment.h:206
TINOSMovePathVec m_vEnd
segment end position vector
Definition cinosmovepathsegment.h:298
double m_dVelocity
velocity
Definition cinosmovepathsegment.h:289
virtual void GetPositionLast(TINOSMovePathVec &ovPos)
get end position
Definition cinosmovepathsegment.h:124
CINOSMovePathSegment()
constructor
Definition cinosmovepathsegment.h:252
CINOSMovePathSegment(uint32 auId, uint32 auFlags, double adTolerance, double adVelocity)
constructor
Definition cinosmovepathsegment.h:259
virtual bool IsStartBlendingAllowed()
return true if start blending allowed
Definition cinosmovepathsegment.h:228
uint32 GetLengthMask()
get segment length mask
Definition cinosmovepathsegment.h:213
virtual void Recalc(double &adP, TINOSMovePathVec &ovStart, uint32 auInvolved, double adEpsilon)=0
recalc segment
double m_dStart
segment start position
Definition cinosmovepathsegment.h:292
uint32 m_uLengthMask
length mask (bit = 1 -> corresponding part is NOT length relevant)
Definition cinosmovepathsegment.h:285
double GetEnd()
get segment end
Definition cinosmovepathsegment.h:192
CINOSMovePathSegment * m_pNxtSegment
pointer to next segment in chain
Definition cinosmovepathsegment.h:301
virtual void GetDerivativeEnd(uint32 auLevel, TINOSMovePathVec &ovDir)=0
get auLevel derivative at segment end
uint32 GetFlags()
get flags
Definition cinosmovepathsegment.h:72
Definition cinosmovepath.h:566