Gocator Vision Library
 All Classes Files Functions Variables Typedefs Friends Modules Pages
GvDataMsg.h
Go to the documentation of this file.
1 /**
2 * @file GvDataMsg.h
3 * @brief Declares the GvDataMsg class.
4 *
5 * Copyright (C) 2019-2022 by LMI Technologies Inc. All rights reserved.
6 */
7 #ifndef GV_DATA_MSG_H
8 #define GV_DATA_MSG_H
9 
10 #include <GoVision/GvDef.h>
11 #include <GoVision/GvUtils.h>
12 #include <kFireSync/Data/kMsgSet.h>
13 #include <kApi/Data/kArray1.h>
14 #include <kApi/Data/kArrayList.h>
15 
16 /**
17 * Base class for data messages.
18 *
19 * @class GvDataMsg
20 * @extends kMsgSet
21 * @ingroup GoVision-Data
22 */
23 typedef kMsgSet GvDataMsg;
24 
25 typedef kPointer GvDataMsgFrame;
26 
28 
29 #define GV_DATA_MSG_DISPOSITION_NONE (0)
30 #define GV_DATA_MSG_DISPOSITION_RANGE (1)
31 #define GV_DATA_MSG_DISPOSITION_PROFILE (2)
32 #define GV_DATA_MSG_DISPOSITION_SURFACE (3)
33 #define GV_DATA_MSG_DISPOSITION_GENERIC (10)
34 
35 #define GV_DATA_MSG_LAYER_RANGE (0)
36 #define GV_DATA_MSG_LAYER_INTENSITY (1)
37 #define GV_DATA_MSG_LAYER_MAP (2)
38 #define GV_DATA_MSG_LAYER_SLICES (3)
39 
40 GvFx(kStatus) GvDataMsg_Construct(GvDataMsg* msg, GvDataMsgDisposition disposition, kType pointType, kSize count, kSize width, kSize length, kAlloc alloc);
41 
42 /**
43  * Convenience wrapper that copies elementary data attributes from the source for first frame.
44  *
45  * @public @memberof GvDataMsg
46  * @param msg Message object.
47  * @param source Source message object.
48  * @return Operation status.
49  */
51 
52 /**
53  * Returns the message disposition type.
54  *
55  * @public @memberof GvDataMsg
56  * @param msg Message object.
57  * @return Disposition type.
58  */
60 
61 /**
62  * Returns the message range data type.
63  *
64  * @public @memberof GvDataMsg
65  * @param msg Message object.
66  * @return Range data type.
67  */
69 
70 /**
71  * Returns the data width as a number of columns.
72  *
73  * @public @memberof GvDataMsg
74  * @param msg Message object.
75  * @return Column count.
76  */
77 
79 
80 /**
81  * Returns the data length as a number of rows.
82  *
83  * @public @memberof GvDataMsg
84  * @param msg Message object.
85  * @return Row count.
86  */
88 
89 /**
90  * Sets range layer data.
91  * NOTE: This copies the data.
92  *
93  * @public @memberof GvDataMsg
94  * @param msg Message object.
95  * @param data Pointer to range layer data.
96  * @return Operation status.
97  */
98 GvFx(kStatus) GvDataMsg_SetRanges(GvDataMsg msg, const void* data);
99 
100 /**
101  * Returns a pointer to range layer data at given row and column.
102  * NOTE: A range layer should be present.
103  *
104  * @public @memberof GvDataMsg
105  * @param msg Message object.
106  * @param row Range data row.
107  * @param column Range data column.
108  * @return Pointer to range layer data.
109  */
110 GvFx(void*) GvDataMsg_Ranges(GvDataMsg msg, kSize row, kSize column);
111 
112 /**
113  * Adds a new layer to the end (and allocates it).
114  *
115  * @public @memberof GvDataMsg
116  * @param msg Message object.
117  * @param type Layer data type.
118  * @param id Layer id.
119  * @return Operation Status.
120  */
121 GvFx(kStatus) GvDataMsg_AddLayer(GvDataMsg msg, kType type, k32s id);
122 
123 /**
124  * Appends a layer to the end (optionally allocating it).
125  *
126  * @public @memberof GvDataMsg
127  * @param msg Message object.
128  * @param type Layer data type.
129  * @param id Layer id.
130  * @param allocate True to allocate the layer.
131  * @return Operation status.
132  */
133 GvFx(kStatus) GvDataMsg_AppendLayer(GvDataMsg msg, kType type, k32s id, kBool allocate);
134 
135 /**
136  * Returns a layer count.
137  *
138  * @public @memberof GvDataMsg
139  * @param msg Message object.
140  * @return Layer count.
141  */
143 
144 /**
145  * Returns the layer id at the given layer index.
146  *
147  * @public @memberof GvDataMsg
148  * @param msg Message object.
149  * @param index Layer index.
150  * @return Layer id.
151  */
152 GvFx(k32s) GvDataMsg_LayerIdAt(GvDataMsg msg, kSize index);
153 
154 /**
155  * Returns whether or not this message contains the given layer id.
156  *
157  * @public @memberof GvDataMsg
158  * @param msg Message object.
159  * @param id Layer id.
160  * @return Presence of layer id.
161  */
162 GvFx(kBool) GvDataMsg_HasLayer(GvDataMsg msg, k32s id);
163 
164 /**
165  * Returns the layer data type of the given layer id.
166  *
167  * @public @memberof GvDataMsg
168  * @param msg Message object.
169  * @param id Layer id.
170  * @return Layer data type.
171  */
172 GvFx(kType) GvDataMsg_LayerType(GvDataMsg msg, k32s id);
173 
174 /**
175  * Sets the layer data.
176  * NOTE: This copies the data.
177  *
178  * @public @memberof GvDataMsg
179  * @param msg Message object.
180  * @param id Layer id.
181  * @param data Pointer to layer data.
182  * @return Operation status.
183  */
184 GvFx(kStatus) GvDataMsg_SetLayerData(GvDataMsg msg, k32s id, const void* data);
185 
186 /**
187  * Gets the layer data at the given row and column.
188  *
189  * @public @memberof GvDataMsg
190  * @param msg Message object.
191  * @param id Layer id.
192  * @param row Layer data row.
193  * @param column Layer data column.
194  * @return Pointer to layer data.
195  */
196 GvFx(void*) GvDataMsg_LayerData(GvDataMsg msg, k32s id, kSize row, kSize column);
197 
198 /**
199  * Returns the movement direction.
200  *
201  * @public @memberof GvDataMsg
202  * @param msg Message object.
203  * @return Movement direction.
204  */
206 
207 /**
208  * Sets the movement direction.
209  *
210  * @public @memberof GvDataMsg
211  * @param msg Message object.
212  * @param direction Movement direction.
213  * @return Operation status.
214  */
216 
217 /**
218  * Returns the data stamp.
219  *
220  * @public @memberof GvDataMsg
221  * @param msg Message object.
222  * @return Pointer to data stamp.
223  */
224 GvFx(const kStamp*) GvDataMsg_Stamp(GvDataMsg msg);
225 
226 /**
227  * Sets the data stamp.
228  *
229  * @public @memberof GvDataMsg
230  * @param msg Message object.
231  * @param stamp Pointer to data stamp.
232  * @return Operation status.
233  */
234 GvFx(kStatus) GvDataMsg_SetStamp(GvDataMsg msg, const kStamp* stamp);
235 
236 /**
237  * Returns the data time, which is expresseed in Firesync time units in microseconds.
238  * To convert Firesync time units to milliseconds, divide by 1024 (not 1000).
239  *
240  * @public @memberof GvDataMsg
241  * @param msg Message object.
242  * @return Data time.
243  */
244 GvFx(k64u) GvDataMsg_Time(GvDataMsg msg);
245 
246 /**
247  * Sets the data time (usec).
248  *
249  * @public @memberof GvDataMsg
250  * @param msg Message object.
251  * @param time Data time.
252  * @return Operation status.
253  */
254 GvFx(kStatus) GvDataMsg_SetTime(GvDataMsg msg, k64u time);
255 
256 /**
257  * Sets the FsTime and PtpTime in (usec).
258  *
259  * @public @memberof GvDataMsg
260  * @param msg Message object.
261  * @param time Data time.
262  * @param ptpTime PTP time.
263  * @return Operation status.
264  */
265 GvFx(kStatus) GvDataMsg_SetFsAndPtpTime(GvDataMsg msg, k64u time, k64u ptpTime);
266 
267 /**
268  * Returns the data encoder value.
269  *
270  * @public @memberof GvDataMsg
271  * @param msg Message object.
272  * @return Data encoder value.
273  */
274 GvFx(k64s) GvDataMsg_Encoder(GvDataMsg msg);
275 
276 /**
277  * Sets the data encoder value.
278  *
279  * @public @memberof GvDataMsg
280  * @param msg Message object.
281  * @param encoder Data encoder value.
282  * @return Operation status.
283  */
284 GvFx(kStatus) GvDataMsg_SetEncoder(GvDataMsg msg, k64s encoder);
285 
286 /**
287  * Returns the ptp timestamp value.
288  *
289  * @public @memberof GvDataMsg
290  * @param msg Message object.
291  * @return Ptp timestamp value.
292  */
293 GvFx(k64u) GvDataMsg_PtpTime(GvDataMsg msg);
294 
295 /**
296  * Sets the data ptp timestamp value.
297  *
298  * @public @memberof GvDataMsg
299  * @param msg Message object.
300  * @param ptpTime Ptp timestamp value.
301  * @return Operation status.
302  */
303 GvFx(kStatus) GvDataMsg_SetPtpTime(GvDataMsg msg, k64u ptpTime);
304 
305 /**
306  * Returns the x,y,z offset for the data message.
307  *
308  * @public @memberof GvDataMsg
309  * @param msg Message object.
310  * @return Pointer to data offset.
311  */
312 GvFx(const kPoint3d64f*) GvDataMsg_Offset(GvDataMsg msg);
313 
314 /**
315  * Sets the x,y,z offset for the data message.
316  *
317  * @public @memberof GvDataMsg
318  * @param msg Message object.
319  * @param offset Pointer to data offset.
320  * @return Operation status.
321  */
322 GvFx(kStatus) GvDataMsg_SetOffset(GvDataMsg msg, const kPoint3d64f* offset);
323 
324 /**
325  * Returns the x,y,z scale of the data message.
326  *
327  * @public @memberof GvDataMsg
328  * @param msg Message object.
329  * @return Pointer to data scale.
330  */
331 GvFx(const kPoint3d64f*) GvDataMsg_Scale(GvDataMsg msg);
332 
333 /**
334  * Sets the x,y,z scale of the data message.
335  *
336  * @public @memberof GvDataMsg
337  * @param msg Message object.
338  * @param scale Pointer to data scale.
339  * @return Operation status.
340  */
341 GvFx(kStatus) GvDataMsg_SetScale(GvDataMsg msg, const kPoint3d64f* scale);
342 
343 /**
344  * Adds pose.
345  *
346  * @public @memberof GvDataMsg
347  * @param msg Message object.
348  * @param id Pose id.
349  * @param pose Pointer to pose.
350  * @return Operation status.
351  */
352 GvFx(kStatus) GvDataMsg_AddPose(GvDataMsg msg, k32s id, const kPose2d64f* pose);
353 
354 /**
355  * Clears all poses.
356  *
357  * @public @memberof GvDataMsg
358  * @param msg Message object.
359  * @return Operation status.
360  */
362 
363 /**
364  * Returns the number of poses.
365  *
366  * @public @memberof GvDataMsg
367  * @param msg Message object.
368  * @return Pose count.
369  */
371 
372 /**
373  * Returns the pose id for the given pose index.
374  *
375  * @public @memberof GvDataMsg
376  * @param msg Message object.
377  * @param index Pose index.
378  * @return Pose id.
379  */
380 GvFx(k32s) GvDataMsg_PoseIdAt(GvDataMsg msg, kSize index);
381 
382 /**
383  * Returns the pose for the given pose index.
384  *
385  * @public @memberof GvDataMsg
386  * @param msg Message object.
387  * @param index Pose index.
388  * @return Pointer to pose.
389  */
390 GvFx(const kPose2d64f*) GvDataMsg_PoseAt(GvDataMsg msg, kSize index);
391 
392 /**
393  * Sets the pose id for the pose at the given index.
394  *
395  * @public @memberof GvDataMsg
396  * @param msg Message object.
397  * @param index Pose index.
398  * @param id Pose id.
399  * @return Operation status.
400  */
401 
402 GvFx(kStatus) GvDataMsg_SetPoseIdAt(GvDataMsg msg, kSize index, k32s id);
403 
404 /**
405  * Sets the pose at the given index.
406  *
407  * @public @memberof GvDataMsg
408  * @param msg Message object.
409  * @param index Pose index.
410  * @param pose Pointer to pose.
411  * @return Operation status.
412  */
413 GvFx(kStatus) GvDataMsg_SetPoseAt(GvDataMsg msg, kSize index, const kPose2d64f* pose);
414 
415 /**
416  * Copies the pose from the source message.
417  *
418  * @public @memberof GvDataMsg
419  * @param msg Message object.
420  * @param source Source message object.
421  * @return Operation status.
422  */
423 GvFx(kStatus) GvDataMsg_CopyPose(GvDataMsg msg, GvDataMsg source);
424 
425 /**
426  * Copies all poses less than the id from the source.
427  *
428  * @public @memberof GvDataMsg
429  * @param msg Message object.
430  * @param source Source message object.
431  * @param id Pose id copy limit (non-inclusive).
432  * @return Operation status.
433  */
434 GvFx(kStatus) GvDataMsg_CopyPoseToId(GvDataMsg msg, GvDataMsg source, k32s id);
435 
436 /**
437  * Selects poses for the given id.
438  *
439  * @public @memberof GvDataMsg
440  * @param msg Message object.
441  * @param toId Pose 'to' selection id (inclusive).
442  * @param pose Pose selection result.
443  * @return Operation status.
444  */
445 GvFx(kStatus) GvDataMsg_SelectPose(GvDataMsg msg, k32s toId, kPose2d64f* pose);
446 
447 /**
448  * Selects poses for the given id and provides the inverse.
449  *
450  * @public @memberof GvDataMsg
451  * @param msg Message object.
452  * @param fromId Pose 'from' selection id (inclusive).
453  * @param pose Pose selection result.
454  * @return Operation status.
455  */
456 GvFx(kStatus) GvDataMsg_SelectPoseInverse(GvDataMsg msg, k32s fromId, kPose2d64f* pose);
457 
458 /**
459  * Selects the relative pose to get from one pose id to another pose id.
460  *
461  * @public @memberof GvDataMsg
462  * @param msg Message object.
463  * @param toId Pose 'to' selection id (inclusive).
464  * @param fromId Pose 'from' selection id (inclusive).
465  * @param pose Pose selection result.
466  * @return Operation status.
467  */
468 GvFx(kStatus) GvDataMsg_SelectPoseRelative(GvDataMsg msg, k32s toId, k32s fromId, kPose2d64f* pose);
469 
470 /**
471  * Sets the extension object for the given message frame.
472  *
473  * @public @memberof GvDataMsg
474  * @param msg Message object.
475  * @param frame Frame object.
476  * @param object Extension object.
477  * @return Operation status.
478  */
479 GvFx(kStatus) GvDataMsg_SetObjectExtAt(GvDataMsg msg, kSize frame, kObject object);
480 
481 /**
482  * Returns the extension object for the given message frame.
483  *
484  * @public @memberof GvDataMsg
485  * @param msg Message object.
486  * @param frame Frame object.
487  * @return Extension object.
488  */
489 GvFx(kObject) GvDataMsg_ObjectExtAt(GvDataMsg msg, kSize frame);
490 
491 /**
492  * Sets the rendering object for the given message frame.
493  *
494  * @public @memberof GvDataMsg
495  * @param msg Message object.
496  * @param frame Frame object.
497  * @param object Rendering object (GdkGraphic until Studio migrates to newer primitives).
498  * @return Operation status.
499  */
500 GvFx(kStatus) GvDataMsg_SetRenderingAt(GvDataMsg msg, kSize frame, kObject object);
501 
502 /**
503  * Returns the rendering object for the given message frame.
504  *
505  * @public @memberof GvDataMsg
506  * @param msg Message object.
507  * @param frame Frame object.
508  * @return Rendering object (GdkGraphic until Studio migrates to newer primitives).
509  */
510 GvFx(kObject) GvDataMsg_RenderingAt(GvDataMsg msg, kSize frame);
511 
512 /**
513  * Returns the x,y,z offset with respect to frame of reference for the data message .
514  *
515  * @public @memberof GvDataMsg
516  * @param msg Message object.
517  * @return Data offset.
518  */
520 
521 #include <GoVision/Data/GvDataMsg.x.h>
522 
523 #endif
kStatus GvDataMsg_CopyPoseToId(GvDataMsg msg, GvDataMsg source, k32s id)
Copies all poses less than the id from the source.
kObject GvDataMsg_ObjectExtAt(GvDataMsg msg, kSize frame)
Returns the extension object for the given message frame.
kStatus GvDataMsg_SetEncoder(GvDataMsg msg, k64s encoder)
Sets the data encoder value.
kStatus GvDataMsg_SetOffset(GvDataMsg msg, const kPoint3d64f *offset)
Sets the x,y,z offset for the data message.
k64u GvDataMsg_Time(GvDataMsg msg)
Returns the data time, which is expresseed in Firesync time units in microseconds.
const kPoint3d64f * GvDataMsg_Offset(GvDataMsg msg)
Returns the x,y,z offset for the data message.
kType GvDataMsg_RangeType(GvDataMsg msg)
Returns the message range data type.
kStatus GvDataMsg_SetTime(GvDataMsg msg, k64u time)
Sets the data time (usec).
GvDataMsgDisposition GvDataMsg_Disposition(GvDataMsg msg)
Returns the message disposition type.
Base class for data messages.
const kStamp * GvDataMsg_Stamp(GvDataMsg msg)
Returns the data stamp.
void * GvDataMsg_LayerData(GvDataMsg msg, k32s id, kSize row, kSize column)
Gets the layer data at the given row and column.
kStatus GvDataMsg_SelectPoseInverse(GvDataMsg msg, k32s fromId, kPose2d64f *pose)
Selects poses for the given id and provides the inverse.
Essential GoVision declarations.
kStatus GvDataMsg_SetLayerData(GvDataMsg msg, k32s id, const void *data)
Sets the layer data.
kStatus GvDataMsg_AddLayer(GvDataMsg msg, kType type, k32s id)
Adds a new layer to the end (and allocates it).
kStatus GvDataMsg_SetPtpTime(GvDataMsg msg, k64u ptpTime)
Sets the data ptp timestamp value.
const kPoint3d64f * GvDataMsg_Scale(GvDataMsg msg)
Returns the x,y,z scale of the data message.
const kPose2d64f * GvDataMsg_PoseAt(GvDataMsg msg, kSize index)
Returns the pose for the given pose index.
kStatus GvDataMsg_SetStamp(GvDataMsg msg, const kStamp *stamp)
Sets the data stamp.
GvMovementDirection GvDataMsg_Direction(GvDataMsg msg)
Returns the movement direction.
kSize GvDataMsg_Width(GvDataMsg msg)
Returns the data width as a number of columns.
kStatus GvDataMsg_ClearPose(GvDataMsg msg)
Clears all poses.
kSize GvDataMsg_PoseCount(GvDataMsg msg)
Returns the number of poses.
kStatus GvDataMsg_SelectPose(GvDataMsg msg, k32s toId, kPose2d64f *pose)
Selects poses for the given id.
kStatus GvDataMsg_SetRanges(GvDataMsg msg, const void *data)
Sets range layer data.
k32s GvDataMsg_LayerIdAt(GvDataMsg msg, kSize index)
Returns the layer id at the given layer index.
kStatus GvDataMsg_SetPoseAt(GvDataMsg msg, kSize index, const kPose2d64f *pose)
Sets the pose at the given index.
kStatus GvDataMsg_SelectPoseRelative(GvDataMsg msg, k32s toId, k32s fromId, kPose2d64f *pose)
Selects the relative pose to get from one pose id to another pose id.
kStatus GvDataMsg_CopyPose(GvDataMsg msg, GvDataMsg source)
Copies the pose from the source message.
kStatus GvDataMsg_SetRenderingAt(GvDataMsg msg, kSize frame, kObject object)
Sets the rendering object for the given message frame.
k64s GvDataMsg_Encoder(GvDataMsg msg)
Returns the data encoder value.
kSize GvDataMsg_LayerCount(GvDataMsg msg)
Returns a layer count.
kStatus GvDataMsg_AddPose(GvDataMsg msg, k32s id, const kPose2d64f *pose)
Adds pose.
kType GvDataMsg_LayerType(GvDataMsg msg, k32s id)
Returns the layer data type of the given layer id.
kPoint3d64f GvDataMsg_OffsetWithRef(GvDataMsg msg)
Returns the x,y,z offset with respect to frame of reference for the data message .
void * GvDataMsg_Ranges(GvDataMsg msg, kSize row, kSize column)
Returns a pointer to range layer data at given row and column.
kStatus GvDataMsg_CopyAttrs(GvDataMsg msg, GvDataMsg source)
Convenience wrapper that copies elementary data attributes from the source for first frame...
kStatus GvDataMsg_AppendLayer(GvDataMsg msg, kType type, k32s id, kBool allocate)
Appends a layer to the end (optionally allocating it).
kObject GvDataMsg_RenderingAt(GvDataMsg msg, kSize frame)
Returns the rendering object for the given message frame.
kStatus GvDataMsg_SetPoseIdAt(GvDataMsg msg, kSize index, k32s id)
Sets the pose id for the pose at the given index.
k32s GvDataMsg_PoseIdAt(GvDataMsg msg, kSize index)
Returns the pose id for the given pose index.
kStatus GvDataMsg_SetDirection(GvDataMsg msg, GvMovementDirection direction)
Sets the movement direction.
kStatus GvDataMsg_SetScale(GvDataMsg msg, const kPoint3d64f *scale)
Sets the x,y,z scale of the data message.
kBool GvDataMsg_HasLayer(GvDataMsg msg, k32s id)
Returns whether or not this message contains the given layer id.
kSize GvDataMsg_Length(GvDataMsg msg)
Returns the data length as a number of rows.
k64u GvDataMsg_PtpTime(GvDataMsg msg)
Returns the ptp timestamp value.
kStatus GvDataMsg_SetObjectExtAt(GvDataMsg msg, kSize frame, kObject object)
Sets the extension object for the given message frame.
kStatus GvDataMsg_SetFsAndPtpTime(GvDataMsg msg, k64u time, k64u ptpTime)
Sets the FsTime and PtpTime in (usec).