Synopsis
get/set the values array within one component of a Cell_Data cell_set Data_Array
int FLDget_cell_data (
OMobj_id cell_set,
int comp,
int *type,
char **cell_data,
int *size,
int mode);
int FLDset_cell_data (
OMobj_id cell_set,
int comp,
char *cell_data,
int type,
int size,
int mode);
Description
These routines get and set the values[nvals][veclen] array within one component of the Data_Array of one cell_set in a Cell_Data.
The FLDget_node_data routine can be used for both getting and setting the values array. When setting with a "get" routine (mode = OM_GET_ARRAY_WR or OM_GET_ARRAY_RW), the routine returns a pointer to a pre-allocated array, and the developer just needs to fill in the values.
Parameters
OMobj_id cell_set
The OMobj_id of a cell_set, as established by a FLDget_cell_set routine.
int comp
An integer that sets which component's [0-n] (ncell_data) Data_Array of the given cell_set to access.
int *type
int type
In FLDget_cell_data, type is a pointer to an integer in which the primitive data type is returned.
The above is true except for the case where the array was first created with an FLDget_cell_data routine (mode = OM_GET_ARRAY_WR). In this case type has to be specified by the caller.
In FLDset_cell_data, type is an integer that sets the cell data's primitive data type.
Constants for the possible values are defined in avs/dtype.h as follows:
Constant
|
Value
|
DTYPE_CHAR |
0 |
DTYPE_BYTE |
1 |
DTYPE_SHORT |
2 |
DTYPE_INT |
3 |
DTYPE_FLOAT |
4 |
DTYPE_DOUBLE |
5 |
DTYPE_UNSET |
DNTYPES+1 |
void *cell_data
void **cell_data
In FLDset_cell_data, cell_data is a pointer to the cell data array you want to set in the Object Manager. See mode below.
In FLDget_cell_data, cell_data is the address of a pointer to the cell data. Upon return, that pointer will be filled in with the address of the cell data array. You must call ARRfree() on that pointer when you are done using it. See mode below.
int *size
int size
In FLDget_cell_data, size is a pointer to an integer in which the total number of array values (nvals * veclen) in the cell_data values is returned.
In FLDset_cell_data, size is an integer that sets the total number of array values (nvals * veclen) to create. A [100][3] array would have size=300.
mode
An integer constant that establishes the access mode for the array subobject. Constants for the possible values are defined in avs/om.h as follows.
For FLDset_cell_data:
Mode
|
Value
|
Meaning
|
OM_SET_ARRAY_COPY |
0 |
Copy the array into the Object Manager |
OM_SET_ARRAY_FREE |
1 |
If possible, do not copy the array. Instead, set the object's array pointer to node_data. AVS/Express copies the array anyway if the function is running in an external process or if data type conversion is required. AVS/Express manages the array and will determine when the array can be freed. You must allocate space for the array with a call to ARRalloc. |
OM_SET_ARRAY_STATIC |
2 |
If possible, do not copy the array. Instead, set the object's array pointer to node_data. AVS/Express copies the array anyway if the function is running in an external process or if data type conversion is required. AVS/Express does not manage the array. You must ensure that the array is valid for the life of the object or until the object replaces the array. |
For FLDget_cell_data:
Mode
|
Value
|
Meaning
|
OM_GET_ARRAY_RD |
0 |
The program intends to read the array, but not write to it. |
OM_GET_ARRAY_WR |
1 |
The program intends to write to the array, completely replacing it, but not read it. |
OM_GET_ARRAY_RW |
The program intends to both read and write to the array. | |
OM_GET_ARRAY_RD_
|
3 |
The program requires a copy of the array for its own, private use (reading or writing). |
Example
modules/cellnode.c
modules/ext_face.c
modules/rd_ucd.c
modules/write.c
Related routines