3D Object Functions

The following convenience functions are defined for creating and manipulating the 3D objects that can be inserted into a View3D widget.

Function NameDescription
XintView3DAddObjectToGroupAdds an object to a group.
XintView3DAdjObjRotationAdjusts an object's dynamic rotation.
XintView3DAdjObjScaleAdjusts an object's dynamic scale.
XintView3DAdjObjTranslationAdjusts an object's dynamic translation.
XintView3DAssignTextureAssigns a texture map to an object.
XintView3DChangeMaterialChange properties of a material.
XintView3DChangeObjectChange properties of an object.
XintView3DChangeVolumeAlphaTableThis function changes the alpha lookup table for a volume object.
XintView3DChangeVolumeColorTableThis function changes the color lookup table or a volume object.
XintView3DCreateDEMSurfaceCreates a mesh surface object from a USGS DEM file.
XintView3DCreateFacetCreates a facet object.
XintView3DCreateGeometricCreates a geometric object.
XintView3DCreateGOCADSurfaceCreates a mesh surface object from a GOCAD file.
XintView3DCreateGroupCreates a group object.
XintView3DCreateINTGridSurfaceCreates a mesh surface object from a regular grid stored in an ASCII file.
XintView3DCreateLineCreates a line object.
XintView3DCreateMarkerCreates a marker object.
XintView3DCreateMaterialCreates an instance of a material.
XintView3DCreateMeshSurfaceCreates a mesh surface object.
XintView3DCreateNormalsForMeshCreates a line object containing the normals at each vertex for the specified mesh surface.
XintView3DCreatePointCreates a point or point cloud object.
XintView3DCreateRasterCreates a raster image object.
XintView3DCreateTextureMapCreates a texture map.
XintView3DCreateUniformGridCreates a mesh surface object from a regular grid.
XintView3DCreateVolumeCreates a volume object.
XintView3DGetAxisLimitsReturns the axis limits in the x, y, znd z directions.
XintView3DGetAxisScaleReturns the axis scale values in the x, y, znd z directions.
XintView3DGetGroupListReturns the list of objects contained in a group.
XintView3DGetMeshTwoSidedReturns True if mesh has a different front and back material.
XintView3DGetObjectMaterialReturns the material(s) used to display an object.
XintView3DGetObjectTypeReturns the type of an object.
XintView3DOverlayObjOnPolygonWill overlay lines or point objects on top of a mesh or facet object.
XintView3DQueryMaterialReturns properties of a material.
XintView3DQueryObjectReturns properties of an object.
XintView3DRefMaterialIncreases the reference count of a material.
XintView3DRefObjectIncreases the reference count of an object.
XintView3DRefTextureIncreases the reference count of a texture map.
XintView3DRemoveObjectFromGroupRemoves an object from a group.
XintView3DSetMaterialSets the values of a material.
XintView3DSetObjRotationSets an object's dynamic rotation.
XintView3DSetObjScaleSets an object's dynamic scale.
XintView3DSetObjTranslationSets an object's dynamic translation.
XintView3DUnRefMaterialDecreases the reference count of a material.
XintView3DUnRefObjectDecreases the reference count of an object.
XintView3DUnRefTextureDecreases the reference count of a texture map.


XintView3DAddObjectToGroup

This function adds an object to a group of objects.

     void XintView3DAddObjectToGroup (...)

XintView3DObject *group_objectID of the group object.
XintView3DObject *objectID of the object to add to the group.


XintView3DAdjObjRotation

This function adjusts the rotation of an object.

     void XintView3DAdjObjRotation (...)

XintView3DObject *objectID of the object to adjust.
XintVector3rotationVector to rotate about.
doubleangleAngle in degrees to rotate.

The object is rotated about the vector rotation by angle degrees. The effects of multiple calls to XintView3DAdjObj* are cumulative.


XintView3DAdjObjScale

This function adjusts the size of an object.

     void XintView3DAdjObjScale (...)

XintView3DObject *objectID of the object to adjust.
XintVector3scaleAmount to scale.

The object is scaled by the vector scale, scale[0] = X, scale[1] = Y, scale[2] = Z. The effects of multiple calls to XintView3DAdjObj* are cumulative.


XintView3DAdjObjTranslation

This function adjusts the location of an object.

     void XintView3DAdjObjTranslation (...)

XintView3DObject *objectID of the object to adjust.
XintVector3translationAmount to translate.

The object is translated by the vector translation, translation[0] = X, translation[1] = Y, translation[2] = Z. The effects of multiple calls to XintView3DAdjObj* are cumulative.


XintView3DAssignTexture

This function assigns a texture map to an object.

     void XintView3DAssignTexture (...)

WidgetwidgetID of the View3D widget.
XintView3DObject *objectObject to assign the texture to.
XintVector2f *tcoordsTexture coordinates.
XintView3DTextureMap *front_textureFront texture map.
XintView3DTextureMap *back_textureBack texture map. Useful only for 2-sided surfaces.

front_texture must be specified. For non-two-sided objects, back_texture is ignored. If automatic texture coordinate generation is not being used, then tcoords must be specified, otherwise it is ignored. tcoords is an array of texture coordinates. One texture coordinate must be specified for each vertex within the object to specify the mapping of the texture to the object. The coordinates of a texture map range from 0.0 through 1.0. If the texture coordinates fall outside of this range, the behavior is defined by the clamp_* arguments to XintView3DCreateTextureMap. See the User Guide for more information on choosing legitimate texture coordinates.


XintView3DChangeMaterial

This function changes properties of a material.

     void XintView3DChangeMaterial (...)

XintView3DMaterial *materialMaterial to change.
unsigned longflagsFlags defining properties to change.
XintView3DMaterialAttributes *attributesMaterial attributes.
XintView3DMaterialColor *colorMaterial color.

The material properties are changed according to the flags parameter.

All Material Types
PropertyRequired Flag
attributes->lightXintMA_LIGHT
attributes->shade_modelXintMA_SHADE_MODEL
attributes->draw_modeXintMA_DRAW_MODE
attributes->draw_gridXintMA_DRAW_GRID

XintMATERIAL_SINGLE_COLOR
PropertyRequired Flag
color->singleXintMA_SINGLE_COLOR

XintMATERIAL_MULTI_COLOR
PropertyRequired Flag
color->multi.colorsXintMA_MULTI_COLOR

XintMATERIAL_COLOR_SCALE
PropertyRequired Flag
color->scale.orientationXintMA_SCALE_ORIENTATION
color->scale.rangeXintMA_SCALE_RANGE
color->scale.colorsXintMA_SCALE_COLORS

XintMATERIAL_RANGE_COLOR
PropertyRequired Flag
color->range.min_colorXintMA_RANGE_MIN
color->range.max_colorXintMA_RANGE_MAX
color->range.range_directionXintMA_RANGE_DIRECTION
color->range.interp_methodXintMA_RANGE_INTERP
color->range.across_objectXintMA_RANGE_ACROSS
color->range.color_modelXintMA_RANGE_MODEL

XintMATERIAL_COLOR_INDEX
PropertyRequired Flag
color->index.tableXintMA_INDEX_TABLE
color->index.indexXintMA_INDEX


XintView3DChangeObject

This function changes properties of a graphical object.

     void XintView3DChangeObject (...)

XintView3DObject *objectObject to change.
unsigned longflagsFlags defining properties to change.
XintView3DObjectProperty *propObject properties.

The object properties are changed according to the flags parameter.

Line Object
PropertyRequired Flag
property->line.nameXintCO_LINE_NAME
property->line.verticesXintCO_LINE_VERTICES
property->line.data_4dXintCO_LINE_DATA4D
property->line.thicknessXintCO_LINE_THICKNESS
property->line.user_dataXintCO_LINE_USER_DATA

Mesh Object
PropertyRequired Flag
property->mesh.nameXintCO_MESH_NAME
property->mesh.verticesXintCO_MESH_VERTICES
property->mesh.fdata_4dXintCO_MESH_F_DATA4D
property->mesh.bdata_4dXintCO_MESH_B_DATA4D
property->mesh.user_dataXintCO_MESH_USER_DATA

Marker Object
PropertyRequired Flag
property->marker.nameXintCO_MARKER_NAME
property->marker.sizeXintCO_MARKER_SIZE
property->marker.locationXintCO_MARKER_LOCATION
property->marker.labelXintCO_MARKER_LABEL
property->marker.label_locXintCO_MARKER_LABEL_LOC
property->marker.user_dataXintCO_MARKER_USER_DATA

Raster Object
PropertyRequired Flag
property->raster.nameXintCO_RASTER_NAME
property->raster.verticesXintCO_RASTER_VERTICES
property->raster.data_4dXintCO_RASTER_DATA4D
property->raster.lower_leftXintCO_RASTER_LOWER_LEFT
property->raster.lower_rightXintCO_RASTER_LOWER_RIGHT
property->raster.upper_rightXintCO_RASTER_UPPER_RIGHT
property->raster.upper_leftXintCO_RASTER_UPPER_LEFT
property->raster.user_dataXintCO_RASTER_USER_DATA

Facet Object
PropertyRequired Flag
property->facet.nameXintCO_FACET_NAME
property->facet.verticesXintCO_FACET_VERTICES
property->facet.data_4dXintCO_FACET_DATA4D
property->facet.user_dataXintCO_FACET_USER_DATA

Point Object
PropertyRequired Flag
property->point.nameXintCO_POINT_NAME
property->point.verticesXintCO_POINT_VERTICES
property->point.data_4dXintCO_POINT_DATA4D
property->point.sizeXintCO_POINT_SIZE
property->point.user_dataXintCO_POINT_USER_DATA

Geometric Object
PropertyRequired Flag
property->geom.nameXintCO_GEOM_NAME
property->geom.data_4dXintCO_GEOM_DATA4D
property->geom.dimXintCO_GEOM_DIMENSION
property->geom.locationXintCO_GEOM_LOCATION
property->geom.user_dataXintCO_GEOM_USER_DATA

Volume Object
PropertyRequired Flag
property->volume.nameXintCO_VOLUME_NAME
property->volume.verticesXintCO_VOLUME_VERTICES
property->volume.min_coordXintCO_VOLUME_MIN_COORD
property->volume.max_coordXintCO_VOLUME_MAX_COORD
property->volume.user_dataXintCO_VOLUME_USER_DATA


XintView3DChangeVolumeAlphaTable

This function changes the alpha lookup table for a Volume object.

     void XintView3DChangeVolumeAlphaTable (...)

XintView3DObject *objectID of the View3D Volume object.
float *alpha_tableVolume alpha lookup table.
intalpha_sizeSize of the alpha lookup table.


XintView3DChangeVolumeColorTable

This function changes the color lookup table for the Volume object.

     void XintView3DChangeVolumeColorTable (...)

XintView3DObject *objectID of the View3D Volume object.
XintPointercolor_tableVolume color lookup table.
intcolor_sizeSize of the color lookup table.


XintView3DCreateDEMSurface

Create a mesh surface from a U.S. Geological Survey Digital Elevation Model. It will accurately generate surfaces from 15-minute, 30-minute, and 1-degree data. It will not process a 7.5-minute data file.

     XintView3DObject *XintView3DCreateDEMSurface (...)

char *filenameName of file to read.
intx_stepSampling interval along X axis.
inty_stepSampling interval along Y axis.
Booleanuse_trianglesSet to True to display the surface using triangles (2 per grid cell). Set to False to display the surface using rectangles. This flag should be set to True if the surface is going to be edited or if the grid is not smooth.
XtPointeruser_dataPointer to user private data.

For sample DEM data look at the U.S. Geological Survey's www site.


XintView3DCreateFacet

Create a facet data type. A faceted data type is a mesh surface composed of polygons whose surface normals are not interpolated from the polygon vertices. A faceted surface is composed of a series of triangles, quadrilaterals or polygons.

     XintView3DObject *XintView3DCreateFacet (...)

char *filenameName of file to read.
XintView3DObjectTypetypeType of facet.
intnum_vertsNumber of vertices in object.
XintVector3 *vertsList of vertices.
XintVector3 *normalOptional list of polygon normals.
intnum_facetsNumber of facets (polygons).
int *num_indicesNumber of indices per polygon.
int **indicesList of indices per polygon.
BooleanrhsSpecifies whether the coordinates system is right handed (z axis pointing up), or left handed (z axis pointing down).
XintReal *data_4dSpecifies a data array, of size num_facets, that is used to assign the color for each facet if the material type is set to XintMATERIAL_COLOR_SCALE.
XtPointeruser_dataPointer to user private data.

The argument type must be set as one of the following constants:

Defined ConstantDescription
XintOBJECT_FACET_TRISSurface is specified as a set of triangles.
XintOBJECT_FACET_QUADSSurface is specified as a set of quadrilaterals.
XintOBJECT_FACET_POLYSSurface is specified as a set of polygons.

For a type of XintOBJECT_FACET_TRIS or XintOBJECT_FACET_QUADS, num_indices is ignored, and indices contains only one list of indices with every 3 or 4 indices representing a single facet on the surface.

If normal is set to NULL, then the surface normals will be calculated for each facet based upon the orientation of the polygons.

A facet data type differs from a mesh surface in several ways:

1. Surface normals are not interpolated across each polygon. This effect is similar to specifying a material with the shading set to XintFLAT.

2. Colors are assigned per facet, not per vertex. When multiple color materials are assigned to a facet, use the number of facets in the object instead of the number of vertices, when specifying the number of colors.

Sample data types and arguments:

XintOBJECT_FACET_TRIS:

XintView3DCreateFacet(num_verts = 5,
                     verts = (XintVector *)malloc(5 * sizeof(XintVector3)),
                     normal = NULL,
                     num_facets = 3,
                     num_indices = NULL,
                     num_lists = (int **)malloc(1 * sizeof(int *)),
                     num_lists[0] = (int *)malloc(num_facets * 3 * sizeof(int)),
                     rhs = True,
                     data_4d = NULL,
                     user_data = NULL);

XintOBJECT_FACET_QUADS:

XintView3DCreateFacet(num_verts = 6,
                     verts = (XintVector *)malloc(6 * sizeof(XintVector3)),
                     normal = NULL,
                     num_facets = 2,
                     num_indices = NULL,
                     num_lists = (int **)malloc(1 * sizeof(int *)),
                     num_lists[0] = (int *)malloc(num_facets * 4 * sizeof(int)),
                     rhs = True,
                     data_4d = NULL,
                     user_data = NULL);

XintOBJECT_FACET_POLYS:

XintView3DCreateFacet(num_verts = 9,
                     verts = (XintVector *)malloc(9 * sizeof(XintVector3)),
                     normal = NULL,
                     num_facets = 2,
                     num_indices = NULL,
                     num_lists = (int **)malloc(2 * sizeof(int *)),
                     num_lists[0] = (int *)malloc(num_facets * 5 * sizeof(int)),
                     num_lists[1] = (int *)malloc(num_facets * 6 * sizeof(int)),
                     rhs = True,
                     data_4d = NULL,
                     user_data = NULL);


XintView3DCreateGeometric

This function creates a geometric object: Sphere, Cube, Cone, or Cylinder.

     XintView3DObject *XintView3DCreateGeometric (...)

char *nameName of geometric object.
XintView3DObjectTypetypeType of object.
double *dimensionDimensions of the object.
XintVector3locationLocation of the object.
intdetailDetail level of the object.
BooleanrhsSpecifies whether the coordinate system is right handed (z axis is pointing up) or left handed (z axis is pointing down).
XintReal *data_4dSpecifies a data array, of size num_verts, that is used to assign the color of the object if the material type is set to XintMATERIAL_COLOR_SCALE.
XtPointeruser_dataPointer to user private data.

The argument type must be set to one of the following constants:

Defined ConstantDescription
XintOBJECT_GEOMETRIC_CYLINDERCylinder
XintOBJECT_GEOMETRIC_CONECone
XintOBJECT_GEOMETRIC_CUBECube (or Box)
XintOBJECT_GEOMETRIC_SPHERESphere

The detail of the object specifies the following:

ObjectDescription
CylinderNumber of vertical sections.
ConeNumber of vertical sections.
CubeIgnored.
SphereNumber of longitudinal and lateral divisions.

A geometric object is a simple geometric shape. Since the object has only one specified vertex (location), it can only be assigned a single color, although any of the material types can be assigned to it. Texture mapping is the only exception.

Application of texture map:

ObjectTexture Map
CylinderMapped around the cylinder with texture coordinates with the top row of the texture on the top of the cylinder, and the bottom row of the texture on the bottom of the cylinder.
ConeSame as the cylinder.
CubeA separate copy of the texture map on each face.
SphereSame as the cylinder.


XintView3DCreateGOCADSurface

This function reads a GOCAD triangle mesh surface file and creates a mesh surface object.

     XintView3DObject *XintView3DCreateGOCADSurface (...)

char *fileName of the GOCAD file.
BooleanrhsSpecifies whether the coordinate system is right handed (z axis pointing up) or left handed (z axis pointing down).
XtPointeruser_dataPointer to user private data.


XintView3DCreateGroup

This function creates an empty group object. Objects can be added to a group using function XintView3DAddObjectToGroup.

     XintView3DObject *XintView3DCreateGroup (...)

char *nameName of the group object to create.
XtPointeruser_dataPointer to user private data.


XintView3DCreateINTGridSurface

This function reads a regular grid description stored in a file and creates a mesh surface object.

     XintView3DObject *XintView3DCreateINTGridSurface (...)

char *filenameName of the file containing the grid.
BooleanrhsSpecifies whether the coordinate system is right handed (z axis pointing up) or left handed (z axis pointing down).
Booleanuse_trianglesSet to True to display the surface using triangles (2 per grid cell). Set to False to display the surface using rectangles. This flag should be set to True if the surface is going to be edited or if the grid is not smooth.
XintReal *null_valueSpecifies a pointer to a value representing missing data. Set it to NULL if your grid has no missing values. Creation time of a grid will increase significantly if you specify a non NULL value.
XtPointeruser_dataPointer to user private data.

The function returns NULL if it could not open the file or if the file did not contain a valid regular grid description. The INT grid file is formatted as an ASCII file as shown below:

    nx ny        # size of the grid
    startx endx  # start and end in x direction (FP values)
    starty endy  # start and end in y direction (FP values)
    data1        # first data element
    data2        # second data element
    ...
    dataN        # last data element (N = nx * ny)
The data points are stored along the X direction (rowwise).

XintView3DCreateLine

This function creates a line object of the specified type.

     XintView3DObject *XintView3DCreateLine (...)

char *nameName of the line object.
XintView3DObjectTypetypeType of the line to create.
doublethicknessThickness of the line.
intnum_verticesNumber of vertices.
XintVector3 *verticesList of vertices for the line.
intnum_indicesNumber of indices.
int *indicesList of indices (Specify NULL in most cases to let the function automatically generate the list).
BooleanrhsSpecifies whether the coordinate system is right handed (z axis pointing up) or left handed (z axis pointing down).
XintReal *data_4dSpecifies a data array, of size num_vertices, that is used to assign the color at each node if the material type is set to XintMATERIAL_COLOR_SCALE.
XtPointeruser_dataPointer to user private data.

Argument type may be set either to XintOBJECT_LINE_SEGMENT or XintOBJECT_LINE_POLYLINE. The following diagram shows the relationship between argument type and arguments vertices/indices:


Data type XintVector3 is used to store X, Y, and Z coordinates and is defined as follows:

     typedef XintReal XintVector3[3];

In most cases argument indices should be set to NULL so that the list of indices is automatically generated by the function (set to 0,1,2... num_verts-1). Only under some special circumstances will you need to specify your own list of indices. An example would be the case where you need to draw a pattern requiring you to traverse some points multiple times. In this case it may be more efficient to specify an index list rather than having to duplicate the points in the list of vertices.

The example below illustrates how to specify the arguments vertices and indices to draw the pattern shown below.





XintView3DCreateMarker

This function creates a marker object. A marker object is made of a symbol along with an optional label. The label can be positioned at the marker location or at a different location. In this case, the marker symbol and the label are connected with a line. Marker objects may be set to be selectable, but they cannot be picked.

     XintView3DObject *XintView3DCreateMarker (...)

char *nameName of the marker object.
XintView3DObjectTypetypeType of marker to create.
doublesizeSpecifies the marker size. Specifying a size of 1.0 corresponds to a symbol size equal to 5% of the width of the scaled display.
XintVector3locationLocation of the Marker object.
char *labelMarker label.
XintVector3label_locationSpecifies the label location. If this location is different from the value specified in argument location then the label will be attached remotely.
BooleanrhsSpecifies whether the coordinate system is right handed (z axis pointing up) or left handed (z axis pointing down).
XtPointeruser_dataPointer to user private data.

Argument type must be specified as one of the following constants:

Defined ConstantDescription
XintOBJECT_MARKER_CROSSThe marker symbol is a 3D cross, the size of which is specified in argument size.
XintOBJECT_MARKER_BOXThe marker symbol is a 3D box, the size of which is specified in argument size.
XintOBJECT_MARKER_POINTThe marker symbol is a point, the size of which is specified in argument size.
XintOBJECT_MARKER_STARThe marker symbol is a 3D star, the size of which is specified in argument size.

Data type XintVector3 is used to store X, Y, and Z coordinates and is defined as

     typedef XintReal XintVector3[3];


XintView3DCreateMaterial

This function creates an instance of a material. A material is used to describe the graphical attributes of an object.

     XintView3DMaterial *XintView3DCreateMaterial (...)

char *name Name of material.
XintView3DMaterialTypetypeType of material.
XintView3DMaterialColor *colorColor specification based on the type of material.
unsigned longattr_maskSpecifies which members of attributes are set. attr_mask is made by combining any number of the mask symbols listed below.
XintView3DMaterialAttributes *attributesSpecifies a pointer to the structure containing the material attributes to be set.

The argument type must be specified as one of the following constants:

Defined ConstantDescription
XintMATERIAL_SINGLE_COLORMaterial type used for objects requiring a single color.
XintMATERIAL_RANGE_COLORMaterial type used for objects which color at a vertex is assigned as the result of an interpolation between two colors.
XintMATERIAL_MULTI_COLORMaterial type used for objects requiring a color definition for each vertex.
XintMATERIAL_COLOR_SCALEMaterial type used for objects which color at a vertex is assigned from an array of colors based on its data value.
XintMATERIAL_COLOR_INDEXMaterial type used for objects requiring a color definition for each vertex and where the color is specified as an index into a color table.

Argument color is a pointer to a structure which members are complex structures used to describe a specific color type. You must fill the member corresponding to the type of material selected.

    typedef struc {
                   XintColor4           single;/* One color type */
                   XintView3DColorRange range; /* Range color type */
                   XintView3DColorScale scale; /* Colorscale information */
                   XintView3DColorIndex index; /* Color index information */
                   XintView3DColorMulti multi; /* Multi color data */
    } XintView3DMaterialColor;

When argument type is set to XintMATERIAL_SINGLE_COLOR, a single color for the object must be specified using member single. Data type XintColor4 is used to store the RGB values and the transparency level as values between 0.0 and 1.0.

     typedef float XintColor4[4];

When argument type is set to XintMATERIAL_RANGE_COLOR, a minimum and maximum color for the object must be specified using member range. The color assigned to each object point of the object is interpolated between the minimum and maximum colors. The type and orientation of the interpolation, as well as the color model used, need also be specified in structure XintView3DColorRange described below:

    typedef struct {
                    unsigned int                  range_direction;
                    XintView3DInterpolationMethod interp_method;
                    Boolean                       across_object;
                    XintView3DColorModel          color_model;
                    XintColor4                    min_color;
                    XintColor4                    max_color;
    } XintView3DColorRange;

Member range_direction describes the direction of interpolation, it may be set to XintINTERPOLATE_X, XintINTERPOLATE_Y , XintINTERPOLATE_Z, or a combination of these (set it to XintINTERPOLATE_X+XintINTERPOLATE_Y to interpolate both in the X and Y directions for example). Member interp_method describes the interpolation method, you may specify XintINTERPOLATE_LINEAR, XintINTERPOLATE_EXPONENTIAL, XintINTERPOLATE_LOGARITHMIC, XintINTERPOLATE_RANDOM.

Member across_object specifies whether the interpolation is performed within the object range (True) or within the limits of the coordinate system (False). Argument color_model specifies in which color model space to perform the interpolation. You may specify XintCOLOR_MODEL_RGB (Red/Green/Blue) or XintCOLOR_MODEL_HSV (Hue/Saturation/Value). Finally, members min_color and max_color specify the two colors to interpolate between.

When argument type is set to XintMATERIAL_MULTI_COLOR, a color must be specified for each vertex of the object that this material is created for. The number of colors specified must be at least as large as the number of vertices in the associated object. Do not use this type of material in conjunction with a Marker object. The number of colors and the array of colors are specified in structure XintView3DColorMulti which is described below.

    typedef struct {
                    int num_colors;    /* Number of colors */
                    XintColor4 *colors; /* Colors in scale */
    } XintView3DColorMulti;

When argument type is set to XintMATERIAL_COLOR_SCALE, the material color is specified as a list of colors. Each vertex is assigned a color from the list based on its data value (x, y, z or 4d component). The colors, orientation, list of intervals are specified in structure XintView3DColorScale, described below.

    typedef struct {
                    XintView3DColorScaleOrientation orientation; /*Orientation*/
                    XintReal    *range;                 /* Data intervals     */
                    int         num_colors;             /* Number of colors   */
                    XintColor4 *colors;                 /* Colors in scale    */
    } XintView3DColorScale;

Member orientation specifies which vertex component is used to assign the color. Specify XintCOLOR_SCALE_ORIENTATION_X to use the X coordinate, XintCOLOR_SCALE_ORIENTATION_Y for the Y coordinate, XintCOLOR_SCALE_ORIENTATION_Z for the Z coordinate and XintCOLOR_SCALE_ORIENTATION_4D to use the 4th component specified using arguments fdata_4d or bdata_4d. Member range is an array of size num_colors-1 and is used to specify the data intervals. For example, if member num_colors is 4 and range contains the values {10., 20., 30.}, then the first color will be assigned to vertices which data component is less than 10., the second color will be assigned to vertices which data component is between 10 and 30. etc.

When argument type is set to XintMATERIAL_COLOR_INDEX the colors for an object are specified as an index into a color table. A color table is a pointer to an opaque structure containing a list of colors. See the Color Function section to create a color table. The color table to use and the list of indices are specified using structure XintView3DColorIndex, described below.

    typedef struct {
                    XintView3DColorTable *table; /* Color table       */
                    int  num_indices;            /* Number of indices */
                    int  *index;                 /* Index list        */
    } XintView3DColorIndex;

Material of type XintMATERIAL_COLOR_INDEX can be used to specify a single color material (num_indices = 1) or a color for each vertex ( num_indices = number of vertices).

Arguments attr_mask and attributes are used to set all the attributes of a material except the color. Argument attributes is a pointer to a structure of type XintView3DMaterialAttributes which is described below:

    typedef struct {
                    Boolean   light;
                    int       shade_model;
                    int       draw_mode;
                    Boolean   draw_grid;
                    Boolean   image_flag;
    } XintView3DMaterialAttributes;

You need only to set the components that you want to change. The following table lists the structure members, the default values, and the corresponding mask.

MemberDefaultMask
lightTrueXintMA_LIGHT
shade_modelXintSMOOTHXintMA_SHADE_MODEL
draw_modeXintDRAW_FILLXintMA_DRAW_MODE
draw_gridFalseXintMA_DRAW_GRID
image_flagFalseXintMA_IMAGE_FLAG

Member light specifies whether lighting is enabled or disabled for the object. Member shade_model specifies the shade model used for the object. It may be set to XintSMOOTH or XintFLAT. Argument draw_mode specifies how to draw the object, it may be set to XintDRAW_FILL, XintDRAW_LINE or XintDRAW_POINT. Argument draw_grid, used for mesh surface objects only, specifies whether or not to draw the mesh grid lines. Finally, argument image_flag must be set to True if the material is to be used in conjunction with a Raster Image object.


XintView3DCreateMeshSurface

This function creates a Mesh Surface data object. Mesh Surface objects can be used to represent surfaces that can be described as sets of triangles, quadrilaterals or polygons.

     XintView3DObject *XintView3DCreateMeshSurface (...)

char *nameName of surface object.
XintView3DObjectTypetypeType of surface.
intnum_vertsNumber of vertices (data points).
XintVector3 *vertsArray of data points.
XintVector3 *normalsArray of normals (normalized vector perpendicular to the surface at the corresponding vertex). A normal vector must be specified for each vertex. Specify NULL to have the normals calculated automatically.
intnum_listsNumber of lists of indices.
int *num_indicesList of number of indices.
int **indicesData indices stored in num_lists lists of num_indices[i] elements each.
BooleanrhsSpecifies whether the coordinate system is right handed (z axis pointing up) or left handed (z axis pointing down).
XintReal *fdata_4dSpecifies a data array, of size num_verts, that is used to assign the color at each node if the front material type is set to XintMATERIAL_COLOR_SCALE.
XintReal *bdata_4dSpecifies a data array, of size num_verts, that is used to assign the color at each node if the back material type is set to XintMATERIAL_COLOR_SCALE.
XtPointeruser_dataPointer to user private data.

The argument type must be set as one of the following constants:

Defined ConstantDescription
XintOBJECT_MESH_SURFACE_QUAD_STRIPSurface may be specified as a set of strips made of quadrilaterals.
XintOBJECT_MESH_SURFACE_TRI_STRIPSurface may be specified as a set of strips made of triangles.
XintOBJECT_MESH_SURFACE_POLYSSurface is specified as a set of polygons.
XintOBJECT_MESH_SURFACE_QUADSSurface is specified as a set of quadrilaterals.
XintOBJECT_MESH_SURFACE_TRISSurface is specified as a set of triangles.

For surfaces specified as XintOBJECT_MESH_SURFACE_POLYS, XintOBJECT_MESH_SURFACE_QUADS or XintOBJECT_MESH_SURFACE_TRIS, argument num_lists represents the number of elements in the surface ( polygons, quadrilaterals or triangles). Argument num_indices is an array containing the size of each polygon for a surface of type XintOBJECT_MESH_SURFACE_POLYS. For surfaces of type XintOBJECT_MESH_SURFACE_QUADS or XintOBJECT_MESH_SURFACE_TRIS, array num_indices must contain the same value in each entry (4 and 3 respectively).

The following diagram illustrates the vertex numbering for each type of surface.

XintOBJECT_MESH_SURFACE_QUAD_STRIP

XintOBJECT_MESH_SURFACE_TRI_STRIP

XintOBJECT_MESH_SURFACE_POLYS

XintOBJECT_MESH_SURFACE_QUADS

XintOBJECT_MESH_SURFACE_TRIS


XintView3DCreateNormalsForMesh

This function creates a line object containing the normals for all the vertices of the specified mesh surface object. This function is primarily designed to facilitate the testing of the normals required when creating mesh surface objects using function XintView3DCreateMeshSurface.

     XintView3DObject * XintView3DCreateNormalsForMesh(...)

XintView3DObject *meshPointer to a mesh surface object.
doublesizeSpecifies the size of the normal vectors. A size of 1.0 corresponds to 2% of the size of the longest axis.


XintView3DCreatePoint

This function creates a point or a point cloud object.

     XintView3DObject *XintView3DCreatePoint (...)

char *nameName of the point object.
doublesizeSize of the point.
intnum_verticesNumber of vertices.
XintVector3 *verticesList of vertices for the point cloud.
BooleanrhsSpecifies whether the coordinate system is right handed (z axis pointing up) or left handed (z axis pointing down).
XintReal *data_4dSpecifies a data array, of size num_vertices, that is used to assign the color at each point if the material type is set to XintMATERIAL_COLOR_SCALE.
XtPointeruser_dataPointer to user private data.


XintView3DCreateRaster

This function creates a Raster Image object.

     XintView3DObject *XintView3DCreateRaster (...)

char *nameName of the raster object.
XintVector3upper_leftUpper left corner of the image.
XintVector3upper_rightUpper right corner of the image.
XintVector3lower_rightLower right corner of the image.
XintVector3lower_leftLower left corner of the image.
intnum_vertsSpecifies the number of elements in array clip_vertices.
XintVector3 *clip_verticesArray of vertices describing a clipping plane for the object. All the vertices must be contained inside the four corners specified for the image. Specify NULL and set num_verts to 0 if you don't want to clip the image.
XintView3DRaster-OrientationorientationSpecify XintORIENT_ROW if the image is stored as scan lines or XintORIENT_COLUMN otherwise.
BooleanrhsSpecifes whether the coordinate system is right handed (z axis pointing up) or left handed (z axis pointing down).
intwidthWidth of the image.
intheightHeight of the image.
XintReal *imageArray containing the data if the material type is XintMATERIAL_COLOR_SCALE. This argument should be set to NULL for the other material types. The actual image data is already described in the color definition of the other valid material types (XintMATERIAL_MULTI_COLOR and XintMATERIAL_COLOR_INDEX)
XtPointeruser_dataPointer to user private data.


XintView3DCreateTextureMap

This function creates a texture map. A texture map must be assigned to an object to be visible (XintView3DAssignTexture).

     XintView3DTextureMap *XintView3DCreateTextureMap (...)

char *nameOptional name of the texture map.
inttypeType of texture map. Must be XintTEXTURE_2D or XintTEXTURE_1D.
intformatFormat of texture map.
intblendBlending function.
intwidthWidth of texture map.
intheightHeight of texture map.
float *imageImage data for texture map (specified in rows).
float **mipmapsOptional minification images.
Booleanbuild_mipmapsSpecify True to build mipmap images for texturing.
intmag_filterMagnification filter.
intmin_filterMinification filter.
Booleanclamp_sIf the object is larger than the texture map, specifying True will clamp the texture map in the S direction (column), repeating the last bit. Specifying False will repeat the texture.
Booleanclamp_tIf the object is larger than the texure map, specifying True will clamp the texture map in the T direction (row), repeating the last bit. Specifying False will repeat the texture.
XintView3DAutoTexture *auto_dataData structure for automatic texture coordinate generation.
Booleanconserve_memoryIf True, textures will be generated that conserve memory with the trade-off of a potential reduction in quality. False will preserve the quality of the image at the trade-off of using more memory.

Textures are defined using the coordinates S and T. All texture coordinates range from 0.0 through 1.0. One dimensional textures only use S coordinates, whereas 2 dimensional textures use both. S is used as the width, and T the height.

type must be one of the following:

Defined ConstantDescription
XintTEXTURE_2D2D texture map. An S x T array of values.
XintTEXTURE_1D1D texture map. An S element array of values.

format defines the format of the image data. format must be one of the following:

Defined ConstantDescription
XintTFORMAT_REDEach element of image is 1 float. The texture adjusts only the Red component of the underlying color.
XintTFORMAT_GREENEach element of image is 1 float. The texture adjusts only the Green component of the underlying color.
XintTFORMAT_BLUEEach element of image is 1 float. The texture adjusts only the Blue component of the underlying color.
XintTFORMAT_ALPHAEach element of image is 1 float. The texture adjusts only the Transparency (Alpha) of the underlying color.
XintTFORMAT_LUMINANCEEach element of image is 1 float. The texture adjusts only the Brightness of the underlying color.
XintTFORMAT_LUMINANCE_ALPHAEach element of image is 2 floats(LA). The texture adjusts the Brightness and the Transparency of the underlying color.
XintTFORMAT_RGBEach element of image is 3 floats(RGB). The texture adjusts the Red, Green, and Blue (color) of the underlying color.
XintTFORMAT_RGBAEach element of image is 4 floats(RGBA). The texture adjusts the Red, Green, Blue, and Transparency of the underlying color.

blend defines how the texture map affects the underlying color of the object. blend must be one of the following:

Defined ConstantDescription
XintTBLEND_DECALReplace the existing color with the texture.
XintTBLEND_MODULATEMultiply the existing color with the texture.
XintTBLEND_BLENDBlend the texture map with the existing color. (Most useful.)

width and height define the dimensions of the texture map. All internal representations of texture maps must have a width and height that is a power of 2. If the specified dimensions are not a power of 2, the texture map will be converted. If conserve memory is True, then the image will be reduced in size to the closest power of 2. If conserve_memory is False, the image will be increased in size to the closest power of 2.

image is the actual image data used for texture mapping.

mapmaps is an optional array of images of reduced size used for minification purposes. When the visible area of the texture map is smaller than the actual image size, a mipmap can be used to generate a better quality final image. (Mip stands for the Latin multim im parvo, meaning "many things in a small place.") If you wish to use mipmapping, but do not want to generate the additional images, you can specify mipmap as NULL, and build_mipmaps as True. To generate mipmaps, you will need to supply sizes of the original image in powers of 2 between the original size and a 1 x 1 map.

Example:

    /* Original Image Size: 64 x 32 */
         mipmaps = (float **)malloc(5 * sizeof(float *));
         mipmaps[0] = (float *)malloc(32 * 16 * sizof(float));   /* 32 x 16 */
         mipmaps[1] = (float *)malloc(16 * 8 * sizof(float));    /* 16 x  8 */
         mipmaps[2] = (float *)malloc(8 * 4 * sizof(float));     /*  8 x  4 */
         mipmaps[3] = (float *)malloc(4 * 2 * sizof(float));     /*  4 x  2 */
         mipmaps[4] = (float *)malloc(2 * 1 * sizof(float));     /*  2 x  1 */

mag_filter is a constant that defines how the texture map should be rendered when the size of the texture map is smaller than the resultant image size. mag_filter must be:

Defined ConstantDescription
XintTFILTER_NEARESTUse the texel on the texture map that is closest to the result (Lowest Quality - Highest Performance).
XintTFILTER_LINEARLinear interpolate the resultant texel from the 4 closest texels on the texture map (Highest Quality - Lowest Performance).

min_filter is a constant that defines how the texture map should be rendered when the size of the texture map is greater than the resultant image size. min_filter must be:

Defined ConstantDescription
XintTFILTER_NEARESTUse the texel on the texture map that is closest to the result (Lowest Quality - Highest Performance).
XintTFILTER_LINEARLinear interpolate the resultant texel from the adjacent texels on the texture map.
XintTFILTER_NEAREST_MIPMAP_NEARESTSelect the output texel from the mipmap closest to the size of the resultant image and the closest texel on the mipmap.
XintTFILTER_LINEAR_MIPMAP_NEARESTSelect the output texel from the mipmap closest to the size of the resultant image and linear interpolate the texel from the adjacent texels.
XintTFILTER_NEAREST_MIPMAP_LINEARLinear interpolate between the two closest mipmaps and then select the output texel from the nearest point on the interpolated mipmap.
XintTFILTER_LINEAR_MIPMAP_LINEARLinear interpolate between the two closest mipmaps and within the mipmaps themselves. (Highest quality - Lowest Performance)

clamp_s and clamp_t define the behavior of texturing when the texture coordinates do not fit within the space of the texture map. The coordinate range for a texture map is [0.0, 1.0]. If clamp_* is set to True, then the texture map will be clamped and pixel coordinates outside the range will be clamped to the boundary (resulting in a streaking effect). If clamp_* is set to False, then the texture map will be repeated across the object.

auto_data is a data structure that is used for the automatic generation of texture coordinates. This is an advanced topic. auto_data is of type XintView3DAutoTexture defined below:

   typedef struct {
                   int mode[2],
                   float parameters[2][4];
        } XintView3DAutoTexture;

Each element of this structure contains 2 elements. The first "[0]" is for 1D textures or the S coordinate of a 2D texture. The seconds element "[1]" is only used for 2D textures and represents the T coordinate. mode must be:

Defined ConstantDescription
XintTGEN_OBJECT_LINEARLinear mapping across the object. The texture map is fixed to the object.
XintTGEN_EYE_LINEARMapping relative to eye coordinates. The texutre map is fixed relative to the eye. The object will move through the texture.
XintTGEN_SPHERESpherical mapping. Useful for environment mapping.

If mode is set to XintT_GEN_OBJECT_LINEAR the parameters specifies a linear mapping using the function:

If mode is set to XintTGEN_EYE_LINEAR then parameters specifies a linear mapping in eye coordinates using the function:

Where M is the viewing transformation matrix.

If mode is set to XintTGEN_SPHERE, then parameters does not need to be defined.

See the Programming Guide for examples on texture mapping.


XintView3DCreateUniformGrid

This function creates a Mesh Surface object from a uniform grid. This convenience function simplifies and speeds the creation of mesh surface objects from a uniform grid of data. In particular, it automatically generates the list of normals for the application. The type of surface created is XintOBJECT_MESH_SURFACE_QUAD_STRIP or XintOBJECT_MESH_SURFACE_TRI_STRIP. The grid points must be specified rowwise.

     XintView3DObject *XintView3DCreateUniformGrid (...)

char *nameName of surface object.
intwidthWidth of the grid.
intheightHeight of the grid.
XintVector3 *gridArray of data points (size is width * height)
BooleanrhsSpecifies whether the coordinate system is right handed (z axis pointing up) or left handed (z axis pointing down).
XintReal *fdata_4dSpecifies a data array, of size width * height, that is used to assign the color at each node if the front material type is set to XintMATERIAL_COLOR_SCALE.
XintReal *bdata_4dSpecifies a data array, of size width * height, that is used to assign the color at each node if the back material type is set to XintMATERIAL_COLOR_SCALE.
Booleanuse_trianglesSet to True to display the surface using triangles (2 per grid cell). Set to False to display the surface using rectangles. This flag should be set to True if the surface is going to be edited or if the grid is not smooth.
XintReal *null_valueSpecifies a pointer to a value representing missing data. Set it to NULL if your grid has no missing values. Creation time of a grid will increase significantly if you specify a non NULL value.
XtPointeruser_dataPointer to user private data.


XintView3DCreateVolume

This function creates a volume object for View3D.

     XintView3DObject *XintView3DCreateVolume (...)

char *nameName of object.
XintView3DVolumeFormatformatType of format for volume.
XintView3DVolumeDataTypedata_typeData type for volume.
XintView3DVolumeAlphaMapalpha_mapAlpha map method to be used.
XtPointeralpha_dataAlpha map array or function.
intalpha_map_sizeSize of alpha map array.
XintView3DVolumeColorMapcolor_mapColor map method to be used.
XtPointercolor_dataColor map array or function.
intcolor_map_sizeSize of color map array.
XintVector3min_coordMinimum coordinate of the volume object.
XintVector3max_coordMaximum coordinate of the volume object.
doublemin_valueMinimum value of the voxel data.
doublemax_valueMaximum value of the voxel data.
unsigned intnum_xVoxel data dimension in X.
unsigned intnum_yVoxel data dimension in Y.
unsigned intnum_zVoxel data dimension in Z.
XtPointerdataVoxel data.
XintView3DVolumeRenderMethodmethod Volume render method used.
XtPointeruser_dataUser defined data.

Argument XintView3DVolumeRenderMethod must be specified as one of the following constants:

Defined ConstantDescription
XintVRM_POINTSPoint based algorithm rendering method.
XintVRM_3D_TEXTURE3D texture extension method. This method needs OpenGL 3D texture extensions and requires texture map hardware.

Argument XintView3DVolumeFormat must be specified as one of the following constants:

Defined ConstantDescription
XintVF_IEach value of the volume data array represents a single color index. The RGBA values of the index are decided by the color and alpha map table.
XintVF_LEach value of the volume data array represents an intensity value. This format needs the color map table and the alpha map table.
XintVF_LAThe volume data array is made up of pairs of luminance and alpha. The luminance component represents an intensity value. The alpha component represents a transparency value. This format needs the color map table.
XintVF_RGBThe volume data array is made up of triplets of Red, Green, and Blue components. This format needs an alpha map table.
XintVF_RGBAThe volume data array is made up of quadruplets of Red, Green, Blue and Alpha components. This format does not need either the color map table or the alpha map table.

Argument XintView3DVolumeDataType must be specified as one of the followoing constants:

Defined ConstantDescription
XintVD_CHARType character.
XintVD_UCHARType unsigned character.
XintVD_SHORTType short.
XintVD_USHORTType unsigned short.
XintVD_INTType integer.
XintVD_UINTType unsigned integer.
XintVD_LONGType long.
XintVD_ULONGType unsigned long.
XintVD_FLOATType floating point.
XintVD_DOUBLEType double.

Argument XintView3DVolumeAlphaMap must be specified as one of the following constants. If the constant XintVAM_USER is supplied, then the function supplied returns the alpha value at the offset index into the voxel data which is given as its only argument.

    float UserAlphaFunction(unsigned long offset); 

Defined ConstantDescription
XintVAM_NONEThe alpha value of each voxel is 1.
XintVAM_LINEAR_INTENSITYThe alpha value of each voxel is its intensity value.
XintVAM_USERThe alpha data is a user defined function.

Argument XintView3DVolumeColorMap must be specified as one of the following constants. If the constant XintVCM_USER is supplied, then the function supplied is a void function with two arguments, offset index into the voxel data and the voxel color at that offset. If the XintView3DVolumeAlphaMap has been used then voxel color need only be RGB values. If an alpha map is not defined then voxel color needs to be RGBA values.

    float UserColorFunction(unsigned long offset, 
                                 XintColor4 voxel_color); 

Defined ConstantDescription
XintVCM_SINGLE_COLORThe colormap is a single color.
XintVCM_LINEAR_SINGLEThe colormap multiplies the single color with intensity.
XintVCM_USERThe colormap data is a user defined function.


XintView3DGetAxisLimits

This function returns the axis limits in x, y and z direction. Please note, that XintView3DGetModelLimits will only return the data model size, not the axis limits.

     void XintView3DGetAxisLimits (...)

WidgetwidgetID of the View3D widget.
XintRealLimits *x_limitsAxis limits returned in the x direction.
XintRealLimits *y_limitsAxis limits returned in the y direction.
XintRealLimits *z_limitsAxis limits returned in the z direction.


XintView3DGetAxisScale

This function returns the axis scale values in the x, y and z directions.

     void XintView3DGetAxisScale (...)

WidgetwidgetID of the View3D widget.
double *x_scaleScale value returned for the x direction.
double *y_scaleScale value returned for the y direction.
double *z_scaleScale value returned for the z direction.

XintView3DGetGroupList

This function returns the list of objects contained in the specified group.

     XintView3DObject **XintView3DGetGroupList (...)

XintView3DObject *objectName of the group object.
int *countReturns the number of objects in the group.


XintView3DGetMeshTwoSided

This function returns whether or not a mesh surface has a different front and back material inside a particular View3D viewer.

     Boolean XintView3DGetMeshTwoSided (...)

WidgetwidgetID of a View3D widget displaying the object.
XintView3DObject *objectMesh surface object.


XintView3DGetObjectMaterial

This function returns the material used by an object when displayed inside a particular View3D viewer. Argument back_material is set to NULL in most cases except for surfaces that use a different front and back material.

     XintView3DMaterial *XintView3DGetObjectMaterial (...)

WidgetwidgetView3D widget.
XintView3DObject *objectObject for which to return material.
XintView3DMaterial **frontReturns material used for object (front material if this is a mesh surface).
XintView3DMaterial **backReturns back material if this is a mesh surface object using a different front and back material, or NULL otherwise.


XintView3DGetObjectType

This function returns the type of an object.

     XintView3DObjectType XintView3DGetObjectType (...)

XintView3DObject *objectObject of interest.

The following table lists all the possible return values for this function. The first column lists all the possible return types, the second column lists the result of a bitwise and operation between the object type and constant XintOBJECT_TYPE_MASK

typetype & XintOBJECT_TYPE_MASK
XintOBJECT_LINE_SEGMENTXintOBJECT_LINE_SEGMENT
XintOBJECT_LINE_POLYLINEXintOBJECT_LINE_SEGMENT
XintOBJECT_MESH_SURFACE_QUAD_STRIPXintOBJECT_MESH_SURFACE
XintOBJECT_MESH_SURFACE_TRI_STRIPXintOBJECT_MESH_SURFACE
XintOBJECT_MESH_SURFACE_POLYSXintOBJECT_MESH_SURFACE
XintOBJECT_MESH_SURFACE_TRISXintOBJECT_MESH_SURFACE
XintOBJECT_MESH_SURFACE_QUADSXintOBJECT_MESH_SURFACE
XintOBJECT_MARKER_BOXXintOBJECT_MARKER
XintOBJECT_MARKER_CROSSXintOBJECT_MARKER
XintOBJECT_MARKER_STARXintOBJECT_MARKER
XintOBJECT_MARKER_POINTXintOBJECT_MARKER
XintOBJECT_POINTXintOBJECT_POINT
XintOBJECT_RASTERXintOBJECT_RASTER


XintView3DOverlayObjOnPolygon

This function allows the overlay of Point or Line objects on top of Mesh or Facet objects. This function is useful for drawing contour lines on a 3D surface.

     void XintView3DOverlayObjOnPolygon (...)

WidgetwidgetID of the View3D widget.
XintView3DObject *polygonThe Mesh or Facet object for overlay.
XintView3DObject *overlayThe Point or Line object overlay.


XintView3DQueryMaterial

This function queries properties of a material object.

     void XintView3DQueryMaterial (...)

XintView3DMaterial *materialMaterial to query.
unsigned longflagsFlags defining properties to query.
XintView3DMaterialAttributes *attributesMaterial attributes.
XintView3DMaterialColor *colorMaterial color.

The material properties are queried according to the flags parameter.

All Material Types
PropertyRequired FlagMemory Allocated
attributes->lightXintMA_LIGHTNo
attributes->shade_modelXintMA_SHADE_MODELNo
attributes->draw_modeXintMA_DRAW_MODENo
attributes->draw_gridXintMA_DRAW_GRIDNo

XintMATERIAL_SINGLE_COLOR
PropertyRequired FlagMemory Required
color->singleXintMA_SINGLE_COLORNo

XintMATERIAL_MULTI_COLOR
PropertyRequired FlagMemory Required
color->multi.colorsXintMA_MULTI_COLORYes
color->multi.num_colorsXintMA_MULTI_COLORNo

XintMATERIAL_COLOR_SCALE
PropertyRequired FlagMemory Required
color->scale.orientationXintMA_SCALE_ORIENTATIONNo
color->scale.rangeXintMA_SCALE_RANGEYes
color->scale.colorsXintMA_SCALE_COLORSYes
color->scale.num_colorsAny of the above.No

XintMATERIAL_RANGE_COLOR
PropertyRequired FlagMemory Required
color->range.min_colorXintMA_RANGE_MINNo
color->range.max_colorXintMA_RANGE_MAXNo
color->range.range_directionXintMA_RANGE_DIRECTIONNo
color->range.interp_methodXintMA_RANGE_INTERPNo
color->range.across_objectXintMA_RANGE_ACROSSNo
color->range.color_modelXintMA_RANGE_MODELNo

XintMATERIAL_COLOR_INDEX
PropertyRequired FlagMemory Required
color->index.tableXintMA_INDEX_TABLENo
color->index.indexXintMA_INDEXYes
color->index.num_indicesAny of the above.No


XintView3DQueryObject

This function queries properties of a graphical object.

     void XintView3DQueryObject (...)

XintView3DObject *objectObject to query.
unsigned longflagsFlags defining properties to query.
XintView3DObjectProperty *propObject properties.

The object properties are queried according to the flags parameter. Memory will be allocated for queried arrays by default. If the global flag local_storage is disabled, memory will not be allocated. (See XintView3DSetGlobalFlags()).

Line Object
PropertyRequired FlagMemory Allocated
property->line.nameXintCO_LINE_NAMEYes
property->line.num_verticesXintCO_LINE_NUMBER_VERTICESNo
property->line.verticesXintCO_LINE_VERTICESMaybe
property->line.data_4dXintCO_LINE_DATA4DMaybe
property->line.thicknessXintCO_LINE_THICKNESSNo
property->line.user_dataXintCO_LINE_USER_DATANo
property->line.minXintCO_LINE_RANGENo
property->line.maxXintCO_LINE_RANGENo

Mesh Object
PropertyRequired FlagMemory Allocated
property->mesh.nameXintCO_MESH_NAMEYes
property->mesh.num_verticesXintCO_MESH_NUMBER_VERTICESNo
property->mesh.verticesXintCO_MESH_VERTICESMaybe
property->mesh.fdata_4dXintCO_MESH_F_DATA4DMaybe
property->mesh.bdata_4dXintCO_MESH_B_DATA4DMaybe
property->mesh.user_dataXintCO_MESH_USER_DATANo
property->mesh.minXintCO_MESH_RANGENo
property->mesh.maxXintCO_MESH_RANGENo

Marker Object
PropertyRequired FlagMemory Allocated
property->marker.nameXintCO_MARKER_NAMEYes
property->marker.sizeXintCO_MARKER_SIZENo
property->marker.locationXintCO_MARKER_LOCATIONNo
property->marker.labelXintCO_MARKER_LABELYes
property->marker.label_locXintCO_MARKER_LABEL_LOCNo
property->marker.user_dataXintCO_MARKER_USER_DATANo
property->marker.minXintCO_MARKER_RANGENo
property->marker.maxXintCO_MARKER_RANGENo

Raster Object
PropertyRequired FlagMemory Allocated
property->raster.nameXintCO_RASTER_NAMEYes
property->raster.num_verticesXintCO_RASTER_NUMBER_VERTICESNo
property->raster.verticesXintCO_RASTER_VERTICESMaybe
property->raster.data_4dXintCO_RASTER_DATA4DMaybe
property->raster.lower_leftXintCO_RASTER_LOWER_LEFTNo
property->raster.lower_rightXintCO_RASTER_LOWER_RIGHTNo
property->raster.upper_rightXintCO_RASTER_UPPER_RIGHTNo
property->raster.upper_leftXintCO_RASTER_UPPER_LEFTNo
property->raster.user_dataXintCO_RASTER_USER_DATANo
property->raster.minXintCO_RASTER_RANGENo
property->raster.maxXintCO_RASTER_RANGENo

Facet Object
PropertyRequired FlagMemory Allocated
property->facet.nameXintCO_FACET_NAMEYes
property->facet.num_verticesXintCO_FACET_NUMBER_VERTICESNo
property->facet.verticesXintCO_FACET_VERTICESMaybe
property->facet.data_4dXintCO_FACET_DATA4DMaybe
property->facet.user_dataXintCO_FACET_USER_DATANo
property->facet.minXintCO_FACET_RANGENo
property->facet.maxXintCO_FACET_RANGENo

Point Object
PropertyRequired FlagMemory Allocated
property->point.nameXintCO_POINT_NAMEYes
property->point.num_verticesXintCO_POINT_NUMBER_VERTICESNo
property->point.verticesXintCO_POINT_VERTICESMaybe
property->point.data_4dXintCO_POINT_DATA4DMaybe
property->point.sizeXintCO_POINT_SIZENo
property->point.user_dataXintCO_POINT_USER_DATANo
property->point.minXintCO_POINT_RANGENo
property->point.maxXintCO_POINT_RANGENo

Geometric Object
PropertyRequired FlagMemory Allocated
property->geom.nameXintCO_GEOM_NAMEYes
property->geom.data_4dXintCO_GEOM_DATA4DMaybe
property->geom.dimXintCO_GEOM_DIMENSIONNo
property->geom.locationXintCO_GEOM_LOCATIONNo
property->geom.user_dataXintCO_GEOM_USER_DATANo
property->geom.minXintCO_GEOM_RANGENo
property->geom.maxXintCO_GEOM_RANGENo

Volume Object
PropertyRequired FlagMemory Allocated
property->volume.nameXintCO_VOLUME_NAMEYes
property->volume.verticesXintCO_VOLUME_VERTICESMaybe
property->volume.min_coordXintCO_VOLUME_MIN_COORDYes
property->volume.max_coordXintCO_VOLUME_MAX_COORDYes
property->volume.user_dataXintCO_VOLUME_USER_DATANo


XintView3DRefMaterial

This function increases the reference count of a material. At creation time, the reference count of a material is initialized to 0. When a material is assigned to an object, its reference count is incremented by 1. A material is destroyed when its reference count drops back to 0. Function XintView3DRefMaterial can be invoked after a material has been created to prevent the material from being destroyed due to dereferencing.

     void XintView3DRefMaterial (...)

XintView3DMaterial *materialMaterial to be referenced.


XintView3DRefObject

This function increases the reference count of an object. At creation time, the reference count of an object is initialized to 0. When an object is assigned to a viewer, its reference count is incremented by 1. An object is destroyed when its reference count drops back to 0. Function XintView3DRefObject can be invoked after an object has been created to prevent the object from being destroyed when function XintView3DRemoveObject is invoked.

     void XintView3DRefObject(...)

XintView3DObject *objectObject to be referenced.


XintView3DRefTexture

This function increases the reference count of an texture. At creation time, the reference count of an texture is initialized to 0. When an texture is assigned to an object, its reference count is incremented by 1. An texture is destroyed when its reference count drops back to 0. Function XintView3DRefTexture can be invoked after an texture has been created to prevent the texture from being destroyed due to dereferencing.

     void XintView3DRefTexture(...)

XintView3DTextureMap *textureTexture to be referenced.


XintView3DRemoveObjectFromGroup

This function removes an object from a group of objects.

     void XintView3DRemoveObjectFromGroup (...)

XintView3DObject *groupGroup object.
XintView3DObject *objectObject to be removed from group.


XintView3DSetMaterial

This function sets the material of an object.

     void XintView3DSetMaterial (...)

WidgetwidgetID of the View3D widget.
XintView3DObject *objectObject to have material assigned.
XintView3DMaterial *front_materialFront material.
XintView3DMaterial *back_materialBack material.

This call is very similar to XintView3DAdjObjRotation, except that this call initializes the rotation. Any previous rotations applied to the object are lost. This call does not affect previous calls to scale or translate the object.


XintView3DSetObjRotation

This function sets the rotation of an object.

     void XintView3DSetObjRotation (...)

XintView3DObject *objectID of the object to set.
XintVector3rotationVector to rotate about.
doubleangleAngle in degrees to rotate.

This call is very similar to XintView3DAdjObjRotation, except that this call initializes the rotation. Any previous rotations applied to the object are lost. This call does not affect previous calls to scale or translate the object.


XintView3DSetObjScale

This function sets the size of an object.

     void XintView3DSetObjScale (...)

XintView3DObject *objectID of the object to set.
XintVector3scaleAmount to scale.

This call is very similar to XintView3DAdjObjScale, except that this call initializes the scaling. Any previous scaling applied to the object are lost. This call does not affect previous calls to rotate or translate the object.


XintView3DSetObjTranslation

This function sets the location of an object.

     void XintView3DSetObjTranslation (...)

XintView3DObject *objectID of the object to set location.
XintVector3translationAmount to translate.

This call is very similar to XintView3DAdjObjTranslation, except that this call initializes the translation. Any previous translations applied to the object are lost. This call does not affect previous calls to rotate or scale the object.


XintView3DUnRefMaterial

This function decrements the reference count of an material. The material is destroyed when the reference count drops back to 0. Care should be taken in calling this function so that a material that is in use by another object is not freed.

     void XintView3DUnRefMaterial (...)

XintView3DMaterial *materialMaterial to be unreferenced.


XintView3DUnRefObject

This function decrements the reference count of an object. The object is destroyed when the reference count drops back to 0. This function should not be called on an object unless function XintView3DRefObject has been invoked before.

     void XintView3DUnRefObject (...)

XintView3DObject *objectObject to be unreferenced.


XintView3DUnRefTexture

This function decrements the reference count of a texture. The texture is destroyed when the reference count drops back to 0. Care should be taken in calling this function so that a texture that is in use by another object is not freed.

     void XintView3DUnRefTexture (...)

XintView3DTextureMap *textureTexture to be unreferenced.