extern void XintView3DQueryMaterial(
XintView3DMaterial *material,
unsigned long flags,
XintView3DMaterialAttributes *attr,
XintView3DMaterialColor *color
);
extern void XintView3DChangeMaterial(
XintView3DMaterial *material,
unsigned long flags,
XintView3DMaterialAttributes *attr,
XintView3DMaterialColor *color
);
Both calls take as arguments, the material to query/change a structure of type XintView3DMaterialAttributes, XintView3DMaterialColor and a series of flags which specify the component(s) of the material you want to query/change. flags is created by combining any of the following flags listed below. For each of the different material types, the following tables list what properties can be queried and changed. The tables list the property, required flags, whether the property can be queried (Q) or changed (C), and if any memory is allocated. If memory is allocated, the application is responsible for freeing the resources.
typedef struct _XintView3DMaterialAttributes {
Boolean light;
int shade_model;
int draw_mode;
Boolean draw_grid;
Boolean image_flag
} XintView3DMaterialAttributes;
typedef struct _XintView3DMaterialColor {
XintColor4 single;
XintView3DColorRange range;
XintView3DColorScale scale;
XintView3DColorIndex index;
XintView3DColorMulti multi
} XintView3DMaterialColor;
typedef struct _XintView3DColorRange {
XintView3DColorScaleOrientation orientation;
XintReal *range;
int num_colors;
XintColor4 *colors;
} XintView3DColorRange;
typedef struct _XintView3DColorScale {
XintView3DColorScaleOrientation orientation;
XintReal *range;
int num_colors;
XintColor4 *colors;
} XintView3DColorScale;
typedef struct _XintView3DColorIndex{
XintView3DColorTable *table;
int num_indices;
int *index;
} XintView3DColorIndex;
typedef struct _XintView3DColorMulti {
int num_colors;
XintColor4 *colors;
} XintView3DColorMulti;
typedef struct _XintView3DColorTable {
char *name;
int num_colors;
XintColor4 *colors;
} XintView3DColorTable;
typedef enum _XintView3DColorScaleOrientation {
XintCOLOR_SCALE_ORIENTATION_X,
XintCOLOR_SCALE_ORIENTATION_Y,
XintCOLOR_SCALE_ORIENTATION_Z,
XintCOLOR_SCALE_ORIENTATION_4D
} XintView3DColorScaleOrientation;
| Property | Required Flag | Q/C | Memory Allocated |
|---|---|---|---|
| attributes->light | XintMA_LIGHT | QC | No |
| attributes->shade_model | XintMA_SHADE_MODEL | QC | No |
| attributes->draw_mode | XintMA_DRAW_MODE | QC | No |
| attributes->draw_grid | XintMA_DRAW_GRID | QC | No |
| attributes->image_flag | XintMA_IMAGE_FLAG | Q | No |
| Property | Required Flag | Q/C | Memory Required |
|---|---|---|---|
| color->single | XintMA_SINGLE_COLOR | QC | No |
| Property | Required Flag | Q/C | Memory Required |
|---|---|---|---|
| color->multi.colors | XintMA_MULTI_COLOR | QC | Yes |
| color->multi.num_colors | XintMA_MULTI_COLOR | Q | No |
| Property | Required Flag | Q/C | Memory Required |
|---|---|---|---|
| color->scale.orientation | XintMA_SCALE_ORIENTATION | QC | No |
| color->scale.range | XintMA_SCALE_RANGE | QC | Yes |
| color->scale.colors | XintMA_SCALE_COLORS | QC | Yes |
| color->scale.num_colors | Any of the above. | Q | No |
| Property | Required Flag | Q/C | Memory Required |
|---|---|---|---|
| color->range.min_color | XintMA_RANGE_MIN | QC | No |
| color->range.max_color | XintMA_RANGE_MAX | QC | No |
| color->range.range_direction | XintMA_RANGE_DIRECTION | QC | No |
| color->range.interp_method | XintMA_RANGE_INTERP | QC | No |
| color->range.across_object | XintMA_RANGE_ACROSS | QC | No |
| color->range.color_model | XintMA_RANGE_MODEL | QC | No |
| Property | Required Flag | Q/C | Memory Required |
|---|---|---|---|
| color->index.table | XintMA_INDEX_TABLE | QC | No |
| color->index.index | XintMA_INDEX | QC | Yes |
| color->index.num_indices | Any of the above. | Q | No |
You only need to supply data for those properties that you wish to change. Currently, View3D does not support changing the number of colors/indices of a material. If you need to change the number of colors/indices of a material, you will need to create a new material with the number of colors/indices that you require. Because View3D does not support changing the number of vertices of objects, you should never need to change the number of colors/indices.