Changeset 3276

Show
Ignore:
Timestamp:
11/03/09 15:38:19 (3 weeks ago)
Author:
sjackson
Message:

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • MOAB/trunk/ReadCGM.cpp

    r3241 r3276  
    1818 
    1919#include "GeometryQueryTool.hpp" 
    20 #include "GeometryQueryEngine.hpp" 
    2120#include "ModelQueryEngine.hpp" 
    2221#include "RefEntityName.hpp" 
     
    388387    RefEdge* edge = dynamic_cast<RefEdge*>(ci->first); 
    389388    Curve* curve = edge->get_curve_ptr(); 
    390     GeometryQueryEngine* gqe = curve->get_geometry_query_engine(); 
    391389    data.clean_out(); 
    392     int count; 
    393     CubitStatus s = gqe->get_graphics( curve, count, &data, faceting_tol); 
     390    edge->get_graphics( data, faceting_tol); 
    394391    if (CUBIT_SUCCESS != s) 
    395392      return MB_FAILURE; 
     
    412409      // Special case for point curve 
    413410    if (points.size() < 2) { 
    414       if (start_vtx != end_vtx || curve->measure() > gqe->get_sme_resabs_tolerance()) { 
     411      if (start_vtx != end_vtx || curve->measure() > GEOMETRY_RESABS ) { 
    415412        std::cerr << "Warning: No facetting for curve " << edge->id() << std::endl; 
    416413        continue; 
     
    423420    } 
    424421     
    425     const bool closed = (points.front() - points.back()).length() < gqe->get_sme_resabs_tolerance(); 
     422    const bool closed = (points.front() - points.back()).length() < GEOMETRY_RESABS; 
    426423    if (closed != (start_vtx == end_vtx)) { 
    427424      std::cerr << "Warning: topology and geometry inconsistant for possibly closed curve " 
     
    430427     
    431428      // check proximity of vertices to end coordinates 
    432     if ((start_vtx->coordinates() - points.front()).length() > gqe->get_sme_resabs_tolerance() 
    433      || (  end_vtx->coordinates() - points.back() ).length() > gqe->get_sme_resabs_tolerance()) { 
     429    if ((start_vtx->coordinates() - points.front()).length() > GEOMETRY_RESABS 
     430     || (  end_vtx->coordinates() - points.back() ).length() > GEOMETRY_RESABS ) { 
    434431      std::cerr << "Warning: vertices not at ends of curve " << edge->id() << std::endl; 
    435432    } 
     
    472469  for (ci = entmap[2].begin(); ci != entmap[2].end(); ++ci) { 
    473470    RefFace* face = dynamic_cast<RefFace*>(ci->first); 
    474     Surface* surf = face->get_surface_ptr(); 
    475     GeometryQueryEngine* gqe = surf->get_geometry_query_engine(); 
     471 
    476472    data.clean_out(); 
    477     int nt, np, nf; 
    478     CubitStatus s = gqe->get_graphics( surf, nt, np, nf, &data,  
    479                                        norm_tol, faceting_tol, len_tol); 
     473    CubitStatus s = face->get_graphics( data, norm_tol, faceting_tol, len_tol ); 
     474 
    480475    if (CUBIT_SUCCESS != s) 
    481476      return MB_FAILURE; 
     
    497492                          data.point_list()[j].y, 
    498493                          data.point_list()[j].z ); 
    499         if ((pos - vpos).length_squared() < gqe->get_sme_resabs_tolerance()*gqe->get_sme_resabs_tolerance()) { 
     494        if ((pos - vpos).length_squared() < GEOMETRY_RESABS*GEOMETRY_RESABS ) { 
    500495          if (verts[j]) 
    501496            std::cerr << "Warning: Coincident vertices in surface " << face->id() << std::endl;