[MOAB-dev] r4611 - in MOAB/trunk: itaps/imesh src test
jvporter at wisc.edu
jvporter at wisc.edu
Fri Mar 18 14:58:23 CDT 2011
Author: jvporter
Date: 2011-03-18 14:58:22 -0500 (Fri, 18 Mar 2011)
New Revision: 4611
Modified:
MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
MOAB/trunk/itaps/imesh/iMesh_MOAB.hpp
MOAB/trunk/src/Core.cpp
MOAB/trunk/test/MBTest.cpp
Log:
Improve error handling for ITAPS compliance
Modified: MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp 2011-03-18 19:35:46 UTC (rev 4610)
+++ MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp 2011-03-18 19:58:22 UTC (rev 4611)
@@ -591,7 +591,25 @@
/*out*/ iBase_EntityArrIterator* entArr_iterator,
int *err)
{
+ CHKENUM(requested_entity_type, iBase_EntityType, iBase_INVALID_ENTITY_TYPE);
+ CHKENUM(requested_entity_topology, iMesh_EntityTopology,
+ iBase_INVALID_ENTITY_TOPOLOGY);
+
EntityType req_type = mb_topology_table[requested_entity_topology];
+
+ if (requested_entity_topology != iMesh_ALL_TOPOLOGIES) {
+ if (requested_entity_type != iBase_ALL_TYPES) {
+ if (requested_entity_topology != iMesh_SEPTAHEDRON &&
+ requested_entity_type != CN::Dimension(req_type))
+ ERROR(iBase_BAD_TYPE_AND_TOPO, "type and topology are inconsistant");
+
+ // Special-case handling for septahedra since we don't support them
+ else if (requested_entity_topology == iMesh_SEPTAHEDRON &&
+ requested_entity_type != iBase_REGION)
+ ERROR(iBase_BAD_TYPE_AND_TOPO, "type and topology are inconsistant");
+ }
+ }
+
int req_dimension = (req_type == MBMAXTYPE ? (int) requested_entity_type : -1);
Range range;
@@ -846,6 +864,9 @@
int* offset_size,
int* err )
{
+ CHKENUM(bridge_entity_type, iBase_EntityType, iBase_INVALID_ENTITY_TYPE);
+ CHKENUM(requested_entity_type, iBase_EntityType, iBase_INVALID_ENTITY_TYPE);
+
ErrorCode result = MB_SUCCESS;
ALLOC_CHECK_ARRAY(offset, entity_handles_size+1);
@@ -1173,6 +1194,9 @@
/*in*/ iBase_EntitySetHandle entity_set_handle,
int *err)
{
+ if (!entity_set_to_add || !entity_set_handle)
+ ERROR(iBase_INVALID_ARGUMENT, "iMesh_addEntSet: ERROR invalid argument");
+
EntityHandle to_add = ENTITY_HANDLE(entity_set_to_add);
ErrorCode result = MOABI->add_entities(ENTITY_HANDLE(entity_set_handle), &to_add, 1);
@@ -1185,6 +1209,9 @@
More information about the moab-dev
mailing list