Store tags and tag data for Mesquite's native mesh representation. More...
#include <MeshImplTags.hpp>
Classes | |
class | TagData |
Store data for a single tag. More... | |
class | TagIterator |
Iterate over list of valid tag handles. More... | |
Public Member Functions | |
~MeshImplTags () | |
void | clear () |
Clear all data. More... | |
size_t | handle (const msq_std::string &name, MsqError &err) const |
Get tag index from name. More... | |
const TagDescription & | properties (size_t tag_handle, MsqError &err) const |
Get tag properties. More... | |
size_t | create (const msq_std::string &name, Mesh::TagType type, unsigned length, const void *defval, MsqError &err) |
Create a new tag. More... | |
size_t | create (const TagDescription &desc, MsqError &err) |
Create a new tag. More... | |
void | destroy (size_t tag_index, MsqError &err) |
Remove a tag. More... | |
void | set_element_data (size_t tag_handle, size_t num_indices, const size_t *elem_indices, const void *tag_data, MsqError &err) |
Set tag data on elements. More... | |
void | set_vertex_data (size_t tag_handle, size_t num_indices, const size_t *elem_indices, const void *tag_data, MsqError &err) |
Set tag data on vertices. More... | |
void | get_element_data (size_t tag_handle, size_t num_indices, const size_t *elem_indices, void *tag_data, MsqError &err) const |
Get tag data on elements. More... | |
void | get_vertex_data (size_t tag_handle, size_t num_indices, const size_t *elem_indices, void *tag_data, MsqError &err) const |
Get tag data on vertices. More... | |
TagIterator | tag_begin () |
TagIterator | tag_end () |
bool | tag_has_vertex_data (size_t index, MsqError &err) |
Check if any vertices have tag. More... | |
bool | tag_has_element_data (size_t index, MsqError &err) |
Check if any elements have tag. More... | |
~MeshImplTags () | |
void | clear () |
Clear all data. More... | |
size_t | handle (const msq_std::string &name, MsqError &err) const |
Get tag index from name. More... | |
const TagDescription & | properties (size_t tag_handle, MsqError &err) const |
Get tag properties. More... | |
size_t | create (const msq_std::string &name, Mesh::TagType type, unsigned length, const void *defval, MsqError &err) |
Create a new tag. More... | |
size_t | create (const TagDescription &desc, MsqError &err) |
Create a new tag. More... | |
void | destroy (size_t tag_index, MsqError &err) |
Remove a tag. More... | |
void | set_element_data (size_t tag_handle, size_t num_indices, const size_t *elem_indices, const void *tag_data, MsqError &err) |
Set tag data on elements. More... | |
void | set_vertex_data (size_t tag_handle, size_t num_indices, const size_t *elem_indices, const void *tag_data, MsqError &err) |
Set tag data on vertices. More... | |
void | get_element_data (size_t tag_handle, size_t num_indices, const size_t *elem_indices, void *tag_data, MsqError &err) const |
Get tag data on elements. More... | |
void | get_vertex_data (size_t tag_handle, size_t num_indices, const size_t *elem_indices, void *tag_data, MsqError &err) const |
Get tag data on vertices. More... | |
TagIterator | tag_begin () |
TagIterator | tag_end () |
bool | tag_has_vertex_data (size_t index, MsqError &err) |
Check if any vertices have tag. More... | |
bool | tag_has_element_data (size_t index, MsqError &err) |
Check if any elements have tag. More... | |
Static Public Member Functions | |
static size_t | size_from_tag_type (Mesh::TagType type) |
Get the size of the passed data type. More... | |
static size_t | size_from_tag_type (Mesh::TagType type) |
Get the size of the passed data type. More... | |
Private Attributes | |
msq_std::vector< TagData * > | tagList |
Friends | |
class | MeshImplTags::TagIterator |
Store tags and tag data for Mesquite's native mesh representation.
Stores for each tag: properties, element data, and vertex data. The tag element and vertex data sets are maps between some element or vertex index and a tag value.
Definition at line 72 of file includeLinks/MeshImplTags.hpp.
|
inline |
Definition at line 75 of file includeLinks/MeshImplTags.hpp.
References MeshImplTags::clear().
|
inline |
Definition at line 75 of file src/Mesh/MeshImplTags.hpp.
References MeshImplTags::clear().
void clear | ( | ) |
Clear all data.
Definition at line 48 of file Mesh/MeshImplTags.cpp.
References MeshImplTags::tagList.
Referenced by MeshImpl::clear(), and MeshImplTags::~MeshImplTags().
void clear | ( | ) |
Clear all data.
size_t create | ( | const msq_std::string & | name, |
Mesh::TagType | type, | ||
unsigned | length, | ||
const void * | defval, | ||
MsqError & | err | ||
) |
Create a new tag.
Create a new tag with the passed properties
name | Tag name (must be unique) |
type | Tag data type |
length | Number of values in tag (array length, 1 for scalar) |
defval | Optional default value for tag |
Definition at line 70 of file Mesh/MeshImplTags.cpp.
References MeshImplTags::TagData::defaultValue, MeshImplTags::TagData::desc, MeshImplTags::handle(), MsqError::INVALID_ARG, MSQ_SETERR, TagDescription::size, MeshImplTags::size_from_tag_type(), MsqError::TAG_ALREADY_EXISTS, and MeshImplTags::tagList.
Referenced by MeshImpl::vtk_read_cell_data(), and MeshImpl::vtk_read_point_data().
size_t create | ( | const msq_std::string & | name, |
Mesh::TagType | type, | ||
unsigned | length, | ||
const void * | defval, | ||
MsqError & | err | ||
) |
Create a new tag.
Create a new tag with the passed properties
name | Tag name (must be unique) |
type | Tag data type |
length | Number of values in tag (array length, 1 for scalar) |
defval | Optional default value for tag |
size_t create | ( | const TagDescription & | desc, |
MsqError & | err | ||
) |
Create a new tag.
Create a new tag with the passed properties
size_t create | ( | const TagDescription & | desc, |
MsqError & | err | ||
) |
Create a new tag.
Create a new tag with the passed properties
Definition at line 102 of file Mesh/MeshImplTags.cpp.
References MeshImplTags::handle(), MsqError::INVALID_ARG, MSQ_SETERR, TagDescription::name, TagDescription::size, MeshImplTags::size_from_tag_type(), MsqError::TAG_ALREADY_EXISTS, MeshImplTags::tagList, and TagDescription::type.
void destroy | ( | size_t | tag_index, |
MsqError & | err | ||
) |
Remove a tag.
void destroy | ( | size_t | tag_index, |
MsqError & | err | ||
) |
Remove a tag.
Definition at line 125 of file Mesh/MeshImplTags.cpp.
References MSQ_SETERR, MsqError::TAG_NOT_FOUND, and MeshImplTags::tagList.
Referenced by MeshImpl::tag_delete().
void get_element_data | ( | size_t | tag_handle, |
size_t | num_indices, | ||
const size_t * | elem_indices, | ||
void * | tag_data, | ||
MsqError & | err | ||
) | const |
Get tag data on elements.
Definition at line 213 of file Mesh/MeshImplTags.cpp.
References MeshImplTags::TagData::defaultValue, MeshImplTags::TagData::desc, MeshImplTags::TagData::elementCount, MeshImplTags::TagData::elementData, for(), i, MsqError::INVALID_ARG, MSQ_SETERR, TagDescription::size, MsqError::TAG_NOT_FOUND, and MeshImplTags::tagList.
Referenced by MeshImpl::tag_get_element_data(), and MeshImpl::write_vtk().
void get_element_data | ( | size_t | tag_handle, |
size_t | num_indices, | ||
const size_t * | elem_indices, | ||
void * | tag_data, | ||
MsqError & | err | ||
) | const |
Get tag data on elements.
void get_vertex_data | ( | size_t | tag_handle, |
size_t | num_indices, | ||
const size_t * | elem_indices, | ||
void * | tag_data, | ||
MsqError & | err | ||
) | const |
Get tag data on vertices.
Definition at line 305 of file Mesh/MeshImplTags.cpp.
References MeshImplTags::TagData::defaultValue, MeshImplTags::TagData::desc, for(), i, MsqError::INVALID_ARG, MSQ_SETERR, TagDescription::size, MsqError::TAG_NOT_FOUND, MeshImplTags::tagList, MeshImplTags::TagData::vertexCount, and MeshImplTags::TagData::vertexData.
Referenced by MeshImpl::read_vtk(), MeshImpl::tag_get_vertex_data(), and MeshImpl::write_vtk().
void get_vertex_data | ( | size_t | tag_handle, |
size_t | num_indices, | ||
const size_t * | elem_indices, | ||
void * | tag_data, | ||
MsqError & | err | ||
) | const |
Get tag data on vertices.
size_t handle | ( | const msq_std::string & | name, |
MsqError & | err | ||
) | const |
Get tag index from name.
size_t handle | ( | const msq_std::string & | name, |
MsqError & | err | ||
) | const |
Get tag index from name.
Definition at line 138 of file Mesh/MeshImplTags.cpp.
References i, and MeshImplTags::tagList.
Referenced by MeshImplTags::create(), rflo_initgenxinterface(), rflu_modrocstaradmin::rflu_genx_initrocman(), MeshImpl::tag_get(), MeshImpl::vtk_read_cell_data(), and MeshImpl::vtk_read_point_data().
const TagDescription& properties | ( | size_t | tag_handle, |
MsqError & | err | ||
) | const |
Get tag properties.
const TagDescription & properties | ( | size_t | tag_handle, |
MsqError & | err | ||
) | const |
Get tag properties.
Definition at line 147 of file Mesh/MeshImplTags.cpp.
References MsqError::INVALID_ARG, MSQ_SETERR, and MeshImplTags::tagList.
Referenced by MeshImpl::read_vtk(), MeshImpl::tag_properties(), MeshImpl::vtk_read_cell_data(), MeshImpl::vtk_read_point_data(), and MeshImpl::write_vtk().
void set_element_data | ( | size_t | tag_handle, |
size_t | num_indices, | ||
const size_t * | elem_indices, | ||
const void * | tag_data, | ||
MsqError & | err | ||
) |
Set tag data on elements.
Definition at line 162 of file Mesh/MeshImplTags.cpp.
References MeshImplTags::TagData::defaultValue, MeshImplTags::TagData::desc, MeshImplTags::TagData::elementCount, MeshImplTags::TagData::elementData, i, MsqError::INVALID_ARG, MSQ_SETERR, TagDescription::size, and MeshImplTags::tagList.
Referenced by MeshImpl::tag_set_element_data(), and MeshImpl::vtk_read_cell_data().
void set_element_data | ( | size_t | tag_handle, |
size_t | num_indices, | ||
const size_t * | elem_indices, | ||
const void * | tag_data, | ||
MsqError & | err | ||
) |
Set tag data on elements.
void set_vertex_data | ( | size_t | tag_handle, |
size_t | num_indices, | ||
const size_t * | elem_indices, | ||
const void * | tag_data, | ||
MsqError & | err | ||
) |
Set tag data on vertices.
Definition at line 254 of file Mesh/MeshImplTags.cpp.
References MeshImplTags::TagData::defaultValue, MeshImplTags::TagData::desc, i, MsqError::INVALID_ARG, MSQ_SETERR, TagDescription::size, MeshImplTags::tagList, MeshImplTags::TagData::vertexCount, and MeshImplTags::TagData::vertexData.
Referenced by MeshImpl::tag_set_vertex_data(), and MeshImpl::vtk_read_point_data().
void set_vertex_data | ( | size_t | tag_handle, |
size_t | num_indices, | ||
const size_t * | elem_indices, | ||
const void * | tag_data, | ||
MsqError & | err | ||
) |
Set tag data on vertices.
|
static |
Get the size of the passed data type.
|
static |
Get the size of the passed data type.
Definition at line 58 of file Mesh/MeshImplTags.cpp.
References Mesh::BOOL, Mesh::BYTE, Mesh::DOUBLE, Mesh::HANDLE, and Mesh::INT.
Referenced by MeshImplTags::create(), MeshImpl::tag_properties(), and MeshImpl::vtk_write_attrib_data().
TagIterator tag_begin | ( | ) |
MeshImplTags::TagIterator tag_begin | ( | ) |
Definition at line 372 of file Mesh/MeshImplTags.cpp.
References MeshImplTags::tagList.
Referenced by MeshImpl::write_vtk().
|
inline |
Definition at line 210 of file src/Mesh/MeshImplTags.hpp.
References MeshImplTags::tagList.
|
inline |
Definition at line 210 of file includeLinks/MeshImplTags.hpp.
References MeshImplTags::tagList.
Referenced by MeshImpl::write_vtk().
bool tag_has_element_data | ( | size_t | index, |
MsqError & | err | ||
) |
Check if any elements have tag.
Definition at line 359 of file Mesh/MeshImplTags.cpp.
References MeshImplTags::TagData::defaultValue, MeshImplTags::TagData::elementData, MsqError::INVALID_ARG, MSQ_SETERR, and MeshImplTags::tagList.
Referenced by MeshImpl::write_vtk().
bool tag_has_element_data | ( | size_t | index, |
MsqError & | err | ||
) |
Check if any elements have tag.
bool tag_has_vertex_data | ( | size_t | index, |
MsqError & | err | ||
) |
Check if any vertices have tag.
bool tag_has_vertex_data | ( | size_t | index, |
MsqError & | err | ||
) |
Check if any vertices have tag.
Definition at line 346 of file Mesh/MeshImplTags.cpp.
References MeshImplTags::TagData::defaultValue, MsqError::INVALID_ARG, MSQ_SETERR, MeshImplTags::tagList, and MeshImplTags::TagData::vertexData.
Referenced by MeshImpl::read_vtk(), and MeshImpl::write_vtk().
|
friend |
Definition at line 219 of file includeLinks/MeshImplTags.hpp.
|
private |
Definition at line 221 of file includeLinks/MeshImplTags.hpp.
Referenced by MeshImplTags::clear(), MeshImplTags::create(), MeshImplTags::destroy(), MeshImplTags::get_element_data(), MeshImplTags::get_vertex_data(), MeshImplTags::handle(), MeshImplTags::TagIterator::operator++(), MeshImplTags::TagIterator::operator--(), MeshImplTags::properties(), MeshImplTags::set_element_data(), MeshImplTags::set_vertex_data(), MeshImplTags::tag_begin(), MeshImplTags::tag_end(), MeshImplTags::tag_has_element_data(), and MeshImplTags::tag_has_vertex_data().