[MOAB-dev] r3680 - MOAB/trunk/itaps/imesh
jvporter at wisc.edu
jvporter at wisc.edu
Fri Mar 19 17:33:17 CDT 2010
Author: jvporter
Date: 2010-03-19 17:33:17 -0500 (Fri, 19 Mar 2010)
New Revision: 3680
Modified:
MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
Log:
Support iBase_BLOCKED storage order for iMesh_createVtxArr
Modified: MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp 2010-03-19 19:38:30 UTC (rev 3679)
+++ MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp 2010-03-19 22:33:17 UTC (rev 3680)
@@ -1269,12 +1269,23 @@
// make the entities
EntityHandle *new_verts = HANDLE_ARRAY_PTR(*new_vertex_handles);
-
- for (int i = 0; i < num_verts; i++) {
- ErrorCode result = MBI->create_vertex(&new_coords[3*i], new_verts[i]);
- CHKERR(result, "iMesh_createVtxArr: couldn't create vertex.");
- }
+ if (storage_order == iBase_INTERLEAVED) {
+ for (int i = 0; i < num_verts; i++) {
+ ErrorCode result = MBI->create_vertex(&new_coords[3*i], new_verts[i]);
+ CHKERR(result, "iMesh_createVtxArr: couldn't create vertex.");
+ }
+ }
+ else {
+ for (int i = 0; i < num_verts; i++) {
+ double tmp[3] = { new_coords[0*num_verts+i],
+ new_coords[1*num_verts+i],
+ new_coords[2*num_verts+i] };
+ ErrorCode result = MBI->create_vertex(tmp, new_verts[i]);
+ CHKERR(result, "iMesh_createVtxArr: couldn't create vertex.");
+ }
+ }
+
KEEP_ARRAY(new_vertex_handles);
RETURN(iBase_SUCCESS);
}
More information about the moab-dev
mailing list