Gocator Development Kit
 All Classes Files Functions Variables Typedefs Friends Modules Pages
Geometric Feature Outputs

Geometric features can be defined within a tool to be sent as outputs to other tools.

Four feature types are currently supported: point, line, circle and plane

Defining Features

To define a feature output, use GdkToolInfo_AddOutput with output type set to one of the following:

  • GDK_DATA_TYPE_FEATURES
  • GDK_DATA_TYPE_FEATURE_POINT
  • GDK_DATA_TYPE_FEATURE_LINE
  • GDK_DATA_TYPE_FEATURE_CIRCLE
  • GDK_DATA_TYPE_FEATURE_PLANE

Retrieving Features

Each of the four features are represented by their respective feature message class:

  • GvPointFeatureMsg
  • GvLineFeatureMsg
  • GvCircleFeatureMsg
  • GvPlaneFeatureMsg

They can be retrieved during tool processing using GdkToolOutput_InitFeature and then used to assign their corresponding data components before being sent out. To retrieve the index of a feature, GdkTool_FeatureIndexByType method should be used.

GdkFx(kStatus) GdkTestTool_VProcess(GdkTestTool tool, GdkToolInput input, GdkToolOutput output)
{
GdkTestPeakToolClass* obj = GdkTestTool_Cast_(tool);
GvCircleFeatureMsg circleFeatureMsg;
kPoint3d64f position = {1.0, 2.0, 3.0};
kPoint3d64f direction = {4.0, 5.0, 6.0};
k64f radius = 5.0;
kTest(GdkToolOutput_InitFeatureAt(output, obj->featureIndexCircleFeature, GDK_FEATURE_TYPE_CIRCLE, &circleFeatureMsg));
kTest(GvCircleFeatureMsg_SetPosition(circleFeatureMsg, &position));
kTest(GvCircleFeatureMsg_SetNormal(circleFeatureMsg, &direction));
kTest(GvCircleFeatureMsg_SetRadius(circleFeatureMsg, radius));
return kOK;
}