FLDFget_cell_data, FLDFset_cell_data


Synopsis

Gets and sets the cell data values array within one component of a cell data in a specified cell set.


INTEGER FUNCTION FLDF
get_cell_data (cell_set, comp, type, cell_data, size, mode)
     INTEGER cell_set(OIDSIZ)
     INTEGER comp
     INTEGER type
     INTEGER cell_data_ptr
     INTEGER size
     INTEGER mode

INTEGER FUNCTION FLDF
set_cell_data (cell_set, comp, type, cell_data, size, mode)
     INTEGER cell_set(OIDSIZ)
     INTEGER comp
     INTEGER cell_data
     INTEGER type
     INTEGER size
     INTEGER mode

Description

These routines get and set the values[nvals][veclen] array for a specified component of cell data of a specified cell set.

The FLDFget_cell_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 an integer that represents a pointer to a pre-allocated array, and the developer just needs to fill in the values. To access the data array you will need to use ARRFoffset function described in Appendix D of Developers Reference.

Parameters

cell_set

The integer id of a cell_set, as established by a FLDFget_cell_set routine.

comp

An integer that sets which component's [0-n] (ncell_data) Data_Array of the given cell_set to access.

type

In FLDFget_cell_data, type is an integer in which the primitive data type is returned. However, in the case where the array was first created with an FLDFget_cell_data routine (mode = OM_GET_ARRAY_WR), type has to be specified by the caller.

In FLDFset_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_INTEGER

3

DTYPE_FLOAT

4

DTYPE_DOUBLE

5

DTYPE_UNSET

DNTYPES+1

 

cell_data_ptr

In FLDFget_cell_data, cell_data is the address of an integer representing a pointer to the cell data. Upon return, that an integer representing a pointer will be filled in with the address of the cell data array. To access the data you will need to use ARRFoffset function described in the OM reference pages

On 64-bit platforms dims_ptr is actually an INTEGER*8.

You must call ARRFfree() on that an integer representing a pointer when you are done using it. See mode below.

cell_data

In FLDFset_cell_data, cell_data is an integer representing a pointer to the cell data array you want to set in the Object Manager. See mode below.

size

In FLDFget_cell_data, size is an integer in which the total number of array values (nvals * veclen) in the cell_data values is returned.

In FLDFset_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 FLDFget_cell_data:

 

Mode

 

Value

 

Meaning

 

OM_GET_ARRAY_RD

0

The program reads the array, but does not write to it.

OM_GET_ARRAY_WR

1

The program writes to the array, completely replacing it.

OM_GET_ARRAY_RW

2

The program reads from and writes to the array.

OM_GET_ARRAY_RD_ COPY

3

The program requires a copy of the array for its own, private use (reading or writing).

 

For FLDFset_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 to an integer representing a pointer to node_data. AVS/Express copies the array if the function is running in an external process or if data type conversion is required.

AVS/Express manages the array and determines when the array can be freed.

You must allocate space for the array with a call to ARRFalloc.

OM_SET_ARRAY_STATIC

2

If possible, do not copy the array. Instead, set the object's array to an integer representing a 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.