FLDget_node_connect, FLDset_node_connect


Synopsis

get/set the node connectivity list of one cell_set within a Cells Grid


int FLDget_node_connect (
           OMobj_id cell_set,
           int **node_conn_array,
           int *size,
           int mode);

int FLDset_node_connect (
           OMobj_id cell_set,
           int *node_conn_array,
           int size,
           int mode);

Description

These routines get/set the node connectivity array (node_connect_list) within one cell_set array element in a Cells Grid.

The FLDget_node_connect routine can be used for both getting and setting the node_connect_list array. When setting with a "get" routine (mode = OM_GET_ARRAY_WR or OM_GET_ARRAY_RW), it returns a pointer to a pointer to a pre-allocated array, and the developer just needs to fill in the values.

If the cell set is a Poly cell set (specifically a Polyhedron cell set), this routine returns the connectivity array of the elementary primitive line or triangle cells, not the polygons themselves. You almost never want to call FLDset_node_connect() on a polyhedron cell set, since this would set the connectivity of the "primitive" triangular cells making up the polygons, not the connectivity of the polygons themselves. To set the connectivity of the polygons, use FLDset_poly_connect().

Parameters

OMobj_id cell_set

The OMobj_id of one cell_set array element within a Cells Grid, as returned by the FLDget_cell_set routine.

int **node_conn_array
int *node_conn_array

In FLDget_node_connect, node_conn_array is the address of a pointer to an array in which the node connectivity list is returned. Call ARRfree() on this pointer when you are done using it.

In FLDset_node_connect, node_conn_array is a pointer to an array from which the node connectivity list will be copied.

int *size
int size

In FLDget_node_connect, size is a pointer to an integer in which the size of the node connectivity array is returned. (It is usually defined as ncells*cell_nnodes.)

In FLDset_node_connect, size is an integer that sets the size of the node connectivity array.

"size" is the number of elements in the array irrespective of type. (It is usually defined as ncells * cell_nnodes.)

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_node_connect:

 

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_conn_array. 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_conn_array. 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_node_connect:

 

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

2

The program intends to both read and write 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).

 

Example

For FLDget_node_connect:

modules/advect.c
modules/cut_quad.c
modules/rd_geom.c
modules/gen_fld.c (and others)

For FLDset_node_connect:

modules/bounds.c
modules/contour.c
modules/cut.c
modules/ext_edge.c
modules/isoline.c
modules/slice.c (and others)

Related routines