|
Gocator Development Kit
|
A tool can also output data such as profiles, surfaces, as well as generic data that can then be selected as stream inputs for other tools.
These can be copied from the input streams, modified versions of them, or even created from scratch.
To define either a profile or surface as an tool output, use GdkToolInfo_AddOutput with the respective output type:
In addition, they can be configured to include intensity data using GdkToolDataOutputInfo_SetHasIntensity.
Profiles are represented as GvProfileMsg classes while surfaces use the GvSurfaceMsg class. During tool processing, the respective class objects can be retrieved using:
To retrieve the index of a data output, GdkTool_ToolDataOutputIndexByType method should be used. Once a class object is retrieved, its member functions can be utilized to populate profile/surface data and other related data such as intensity. Attributes of the object such as the scale and offset can also be set or updated before being sent out.
Generic data output is added using GdkToolInfo_AddOutput with the output type value ranging from GDK_DATA_TYPE_GENERIC_BASE to GDK_DATA_TYPE_GENERIC_END. This allows up to 2147483648 generic data types to be uniquely identified.
There are two ways generic data can be represented: as a kObject type and as a kByte buffer. Similar to profiles and surfaces, generic data is represented as a GvGenericMsg class. During tool processing, the generic class objects can be retrieved using GdkToolOutput_InitGenericAt where the generic data type (kObject or kByte buffer) is specified as one the parameters passed to the function. Because generic outputs are handled by the framework similar to tool data outputs, GdkTool_ToolDataOutputIndexByType method is used to retrieve the appropriate index.
Once a class object is retrieved, its member functions can be utilized to populate the generic data object.
By default data outputs from a tool inherit the region of the input to the tool. There are situations where a developer may want to use a different region. This can be done by overriding the function GdkTool_VCalcDataOutputRegionInstanced. Note that this is called every time the sensor configuration is changed but not on every data scan so the updated region must be able to accomodate for the possible data outputs generated during multiple scan cycles.
In the example below, a surface output has its region set such that the length is equal to the width. If the function does not explicitly set the region, the region remains the default.