MOAB: Mesh Oriented datABase  (version 5.5.0)
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

Tag Data On Arrays of Entities TagData

Function Documentation

◆ iMesh_getArrData()

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.

1887 {
1888  if( 0 == entity_handles_size ) RETURN( iBase_SUCCESS );
1889  CHKNONEMPTY();
1890 
1891  const EntityHandle* ents = reinterpret_cast< const EntityHandle* >( entity_handles );
1892  Tag tag = TAG_HANDLE( tag_handle );
1893 
1894  int tag_size;
1895  ErrorCode result = MOABI->tag_get_bytes( tag, tag_size );
1896  if( MB_SUCCESS != result )
1897  {
1898  int nerr = -1;
1899  char tagn[64], msg[256];
1900  iMesh_getTagName( instance, tag_handle, tagn, &nerr, sizeof( tagn ) );
1901  snprintf( msg, sizeof( msg ), "iMesh_getArrData: couldn't get size for tag \"%s\"",
1902  nerr == 0 ? tagn : "unknown" );
1903  ERROR( result, msg );
1904  }
1905 
1906  ALLOC_CHECK_TAG_ARRAY( tag_values, tag_size * entity_handles_size );
1907 
1908  result = MOABI->tag_get_data( tag, ents, entity_handles_size, *static_cast< void** >( tag_values ) );
1909 
1910  if( MB_SUCCESS != result )
1911  {
1912  std::string message( "iMesh_getArrData: " );
1913  if( MB_TAG_NOT_FOUND == result )
1914  message += "tag not found";
1915  else
1916  message += "failed";
1917 
1918  std::string name;
1919  if( MB_SUCCESS == MOABI->tag_get_name( tag, name ) )
1920  {
1921  message += "for tag \"";
1922  message += name;
1923  message += "\".";
1924  }
1925  ERROR( result, message.c_str() );
1926  }
1927 
1928  KEEP_ARRAY( tag_values );
1929  RETURN( iBase_SUCCESS );
1930 }

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.

Referenced by iMesh_getData(), iMesh_getDblArrData(), iMesh_getDblData(), iMesh_getEHArrData(), iMesh_getEHData(), iMesh_getESHArrData(), iMesh_getESHData(), iMesh_getIntArrData(), and iMesh_getIntData().

◆ iMesh_getDblArrData()

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.

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.

1958 {
1959  CHKTAGTYPE( tag_handle, iBase_DOUBLE );
1960  *tag_values_allocated *= sizeof( double );
1961  if( tag_values_size != tag_values_allocated ) *tag_values_size *= sizeof( double );
1962  iMesh_getArrData( instance, entity_handles, entity_handles_size, tag_handle, tag_values, tag_values_allocated,
1963  tag_values_size, err );
1964  *tag_values_allocated /= sizeof( double );
1965  if( tag_values_size != tag_values_allocated ) *tag_values_size /= sizeof( double );
1966 }

References CHKTAGTYPE, iBase_DOUBLE, and iMesh_getArrData().

◆ iMesh_getEHArrData()

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.

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.

1976 {
1977  CHKTAGTYPE( tag_handle, iBase_ENTITY_HANDLE );
1978  *tag_value_allocated *= sizeof( iBase_EntityHandle );
1979  if( tag_value_size != tag_value_allocated ) *tag_value_size *= sizeof( iBase_EntityHandle );
1980  iMesh_getArrData( instance, entity_handles, entity_handles_size, tag_handle,
1981  reinterpret_cast< void** >( tag_value ), tag_value_allocated, tag_value_size, err );
1982  *tag_value_allocated /= sizeof( iBase_EntityHandle );
1983  if( tag_value_size != tag_value_allocated ) *tag_value_size /= sizeof( iBase_EntityHandle );
1984 }

References CHKTAGTYPE, iBase_ENTITY_HANDLE, and iMesh_getArrData().

◆ iMesh_getESHArrData()

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.

1994 {
1995  CHKTAGTYPE( tag_handle, iBase_ENTITY_SET_HANDLE );
1996  *tag_value_allocated *= sizeof( iBase_EntityHandle );
1997  if( tag_value_size != tag_value_allocated ) *tag_value_size *= sizeof( iBase_EntityHandle );
1998  iMesh_getArrData( instance, entity_handles, entity_handles_size, tag_handle,
1999  reinterpret_cast< void** >( tag_value ), tag_value_allocated, tag_value_size, err );
2000  *tag_value_allocated /= sizeof( iBase_EntityHandle );
2001  if( tag_value_size != tag_value_allocated ) *tag_value_size /= sizeof( iBase_EntityHandle );
2002 }

References CHKTAGTYPE, iBase_ENTITY_SET_HANDLE, and iMesh_getArrData().

◆ iMesh_getIntArrData()

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.

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.

1940 {
1941  CHKTAGTYPE( tag_handle, iBase_INTEGER );
1942  *tag_values_allocated *= sizeof( int );
1943  if( tag_values_size != tag_values_allocated ) *tag_values_size *= sizeof( int );
1944  iMesh_getArrData( instance, entity_handles, entity_handles_size, tag_handle, tag_values, tag_values_allocated,
1945  tag_values_size, err );
1946  *tag_values_allocated /= sizeof( int );
1947  if( tag_values_size != tag_values_allocated ) *tag_values_size /= sizeof( int );
1948 }

References CHKTAGTYPE, iBase_INTEGER, and iMesh_getArrData().

◆ iMesh_setArrData()

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.

2011 {
2012  if( 0 == entity_handles_size ) RETURN( iBase_SUCCESS );
2013  CHKNONEMPTY();
2014 
2015  int tag_size;
2016  iMesh_getTagSizeBytes( instance, tag_handle, &tag_size, err );
2017  // Check err manually and just return if not iBase_SUCCESS to not step on
2018  // the error set in iMesh_getTagSizeBytes().
2019  if( iBase_SUCCESS != *err ) return;
2020 
2021  if( tag_values_size != ( tag_size * entity_handles_size ) )
2022  {
2023  ERROR( iBase_BAD_ARRAY_SIZE, "iMesh_setArrData: bad tag_values_size passed." );
2024  }
2025 
2026  ErrorCode result = MOABI->tag_set_data( TAG_HANDLE( tag_handle ), CONST_HANDLE_ARRAY_PTR( entity_handles ),
2027  entity_handles_size, tag_values );CHKERR( result, "iMesh_setArrData didn't succeed." );
2028  RETURN( iBase_SUCCESS );
2029 }

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

Referenced by iMesh_setData(), iMesh_setDblArrData(), iMesh_setDblData(), iMesh_setEHArrData(), iMesh_setEHData(), iMesh_setESHArrData(), iMesh_setESHData(), iMesh_setIntArrData(), and iMesh_setIntData().

◆ iMesh_setDblArrData()

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.

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.

2051 {
2052  CHKTAGTYPE( tag_handle, iBase_DOUBLE );
2053  iMesh_setArrData( instance, entity_handles, entity_handles_size, tag_handle,
2054  reinterpret_cast< const char* >( tag_values ), sizeof( double ) * tag_values_size, err );
2055 }

References CHKTAGTYPE, iBase_DOUBLE, and iMesh_setArrData().

◆ iMesh_setEHArrData()

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.

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.

2064 {
2065  CHKTAGTYPE( tag_handle, iBase_ENTITY_HANDLE );
2066  iMesh_setArrData( instance, entity_handles, entity_handles_size, tag_handle,
2067  reinterpret_cast< const char* >( tag_values ), sizeof( iBase_EntityHandle ) * tag_values_size,
2068  err );
2069 }

References CHKTAGTYPE, iBase_ENTITY_HANDLE, and iMesh_setArrData().

◆ iMesh_setESHArrData()

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.

2078 {
2079  CHKTAGTYPE( tag_handle, iBase_ENTITY_SET_HANDLE );
2080  iMesh_setArrData( instance, entity_handles, entity_handles_size, tag_handle,
2081  reinterpret_cast< const char* >( tag_values ), sizeof( iBase_EntityHandle ) * tag_values_size,
2082  err );
2083 }

References CHKTAGTYPE, iBase_ENTITY_SET_HANDLE, and iMesh_setArrData().

◆ iMesh_setIntArrData()

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.

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.

2038 {
2039  CHKTAGTYPE( tag_handle, iBase_INTEGER );
2040  iMesh_setArrData( instance, entity_handles, entity_handles_size, tag_handle,
2041  reinterpret_cast< const char* >( tag_values ), sizeof( int ) * tag_values_size, err );
2042 }

References CHKTAGTYPE, iBase_INTEGER, and iMesh_setArrData().