Marker Object


Introduction

A Marker object displays a symbol along with an optional label. Marker objects are created using the function
XintView3DCreateMarker. The label can be located at the marker location or at a different location. In this case, a line is drawn to connect the symbol and the label.

Material Types

Marker objects require a single color and should only be used with material types XintMATERIAL_SINGLE_COLOR or XintMATERIAL_COLOR_INDEX. Most material attributes, except for the color specification, are ignored for Marker objects. In particular, Marker objects do not support lighting, and the material draw mode is ignored. The material attribute specifying whether or not to draw grid lines is also ignored.

Example

The following code example (see file marker.c in example directory) illustrates how to create a Marker object.

    XtAppContext            app_context;
    Widget                  top_level, view3d;
    XintView3DObject        *marker;
    XintView3DMaterial      *material;
    XintView3DMaterialColor color;
    XintVector3             marker_location, label_location;
    XintRealLimits          x_limits, y_limits, z_limits;

    /* Initialize the application */
    top_level = XtGlVaAppInitialize(&app_context, "marker", NULL, 0, &argc,
                                    argv, NULL, NULL);

    /*Create a viewer */
    x_limits.minimum = 0.;
    x_limits.maximum = 1.;
    y_limits.minimum = 0.;
    y_limits.maximum = 1.;
    z_limits.minimum = 0.;
    z_limits.maximum = 1.;
 
    view3d = XtVaCreateManagedWidget("Viewer3D", xintView3DWidgetClass, 
                                     top_level,
                                     XmNwidth,  400,
                                     XmNheight, 400,
                                     XmNxLimits, &x_limits,
                                     XmNyLimits, &y_limits,
                                     XmNzLimits, &z_limits,
                                     NULL);

    /* Create a single color material */
    color.single[0] = 1.0;
    color.single[1] = 0;
    color.single[2] = 0;
    color.single[3] = 1.0;
    material = XintView3DCreateMaterial(NULL, XintMATERIAL_SINGLE_COLOR, 
                                        &color, 0, NULL);

    /* Create a marker object */
    marker_location[0] = .5;
    marker_location[1] = .5;
    marker_location[2] = .2;

    label_location[0] = .5;
    label_location[1] = .5;
    label_location[2] = .8;

    marker = XintView3DCreateMarker("marker", XintOBJECT_MARKER_BOX,
                                    1.0, marker_location, "remote marker",
                                    label_location, True, NULL);

    /* Add object to display */
    XintView3DAddObjectAndMaterial(view3d, marker, material, NULL);

    ...

The output of example marker.c is shown below.


Figure 17: Marker example