Gocator Development Kit
 All Classes Files Functions Variables Typedefs Friends Modules Pages
GdkToolInput.h
Go to the documentation of this file.
1 /**
2 * @file GdkToolInput.h
3 * @brief Declares the GdkToolInput and related classes.
4 *
5 * Copyright (C) 2015-2022 by LMI Technologies Inc. All rights reserved.
6 */
7 #ifndef GDK_TOOL_INPUT_H
8 #define GDK_TOOL_INPUT_H
9 
10 #include <Gdk/GdkDef.h>
11 #include <Gdk/Tools/GdkFeature.h>
12 #include <Gdk/Utils/GdkDataInfo.h>
13 #include <GoVision/Data/GvDataMsg.h>
14 #include <GoVision/Data/GvGenericMsg.h>
15 #include <GoVision/Data/GvMeasureMsg.h>
16 #include <GoVision/Data/GvFeatureMsg.h>
17 #include <GoVision/Data/GvProfileMsg.h>
18 #include <GoVision/Data/GvSurfaceMsg.h>
19 
20 /**
21 * Represents a tool input collection.
22 *
23 * @class GdkToolInput
24 * @extends kObject
25 * @ingroup Gdk-Tools
26 */
27 typedef kObject GdkToolInput;
29 kDeclareValueEx(Gdk, GdkInputItemClass, kValue)
30 kDeclareValueEx(Gdk, GdkToolInputDataItem, kValue)
31 
32 /**
33 * Represents a tool input item.
34 *
35 * @class GdkInputItem
36 * @ingroup Gdk-Tools
37 */
38 typedef kPointer GdkInputItem;
39 
40 /**
41 * @struct GdkFrameInfo
42 * @extends kValue
43 * @ingroup Gdk-Tools
44 * @brief Represents acquisition metadata associated with a data message.
45 */
46 
47 typedef struct GdkFrameInfo
48 {
49  k64u frame; ///< Frame index of message data (counts up from zero).
50  k64u time; ///< Timestamp corresponding to message data (us).
51  k64s encoder; ///< Encoder value corresponding to message data (encoder ticks).
52  k64s encoderIndex; ///< Encoder value at time of most recent encoder snapshot signal (encoder ticks).
54  * Bit mask containing frame information:
55  *
56  * - Bit 0: Represents sensor digital input state.
57  * - Bit 4: Represents Master digital input state.
58  * - Bits 8 and 9: Represents inter-frame digital pulse trigger
59  (Master digital input if a Master is connected, otherwise
60  sensor digital input. Value is cleared after each frame
61  and clamped at 3 if more than 3 pulses are received).
62  */
63 } GdkFrameInfo;
64 
65 /**
66 * Returns if it is an unmerged multi-exposure profile (array of kMsgSet).
67 *
68 * @public @memberof GdkToolInput
69 * @param msg kMsgSet input data stream.
70 * @return kBool return if it is an unmerged multi-exposure profile (array of kMsgSet).
71 */
73 
74 /**
75 * Returns the item correspoding to the selected data source.
76 *
77 * If the selected source has multiple items (e.g. top and bottom), this will return
78 * the first item (e.g. the top).
79 *
80 * @public @memberof GdkToolInput
81 * @param input Input collection.
82 * @return Selected input item.
83 */
85 
86 /**
87 * Returns the secondary item correspoding to the selected data source.
88 *
89 * If the selected source has multiple items (e.g. top and bottom), this will return
90 * the second item (e.g. the bottom). Otherwise kNULL is returned.
91 *
92 * @public @memberof GdkToolInput
93 * @param input Input collection.
94 * @return Secondary selected input item.
95 */
97 
98 /**
99 * Finds an input item by data source.
100 *
101 * @public @memberof GdkToolInput
102 * @param input Input collection.
103 * @param source Data source.
104 * @return Input item corresponding to source. kNULL if not found.
105 */
107 
108 /**
109 * Returns the anchoring position for the input.
110 *
111 * If anchoring is not enabled for an axis, the value for that axis is 0.0.
112 * A value may be k64F_NULL if anchoring fails for that axis.
113 *
114 * @public @memberof GdkToolInput
115 * @param input Input collection.
116 * @return Pointer to anchoring position.
117 */
119 
120 /**
121 * Returns true if the tool is anchored in the specified component.
122 *
123 * @public @memberof GdkToolInput
124 * @param input Input collection.
125 * @param component Component of the anchor input to return.
126 * @return Component is set.
127 */
129 
130 /**
131 * Returns true if the tool is anchored in any component.
132 *
133 * @public @memberof GdkToolInput
134 * @param input Input collection.
135 * @return Any component is set.
136 */
138 
139 /**
140 * Returns the a component of the anchor input.
141 *
142 * If the tool is not anchored in the specified component (e.g. Z angle anchoring
143 * is not used), then k64F_NULL is returned.
144 *
145 * @public @memberof GdkToolInput
146 * @param input Input collection.
147 * @param component Component of the anchor input to return.
148 * @return Value of the specified component.
149 */
151 
152 /**
153 * Returns the position of the feature providing the anchoring value.
154 *
155 * Sometimes it is useful to know the position of the feature providing the anchoring
156 * value for a given dimension. This function will return the position if the source tool
157 * provides it for the anchor source measurement. All built-in tools provide the position,
158 * as well as GDK-based tools that use GdkToolInput_SetMeasurementPosition to set it.
159 *
160 * @public @memberof GdkToolInput
161 * @param input Input collection.
162 * @param component Component of the anchor input for which to return the position.
163 * @return Value of the specified component.
164 */
166 
167 /**
168 * Returns the Gdk feature class object at the specified index.This function is used to read input message other than primary input
169 *
170 * @public @memberof GdkToolInput
171 * @param input Input item.
172 * @param index Row index.
173 * @return Intensity values.
174 */
176 
177 /**
178 * Retrieve the message associated with input data set referenced by the specified index.
179 *
180 * @public @memberof GdkToolInput
181 * @param input Input item.
182 * @param id Input id starting from 0; note that id 0 is reserved for the
183 * primary data inputs (see #GDK_DATA_PRIMARY_INPUT_INDEX).
184 * Secondary data inputs have id >= #GDK_DATA_SECONDARY_INPUT_START_INDEX.
185 * It is **NOT** an index into the internal data structure.
186 * This argument is often referred to as an index which is misleading.
187 * @param source Source of the data.
188 * For scan data inputs (profiles and surfaces) and non-scan data inputs
189 * (measurements and features), it has to be one of the following:
190 * - #GDK_DATA_SOURCE_TOP
191 * - #GDK_DATA_SOURCE_BOTTOM
192 * - #GDK_DATA_SOURCE_TOP_LEFT
193 * - #GDK_DATA_SOURCE_TOP_RIGHT
194 * - #GDK_DATA_SOURCE_TOP_BOTTOM
195 * - #GDK_DATA_SOURCE_LEFT_RIGHT
196 * @param msg Pointer variable to store the associated message found.
197 * @return Operation status.
198 */
199 GdkFx(kStatus) GdkToolInput_InputDataAt(GdkToolInput input, kSize id, GdkDataSource source, GvDataMsg* msg);
200 
201 /**
202 * Retrieve the message associated with input data set referenced by name.
203 *
204 * @public @memberof GdkToolInput
205 * @param input Input item.
206 * @param name Name of input data set.
207 * @param source Source of the data.
208 * For scan data inputs (profiles and surfaces) and non-scan data inputs
209 * (measurements and features), it has to be one of the following:
210 * - #GDK_DATA_SOURCE_TOP
211 * - #GDK_DATA_SOURCE_BOTTOM
212 * - #GDK_DATA_SOURCE_TOP_LEFT
213 * - #GDK_DATA_SOURCE_TOP_RIGHT
214 * - #GDK_DATA_SOURCE_TOP_BOTTOM
215 * - #GDK_DATA_SOURCE_LEFT_RIGHT
216 * @param msg Pointer variable to store the associated message found.
217 * @return Operation status.
218 */
219 GdkFx(kStatus) GdkToolInput_InputData(GdkToolInput input, const kChar* name, GdkDataSource source, GvDataMsg* msg);
220 
221 /**
222 * Returns the input message object for the item.
223 *
224 * @public @memberof GdkInputItem
225 * @param input Input item.
226 * @return kMsgSet object.
227 */
229 
230 /**
231 * Returns the static data source descriptor for the item.
232 *
233 * @public @memberof GdkInputItem
234 * @param input Input item.
235 * @return Data source descriptor.
236 */
238 
239 /**
240 * Returns the frame information for the item.
241 *
242 * @public @memberof GdkInputItem
243 * @param input Input item.
244 * @return Frame Information.
245 */
247 
248 /**
249 * Returns data offset for the item.
250 *
251 * The data offset should be added to any calculation turning integers or
252 * array indices into real world units (mm). Note that the offset can change
253 * from frame-to-frame due to features such as part detection.
254 *
255 * @public @memberof GdkInputItem
256 * @param input Input item.
257 * @return Data offset.
258 */
259 GdkFx(const kPoint3d64f*) GdkInputItem_Offset(GdkInputItem input);
260 
261 /**
262 * Returns transformation matrix of the item in global space.
263 *
264 * @public @memberof GdkInputItem
265 * @param input Input item.
266 * @return Transformation matrix in global space.
267 */
269 
270 /**
271 * Represents a range input.
272 *
273 * @class GdkRangeInput
274 * @extends GdkInputItem
275 * @ingroup Gdk-Tools
276 */
277 typedef kPointer GdkRangeInput;
278 
279 /**
280 * Returns the range value.
281 *
282 * @public @memberof GdkRangeInput
283 * @param input Input item.
284 * @return Range value.
285 */
286 GdkFx(k16s) GdkRangeInput_Range(GdkRangeInput input);
287 
288 /**
289 * Returns the intensity value.
290 *
291 * @public @memberof GdkRangeInput
292 * @param input Input item.
293 * @return Intensity value.
294 */
295 GdkFx(k8u) GdkRangeInput_Intensity(GdkRangeInput input);
296 
297 /**
298 * Represents a resampled profile input.
299 *
300 * @class GdkProfileInput
301 * @extends GdkInputItem
302 * @ingroup Gdk-Tools
303 */
304 typedef kPointer GdkProfileInput;
305 
306 /**
307 * Returns the number of points.
308 *
309 * @public @memberof GdkProfileInput
310 * @param input Input item.
311 * @return Point count.
312 */
313 GdkFx(kSize) GdkProfileInput_Count(GdkProfileInput input);
314 
315 /**
316 * Returns the range values.
317 *
318 * @public @memberof GdkProfileInput
319 * @param input Input item.
320 * @return Range values.
321 */
322 GdkFx(const k16s*) GdkProfileInput_Ranges(GdkProfileInput input);
323 
324 /**
325 * Returns the intensity values.
326 *
327 * @public @memberof GdkProfileInput
328 * @param input Input item.
329 * @return Intensity values.
330 */
331 GdkFx(const k8u*) GdkProfileInput_Intensities(GdkProfileInput input);
332 
333 /**
334 * Represents an unresampled profile input.
335 *
336 * @class GdkRawProfileInput
337 * @extends GdkInputItem
338 * @ingroup Gdk-Tools
339 */
341 
342 /**
343 * Returns the number of points.
344 *
345 * @public @memberof GdkRawProfileInput
346 * @param input Input item.
347 * @return Point count.
348 */
349 GdkFx(kSize) GdkRawProfileInput_Count(GdkRawProfileInput input);
350 
351 /**
352 * Returns the range values.
353 *
354 * @public @memberof GdkRawProfileInput
355 * @param input Input item.
356 * @return Range values.
357 */
358 GdkFx(const GdkPointXZ16s*) GdkRawProfileInput_Ranges(GdkRawProfileInput input);
359 
360 /**
361 * Returns the intensity values.
362 *
363 * @public @memberof GdkRawProfileInput
364 * @param input Input item.
365 * @return Intensity values.
366 */
367 GdkFx(const k8u*) GdkRawProfileInput_Intensities(GdkRawProfileInput input);
368 
369 /**
370 * Represents a resampled surface input.
371 *
372 * @class GdkSurfaceInput
373 * @extends GdkInputItem
374 * @ingroup Gdk-Tools
375 */
376 typedef kPointer GdkSurfaceInput;
377 
378 /**
379 * Returns the number of columns.
380 *
381 * @public @memberof GdkSurfaceInput
382 * @param input Input item.
383 * @return Column count.
384 */
385 GdkFx(kSize) GdkSurfaceInput_ColumnCount(GdkSurfaceInput input);
386 
387 /**
388 * Returns the number of rows.
389 *
390 * @public @memberof GdkSurfaceInput
391 * @param input Input item.
392 * @return Row count.
393 */
394 GdkFx(kSize) GdkSurfaceInput_RowCount(GdkSurfaceInput input);
395 
396 /**
397 * Returns the range values at a specified row.
398 *
399 * @public @memberof GdkSurfaceInput
400 * @param input Input item.
401 * @param row Row index.
402 * @return Range values.
403 */
404 GdkFx(const k16s*) GdkSurfaceInput_RangeRowAt(GdkSurfaceInput input, kSize row);
405 
406 /**
407 * Returns the intensity values at a specified row.
408 *
409 * @public @memberof GdkSurfaceInput
410 * @param input Input item.
411 * @param row Row index.
412 * @return Intensity values.
413 */
414 GdkFx(const k8u*) GdkSurfaceInput_IntensityRowAt(GdkSurfaceInput input, kSize row);
415 
416 
417 /**
418 * Represents a resampled surface input.
419 *
420 * @class GdkRawSurfaceInput
421 * @extends GdkInputItem
422 * @ingroup Gdk-Tools
423 */
425 
426 /**
427 * Returns the number of columns.
428 *
429 * @public @memberof GdkRawSurfaceInput
430 * @param input Input item.
431 * @return Column count.
432 */
433 GdkFx(kSize) GdkRawSurfaceInput_ColumnCount(GdkRawSurfaceInput input);
434 
435 /**
436 * Returns the number of rows.
437 *
438 * @public @memberof GdkRawSurfaceInput
439 * @param input Input item.
440 * @return Row count.
441 */
442 GdkFx(kSize) GdkRawSurfaceInput_RowCount(GdkRawSurfaceInput input);
443 
444 /**
445 * Returns the range values at a specified row.
446 *
447 * @public @memberof GdkRawSurfaceInput
448 * @param input Input item.
449 * @param row Row index.
450 * @return Range values.
451 */
452 GdkFx(const kPoint3d16s*) GdkRawSurfaceInput_RangeRowAt(GdkRawSurfaceInput input, kSize row);
453 
454 /**
455 * Returns the intensity values at a specified row.
456 *
457 * @public @memberof GdkRawSurfaceInput
458 * @param input Input item.
459 * @param row Row index.
460 * @return Intensity values.
461 */
462 GdkFx(const k8u*) GdkRawSurfaceInput_IntensityRowAt(GdkRawSurfaceInput input, kSize row);
463 
464 /**
465 * Represents a generic data input.
466 *
467 * @class GdkGenericInput
468 * @extends GdkInputItem
469 * @ingroup Gdk-Tools
470 */
471 typedef kPointer GdkGenericInput;
472 
473 /**
474 * Returns the size of the generic data.
475 *
476 * @public @memberof GdkGenericInput
477 * @param input Input item.
478 * @return Size of data.
479 */
480 GdkFx(kSize) GdkGenericInput_DataSize(GdkGenericInput input);
481 
482 /**
483 * Returns the pointer to the data.
484 *
485 * @public @memberof GdkGenericInput
486 * @param input Input item.
487 * @return Pointer to data.
488 */
489 GdkFx(const k8u*) GdkGenericInput_Data(GdkGenericInput input);
490 
491 #include <Gdk/Tools/GdkToolInput.x.h>
492 
493 #endif
Essential Gdk declarations.
const GdkPointXZ16s * GdkRawProfileInput_Ranges(GdkRawProfileInput input)
Returns the range values.
Definition: GdkCfgInterfaces.h:14
Represents a tool input item.
GdkFrameInfo GdkInputItem_FrameInfo(GdkInputItem input)
Returns the frame information for the item.
kBool GdkToolInput_IsAnyAnchorSet(GdkToolInput input)
Returns true if the tool is anchored in any component.
const k8u * GdkSurfaceInput_IntensityRowAt(GdkSurfaceInput input, kSize row)
Returns the intensity values at a specified row.
kBool GdkToolInput_IsAnchorSet(GdkToolInput input, GdkAnchorParam component)
Returns true if the tool is anchored in the specified component.
const k8u * GdkRawSurfaceInput_IntensityRowAt(GdkRawSurfaceInput input, kSize row)
Returns the intensity values at a specified row.
Represents a resampled surface input.
const kPoint3d64f * GdkInputItem_Offset(GdkInputItem input)
Returns data offset for the item.
const k16s * GdkProfileInput_Ranges(GdkProfileInput input)
Returns the range values.
kSize GdkRawProfileInput_Count(GdkRawProfileInput input)
Returns the number of points.
Represents a range input.
#define kDeclareClassEx(PREFIX, SYMBOL, BASE)
Describes a data source.
Represents a resampled surface input.
Represents a data source selection.
k64f GdkToolInput_AnchorValue(GdkToolInput input, GdkAnchorParam component)
Returns the a component of the anchor input.
GdkInputItem GdkToolInput_Selected(GdkToolInput input)
Returns the item correspoding to the selected data source.
k64u digitalInputStatus
Bit mask containing frame information:
Definition: GdkToolInput.h:53
k8u GdkRangeInput_Intensity(GdkRangeInput input)
Returns the intensity value.
const k8u * GdkRawProfileInput_Intensities(GdkRawProfileInput input)
Returns the intensity values.
kSize GdkSurfaceInput_ColumnCount(GdkSurfaceInput input)
Returns the number of columns.
kBool GdkToolInput_IsArraykMsgSet(kMsgSet msg)
Returns if it is an unmerged multi-exposure profile (array of kMsgSet).
kSize GdkRawSurfaceInput_ColumnCount(GdkRawSurfaceInput input)
Returns the number of columns.
k64s encoderIndex
Encoder value at time of most recent encoder snapshot signal (encoder ticks).
Definition: GdkToolInput.h:52
GdkDataInfo GdkInputItem_Info(GdkInputItem input)
Returns the static data source descriptor for the item.
k64u frame
Frame index of message data (counts up from zero).
Definition: GdkToolInput.h:49
Represents a generic data input.
Declares geometric feature class.
Represents a resampled profile input.
kSize GdkSurfaceInput_RowCount(GdkSurfaceInput input)
Returns the number of rows.
Represents acquisition metadata associated with a data message.
Definition: GdkToolInput.h:47
GdkInputItem GdkToolInput_Find(GdkToolInput input, GdkDataSource source)
Finds an input item by data source.
kSize GdkProfileInput_Count(GdkProfileInput input)
Returns the number of points.
k64s encoder
Encoder value corresponding to message data (encoder ticks).
Definition: GdkToolInput.h:51
const GdkTransform3d * GdkInputItem_GlobalMatrix(GdkInputItem input)
Returns transformation matrix of the item in global space.
kStatus GdkToolInput_InputDataAt(GdkToolInput input, kSize id, GdkDataSource source, GvDataMsg *msg)
Retrieve the message associated with input data set referenced by the specified index.
const k8u * GdkGenericInput_Data(GdkGenericInput input)
Returns the pointer to the data.
Represents anchor parameter source selections.
Represents a tool input collection.
kSize GdkRawSurfaceInput_RowCount(GdkRawSurfaceInput input)
Returns the number of rows.
const kPoint3d64f * GdkToolInput_AnchorPosition(GdkToolInput input)
Returns the anchoring position for the input.
const k8u * GdkProfileInput_Intensities(GdkProfileInput input)
Returns the intensity values.
GdkInputItem GdkToolInput_SelectedSec(GdkToolInput input)
Returns the secondary item correspoding to the selected data source.
k64u time
Timestamp corresponding to message data (us).
Definition: GdkToolInput.h:50
k16s GdkRangeInput_Range(GdkRangeInput input)
Returns the range value.
Declares the GdkDataInfo class.
GdkFeature GdkToolInput_FeatureAt(GdkToolInput input, kSize index)
Returns the Gdk feature class object at the specified index.This function is used to read input messa...
kStatus GdkToolInput_InputData(GdkToolInput input, const kChar *name, GdkDataSource source, GvDataMsg *msg)
Retrieve the message associated with input data set referenced by name.
const k16s * GdkSurfaceInput_RangeRowAt(GdkSurfaceInput input, kSize row)
Returns the range values at a specified row.
const kPoint3d16s * GdkRawSurfaceInput_RangeRowAt(GdkRawSurfaceInput input, kSize row)
Returns the range values at a specified row.
kSize GdkGenericInput_DataSize(GdkGenericInput input)
Returns the size of the generic data.
kMsgSet GdkInputItem_InputMsg(GdkInputItem input)
Returns the input message object for the item.
const kPoint3d64f * GdkToolInput_AnchorFeaturePosition(GdkToolInput input, GdkAnchorParam component)
Returns the position of the feature providing the anchoring value.
Represents an unresampled profile input.
3D transformation matrix
Definition: GdkDef.h:131