[MOAB-dev] r4430 - MOAB/trunk/itaps/imesh

tautges at mcs.anl.gov tautges at mcs.anl.gov
Tue Jan 11 11:54:19 CST 2011


Author: tautges
Date: 2011-01-11 11:54:19 -0600 (Tue, 11 Jan 2011)
New Revision: 4430

Added:
   MOAB/trunk/itaps/imesh/MBiMesh.hpp
Modified:
   MOAB/trunk/itaps/imesh/MOAB_iMesh_unit_tests.cpp
   MOAB/trunk/itaps/imesh/Makefile.am
   MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
   MOAB/trunk/itaps/imesh/iMesh_MOAB.hpp
Log:
Change initialization of iMesh so the resulting class object (MBiMesh) 
hasA moab::Interface * instead of isA moab::Core*.  Makes it possible to
initialize iMesh with an existing moab::Interface object.




Added: MOAB/trunk/itaps/imesh/MBiMesh.hpp
===================================================================
--- MOAB/trunk/itaps/imesh/MBiMesh.hpp	                        (rev 0)
+++ MOAB/trunk/itaps/imesh/MBiMesh.hpp	2011-01-11 17:54:19 UTC (rev 4430)
@@ -0,0 +1,73 @@
+#ifndef MBIMESH_HPP
+#define MBIMESH_HPP
+
+#include "moab/Core.hpp"
+using namespace moab;
+
+class MBiMesh
+{
+private:
+  bool haveDeletedEntities;
+  bool iCreatedInterface;
+public:
+  MBiMesh(moab::Interface *mbImpl = NULL);
+
+  virtual ~MBiMesh();
+  bool have_deleted_ents( bool reset ) {
+    bool result = haveDeletedEntities;
+    if (reset)
+      haveDeletedEntities = false;
+    return result;
+  }
+
+  virtual ErrorCode delete_mesh();
+  virtual ErrorCode delete_entities( const EntityHandle*, const int );
+  virtual ErrorCode delete_entities( const Range& );
+  int AdjTable[16];
+  moab::Interface *mbImpl;
+};
+
+#define MBimesh reinterpret_cast<MBiMesh*>(instance)
+
+inline MBiMesh::MBiMesh(Interface *impl)
+        : haveDeletedEntities(false), iCreatedInterface(false), mbImpl(impl)
+{
+  int tmp_table[] = {
+      1, 1, 1, 1,
+      1, 0, 2, 2,
+      1, 2, 0, 2,
+      1, 2, 2, 1
+  };
+  memcpy(AdjTable, tmp_table, 16*sizeof(int));
+
+  if (!mbImpl) {
+    mbImpl = new Core();
+    iCreatedInterface = true;
+  }


More information about the moab-dev mailing list