[MOAB-dev] r2707 - in MOAB/trunk/tools: iMesh iMesh/SIDL iMesh/SIDL/mserver mbperf
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Thu Mar 12 16:26:05 CDT 2009
Author: kraftche
Date: 2009-03-12 16:26:05 -0500 (Thu, 12 Mar 2009)
New Revision: 2707
Modified:
MOAB/trunk/tools/iMesh/SIDL/iBase.sidl
MOAB/trunk/tools/iMesh/SIDL/iMesh.sidl
MOAB/trunk/tools/iMesh/SIDL/mserver/iMesh_SIDL_MeshSidl_Impl.cc
MOAB/trunk/tools/iMesh/iBase.h
MOAB/trunk/tools/iMesh/iMesh.h
MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp
MOAB/trunk/tools/mbperf/mbperf_SIDL.cpp
MOAB/trunk/tools/mbperf/mbperf_iMesh.cpp
Log:
iMesh updates
Modified: MOAB/trunk/tools/iMesh/SIDL/iBase.sidl
===================================================================
--- MOAB/trunk/tools/iMesh/SIDL/iBase.sidl 2009-03-12 21:25:26 UTC (rev 2706)
+++ MOAB/trunk/tools/iMesh/SIDL/iBase.sidl 2009-03-12 21:26:05 UTC (rev 2707)
@@ -28,8 +28,7 @@
enum StorageOrder {
BLOCKED,
- INTERLEAVED,
- UNDETERMINED
+ INTERLEAVED
};
enum CreationStatus {
Modified: MOAB/trunk/tools/iMesh/SIDL/iMesh.sidl
===================================================================
--- MOAB/trunk/tools/iMesh/SIDL/iMesh.sidl 2009-03-12 21:25:26 UTC (rev 2706)
+++ MOAB/trunk/tools/iMesh/SIDL/iMesh.sidl 2009-03-12 21:26:05 UTC (rev 2707)
@@ -100,17 +100,9 @@
out int entity_handles_size) throws iBase.Error;
void getVtxArrCoords( in array<opaque> vertex_handles,
in int vertex_handles_size,
- inout StorageOrder storage_order,
+ in StorageOrder storage_order,
inout array<double> coords,
out int coords_size) throws iBase.Error;
- void getAdjEntities( in opaque entity_set,
- in EntityType entity_type_requestor,
- in EntityTopology entity_topology_requestor,
- in EntityType entity_type_requested,
- inout array<opaque> adj_entity_handles,
- out int adj_entity_handles_size,
- inout array<int> offset,
- out int offset_size) throws iBase.Error;
void getAdjEntIndices( in opaque entity_set_handle,
in EntityType entity_type_requestor,
@@ -235,8 +227,8 @@
interface Modify extends Mesh {
// single entities
- void setVtxCoords( in opaque vertex_handle,
- in double x, in double y, in double z) throws iBase.Error;
+ void setVtxCoord( in opaque vertex_handle,
+ in double x, in double y, in double z) throws iBase.Error;
void createVtx( in double x, in double y, in double z,
out opaque new_vertex_handle) throws iBase.Error;
void createEnt( in EntityTopology new_entity_topology,
Modified: MOAB/trunk/tools/iMesh/SIDL/mserver/iMesh_SIDL_MeshSidl_Impl.cc
===================================================================
--- MOAB/trunk/tools/iMesh/SIDL/mserver/iMesh_SIDL_MeshSidl_Impl.cc 2009-03-12 21:25:26 UTC (rev 2706)
+++ MOAB/trunk/tools/iMesh/SIDL/mserver/iMesh_SIDL_MeshSidl_Impl.cc 2009-03-12 21:26:05 UTC (rev 2707)
@@ -1539,7 +1539,7 @@
iMesh_SIDL::MeshSidl_impl::getVtxArrCoords (
/* in */ ::sidl::array<void*> vertex_handles,
/* in */ int32_t vertex_handles_size,
- /* inout */ ::iBase::StorageOrder& storage_order,
+ /* in */ ::iBase::StorageOrder storage_order,
/* inout */ ::sidl::array<double>& coords,
/* out */ int32_t& coords_size )
throw (
@@ -1551,7 +1551,7 @@
iMesh_getVtxArrCoords (imeshInstance,
TEMP_TYPED_ARRAY_IN(iBase_EntityHandle, vertex_handles),
- (int*)&storage_order,
+ storage_order,
TEMP_ARRAY_INOUT(coords), &imeshError);
PROCESS_ERROR;
@@ -1561,43 +1561,6 @@
}
/**
- * Method: getAdjEntities[]
- */
-void
-iMesh_SIDL::MeshSidl_impl::getAdjEntities (
- /* in */ void* entity_set,
- /* in */ ::iBase::EntityType entity_type_requestor,
- /* in */ ::iMesh::EntityTopology entity_topology_requestor,
- /* in */ ::iBase::EntityType entity_type_requested,
- /* inout */ ::sidl::array<void*>& adj_entity_handles,
- /* out */ int32_t& adj_entity_handles_size,
- /* inout */ ::sidl::array<int32_t>& offset,
- /* out */ int32_t& offset_size )
-throw (
- ::iBase::Error
-){
- // DO-NOT-DELETE splicer.begin(iMesh_SIDL.MeshSidl.getAdjEntities)
- // Insert-Code-Here {iMesh_SIDL.MeshSidl.getAdjEntities} (getAdjEntities method)
-
- CREATE_TEMP_EH_ARRAY(adj_entity_handles);
- CREATE_TEMP_ARRAY(int32_t, offset);
-
- iMesh_getAdjEntities (imeshInstance, reinterpret_cast<iBase_EntitySetHandle>(entity_set),
- (iBase_EntityType)entity_type_requestor,
- (iMesh_EntityTopology)entity_topology_requestor,
- (iBase_EntityType)entity_type_requested,
- TEMP_ARRAY_INOUT(adj_entity_handles),
- TEMP_ARRAY_INOUT(offset),
- &imeshError);
- PROCESS_ERROR;
-
-
- ASSIGN_TYPED_ARRAY(void*, adj_entity_handles);
- ASSIGN_TYPED_ARRAY(int32_t, offset);
- // DO-NOT-DELETE splicer.end(iMesh_SIDL.MeshSidl.getAdjEntities)
-}
-
-/**
* Method: getAdjEntIndices[]
*/
void
@@ -2025,10 +1988,10 @@
}
/**
- * Method: setVtxCoords[]
+ * Method: setVtxCoord[]
*/
void
-iMesh_SIDL::MeshSidl_impl::setVtxCoords (
+iMesh_SIDL::MeshSidl_impl::setVtxCoord (
/* in */ void* vertex_handle,
/* in */ double x,
/* in */ double y,
@@ -2036,13 +1999,12 @@
throw (
::iBase::Error
){
- // DO-NOT-DELETE splicer.begin(iMesh_SIDL.MeshSidl.setVtxCoords)
- // Insert-Code-Here {iMesh_SIDL.MeshSidl.setVtxCoords} (setVtxCoords method)
- iMesh_setVtxCoords (imeshInstance,
- reinterpret_cast<iBase_EntityHandle>(vertex_handle),
- x, y, z, &imeshError);
+ // DO-NOT-DELETE splicer.begin(iMesh_SIDL.MeshSidl.setVtxCoord)
+ iMesh_setVtxCoord (imeshInstance,
+ reinterpret_cast<iBase_EntityHandle>(vertex_handle),
+ x, y, z, &imeshError);
PROCESS_ERROR;
- // DO-NOT-DELETE splicer.end(iMesh_SIDL.MeshSidl.setVtxCoords)
+ // DO-NOT-DELETE splicer.end(iMesh_SIDL.MeshSidl.setVtxCoord)
}
/**
@@ -2257,4 +2219,3 @@
}
// DO-NOT-DELETE splicer.end(iMesh_SIDL.MeshSidl._misc)
-
Modified: MOAB/trunk/tools/iMesh/iBase.h
===================================================================
--- MOAB/trunk/tools/iMesh/iBase.h 2009-03-12 21:25:26 UTC (rev 2706)
+++ MOAB/trunk/tools/iMesh/iBase.h 2009-03-12 21:26:05 UTC (rev 2707)
@@ -114,8 +114,7 @@
*/
enum iBase_StorageOrder {
iBase_BLOCKED,
- iBase_INTERLEAVED,
- iBase_UNDETERMINED
+ iBase_INTERLEAVED
};
/*==========================================================
Modified: MOAB/trunk/tools/iMesh/iMesh.h
===================================================================
--- MOAB/trunk/tools/iMesh/iMesh.h 2009-03-12 21:25:26 UTC (rev 2706)
+++ MOAB/trunk/tools/iMesh/iMesh.h 2009-03-12 21:26:05 UTC (rev 2707)
@@ -383,56 +383,13 @@
void iMesh_getVtxArrCoords(iMesh_Instance instance,
/*in*/ const iBase_EntityHandle* vertex_handles,
/*in*/ const int vertex_handles_size,
- /*inout*/ int* storage_order,
+ /*in*/ int storage_order,
/*inout*/ double** coords,
/*inout*/ int* coords_allocated,
/*out*/ int* coords_size,
/*out*/ int *err);
- /**\brief Get entities adjacent to those of requested type/topology in set or instance
- *
- * Get entities adjacent to those of requested type/topology in set or
- * instance.
- *
- * If adjacencies for all entities of specified type or
- * topology are desired, specify iMesh_ALL_TOPOLOGIES or iBase_ALL_TYPES,
- * respectively. Types and topologies input to this function must be values
- * in the iBase_EntityType or iBase_EntityTopology enumerations, respectively.
- * \em offset[i] stores index of first adjacent entity to entity \em i from
- * mesh or set.
- * \param instance iMesh instance handle
- * \param entity_set_handle Entity set whose adjacent entities are requested
- * (root set indicates whole mesh)
- * \param entity_type_requestor Return entities adjacent to entities of this
- * type
- * \param entity_topology_requestor Return entities adjacent to entities of
- * this topology
- * \param entity_type_requested Return adjacent entities of this type
- * \param *adj_entity_handles Pointer to array of adjacent entity handles
- * returned from function
- * \param *adj_entity_handles_allocated Pointer to allocated size of
- * adj_entity_handles array
- * \param *adj_entity_handles_size Pointer to occupied size of
- * adj_entity_handles array
- * \param *offset Pointer to array of offsets returned from function
- * \param *offset_allocated Pointer to allocated size of offset array
- * \param *offset_size Pointer to occupied size of offset array
- * \param *err Pointer to error type returned from function
- */
- void iMesh_getAdjEntities(iMesh_Instance instance,
- /*in*/ const iBase_EntitySetHandle entity_set_handle,
- /*in*/ const int entity_type_requestor,
- /*in*/ const int entity_topology_requestor,
- /*in*/ const int entity_type_requested,
- /*inout*/ iBase_EntityHandle** adj_entity_handles,
- /*inout*/ int* adj_entity_handles_allocated,
- /*out*/ int* adj_entity_handles_size,
- /*inout*/ int** offset,
- /*inout*/ int* offset_allocated,
- /*out*/ int* offset_size,
- /*out*/ int *err);
-
/**\brief Initialize an array iterator over specified entity type, topology, and
* size
*
@@ -1418,11 +1375,11 @@
* \param z z coordinate being set
* \param *err Pointer to error type returned from function
*/
- void iMesh_setVtxCoords(iMesh_Instance instance,
- /*in*/ iBase_EntityHandle vertex_handle,
- /*in*/ const double x, /*in*/ const double y,
- /*in*/ const double z,
- /*out*/ int *err);
+ void iMesh_setVtxCoord(iMesh_Instance instance,
+ /*in*/ iBase_EntityHandle vertex_handle,
+ /*in*/ const double x, /*in*/ const double y,
+ /*in*/ const double z,
+ /*out*/ int *err);
/**\brief Create a new vertex at specified coordinates
*
Modified: MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp 2009-03-12 21:25:26 UTC (rev 2706)
+++ MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp 2009-03-12 21:26:05 UTC (rev 2707)
@@ -446,200 +446,6 @@
RETURN(iBase_SUCCESS);
}
-
- void iMesh_getAllVtxCoords (iMesh_Instance instance,
- /*in*/ const iBase_EntitySetHandle entity_set_handle,
- /*inout*/ double** coordinates,
- /*inout*/ int* coordinates_allocated,
- /*out*/ int* coordinates_size,
- /*inout*/ int** in_entity_set,
- /*inout*/ int* in_entity_set_allocated,
- /*out*/ int* in_entity_set_size,
- /*inout*/ int* storage_order, int *err)
- {
- MBEntityHandle in_set = ENTITY_HANDLE(entity_set_handle);
-
- // get all the entities then vertices
- MBRange entities, vertices;
- MBErrorCode result = MBI->get_entities_by_handle(in_set, entities, false);
- if (MB_SUCCESS != result) {
- std::string msg("iMesh_entitysetGetVertexCoordinates: getting entities didn't succeed, "
- "with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- RETURN(iBase_ERROR_MAP[result]);
- }
-
- // remove any sets
- entities.erase(entities.lower_bound(MBENTITYSET),
- entities.upper_bound(MBENTITYSET));
-
- // get all the vertices
- result = MBI->get_adjacencies(entities, 0, false, vertices,
- MBInterface::UNION);
- if (MB_SUCCESS != result) {
- std::string msg("iMesh_entitysetGetVertexCoordinates: getting vertices didn't succeed, "
- "with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- RETURN(iBase_ERROR_MAP[result]);
- }
-
- // now get all the coordinates
- CHECK_SIZE(*coordinates, *coordinates_allocated,
- (int)(3*vertices.size()), double, iBase_MEMORY_ALLOCATION_FAILED);
- CHECK_SIZE(*in_entity_set, *in_entity_set_allocated,
- (int)vertices.size(), int, iBase_MEMORY_ALLOCATION_FAILED);
-
- // coords will come back interleaved by default
- MBRange::iterator vit;
- if (*storage_order == iBase_INTERLEAVED || *storage_order == iBase_UNDETERMINED) {
- result = MBI->get_coords(vertices, *coordinates);
- *storage_order = iBase_INTERLEAVED;
- }
-
- else {
- double *dum_coords = new double[3*vertices.size()];
- result = MBI->get_coords(vertices, dum_coords);
- if (MB_SUCCESS == result) {
- unsigned int offset = vertices.size();
- for (unsigned int i= 0; i < offset; i++) {
- (*coordinates)[i]= dum_coords[3*i];
- (*coordinates)[offset+i] = dum_coords[3*i+1];
- (*coordinates)[2*offset+i] = dum_coords[3*i+2];
- }
- }
- delete [] dum_coords;
- }
-
- if (MB_SUCCESS != result) {
- std::string msg("iMesh_entitysetGetVertexCoordinates: problem getting vertex coords, "
- "with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- RETURN(iBase_ERROR_MAP[result]);
- }
-
- // now fill the in_entity_set array
- MBRange::iterator endr = entities.end();
- int i;
- for (i = 0, vit = vertices.begin(); vit != vertices.end(); vit++, i++) {
- if (0 == in_set || entities.find(*vit) != endr)
- (*in_entity_set)[i] = 1;
- else
- (*in_entity_set)[i] = 0;
- }
-
- *coordinates_size = 3*vertices.size();
- *in_entity_set_size = vertices.size();
-
- RETURN(iBase_SUCCESS);
- }
-
- void iMesh_getVtxCoordIndex (iMesh_Instance instance,
- /*in*/ const iBase_EntitySetHandle entity_set_handle,
- /*in*/ const int requested_entity_type,
- /*in*/ const int requested_entity_topology,
- /*in*/ const int entity_adjacency_type,
- /*inout*/ int** offset,
- /*inout*/ int* offset_allocated,
- /*out*/ int* offset_size,
- /*inout*/ int** index,
- /*inout*/ int* index_allocated,
- /*out*/ int* index_size,
- /*inout*/ int** entity_topologies,
- /*inout*/ int* entity_topologies_allocated,
- /*out*/ int* entity_topologies_size, int *err)
- {
- MBEntityType req_type = mb_topology_table[requested_entity_topology];
- int req_dimension = (req_type != MBMAXTYPE ? (int) requested_entity_type : -1);
-
- MBEntityHandle in_set = ENTITY_HANDLE(entity_set_handle);
-
- MBTag pos_tag = 0;
- MBRange req_entities;
- int num_verts;
- MBErrorCode result =
- iMesh_tag_set_vertices(instance, in_set,
- req_dimension, req_type,
- pos_tag, req_entities, num_verts, err);
- if (MB_SUCCESS != result) {
- RETURN(iMesh_LAST_ERROR.error_type);
- }
-
- // doesn't make sense for vertices, so remove them
- if (-1 == req_dimension && MBI->type_from_handle(*req_entities.begin()) == MBVERTEX)
- req_entities = req_entities.subtract(req_entities.subset_by_type(MBVERTEX));
-
- if (0 == pos_tag || req_entities.empty()) {
- *offset_size = 0;
- *index_size = 0;
- *entity_topologies_size = 0;
- RETURN(iBase_SUCCESS);
- }
-
- // now get the connectivity; get it all in one vector before setting indices, so that
- // we can check size of or allocate index vector; but, we can check and allocate
- // count vector
- const MBEntityHandle *tmp_connect;
- int num_connect;
- std::vector<MBEntityHandle> connect;
- CHECK_SIZE(*offset, *offset_allocated,
- (int)(req_entities.size()+1), int, iBase_MEMORY_ALLOCATION_FAILED);
- CHECK_SIZE(*entity_topologies, *entity_topologies_allocated,
- (int)req_entities.size(), int, iBase_MEMORY_ALLOCATION_FAILED);
-
- MBRange::iterator ent_it;
- int curr_offset = 0;
- int i;
- for (ent_it = req_entities.begin(), i = 0; ent_it != req_entities.end();
- ent_it++, i++) {
- MBErrorCode result = MBI->get_connectivity(*ent_it, tmp_connect, num_connect);
- if (MB_SUCCESS != result) {
- std::string msg("iMesh_getVtxCoordIndex: couldn't get connectivity, with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- RETURN(iBase_ERROR_MAP[result]);
- }
- std::copy(tmp_connect, tmp_connect+num_connect, std::back_inserter(connect));
- MBEntityType this_type = MBI->type_from_handle(*ent_it);
- (*entity_topologies)[i] = tstt_topology_table[this_type];
- (*offset)[i] = curr_offset;
- curr_offset += num_connect;
- }
- // set the last offset too
- (*offset)[i] = curr_offset;
-
-
- // now check size of, allocate, and assign index vector
- CHECK_SIZE(*index, *index_allocated,
- (int)connect.size(), int, iBase_MEMORY_ALLOCATION_FAILED);
- // get the tags all at once, it's more efficient
- result = MBI->tag_get_data(pos_tag, &connect[0],
- connect.size(), *index);
- if (MB_SUCCESS != result) {
- std::string msg("iMesh_getVtxCoordIndex: couldn't get index tag, with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- RETURN(iBase_ERROR_MAP[result]);
- }
-
- // don't need the tag any more
- result = MBI->tag_delete(pos_tag);
- if (MB_SUCCESS != result) {
- std::string msg("iMesh_getVtxCoordIndex: error deleting tag, with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- RETURN(iBase_ERROR_MAP[result]);
- }
-
- *offset_size = req_entities.size() + 1;
- *entity_topologies_size = req_entities.size();
- *index_size = connect.size();
-
- RETURN(iBase_SUCCESS);
- }
-
void iMesh_getEntities(iMesh_Instance instance,
/*in*/ const iBase_EntitySetHandle entity_set_handle,
/*in*/ const int entity_type,
@@ -658,7 +464,7 @@
void iMesh_getVtxArrCoords (iMesh_Instance instance,
/*in*/ const iBase_EntityHandle* vertex_handles,
/*in*/ const int vertex_handles_size,
- /*inout*/ int* storage_order,
+ /*inout*/ int storage_order,
/*inout*/ double** coords,
/*inout*/ int* coords_allocated,
/*out*/ int* coords_size, int *err)
@@ -670,10 +476,9 @@
// now get all the coordinates
// coords will come back interleaved by default
MBErrorCode result;
- if (*storage_order == iBase_INTERLEAVED || *storage_order == iBase_UNDETERMINED) {
+ if (storage_order == iBase_INTERLEAVED) {
result = MBI->get_coords(CONST_HANDLE_ARRAY_PTR(vertex_handles),
vertex_handles_size, *coords);
- *storage_order = iBase_INTERLEAVED;
}
else {
@@ -707,122 +512,6 @@
RETURN(iBase_SUCCESS);
}
- void iMesh_getAdjEntities(iMesh_Instance instance,
- /*in*/ const iBase_EntitySetHandle entity_set_handle,
- /*in*/ const int entity_type_requestor,
- /*in*/ const int entity_topology_requestor,
- /*in*/ const int entity_type_requested,
- /*inout*/ iBase_EntityHandle** adj_entity_handles,
- /*inout*/ int* adj_entity_handles_allocated,
- /*out*/ int* adj_entity_handles_size,
- /*inout*/ int** offset,
- /*inout*/ int* offset_allocated,
- /*inout*/ int* offset_size,
- /*out*/ int *err)
- {
- MBEntityHandle in_set = ENTITY_HANDLE(entity_set_handle);
- MBRange entities;
- MBEntityType requestor_type = mb_topology_table[entity_topology_requestor];
- MBErrorCode result;
-
- if (entity_type_requestor == iBase_ALL_TYPES &&
- entity_topology_requestor == iMesh_ALL_TOPOLOGIES )
- result = MBI->get_entities_by_handle( in_set, entities );
- else if (requestor_type == MBMAXTYPE)
- result = MBI->get_entities_by_dimension
- (in_set, entity_type_requestor, entities);
- else if (entity_topology_requestor == iMesh_SEPTAHEDRON)
- result = MB_SUCCESS; // MOAB doesn't do septahedrons, so there are never any of them.
- else
- result = MBI->get_entities_by_type(in_set, requestor_type, entities);
-
- if (result != MB_SUCCESS) {
- std::string msg("iMesh_getAdjEntities: ERROR getting requestor entities in entityset, "
- "with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- RETURN(iBase_ERROR_MAP[result]);
- }
-
- int num_entities = entities.size();
-
- if (num_entities == 0)
- {
- *adj_entity_handles_size = *offset_size = 0;
- RETURN(iBase_ERROR_MAP[result]);
- }
-
- // first, count the number of adjacent entities we'll have
- int num_sub = 0;
- int to_dim = entity_type_requested;
- if (to_dim == 0) {
- const MBEntityHandle *connect;
- int num_connect;
- MBErrorCode result;
- for (MBRange::const_iterator rit = entities.lower_bound(MBEDGE); rit != entities.end(); rit++) {
- result = MBI->get_connectivity(*rit, connect, num_connect);
- if (MB_SUCCESS != result) RETURN(iBase_ERROR_MAP[result]);
- num_sub += num_connect;
- }
- }
- else {
- MBRange tmp_adjs;
- MBErrorCode result;
- for (MBRange::iterator rit = entities.begin(); rit != entities.end(); rit++) {
- result = MBI->get_adjacencies(&(*rit), 1, to_dim, false, tmp_adjs);
- if (MB_SUCCESS != result) RETURN(iBase_ERROR_MAP[result]);
- num_sub += tmp_adjs.size();
- tmp_adjs.clear();
- }
- }
-
- // allocate enough space for those adjacent entities
- CHECK_SIZE(*adj_entity_handles, *adj_entity_handles_allocated,
- num_sub, iBase_EntityHandle, iBase_MEMORY_ALLOCATION_FAILED);
-
- CHECK_SIZE(*offset, *offset_allocated,
- (int)entities.size(), int, iBase_MEMORY_ALLOCATION_FAILED);
-
- // now iterate over entities
- num_sub = 0;
- int i = 0;
- std::vector<MBEntityHandle> adj_ents;
- MBRange::iterator endr = entities.end();
- for (MBRange::iterator rit = entities.begin(); rit != endr; rit++) {
- adj_ents.clear();
- (*offset)[i] = num_sub;
- if (to_dim == 0 && MBI->type_from_handle(*rit) == MBVERTEX) {
- i++;
- continue;
- }
-
-
- result = MBI->get_adjacencies(&(*rit), 1, (int)entity_type_requested, false,
- adj_ents);
-
- if (result != MB_SUCCESS) {
- std::string msg("iMesh_getAdjEntities: ERROR getting adjacencies of requested entities, "
- "with error type: ");
- msg += MBI->get_error_string(result);
- iMesh_processError(iBase_ERROR_MAP[result], msg.c_str());
- RETURN(iBase_ERROR_MAP[result]);
- }
-
- for (std::vector<MBEntityHandle>::iterator vit = adj_ents.begin();
- vit != adj_ents.end(); vit++) {
- (*adj_entity_handles)[num_sub] = (iBase_EntityHandle)*vit;
- num_sub++;
- }
-
- i++;
- }
-
- *adj_entity_handles_size = num_sub;
- *offset_size = entities.size();
-
- RETURN(iBase_SUCCESS);
- }
-
/**
* Method: initEntArrIter[]
*/
@@ -2234,10 +1923,10 @@
RETURN(iBase_ERROR_MAP[result]);
}
- void iMesh_setVtxCoords (iMesh_Instance instance,
- /*in*/ iBase_EntityHandle vertex_handle,
- /*in*/ const double x, /*in*/ const double y,
- /*in*/ const double z, int *err)
+ void iMesh_setVtxCoord (iMesh_Instance instance,
+ /*in*/ iBase_EntityHandle vertex_handle,
+ /*in*/ const double x, /*in*/ const double y,
+ /*in*/ const double z, int *err)
{
const double xyz[3] = {x, y, z};
@@ -2716,7 +2405,7 @@
int dum = 3;
iMesh_getVtxArrCoords(instance,
- &vertex_handle, 1, &order,
+ &vertex_handle, 1, order,
&tmp_xyz, &dum, &dum, err);
if (iBase_SUCCESS == *err) {
*x = xyz[0]; *y = xyz[1]; *z = xyz[2];
Modified: MOAB/trunk/tools/mbperf/mbperf_SIDL.cpp
===================================================================
--- MOAB/trunk/tools/mbperf/mbperf_SIDL.cpp 2009-03-12 21:25:26 UTC (rev 2706)
+++ MOAB/trunk/tools/mbperf/mbperf_SIDL.cpp 2009-03-12 21:26:05 UTC (rev 2707)
@@ -361,30 +361,17 @@
// but will have correct size on subsequent ones
sidl::array<double> dum_coords;
int dum_coords_size = 0;
- iBase::StorageOrder order = iBase::StorageOrder_UNDETERMINED;
- mesh.getVtxArrCoords(dum_connect, dum_connect_size, order,
+ mesh.getVtxArrCoords(dum_connect, dum_connect_size, iBase::StorageOrder_INTERLEAVED,
dum_coords, dum_coords_size);
assert(24 == dum_coords_size && ARRAY_SIZE(dum_coords) == 24);
double *dum_coords_ptr = ARRAY_PTR(dum_coords, double);
double centroid[3] = {0.0, 0.0, 0.0};
- if (order == iBase::StorageOrder_BLOCKED) {
- for (int j = 0; j < 8; j++) {
- centroid[0] += dum_coords_ptr[j];
- centroid[1] += dum_coords_ptr[8+j];
- centroid[2] += dum_coords_ptr[16+j];
- centroid[0] += dum_coords.get(j);
- centroid[1] += dum_coords.get(8+j);
- centroid[2] += dum_coords.get(16+j);
- }
+ for (int j = 0; j < 8; j++) {
+ centroid[0] += dum_coords_ptr[3*j];
+ centroid[1] += dum_coords_ptr[3*j+1];
+ centroid[2] += dum_coords_ptr[3*j+2];
}
- else {
- for (int j = 0; j < 8; j++) {
- centroid[0] += dum_coords_ptr[3*j];
- centroid[1] += dum_coords_ptr[3*j+1];
- centroid[2] += dum_coords_ptr[3*j+2];
- }
- }
}
} catch (iBase::Error err) {
cerr << "Problem getting connectivity or vertex coords." << endl;
Modified: MOAB/trunk/tools/mbperf/mbperf_iMesh.cpp
===================================================================
--- MOAB/trunk/tools/mbperf/mbperf_iMesh.cpp 2009-03-12 21:25:26 UTC (rev 2706)
+++ MOAB/trunk/tools/mbperf/mbperf_iMesh.cpp 2009-03-12 21:26:05 UTC (rev 2707)
@@ -287,27 +287,17 @@
if (iBase_SUCCESS == success) {
// get vertex coordinates; ; will allocate space on 1st iteration,
// but will have correct size on subsequent ones
- int order = iBase_UNDETERMINED;
iMesh_getVtxArrCoords(mesh, dum_connect, dum_connect_size,
- &order,
+ iBase_INTERLEAVED,
&dum_coords, &dum_coords_allocated,
&dum_coords_size, &success);
double centroid[3] = {0.0, 0.0, 0.0};
- if (order == iBase_BLOCKED) {
- for (int j = 0; j < 8; j++) {
- centroid[0] += dum_coords[j];
- centroid[1] += dum_coords[8+j];
- centroid[2] += dum_coords[16+j];
- }
+ for (int j = 0; j < 8; j++) {
+ centroid[0] += dum_coords[3*j];
+ centroid[1] += dum_coords[3*j+1];
+ centroid[2] += dum_coords[3*j+2];
}
- else {
- for (int j = 0; j < 8; j++) {
- centroid[0] += dum_coords[3*j];
- centroid[1] += dum_coords[3*j+1];
- centroid[2] += dum_coords[3*j+2];
- }
- }
}
if (iBase_SUCCESS != success) {
More information about the moab-dev
mailing list