MOAB: Mesh Oriented datABase  (version 5.4.1)
TagsOnArr

Functions

void iMesh_getArrData (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, const int entity_handles_size, const iBase_TagHandle tag_handle, void *tag_values, int *tag_values_allocated, int *tag_values_size, int *err)
 Get tag values of arbitrary type for an array of entities.
void iMesh_getIntArrData (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, const int entity_handles_size, const iBase_TagHandle tag_handle, int **tag_values, int *tag_values_allocated, int *tag_values_size, int *err)
void iMesh_getDblArrData (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, const int entity_handles_size, const iBase_TagHandle tag_handle, double **tag_values, int *tag_values_allocated, int *tag_values_size, int *err)
void iMesh_getEHArrData (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, const int entity_handles_size, const iBase_TagHandle tag_handle, iBase_EntityHandle **tag_value, int *tag_value_allocated, int *tag_value_size, int *err)
void iMesh_getESHArrData (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, const int entity_handles_size, const iBase_TagHandle tag_handle, iBase_EntitySetHandle **tag_value, int *tag_value_allocated, int *tag_value_size, int *err)
 Get tag values of entity set handle type for an array of.
void iMesh_setArrData (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, const int entity_handles_size, const iBase_TagHandle tag_handle, const void *tag_values, const int tag_values_size, int *err)
 Set tag values of arbitrary type on an array of entities.
void iMesh_setIntArrData (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, const int entity_handles_size, const iBase_TagHandle tag_handle, const int *tag_values, const int tag_values_size, int *err)
void iMesh_setDblArrData (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, const int entity_handles_size, const iBase_TagHandle tag_handle, const double *tag_values, const int tag_values_size, int *err)
void iMesh_setEHArrData (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, const int entity_handles_size, const iBase_TagHandle tag_handle, const iBase_EntityHandle *tag_values, const int tag_values_size, int *err)
void iMesh_setESHArrData (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, const int entity_handles_size, const iBase_TagHandle tag_handle, const iBase_EntitySetHandle *tag_values, const int tag_values_size, int *err)
 Set tag values of entity set handle type on an array of.

Detailed Description

Tag Data On Arrays of Entities TagData


Function Documentation

void iMesh_getArrData ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
const int  entity_handles_size,
const iBase_TagHandle  tag_handle,
void *  tag_values,
int *  tag_values_allocated,
int *  tag_values_size,
int *  err 
)

Get tag values of arbitrary type for an array of entities.

Get tag values of arbitrary type for an array of entities. Tag data is returned as void*. tag_values_size specifies the size of the memory pointed to by tag_values in terms of bytes. Applications may use this function to get data of any type, not just iBase_BYTES. However, because this function supports data of arbitrary type, in all cases the size specified by tag_values_size always in terms of bytes.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesEntity array on which tag is being set
[in]entity_handles_sizeNumber of entities in array
[in]tag_handleTag being set on an entity
[in,out]tag_valuesPointer to tag data array being returned. Note that the implicit INTERLEAVED storage order rule applies (see iBase_StorageOrder) Array pointer, allocated and occupied sizes argument trio)
[in,out]tag_values_allocatedPointer to allocated size of tag data array
[out]tag_values_sizePointer to occupied size in bytes of tag data
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1879 of file iMesh_MOAB.cpp.

References ALLOC_CHECK_TAG_ARRAY, CHKNONEMPTY, ERROR, ErrorCode, iBase_SUCCESS, iMesh_getTagName, KEEP_ARRAY, MB_SUCCESS, MB_TAG_NOT_FOUND, MOABI, RETURN, and TAG_HANDLE.

{
    if( 0 == entity_handles_size ) RETURN( iBase_SUCCESS );
    CHKNONEMPTY();

    const EntityHandle* ents = reinterpret_cast< const EntityHandle* >( entity_handles );
    Tag tag                  = TAG_HANDLE( tag_handle );

    int tag_size;
    ErrorCode result = MOABI->tag_get_bytes( tag, tag_size );
    if( MB_SUCCESS != result )
    {
        int nerr = -1;
        char tagn[64], msg[256];
        iMesh_getTagName( instance, tag_handle, tagn, &nerr, sizeof( tagn ) );
        snprintf( msg, sizeof( msg ), "iMesh_getArrData: couldn't get size for tag \"%s\"",
                  nerr == 0 ? tagn : "unknown" );
        ERROR( result, msg );
    }

    ALLOC_CHECK_TAG_ARRAY( tag_values, tag_size * entity_handles_size );

    result = MOABI->tag_get_data( tag, ents, entity_handles_size, *static_cast< void** >( tag_values ) );

    if( MB_SUCCESS != result )
    {
        std::string message( "iMesh_getArrData: " );
        if( MB_TAG_NOT_FOUND == result )
            message += "tag not found";
        else
            message += "failed";

        std::string name;
        if( MB_SUCCESS == MOABI->tag_get_name( tag, name ) )
        {
            message += "for tag \"";
            message += name;
            message += "\".";
        }
        ERROR( result, message.c_str() );
    }

    KEEP_ARRAY( tag_values );
    RETURN( iBase_SUCCESS );
}
void iMesh_getDblArrData ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
const int  entity_handles_size,
const iBase_TagHandle  tag_handle,
double **  tag_values,
int *  tag_values_allocated,
int *  tag_values_size,
int *  err 
)

Get tag values of double type for an array of entities.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesEntity array on which tag is being set
[in]entity_handles_sizeNumber of entities in array
[in]tag_handleTag being set on an entity
[in,out]tag_valuesPointer to tag data array being returned. Note that the implicit INTERLEAVED storage order rule applies (see iBase_StorageOrder) Array pointer, allocated and occupied sizes argument trio)
[in,out]tag_values_allocatedPointer to allocated size of tag data array
[out]tag_values_sizePointer to occupied size of tag data array
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1950 of file iMesh_MOAB.cpp.

References CHKTAGTYPE, iBase_DOUBLE, and iMesh_getArrData.

{
    CHKTAGTYPE( tag_handle, iBase_DOUBLE );
    *tag_values_allocated *= sizeof( double );
    if( tag_values_size != tag_values_allocated ) *tag_values_size *= sizeof( double );
    iMesh_getArrData( instance, entity_handles, entity_handles_size, tag_handle, tag_values, tag_values_allocated,
                      tag_values_size, err );
    *tag_values_allocated /= sizeof( double );
    if( tag_values_size != tag_values_allocated ) *tag_values_size /= sizeof( double );
}
void iMesh_getEHArrData ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
const int  entity_handles_size,
const iBase_TagHandle  tag_handle,
iBase_EntityHandle **  tag_value,
int *  tag_value_allocated,
int *  tag_value_size,
int *  err 
)

Get tag values of entity handle type for an array of entities.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesEntity array on which tag is being set
[in]entity_handles_sizeNumber of entities in array
[in]tag_handleTag being set on an entity
[in,out]tag_valuePointer to tag data array being returned. Note that the implicit INTERLEAVED storage order rule applies (see iBase_StorageOrder) Array pointer, allocated and occupied sizes argument trio)
[in,out]tag_value_allocatedPointer to allocated size of tag data array
[out]tag_value_sizePointer to occupied size of tag data array
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1968 of file iMesh_MOAB.cpp.

References CHKTAGTYPE, iBase_ENTITY_HANDLE, and iMesh_getArrData.

{
    CHKTAGTYPE( tag_handle, iBase_ENTITY_HANDLE );
    *tag_value_allocated *= sizeof( iBase_EntityHandle );
    if( tag_value_size != tag_value_allocated ) *tag_value_size *= sizeof( iBase_EntityHandle );
    iMesh_getArrData( instance, entity_handles, entity_handles_size, tag_handle,
                      reinterpret_cast< void** >( tag_value ), tag_value_allocated, tag_value_size, err );
    *tag_value_allocated /= sizeof( iBase_EntityHandle );
    if( tag_value_size != tag_value_allocated ) *tag_value_size /= sizeof( iBase_EntityHandle );
}
void iMesh_getESHArrData ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
const int  entity_handles_size,
const iBase_TagHandle  tag_handle,
iBase_EntitySetHandle **  tag_value,
int *  tag_value_allocated,
int *  tag_value_size,
int *  err 
)

Get tag values of entity set handle type for an array of.

entities Get tag values of entity set handle type for an array of entities.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesEntity array on which tag is being set
[in]entity_handles_sizeNumber of entities in array
[in]tag_handleTag being set on an entity
[in,out]tag_valuePointer to tag data array being returned. Note that the implicit INTERLEAVED storage order rule applies (see iBase_StorageOrder) Array pointer, allocated and occupied sizes argument trio)
[in,out]tag_value_allocatedPointer to allocated size of tag data array
[out]tag_value_sizePointer to occupied size of tag data array
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1986 of file iMesh_MOAB.cpp.

References CHKTAGTYPE, iBase_ENTITY_SET_HANDLE, and iMesh_getArrData.

{
    CHKTAGTYPE( tag_handle, iBase_ENTITY_SET_HANDLE );
    *tag_value_allocated *= sizeof( iBase_EntityHandle );
    if( tag_value_size != tag_value_allocated ) *tag_value_size *= sizeof( iBase_EntityHandle );
    iMesh_getArrData( instance, entity_handles, entity_handles_size, tag_handle,
                      reinterpret_cast< void** >( tag_value ), tag_value_allocated, tag_value_size, err );
    *tag_value_allocated /= sizeof( iBase_EntityHandle );
    if( tag_value_size != tag_value_allocated ) *tag_value_size /= sizeof( iBase_EntityHandle );
}
void iMesh_getIntArrData ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
const int  entity_handles_size,
const iBase_TagHandle  tag_handle,
int **  tag_values,
int *  tag_values_allocated,
int *  tag_values_size,
int *  err 
)

Get tag values of integer type for an array of entities.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesEntity array on which tag is being set
[in]entity_handles_sizeNumber of entities in array
[in]tag_handleTag being set on an entity
[in,out]tag_valuesPointer to tag data array being returned. Note that the implicit INTERLEAVED storage order rule applies (see iBase_StorageOrder) Array pointer, allocated and occupied sizes argument trio)
[in,out]tag_values_allocatedPointer to allocated size of tag data array
[out]tag_values_sizePointer to occupied size of tag data array
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1932 of file iMesh_MOAB.cpp.

References CHKTAGTYPE, iBase_INTEGER, and iMesh_getArrData.

{
    CHKTAGTYPE( tag_handle, iBase_INTEGER );
    *tag_values_allocated *= sizeof( int );
    if( tag_values_size != tag_values_allocated ) *tag_values_size *= sizeof( int );
    iMesh_getArrData( instance, entity_handles, entity_handles_size, tag_handle, tag_values, tag_values_allocated,
                      tag_values_size, err );
    *tag_values_allocated /= sizeof( int );
    if( tag_values_size != tag_values_allocated ) *tag_values_size /= sizeof( int );
}
void iMesh_setArrData ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
const int  entity_handles_size,
const iBase_TagHandle  tag_handle,
const void *  tag_values,
const int  tag_values_size,
int *  err 
)

Set tag values of arbitrary type on an array of entities.

Set tag values of arbitrary type on an array of entities. Tag data is passed as void*. tag_values_size specifies the size of the memory pointed to by tag_values in terms of bytes. Applications may use this function to set data of any type, not just iBase_BYTES. However, because this function supports data of arbitrary type, in all cases the size specified by tag_values_size is always in terms of bytes.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesEntity array on which tag is being set
[in]entity_handles_sizeNumber of entities in array
[in]tag_handleTag being set on an entity
[in]tag_valuesPointer to tag data being set on entity. Note that the implicit INTERLEAVED storage order rule applies (see iBase_StorageOrder)
[in]tag_values_sizeSize in bytes of tag data
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 2004 of file iMesh_MOAB.cpp.

References CHKERR, CHKNONEMPTY, CONST_HANDLE_ARRAY_PTR, ERROR, ErrorCode, iBase_BAD_ARRAY_SIZE, iBase_SUCCESS, iMesh_getTagSizeBytes, MOABI, RETURN, and TAG_HANDLE.

{
    if( 0 == entity_handles_size ) RETURN( iBase_SUCCESS );
    CHKNONEMPTY();

    int tag_size;
    iMesh_getTagSizeBytes( instance, tag_handle, &tag_size, err );
    // Check err manually and just return if not iBase_SUCCESS to not step on
    // the error set in iMesh_getTagSizeBytes().
    if( iBase_SUCCESS != *err ) return;

    if( tag_values_size != ( tag_size * entity_handles_size ) )
    {
        ERROR( iBase_BAD_ARRAY_SIZE, "iMesh_setArrData: bad tag_values_size passed." );
    }

    ErrorCode result = MOABI->tag_set_data( TAG_HANDLE( tag_handle ), CONST_HANDLE_ARRAY_PTR( entity_handles ),
                                            entity_handles_size, tag_values );CHKERR( result, "iMesh_setArrData didn't succeed." );
    RETURN( iBase_SUCCESS );
}
void iMesh_setDblArrData ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
const int  entity_handles_size,
const iBase_TagHandle  tag_handle,
const double *  tag_values,
const int  tag_values_size,
int *  err 
)

Set tag values of double type on an array of entities.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesEntity array on which tag is being set
[in]entity_handles_sizeNumber of entities in array
[in]tag_handleTag being set on an entity
[in]tag_valuesPointer to tag data being set on entities. Note that the implicit INTERLEAVED storage order rule applies (see iBase_StorageOrder)
[in]tag_values_sizeSize in total number of doubles of tag data
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 2044 of file iMesh_MOAB.cpp.

References CHKTAGTYPE, iBase_DOUBLE, and iMesh_setArrData.

{
    CHKTAGTYPE( tag_handle, iBase_DOUBLE );
    iMesh_setArrData( instance, entity_handles, entity_handles_size, tag_handle,
                      reinterpret_cast< const char* >( tag_values ), sizeof( double ) * tag_values_size, err );
}
void iMesh_setEHArrData ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
const int  entity_handles_size,
const iBase_TagHandle  tag_handle,
const iBase_EntityHandle tag_values,
const int  tag_values_size,
int *  err 
)

Set tag values of entity handle type on an array of entities.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesEntity array on which tag is being set
[in]entity_handles_sizeNumber of entities in array
[in]tag_handleTag being set on an entity
[in]tag_valuesPointer to tag data being set on entities. Note that the implicit INTERLEAVED storage order rule applies (see iBase_StorageOrder)
[in]tag_values_sizeSize in total number of entity handles of tag
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 2057 of file iMesh_MOAB.cpp.

References CHKTAGTYPE, iBase_ENTITY_HANDLE, and iMesh_setArrData.

{
    CHKTAGTYPE( tag_handle, iBase_ENTITY_HANDLE );
    iMesh_setArrData( instance, entity_handles, entity_handles_size, tag_handle,
                      reinterpret_cast< const char* >( tag_values ), sizeof( iBase_EntityHandle ) * tag_values_size,
                      err );
}
void iMesh_setESHArrData ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
const int  entity_handles_size,
const iBase_TagHandle  tag_handle,
const iBase_EntitySetHandle tag_values,
const int  tag_values_size,
int *  err 
)

Set tag values of entity set handle type on an array of.

entities Set tag values of entity set handle type on an array of entities.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesEntity array on which tag is being set
[in]entity_handles_sizeNumber of entities in array
[in]tag_handleTag being set on an entity
[in]tag_valuesPointer to tag data being set on entities. Note that the implicit INTERLEAVED storage order rule applies (see iBase_StorageOrder)
[in]tag_values_sizeSize in total number of entity handles of tag
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 2071 of file iMesh_MOAB.cpp.

References CHKTAGTYPE, iBase_ENTITY_SET_HANDLE, and iMesh_setArrData.

{
    CHKTAGTYPE( tag_handle, iBase_ENTITY_SET_HANDLE );
    iMesh_setArrData( instance, entity_handles, entity_handles_size, tag_handle,
                      reinterpret_cast< const char* >( tag_values ), sizeof( iBase_EntityHandle ) * tag_values_size,
                      err );
}
void iMesh_setIntArrData ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
const int  entity_handles_size,
const iBase_TagHandle  tag_handle,
const int *  tag_values,
const int  tag_values_size,
int *  err 
)

Set tag values of integer type on an array of entities.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesEntity array on which tag is being set
[in]entity_handles_sizeNumber of entities in array
[in]tag_handleTag being set on an entity
[in]tag_valuesPointer to tag data being set on entities. Note that the implicit INTERLEAVED storage order rule applies (see iBase_StorageOrder)
[in]tag_values_sizeSize in total number of integers of tag data
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 2031 of file iMesh_MOAB.cpp.

References CHKTAGTYPE, iBase_INTEGER, and iMesh_setArrData.

{
    CHKTAGTYPE( tag_handle, iBase_INTEGER );
    iMesh_setArrData( instance, entity_handles, entity_handles_size, tag_handle,
                      reinterpret_cast< const char* >( tag_values ), sizeof( int ) * tag_values_size, err );
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines