36 #include <sidl_cxx.hh>
40 #include "MsqDebug.hpp"
42 #include "MsqError.hpp"
46 #ifdef MSQ_USE_OLD_STD_HEADERS
54 #define OPAQUE_TYPE_OPAQUE_PADDED 0
55 #define OPAQUE_TYPE_OPAQUE_PACKED 1
56 #define OPAQUE_TYPE_CHAR 2
57 #define OPAQUE_TYPE_UCHAR 3
58 #define OPAQUE_TYPE_BYTE OPAQUE_TYPE_UCHAR
59 #define TSTT_OPAQUE_TAG_TYPE OPAQUE_TYPE_CHAR
100 TSTTM::EntityType type,
120 : tsttMesh(mesh), tsttIter(0), notAtEnd(true), entityHandle(0)
126 catch (TSTTB::Error& tstt_err) {
143 catch (TSTTB::Error& tstt_err) {
164 catch (TSTTB::Error& tstt_err) {
175 sidl::array<void*>::const_iterator
iter;
218 TSTTM::EntityType type,
220 unsigned buffer_count = 1024 );
236 TSTTM::EntityType type,
238 unsigned buffer_count )
246 mesh.initEntArrIter( meshset, type, topo, buffer_count,
tsttIter );
256 catch (TSTTB::Error& tstt_err) {
268 catch (TSTTB::Error& tstt_err) {
291 catch (TSTTB::Error& tstt_err) {
342 size_t& element_count,
343 size_t& vertex_use_count,
366 size_t* elem_conn_offsets,
size_t offset_len,
367 size_t* elem_conn_indices,
size_t index_len,
396 unsigned char *byte_array,
401 unsigned char *byte,
MsqError &err);
404 unsigned char *byte_array,
413 size_t sizeof_elem_array,
462 size_t &sizeof_vert_handles,
464 size_t &sizeof_csr_data,
475 size_t num_elements,
MsqError &err);
505 const void* default_value,
528 msq_std::string& name_out,
530 unsigned& length_out,
546 const void* tag_data,
562 const void* tag_data,
610 const void* tag_data,
715 : meshIFace(tstt_mesh),
716 elementSet(0), nodeSet(0),
717 inputSetType( TSTTM::EntityType_ALL_TYPES ),
718 byteTag(0), createdByteTag(false),
719 fixedTag(0), createdFixedTag(false),
720 vertexAdjElementSize(0), cachedAdjVertex(0)
726 if (mapsize < TSTTM::EntityTopology_ALL_TOPOLOGIES)
728 MSQ_SETERR(err)(
"MeshTSTT needs to be updated for new TSTT element topologies.",
733 for (
size_t i = 0;
i <= TSTTM::EntityTopology_ALL_TOPOLOGIES; ++
i)
748 MSQ_SETERR(err)(
"TSTTM::Mesh does not implement TSTTM::EntTag",
756 MSQ_SETERR(err)(
"TSTTM::Mesh does not implement TSTTM::ArrTag",
764 MSQ_SETERR(err)(
"TSTTM::Mesh does not implement TSTTM::Modify",
772 MSQ_SETERR(err)(
"TSTTM::Mesh does not implement TSTTM::EntSet",
780 MSQ_SETERR(err)(
"TSTTM::Mesh does not implement TSTTB::EntTag",
788 MSQ_SETERR(err)(
"TSTTM::Mesh does not implement TSTTB::ArrTag",
802 "Tag \"%s\" exists with invalid type/size",
824 "Tag \"%s\" exists with invalid type/size",
855 catch (TSTTB::Error &tstt_err) {
876 setIFace.destroyEntSet( elementSet );
878 setIFace.destroyEntSet( nodeSet );
881 tagIFace.destroyTag( fixedTag,
false );
883 tagIFace.destroyTag( byteTag,
false );
887 catch (TSTTB::Error& tstt_err ) {
899 const unsigned BUFFER_COUNT = 1024;
901 sidl::array<int> value_array( alloc_sidl_vector<int>( BUFFER_COUNT, value ) );
903 sidl::array<void*> handle_array( alloc_sidl_vector<void*>( BUFFER_COUNT ) );
904 int count = BUFFER_COUNT;
911 TSTTM::EntityType_VERTEX,
912 TSTTM::EntityTopology_POINT,
913 BUFFER_COUNT, iter );
916 more =
arrIFace.getEntArrNextIter( iter, handle_array, count );
918 arrTagIFace.setIntArrData( handle_array, count, tag, value_array, count );
924 catch (TSTTB::Error &tstt_err) {
925 if( iter )
try {
arrIFace.endEntArrIter( iter ); }
catch (...) {}
933 const int ELEM_BUFFER_SIZE = 1024;
934 const int NODE_BUFFER_SIZE = 27 * ELEM_BUFFER_SIZE;
935 sidl::array<void*> elements( alloc_sidl_vector<void*>( ELEM_BUFFER_SIZE ) );
936 sidl::array<void*> nodes( alloc_sidl_vector<void*>( NODE_BUFFER_SIZE ) );
937 sidl::array<int> offsets( alloc_sidl_vector<int >( ELEM_BUFFER_SIZE ) );
957 bool have_faces =
false, have_regions =
false;
958 for (
int i = 0;
i < 2; ++
i)
960 TSTTM::EntityType type =
i ? TSTTM::EntityType_REGION :
961 TSTTM::EntityType_FACE;
962 bool& have_some =
i ? have_regions : have_faces;
966 TSTTM::EntityTopology_ALL_TOPOLOGIES,
974 more =
arrIFace.getEntArrNextIter( iter, elements, count );
980 arrIFace.getEntArrAdj( elements, count, TSTTM::EntityType_VERTEX,
981 nodes, num_nodes, offsets, num_offsets );
994 else if (!have_regions)
1001 catch (TSTTB::Error &tstt_err) {
1039 const int ELEM_BUFFER_SIZE = 1024;
1040 void* handle_array[ELEM_BUFFER_SIZE];
1047 TSTTM::EntityType_ALL_TYPES,
1048 TSTTM::EntityTopology_ALL_TOPOLOGIES,
1056 more =
arrIFace.getEntArrNextIter( iter, handles, count );
1060 void**
const end_ptr = handle_array + count;
1061 for (
void** ptr = handle_array; ptr != end_ptr; ++ptr)
1077 catch (TSTTB::Error &tstt_err) {
1094 TSTTM::EntityType_ALL_TYPES,
1095 TSTTM::EntityTopology_ALL_TOPOLOGIES );
1097 catch (TSTTB::Error &tstt_err) {
1113 TSTTM::EntityType_ALL_TYPES,
1114 TSTTM::EntityTopology_ALL_TOPOLOGIES );
1116 catch (TSTTB::Error &tstt_err) {
1137 catch( TSTTB::Error& tstt_err ) {
1156 memset( bool_array, 0, num_vtx *
sizeof(
bool) );
1163 sidl::array<int> bools = alloc_sidl_vector<int>(num_vtx);
1165 int num_bools = num_vtx;
1167 if (num_vtx != (
unsigned)num_bools)
1170 for (
size_t i = 0;
i < num_vtx; ++
i)
1171 bool_array[
i] = bools.get(
i);
1173 catch(::TSTTB::Error &tstt_err) {
1185 double* dbl_array = 0;
1189 int dbl_len = dim * num_vtx;
1191 sidl::array<void*> vertex_wrapper(
1193 dbl_array =
new double[dbl_len];
1196 TSTTM::StorageOrder order = TSTTM::StorageOrder_UNDETERMINED;
1197 meshIFace.getVtxArrCoords( vertex_wrapper, num_vtx, order, dbl_wrapper, dbl_len );
1198 if ((
unsigned)dbl_len != dim*num_vtx) {
1200 delete [] dbl_array;
1206 if (order == TSTTM::StorageOrder_INTERLEAVED)
1208 double* iter = dbl_array;
1209 for (
size_t i = 0;
i < num_vtx; ++
i)
1211 coordinates[
i].
x(*iter); ++iter;
1212 coordinates[
i].
y(*iter); ++iter;
1213 coordinates[
i].
z(0);
1218 double *xiter = dbl_array;
1219 double *yiter = dbl_array + num_vtx;
1220 for (
size_t i = 0;
i < num_vtx; ++
i)
1222 coordinates[
i].
x(*xiter); ++xiter;
1223 coordinates[
i].
y(*yiter); ++yiter;
1224 coordinates[
i].
z(0);
1230 if (order == TSTTM::StorageOrder_INTERLEAVED)
1232 double* iter = dbl_array;
1233 for (
size_t i = 0;
i < num_vtx; ++
i)
1235 coordinates[
i].
set(iter);
1241 double *xiter = dbl_array;
1242 double *yiter = dbl_array + num_vtx;
1243 double *ziter = dbl_array + 2*num_vtx;
1244 for (
size_t i = 0;
i < num_vtx; ++
i)
1246 coordinates[
i].
x(*xiter); ++xiter;
1247 coordinates[
i].
y(*yiter); ++yiter;
1248 coordinates[
i].
z(*ziter); ++ziter;
1255 delete [] dbl_array;
1260 catch(::TSTTB::Error &tstt_err) {
1264 delete [] dbl_array;
1272 sidl::array<double> coords(
1274 modIFace.setVtxCoords( vertex, coords, 1 );
1276 catch(::TSTTB::Error &tstt_err) {
1293 catch(::TSTTB::Error &tstt_err) {
1300 unsigned char *byte_array,
1310 sidl::array<int> data(alloc_sidl_vector<int>(array_size));
1311 for (
size_t i = 0;
i < array_size; ++
i)
1312 data.set(
i, byte_array[
i] );
1315 catch(::TSTTB::Error &tstt_err) {
1325 unsigned char *byte,
MsqError &err)
1330 catch(::TSTTB::Error &tstt_err) {
1337 unsigned char *byte_array,
1347 sidl::array<int> data( alloc_sidl_vector<int>(array_size) );
1351 for (
size_t i = 0;
i< array_size; ++
i )
1352 byte_array[
i] = (
unsigned char)data.get(
i);
1354 catch(::TSTTB::Error &tstt_err) {
1398 catch(::TSTTB::Error &tstt_err) {
1406 for (
void** read_ptr = write_ptr; read_ptr != end_ptr; ++read_ptr)
1410 *write_ptr = *read_ptr;
1435 size_t sizeof_elem_array,
MsqError &err)
1445 memcpy( elem_array, array, vertexAdjElementSize *
sizeof(
void*) );
1458 sidl::array<void*> junk;
1460 entIFace.getEntAdj( elem, TSTTM::EntityType_VERTEX, junk, result );
1463 catch(::TSTTB::Error &tstt_err) {
1475 sidl::array<void*> adj;
1476 sidl::array<int> offsets;
1477 int32_t adj_size, off_size;
1478 arrIFace.getEntArrAdj( handles, length, TSTTM::EntityType_VERTEX, adj, adj_size, offsets, off_size );
1481 catch(::TSTTB::Error &tstt_err) {
1501 size_t &indices_len,
1510 int vert_count, off_count;
1513 sidl::array<int> off_arr;
1514 if (
sizeof(
size_t) ==
sizeof(
int))
1517 off_arr = alloc_sidl_vector<int>( num_elems + 1 );
1520 arrIFace.getEntArrAdj( elem_arr, num_elems,
1521 TSTTM::EntityType_VERTEX,
1522 vert_arr, vert_count,
1523 off_arr, off_count );
1525 indices_len = vert_count;
1527 if (
sizeof(
size_t) !=
sizeof(
int))
1532 if ((
unsigned)off_count == num_elems)
1533 offsets[num_elems] = vert_count;
1535 assert( (
unsigned)off_count == num_elems+1 );
1537 catch(::TSTTB::Error &tstt_err) {
1544 msq_std::map<VertexHandle,size_t> index_map;
1545 const size_t* end = indices + indices_len;
1563 for (
size_t* iter = indices; iter != end; ++iter)
1566 msq_std::map<VertexHandle,size_t>::iterator pos = index_map.find( vertex );
1567 if (pos == index_map.end())
1568 index_map[vertex] = 0;
1570 for (msq_std::map<VertexHandle,size_t>::iterator m_iter = index_map.begin();
1571 m_iter != index_map.end(); ++m_iter)
1573 vertices[vert_len] = m_iter->first;
1574 m_iter->second = vert_len++;
1576 for (
size_t* iter = indices; iter != end; ++iter)
1579 msq_std::map<VertexHandle,size_t>::iterator pos = index_map.find( vertex );
1580 *iter = pos->second;
1587 size_t& element_count,
1588 size_t& vertex_use_count,
1594 vertex_count =
meshIFace.getNumOfType(
nodeSet, TSTTM::EntityType_VERTEX );
1601 sidl::array<void*> handles1, handles2;
1602 sidl::array<int> offsets1, offsets2;
1603 sidl::array<int> flags1, flags2;
1604 int num_handles, num_offsets, num_flags;
1607 TSTTM::EntityType_FACE,
1608 TSTTM::EntityTopology_ALL_TOPOLOGIES,
1609 TSTTM::EntityType_VERTEX,
1610 handles1, num_handles,
1611 offsets1, num_offsets,
1612 flags1 , num_flags );
1613 vertex_use_count = num_handles;
1616 TSTTM::EntityType_REGION,
1617 TSTTM::EntityTopology_ALL_TOPOLOGIES,
1618 TSTTM::EntityType_VERTEX,
1619 handles2, num_handles,
1620 offsets2, num_offsets,
1621 flags2 , num_flags );
1622 vertex_use_count += num_handles;
1624 catch(::TSTTB::Error &tstt_err) {
1631 size_t* offset_array,
size_t offset_len,
1632 size_t* conn_array,
size_t conn_len ,
1639 TSTTM::EntityType_ALL_TYPES,
1640 TSTTM::EntityTopology_ALL_TOPOLOGIES,
1643 if ((
unsigned)num_elem > elem_len)
1649 catch(::TSTTB::Error &tstt_err) {
1654 if (offset_len <= (
unsigned)num_elem)
1661 vert_array, vert_len,
1662 conn_array, conn_len,
1663 offset_array, err );
1675 catch(::TSTTB::Error &tstt_err) {
1686 size_t num_elements,
MsqError &err)
1690 sidl::array<TSTTM::EntityTopology> topologies( alloc_sidl_vector<TSTTM::EntityTopology>( num_elements ) );
1693 arrIFace.getEntArrTopo( handles, num_elements, topologies, topo_len_out );
1694 if ((
size_t)topo_len_out != num_elements) {
1699 for (
unsigned i = 0;
i < num_elements; ++
i)
1702 catch(::TSTTB::Error &tstt_err) {
1729 const void* default_val,
1732 TSTTB::TagValueType tstt_type;
1735 case Mesquite::Mesh::BYTE: size =
sizeof(char ); tstt_type = TSTTB::TagValueType_OPAQUE;
break;
1736 case Mesquite::Mesh::INT: size =
sizeof(int ); tstt_type = TSTTB::TagValueType_INTEGER;
break;
1738 case Mesquite::Mesh::HANDLE: size =
sizeof(
void* ); tstt_type = TSTTB::TagValueType_ENTITY_HANDLE;
break;
1747 tagIFace.createTag( name, size, tstt_type, handle );
1750 catch(::TSTTB::Error &tstt_err) {
1759 tagIFace.destroyTag( handle,
true );
1761 catch(::TSTTB::Error &tstt_err) {
1769 return tagIFace.getTagHandle( name );
1771 catch(::TSTTB::Error &tstt_err) {
1772 if (tstt_err.getErrorType() != TSTTB::ErrorType_TAG_NOT_FOUND) {
1780 msq_std::string& name,
1782 unsigned& length_out,
1786 TSTTB::TagValueType type;
1788 name =
tagIFace.getTagName( handle );
1789 size =
tagIFace.getTagSize( handle );
1790 type =
tagIFace.getTagType( handle );
1792 catch(::TSTTB::Error &tstt_err) {
1799 case TSTTB::TagValueType_OPAQUE : tsize =
sizeof(char ); type_out =
Mesquite::Mesh::BYTE ;
break;
1800 case TSTTB::TagValueType_INTEGER : tsize =
sizeof(int ); type_out =
Mesquite::Mesh::INT ;
break;
1802 case TSTTB::TagValueType_ENTITY_HANDLE: tsize =
sizeof(
void* ); type_out =
Mesquite::Mesh::HANDLE;
break;
1808 if (size % tsize != 0)
1814 length_out = size / tsize;
1842 size_t len, size =
tagIFace.getTagSize( tag );
1845 switch (
tagIFace.getTagType( tag ))
1847 case TSTTB::TagValueType_ENTITY_HANDLE:
1849 len = size /
sizeof(
void*);
1851 arrTagIFace.setEHArrData( handles, num_elems, tag, sdata, count );
1855 case TSTTB::TagValueType_DOUBLE:
1857 len = size /
sizeof(double);
1859 arrTagIFace.setDblArrData( handles, num_elems, tag, sdata, count );
1863 case TSTTB::TagValueType_INTEGER:
1865 len = size /
sizeof(int);
1867 arrTagIFace.setIntArrData( handles, num_elems, tag, sdata, count );
1873 #if TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_OPAQUE_PACKED
1874 len = num_elems /
sizeof(
void*);
1875 if (num_elems %
sizeof(
void*))
1878 #elif TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_OPAQUE_PADDED
1879 assert( size <=
sizeof(
void*) );
1880 sidl::array<void*> sdata( alloc_sidl_vector<void*>(num_elems) );
1881 const char* ptr =
reinterpret_cast<const char*
>(data);
1882 for (
size_t i = 0;
i < num_elems; ++
i)
1883 sdata.set(
i, reinterpret_cast<void*>(*(ptr +
i*size)) );
1884 #elif TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_CHAR
1885 len = size * num_elems;
1887 #elif TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_UCHAR \
1888 || TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_BYTE
1889 len = size * num_elems;
1890 sidl::array<unsigned char> sdata(
alloc_sidl_vector( (
unsigned char*)data, len ) );
1894 arrTagIFace.setArrData( handles, num_elems, tag, sdata, count, size );
1898 catch(::TSTTB::Error &tstt_err) {
1929 size_t len, size =
tagIFace.getTagSize( tag );
1930 int32_t lower = 0, upper = num_elems - 1, stride = 1, count = num_elems;
1931 sidl::array<void*> handles;
1932 handles.borrow( const_cast<void**>(array), 1, &lower, &upper, &stride );
1933 switch (
tagIFace.getTagType( tag ))
1935 case TSTTB::TagValueType_ENTITY_HANDLE:
1937 len = size /
sizeof(
void*);
1939 arrTagIFace.getEHArrData( handles, num_elems, tag, sdata, count );
1943 case TSTTB::TagValueType_DOUBLE:
1945 len = size /
sizeof(double);
1947 arrTagIFace.getDblArrData( handles, num_elems, tag, sdata, count );
1951 case TSTTB::TagValueType_INTEGER:
1953 len = size /
sizeof(int);
1955 arrTagIFace.getIntArrData( handles, num_elems, tag, sdata, count );
1961 #if TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_OPAQUE_PACKED
1962 len = num_elems /
sizeof(
void*);
1963 if (num_elems %
sizeof(
void*))
1966 #elif TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_OPAQUE_PADDED
1967 assert( size <=
sizeof(
void*) );
1968 sidl::array<void*> sdata( alloc_sidl_vector<void*>(num_elems) );
1969 #elif TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_CHAR
1970 len = size * num_elems;
1972 #elif TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_UCHAR \
1973 || TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_BYTE
1974 len = size * num_elems;
1975 sidl::array<unsigned char> sdata(
alloc_sidl_vector( (
unsigned char*)data, len ) );
1980 arrTagIFace.getArrData( handles, num_elems, tag, sdata, count, junk );
1982 #if TSTT_OPAQUE_TAG_TYPE == OPAQUE_TYPE_OPAQUE_PADDED
1983 const char* ptr =
reinterpret_cast<const char*
>(data);
1984 for (
size_t i = 0;
i < num_elems; ++
i)
1985 sdata.set(
i, reinterpret_cast<void*>(*(ptr +
i*size)) );
1990 catch(::TSTTB::Error &tstt_err) {
void cache_adjacent_elements(void *vertex_handle, MsqError &err)
Get elements adjacent to vertex and store in vertexAdjElements.
unable to allocate the necessary memory
Iterates through a set of entities. An EntityIterator is typically obtained via Mesh::vertex_iterator...
virtual void set_active_set(void *element_set, MsqError &)
set mesh to be smoothed.
bool createdByteTag
Tag was created in constructor.
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
TSTTM::Entity tsttMesh
TSTT mesh interface.
virtual void vertices_are_on_boundary(VertexHandle vert_array[], bool on_bnd[], size_t num_vtx, MsqError &err)
Query "boundary" flag for an array of vertices.
virtual void tag_get_vertex_data(TagHandle handle, size_t num_elems, const VertexHandle *node_array, void *tag_data, MsqError &err)
Get tag values on vertices.
void tag_set_data(TagHandle handle, size_t num_elems, const EntityHandle *handle_array, const void *tag_data, MsqError &err)
Set tag values.
virtual void operator++()
step
static sidl::array< T > alloc_sidl_vector(size_t size)
int vertexAdjElementSize
Number of valid entries vertexAdjElements.
virtual void vertex_set_coordinates(VertexHandle vertex, const Vector3D &coordinates, MsqError &err)
Set vertex coordinates.
virtual size_t get_vertex_use_count(ElementHandle *array, size_t length, MsqError &err)
Used to hold the error state and return it to the application.
virtual ElementIterator * element_iterator(MsqError &err)
Create iterator for elements in active set.
TagType
The type of a tag.
void * nodeSet
TSTTM entity set handle for nodes to move.
virtual void tag_set_element_data(TagHandle handle, size_t num_elems, const ElementHandle *elem_array, const void *tag_data, MsqError &err)
Set tag values on elements.
TagHandle fixedTag
Handle for tag used to hold vertex-fixed flag.
bool createdFixedTag
Fixed tag was created in constructor.
TSTTM::Modify modIFace
TSTT interface for modifying mesh.
virtual void tag_delete(TagHandle handle, MsqError &err)
Remove a tag and all corresponding data.
virtual TagHandle tag_get(const msq_std::string &name, MsqError &err)
Get handle for existing tag, by name.
virtual void get_all_mesh(VertexHandle *vert_array, size_t vert_len, ElementHandle *elem_array, size_t elem_len, size_t *elem_conn_offsets, size_t offset_len, size_t *elem_conn_indices, size_t index_len, MsqError &err)
Get entities and connectivity.
requested functionality is not (yet) implemented
EntityHandle VertexHandle
TSTTArrIter(TSTTM::Arr &mesh, void *meshset, TSTTM::EntityType type, TSTTM::EntityTopology topo, unsigned buffer_count=1024)
sidl::array< void * >::const_iterator iter
const char *const VERTEX_BYTE_TAG_NAME
The name of the tag (integer) that Mesquite will use to store internal data.
EntityHandle ElementHandle
TSTTM::EntityType inputSetType
The type of elements contained in the input element set.
virtual Mesh::EntityHandle operator*() const
get current entity handle
This file contains the Mesquite mesh interface. Many users will want to implement a concrete class de...
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
The name of the tag (integer) used internally by MeshTSTT to eliminate duplicate vertices.
void set_int_tag(void *tag, void *meshset, int value, MsqError &err)
void * EntityHandle
Opaque EntityHandle type and tag type.
virtual void restart()
reset iterator
void * elementSet
TSTTM entity set handle for elements to improve.
double length(Vector3D *const v, int n)
sidl::array< void * > handleArray
static T * convert_from_sidl_vector(sidl::array< T > &array)
virtual void release()
Instead of deleting a Mesh when you think you are done, call release().
sidl::array< void * > vertexAdjElements
Cached result for vertex->element query.
virtual void restart()
reset iterator
static sidl::array< T > convert_to_sidl_vector(T *array, size_t size)
invalid function argument passed
TSTT iterator using array-iterator interface and buffer of handles.
virtual void operator++()
step
SIDLIterator(const sidl::array< void * > &a)
TSTTB::ArrTag arrTagIFace
TagHandle byteTag
Handle for tag used to hold vertex byte.
virtual bool is_at_end() const
check if any remaining entity handles
void popupate_input_elements()
Populate inputElements from elemetnSet.
#define MSQ_CHKERR(err)
Mesquite's Error Checking macro.
void * tsttIter
TSTT iterator handle.
static void copy_from_sidl(sidl::array< S > &source, T *target)
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
TSTTM::Mesh meshIFace
TSTT basic mesh interface instance.
virtual void release_entity_handles(EntityHandle *handle_array, size_t num_handles, MsqError &err)
no-op
bool notAtEnd
Flag to mark if end of iterator had been reached.
const sidl::array< void * > array
virtual void restart()
reset iterator
Wrapper around single-entity TSTT interator.
virtual void set_active_set(void *element_set, MsqError &)=0
set mesh to be smoothed.
void * cachedAdjVertex
Vertex for which vertexAdjElements is cached.
msq_std::set< void * > inputElements
std::set containing elements in elementSet, used to constrain vertex->element adjaceny queries to onl...
virtual Mesh::EntityHandle operator*() const
get current entity handle
virtual void vertices_set_byte(VertexHandle *vert_array, unsigned char *byte_array, size_t array_size, MsqError &err)
Set vertex mark.
virtual void vertex_set_byte(VertexHandle vertex, unsigned char byte, MsqError &err)
Set vertex mark.
void * entityHandle
Current TSTT entity handle.
virtual void tag_properties(TagHandle handle, msq_std::string &name_out, TagType &type_out, unsigned &length_out, MsqError &err)
Get properites of tag.
virtual void vertex_get_attached_elements(VertexHandle vertex, ElementHandle *elem_array, size_t sizeof_elem_array, MsqError &err)
Get vertex adjacencies.
TSTTIterator(TSTTM::Entity &mesh, void *meshset, TSTTM::EntityType type, TSTTM::EntityTopology topo, MsqError &err)
static MeshTSTT * create(TSTTM::Mesh &mesh, void *meshset, MsqError &err)
factory method
virtual TagHandle tag_create(const msq_std::string &tag_name, TagType type, unsigned length, const void *default_value, MsqError &err)
Create a tag.
void tag_get_data(TagHandle handle, size_t num_elems, const EntityHandle *handle_array, void *tag_data, MsqError &err)
Get tag values.
const char *const VERTEX_FIXED_TAG_NAME
The name of the tag (integer) Mesquite expects to be non-zero for vertices which are not to be moved ...
object is in an invalid state
const double * to_array() const
virtual bool is_at_end() const
check if any remaining entity handles
virtual void elements_get_topologies(ElementHandle *element_handle_array, EntityTopology *element_topologies, size_t num_elements, MsqError &err)
Return topology type enum for an array of elements.
void * TagHandle
Type used to refer to a tag defintion.
void set(const double x, const double y, const double z)
virtual void operator++()
step
virtual EntityTopology element_get_topology(ElementHandle entity_handle, MsqError &err)
Return topology type enum for specified element.
virtual Mesh::EntityHandle operator*() const
get current entity handle
virtual size_t element_get_attached_vertex_count(ElementHandle elem, MsqError &err)
Get length of connectivity list
virtual void tag_get_element_data(TagHandle handle, size_t num_elems, const ElementHandle *elem_array, void *tag_data, MsqError &err)
Get tag values on elements.
virtual size_t vertex_get_attached_element_count(VertexHandle vertex, MsqError &err)
Get vertex adjacencies.
virtual bool is_at_end() const
check if any remaining entity handles
TSTTB::EntSet setIFace
TSTT interface for entity set operations.
EntityTopology topologyMap[TSTTM::EntityTopology_ALL_TOPOLOGIES+1]
Handle for the tag used internally to remove duplicates from lists.
TSTTM::Arr arrIFace
TSTT interface for multi-entity (array) queries.
MeshTSTTImpl(TSTTM::Mesh &tstt_mesh, MsqError &err)
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...
virtual VertexIterator * vertex_iterator(MsqError &err)
Create iterator for vertices in active set.
Iterate over a sidl array of TSTT entity handles.
#define MSQ_ERRRTN(err)
If passed error is true, return from a void function.
virtual void get_all_sizes(size_t &vertex_count, size_t &element_count, size_t &vertex_use_count, MsqError &err)
get sizes for calling get_all_mesh
virtual void vertex_get_byte(VertexHandle vertex, unsigned char *byte, MsqError &err)
Get vertex mark.
virtual void vertices_get_coordinates(const VertexHandle vert_array[], MsqVertex *coordinates, size_t num_vtx, MsqError &err)
Get vertex coordinates.
void get_next_entity()
Advance the iterator to the next entity.
virtual bool vertex_is_fixed(VertexHandle vertex, MsqError &err)
Query "fixed" flag for a vertex.
TSTTM::Entity entIFace
TSTT interface for per-entity queries.
Implementation of MeshTSTT.
virtual void elements_get_attached_vertices(ElementHandle *elem_handles, size_t num_elems, VertexHandle *vert_handles, size_t &sizeof_vert_handles, size_t *csr_data, size_t &sizeof_csr_data, size_t *csr_offsets, MsqError &err)
Get element connectivity in overly-complex CSR rep.
static msq_std::string process_tstt_error(TSTTB::Error &tstt_err)
virtual void vertices_get_byte(VertexHandle *vert_array, unsigned char *byte_array, size_t array_size, MsqError &err)
Get vertex mark.
virtual int get_geometric_dimension(Mesquite::MsqError &)
Get dimension of vertex coordinates (2D vs.
virtual void tag_set_vertex_data(TagHandle handle, size_t num_elems, const VertexHandle *node_array, const void *tag_data, MsqError &err)
Set tag values on vertices.