View3D Resources
Inherited Behavior and Resources
The View3D widget inherits behavior and resources from the Core,
Composite, Constraint, Manager and CompBase classes.
- The class pointer is xintView3DWidgetClass.
- The class name is XintView3D.
- The header file is included as <Xint/View3D.h>.
The following resources are defined by the View3D widget class.
| Name | Type | Default | Access
|
|---|
| XmNannotationFont | char * | *-helvetica-medium-r-*--14-* | CSG
|
| XmNautoUpdate | Boolean | False | CSG
|
| XmNaxisColor4 | XintColor4 * | 1.0, 1.0, 1.0, 1.0 (white) | CSG
|
| XmNaxisOn | Boolean | True | CSG
|
| XmNaxisLineThickness | int | 2 | CSG
|
| XmNbackgroundColor4 | XintColor4 * | 0.0, 0.0, 0.0, 1.0 (black) | CSG
|
| XmNdefaultMaterial | XintView3DMaterial * | NULL | CSG
|
| XmNdoubleClickCallback | XtCallbackList | NULL | C
|
| XmNdrawHookCallback | XtCallbackList | NULL | C
|
| XmNeditVectorCallback | XtCallbackList | NULL | C
|
| XmNglobalOverride | Boolean | False | CSG
|
| XmNgridColor4 | XintColor4 * | 1.0, 1.0, 1.0, 1.0 (white) | CSG
|
| XmNgridLineThickness | int | 1 | CSG
|
| XmNgridOn | Boolean | True | CSG
|
| XmNhelpCallback | XtCallbackList | NULL | CSG
|
| XmNhighlightColor4 | XintColor4 * | 1.0, 0.0, 0.0, 1.0 (red) | CSG
|
| XmNhighlightThickness | int | 2 | CSG
|
| XmNlabelColor4 | XintColor4 * | 1.0, 1.0, 1.0, 1.0 (white) | CSG
|
| XmNperspectiveProjection | Boolean | True | CSG
|
| XmNpickCallback | XtCallbackList | NULL | C
|
| XmNpickHookCallback | XtCallbackList | NULL | C
|
| XmNremoveCallback | XtCallbackList | NULL | C
|
| XmNrotationCallback | XtCallbackList | NULL | C
|
| XmNrotationMode | int | XintROTATE_OUTLINE | CSG
|
| XmNrotateSensitivity | int | 20 | CSG
|
| XmNselectCallback | XtCallbackList | NULL | C
|
| XmNselectHookCallback | XtCallbackList | NULL | C
|
| XmNselectMode | int | XintSELECT_OUTLINE | CSG
|
| XmNsortTransparent | Boolean | False | CSG
|
| XmNtranslationCallback | XtCallbackList | NULL | C
|
| XmNtranslateSensitivity | int | 20 | CSG
|
| XmNviewAngle | XintViewAngle * | NULL | CS
|
| XmNvisual | Visual * | NULL | CG
|
| XmNxAnnotation | Boolean | True | CSG
|
| XmNxAnnotationFormat | char * | "%.0f" | CSG
|
| XmNxIncrement | XintReal * | NULL | CSG
|
| XmNxLabel | char * | "X" | CSG
|
| XmNxLabelCount | int | 0 | CSG
|
| XmNxLabelLimits
| XintRealLimits * | NULL | CSG
|
| XmNxLabelList | char ** | NULL | CSG
|
| XmNxLabelPositionArray | XintReal * | NULL | CSG
|
| XmNxLimits | XintRealLimits * | NULL | CSG
|
| XmNxUnit | char * | "x_unit" | C
|
| XmNyAnnotation
| Boolean
| True | CSG
|
| XmNyAnnotationFormat | char * | "%.0f" | CSG
|
| XmNyIncrement | XintReal * | NULL | CSG
|
| XmNyLabel | char * | "Y" | CSG
|
| XmNyLabelCount | int | 0 | CSG
|
| XmNyLabelLimits
| XintRealLimits * | NULL | CSG
|
| XmNyLabelList | char ** | NULL | CSG
|
| XmNyLabelPositionArray | XintReal * | NULL | CSG
|
| XmNyLimits | XintRealLimits * | NULL | CSG
|
| XmNyUnit | char * | "y_unit" | C
|
| XmNzAnnotation | Boolean | True | CSG
|
| XmNzAnnotationFormat | char * | "%.0f" | CSG
|
| XmNzIncrement | XintReal * | NULL | CSG
|
| XmNzLabel | char * | "Z" | CSG
|
| XmNzLabelCount | int | 0 | CSG
|
| XmNzLabelLimits
| XintRealLimits * | NULL | CSG
|
| XmNzLabelList | char ** | NULL | CSG
|
| XmNzLabelPositionArray | XintReal * | NULL | CSG
|
| XmNzLimits | XintRealLimits * | NULL | CSG
|
| XmNzUnit | char * | "z_unit" | C
|
| XmNzoomCallback | XtCallbackList | NULL | C
|
| XmNzoomSensitivity | int | 20 | CSG
|
XmNannotationFont
Specifies the name of the font used to draw annotation.
XmNautoUpdate
Specifies whether or not to update the widget display automatically when one of
the attributes is changed in one of the built-in dialog editors, such as the
material or light editor. If this resource is False, the end-user must press
the "OK" or "APPLY" buttons to have the widget redisplay itself. This resource
should be set to False when using the widget on a machine that does not provide
3D accelerated graphics.
XmNaxisColor4
Specifies the color used to draw the axis as a XintColor4 value. Data type
XintColor4 is defined as an array of four floating point values, all between
0.0 and 1.0, containing the red, green, blue and transparency values
respectively.
XmNaxisOn
Specifies whether or not the X, Y and Z axes are visible.
XmNaxisLineThickness
Specifies the thickness in pixels for the axis lines.
XmNbackgroundColor4
Specifies the color used to draw the View3D background as a XintColor4 value.
XmNdefaultMaterial
Specifies the default material used to display unselected objects when the
global override mode is set (See resource XmNglobalOverride below).
XmNdoubleClickCallback
Specifies the list of callback procedures called when an object is double-clicked (action: View3DDoubleClickObject). The reason is XintCR_DOUBLE_CLICK.
XmNdrawHookCallback
Specifies the list of callback procedures called before drawing is done, to allow the addition of user defined OpenGL rendering to draw objects not currently supported by the View3D widget. The callback structure is XintView3DHookCallbackStruct. The reason is XintCR_HOOK_DRAW.
XmNeditVectorCallback
Specifies the list of callback procedures called by actions
View3DEditVectorStart, View3DEditVector or View3DEditVectorEnd. The callback
structure is XintView3DCallbackStruct. The reasosn are XintCR_EDIT_VECTOR_START,
XintCR_EDIT_VECTOR or XintCR_EDIT_VECTOR_END.
XmNglobalOverride
Specifies whether or not the global override mode is set. When the global
override mode is set, all selected objects are displayed with their own
material, and all non selected objects are displayed using a default material
that is set using resource XmNdefaultMaterial.
XmNgridColor4
Specifies the color used to draw grid lines as a XintColor4 value.
XmNgridLineThickness
Specifies the thickness in pixels for the axis grid lines.
XmNgridOn
Specifies whether or not the grid is visible.
XmNhelpCallback
Specifies a list of callbacks called when an end-user presses one of the Help
buttons from one of the built-in menus provided by the View3D widget. If this
resource is set to NULL, no Help button will show up in the built-in menus.
XmNhighlightColor4
Specifies the color used to highlight selected objects as a XintColor4 value.
XmNhighlightThickness
Specifies the thickness in pixels of the line used to draw an object outline
when it is selected and select mode is set to XintSELECT_OUTLINE.
XmNlabelColor4
Specifies the color used to draw the labels as a XintColor4 value.
XmNperspectiveProjection
Specifies whether to use a perspective projection (True) or an orthographic
parallel projection (False).
XmNpickCallback
Specifies the list of callback procedures called when a user picks on an object.
The callback structure is XintView3DCallbackStruct. The reason is XintCR_PICK.
XmNpickHookCallback
Specifies the list of callback procedures called before picking is done, to allow the addition of a user defined picking algorithm for the View3D widget. The callback structure is XintView3DHookCallbackStruct. The reason is XintCR_HOOK_PICK.
XmNremoveCallback
Specifies the list of callbacks called when an object is removed from the
display list using action View3DRemoveObject. The callback structure is
XintView3DRemoveCallbackStruct. The reason is XintCR_REMOVE.
XmNrotationCallback
Specifies the list of callbacks called when the display within the widget is rotated by using the View3DRotateStart(), View3DRotate(), View3DRotateEnd() actions. The callback structure is XintView3DOrientationCallbackStruct. The reasons are XintCR_ROTATE_START, XintCR_ROTATE, XintCR_ROTATE_END.
XmNrotationMode
Specifies how objects are drawn during a rotation, scale or translation
operation. One of the following defined constants may be specified:
| Defined Constant | Description
|
|---|
| XintROTATE_OUTLINE (default) | Only the object outline is drawn during a rotation.
|
| XintROTATE_POINTS | Surface objects are drawn as point clouds during a rotation.
|
| XintROTATE_SOLID | All objects are fully drawn during a rotation
|
| XintROTATE_WIREFRAME | Each object is drawn in wireframe mode during a rotation.
|
XmNrotateSensitivity
Specifies the sensitivity of the mouse with respect to rotation. You may
specify a value from 1 to 100 (default value is 20). The higher the value, the
more sensitive the mouse will be.
XmNselectCallback
Specifies the list of callback procedures called when an object is selected.
The callback structure is XintView3DCallbackStruct, and the reason is
XintCR_SELECT.
XmNselectHookCallback
Specifies the list of callback procedures called before a selection is done, to
allow the addition of a user defined selection algorithm for the View3D widget. The callback structure is XintView3DHookCallbackStruct. The reason is XintCR_HOOK_SELECT.
XmNselectMode
Specifies how selected objects will appear. You may specify one of the
following defined constants:
| Defined Constant | Description
|
|---|
| XintSELECT_OUTLINE (default) | Object outline is drawn with the highlight color.
|
| XintSELECT_POINTS | Object points are drawn with the highlight color.
|
| XintSELECT_SOLID | Object surface is drawn as a solid surface using the highlight color.
|
| XintSELECT_WIREFRAME | Object wireframe is drawn with the highlight color.
|
See resource XmNhighlightColor to specify the highlight color.
XmNsortTransparent
Specifies the type of transparency rendering the user prefers. Supply True if there is more than one transparent object in the viewer. This sorts all transparent objects and draws them from back to front. This is slower but the user is assured that all transparent objects are rendered in the right order. The predisplay calculation may take some time but rotation and transformation are done in real time. Supply False if only one transparent object is being used at a time or the rendering order of transparent objects does not matter.
XmNtranslationCallback
Specifies the list of callbacks called when the display within the widget is translated by using the View3DTranslateStart(), View3DTranslate(), View3DTranslateEnd() actions. The callback structure is XintView3DOrientationCallbackStruct. The reasons are XintCR_TRANSLATE_START, XintCR_TRANSLATE, and XintCR_TRANSLATE_END.
XmNtranslateSensitivity
Specifies the sensitivity of the mouse with respect to translation. You may
specify a value from 1 to 100 (default value is 20). The higher the value, the
more sensitive the mouse will be.
XmNviewAngle
Specifies the viewing angle. This resource is specified as a pointer to a data
structure of type XintViewAngle which takes the following form:
typedef struct {
float azimuth;
float dip;
} XintViewAngle;
Member azimuth is an angle between 0.0 and 360.0 and
dip an angle between -90.0 and 90.0.

XmNvisual
Specifies a visual to be used by the View3D widget. Because View3D is based on
OpenGL, the default visual created by the application may not be suitable.
View3D does not inherit the visual from its parent. So, if no visual is
specified, View3D will automatically select a visual compatible with OpenGL.
Visual selection is done internally using OpenGL function glXChooseVisual.
View3D tries to select an RGBA visual with support for double buffering. If a
new visual is selected, View3D also creates a colormap compatible with that
visual.
When using the Mesa library, View3D will select the default visual in most
cases. If this is the case, it will not create a new colormap, but use the
default colormap instead.
If you set resource XmNvisual yourself, you must:
- Make sure that it is compatible with OpenGL (use convenience function
XintGlChooseVisual or function glXChooseVisual directly).
- Allocate and specify (using Core resource XmNcolormap) a colormap that is
compatible with the selected visual (You can use function
XintGlAllocateColormap).
- Set resource XmNdepth if the visual depth is different from the default
depth.
XmN[xyz]Annotation
Specifies whether or not the X, Y or Z annotation is visible.
XmN[xyz]AnnotationFormat
Specifies the format used to draw the X, Y or Z annotation. Use any C format
descriptor (e.g. "%5.2f") suitable for displaying floating point data.
XmN[xyz]Increment
Specifies the increment for the axis along the X, Y or Z direction in user
coordinates. This resource must be specified as a pointer to a floating point
value. If you set this resource to NULL, the axis increment is calculated
automatically based on the range of the data. See resource XmN[xyz]LabelList to
annotate an axis based on a set of application's defined labels.
XmN[xyz]Label
Specifies the X, Y or Z label displayed next to the corresponding axis. Specify
NULL to have no label displayed.
XmN[xyz]LabelCount
Specifies the size of array XmNxLabelList, XmNyLabelList or XmNzLabelList
respectively.
XmN[xyz]LabelLimits
Specifies the limits to honor when axis is automatically labeled by the View3D widget. XmN[xyz]Increment will determine the increment of the labels along each axis. Since the View3D widget automatically adjusts the model boundary when deleting or adding objects, the resource has to be specified by the ratio to the minimum of XmN[xyz]Limits or model limits.
XmN[xyz]LabelList
Specifies a list of labels to be used to annotate the X, Y or Z axis. The size
of the array is set using resource Xm[xyz]LabelCount, and the position of the
labels along each axis may be specified using resource
XmN[xyz]LabelPositionArray. If resource XmN[xyz]LabelList is NULL, the
corresponding axis is annotated based on the numerical range of the axis and
the values of resource XmN[xyz]Increment.
XmN[xyz]LabelPositionArray
Specifies the position, in user coordinates, of the labels specified using
resource XmN[xyz]LabelList. Labels must be positioned inside the limits of the
corresponsing axis, or they will not be displayed.
XmN[xyz]Limits
Specifies the axis range along the specified direction. If you don't specify
anything for this value, the axis range will be set to the minimum and maximum
in the specified direction. This resource is specified as a pointer to a data
structure of type XintRealLimits which takes the following form:
typedef struct {
XintReal minimum;
XintReal maximum;
} XintRealLimits;
XmN[xyz]Unit
Specifies a string describing the unit system used for the X, Y or Z direction.
This resource is used by the View3D widget to determine how to size the initial
display inside a unit cube and in particular to decide whether or not to
preserve the aspect ratio between the different directions. The aspect ratio,
calculated from the limits of the display, is preserved for the directions
which have the same units. The other directions are mapped to the unit size.
The following example illustrates how this resource works.

XmNzoomCallback
Specifies the list of callbacks called when the display within the widget is zoomed by using the View3DZoomStart(), View3DZoom(), and View3DZoomEnd() actions. The callback structure is XintView3DOrientationCallbackStruct. The reasons are XintCR_ZOOM_START, XintCR_ZOOM, and XintCR_ZOOM_END.
XmNzoomSensitivity
Specifies the sensitivity of the mouse with respect to zooming. You may specify
a value from 1 to 100 (default value is 20). The higher the value, the more
sensitive the mouse will be.