FLDget_node_null_data, FLDset_node_null_data, FLDget_node_null_flag
Synopsis
get/set the NULL data flag and NULL data value in one Node_Data component
int FLDget_node_null_data (
OMobj_id field,
int comp,
int *null_flag,
char *null_value);
int FLDset_node_null_data (
OMobj_id field,
int comp,
char *null_value,
int type)
int FLDset_node_null_flag (
OMobj_id field,
int comp,
int null_flag);Description
These routines get/set the NULL data flag (null_flag) in a Node_Data Data_Array that indicates the presence of NULL data. They also get/set the data value (null_value) that should be interpreted as meaning "no data here."
Note: To get the null_flag, use FLDget_node_null_data.
Parameters
In FLDget_node_null_data, a pointer to an integer in which the flag that signifies "NULL data is present" is returned.
In FLDget_node_null_data, a pointer to a data item of unknown type in which the null data value this component is using will be returned.
In FLDset_node_null_data, a pointer to a data item of unknown type from which the null data value will be copied into the component.
FLDset_node_null_data only. An integer that specifies the type of the null_value. This should match the primitive data type of the rest of the Data_Array. The choices are (defined in avs/db.h):
Examples
This example, a fragment from modules/down.c, shows downsize getting and setting NULL data flags and values in its input and output fields:
int FUNCdownsize (in, stride, out)
OMobj_id in, out;
float *stride;
{
int ndim, *dims, npoints, fld_type, i, j, n, stat, comp, ncomp,
null_flag, data_id;
int size, type, in_type, veclen, nspace, out_nspace;
...
double null_value;
...
if (FLDget_node_data_ncomp(in, &ncomp)!= 1) {
ERR_RETURN("Error getting ncomp");
}
if (FLDset_node_data_ncomp (out, ncomp)!= 1) {
ERR_RETURN("Error setting nnode_data");
}
for (comp=0; comp<ncomp; comp++) {
...
if (FLDget_node_data_type(in, comp, &type)!= 1) {
ERR_RETURN("Error copying node minmax");
}
...
if (FLDget_node_null_data(in, comp, &null_flag, (char *)&null_value)!= 1) {
ERR_RETURN("cannot get null data");
}
if (null_flag) {
if (FLDset_node_null_data(out, comp, (char *)&null_value, type)
!= 1)
{
ERR_RETURN("Error setting null value");
}
}
else {
if (FLDset_node_null_flag(out, comp, 0)!= 1) {
ERR_RETURN("Error setting null flag");
}
}Files
See Also