From 2741b73b946af6521abbac0b2ecaaac188c7e013 Mon Sep 17 00:00:00 2001 From: Jean-Francois Remacle <jean-francois.remacle@uclouvain.be> Date: Wed, 15 Nov 2006 21:53:31 +0000 Subject: [PATCH] *** empty log message *** --- Geo/GModel.h | 1 + Geo/GModelIO_OCC.cpp | 13 +++++++++++-- Geo/OCCIncludes.h | 1 + Parser/OpenFile.cpp | 6 +++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Geo/GModel.h b/Geo/GModel.h index b81a97ce65..52194e4ae2 100644 --- a/Geo/GModel.h +++ b/Geo/GModel.h @@ -138,6 +138,7 @@ class GModel virtual int readFourier(const std::string &name); // OCC model + int readOCCBREP(const std::string &name); int readOCCIGES(const std::string &name); int readOCCSTEP(const std::string &name); void deleleOCCInternals(); diff --git a/Geo/GModelIO_OCC.cpp b/Geo/GModelIO_OCC.cpp index 4c1e3f8543..4fc99138b0 100644 --- a/Geo/GModelIO_OCC.cpp +++ b/Geo/GModelIO_OCC.cpp @@ -1,4 +1,4 @@ - // $Id: GModelIO_OCC.cpp,v 1.3 2006-11-15 15:06:45 geuzaine Exp $ + // $Id: GModelIO_OCC.cpp,v 1.4 2006-11-15 21:53:31 remacle Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -265,7 +265,8 @@ void OCC_Internals :: buildLists () void OCC_Internals :: loadBREP (const char *fn) { - throw; + BRep_Builder aBuilder; + Standard_Boolean result = BRepTools::Read( shape, (char*)fn, aBuilder ); } void OCC_Internals :: loadSTEP (const char *fn) @@ -342,6 +343,14 @@ int GModel::readOCCIGES(const std::string &fn) occ_internals->buildGModel (this); return 1; } +int GModel::readOCCBREP(const std::string &fn) +{ + occ_internals = new OCC_Internals; + occ_internals->loadBREP (fn.c_str()); + occ_internals->buildLists (); + occ_internals->buildGModel (this); + return 1; +} void GModel::deleteOCCInternals() { if(occ_internals)delete occ_internals; diff --git a/Geo/OCCIncludes.h b/Geo/OCCIncludes.h index 10367594b6..80c6b4cbe3 100644 --- a/Geo/OCCIncludes.h +++ b/Geo/OCCIncludes.h @@ -30,6 +30,7 @@ using std::iostream; #include "TopoDS_Solid.hxx" #include "TopExp_Explorer.hxx" #include "BRep_Tool.hxx" +#include "BRep_Builder.hxx" #include "Geom_Curve.hxx" #include "Geom2d_Curve.hxx" #include "Geom_Surface.hxx" diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp index 775b727189..8d76b46e5b 100644 --- a/Parser/OpenFile.cpp +++ b/Parser/OpenFile.cpp @@ -1,4 +1,4 @@ -// $Id: OpenFile.cpp,v 1.126 2006-11-14 20:20:18 remacle Exp $ +// $Id: OpenFile.cpp,v 1.127 2006-11-15 21:53:31 remacle Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -293,6 +293,10 @@ int MergeProblem(char *name, int warn_if_missing) if(!strcmp(ext, ".stl") || !strcmp(ext, ".STL")){ status = GMODEL->readSTL(name, CTX.mesh.stl_distance_tol); } + else if(!strcmp(ext, ".brep") || !strcmp(ext, ".rle") || + !strcmp(ext, ".brp") || !strcmp(ext, ".BRP")){ + GMODEL->readOCCBREP(std::string(name)); + } else if(!strcmp(ext, ".iges") || !strcmp(ext, ".IGES") || !strcmp(ext, ".igs") || !strcmp(ext, ".IGS")){ GMODEL->readOCCIGES(std::string(name)); -- GitLab