[MOAB-dev] r3276 - MOAB/trunk

sjackson at cae.wisc.edu sjackson at cae.wisc.edu
Tue Nov 3 15:38:19 CST 2009


Author: sjackson
Date: 2009-11-03 15:38:19 -0600 (Tue, 03 Nov 2009)
New Revision: 3276

Modified:
   MOAB/trunk/ReadCGM.cpp
Log:
Remove dependence on CGM's GeometryQueryEngine from ReadCGM.cpp. This fixes a bug
that occured when MOAB was built with a CUBIT-based CGM.

Per Jason's recommendation, calls to GeometryQueryEngine::get_sme_resabs_tolerance()
have been replaced with GEOMETRY_RESABS.


Modified: MOAB/trunk/ReadCGM.cpp
===================================================================
--- MOAB/trunk/ReadCGM.cpp	2009-11-03 19:51:30 UTC (rev 3275)
+++ MOAB/trunk/ReadCGM.cpp	2009-11-03 21:38:19 UTC (rev 3276)
@@ -17,7 +17,6 @@
 #endif
 
 #include "GeometryQueryTool.hpp"
-#include "GeometryQueryEngine.hpp"
 #include "ModelQueryEngine.hpp"
 #include "RefEntityName.hpp"
 #include "GMem.hpp"
@@ -387,10 +386,8 @@
   for (ci = entmap[1].begin(); ci != entmap[1].end(); ++ci) {
     RefEdge* edge = dynamic_cast<RefEdge*>(ci->first);
     Curve* curve = edge->get_curve_ptr();
-    GeometryQueryEngine* gqe = curve->get_geometry_query_engine();
     data.clean_out();
-    int count;
-    CubitStatus s = gqe->get_graphics( curve, count, &data, faceting_tol);
+    edge->get_graphics( data, faceting_tol);
     if (CUBIT_SUCCESS != s)
       return MB_FAILURE;
       
@@ -411,7 +408,7 @@
     
       // Special case for point curve
     if (points.size() < 2) {
-      if (start_vtx != end_vtx || curve->measure() > gqe->get_sme_resabs_tolerance()) {
+      if (start_vtx != end_vtx || curve->measure() > GEOMETRY_RESABS ) {
         std::cerr << "Warning: No facetting for curve " << edge->id() << std::endl;
         continue;
       }
@@ -422,15 +419,15 @@
       continue;
     }
     
-    const bool closed = (points.front() - points.back()).length() < gqe->get_sme_resabs_tolerance();
+    const bool closed = (points.front() - points.back()).length() < GEOMETRY_RESABS;
     if (closed != (start_vtx == end_vtx)) {
       std::cerr << "Warning: topology and geometry inconsistant for possibly closed curve "
                 << edge->id() << std::endl;
     }
     
       // check proximity of vertices to end coordinates
-    if ((start_vtx->coordinates() - points.front()).length() > gqe->get_sme_resabs_tolerance()
-     || (  end_vtx->coordinates() - points.back() ).length() > gqe->get_sme_resabs_tolerance()) {
+    if ((start_vtx->coordinates() - points.front()).length() > GEOMETRY_RESABS
+     || (  end_vtx->coordinates() - points.back() ).length() > GEOMETRY_RESABS ) {
       std::cerr << "Warning: vertices not at ends of curve " << edge->id() << std::endl;
     }
     
@@ -471,12 +468,10 @@
     // create geometry for all surfaces
   for (ci = entmap[2].begin(); ci != entmap[2].end(); ++ci) {
     RefFace* face = dynamic_cast<RefFace*>(ci->first);
-    Surface* surf = face->get_surface_ptr();
-    GeometryQueryEngine* gqe = surf->get_geometry_query_engine();
+
     data.clean_out();
-    int nt, np, nf;
-    CubitStatus s = gqe->get_graphics( surf, nt, np, nf, &data, 
-                                       norm_tol, faceting_tol, len_tol);
+    CubitStatus s = face->get_graphics( data, norm_tol, faceting_tol, len_tol );
+
     if (CUBIT_SUCCESS != s)
       return MB_FAILURE;
 
@@ -496,7 +491,7 @@
         CubitVector vpos( data.point_list()[j].x,
                           data.point_list()[j].y,
                           data.point_list()[j].z );
-        if ((pos - vpos).length_squared() < gqe->get_sme_resabs_tolerance()*gqe->get_sme_resabs_tolerance()) {
+        if ((pos - vpos).length_squared() < GEOMETRY_RESABS*GEOMETRY_RESABS ) {
           if (verts[j])
             std::cerr << "Warning: Coincident vertices in surface " << face->id() << std::endl;
           verts[j] = entmap[0][vtx];



More information about the moab-dev mailing list