diff --git a/Geo/GModelIO_OCC.cpp b/Geo/GModelIO_OCC.cpp index d91df015cefad4249cb62c45b323fa51ea363391..32055b81cf9efbd48164bf05f4e52cb7d5b18ade 100644 --- a/Geo/GModelIO_OCC.cpp +++ b/Geo/GModelIO_OCC.cpp @@ -1,4 +1,4 @@ - // $Id: GModelIO_OCC.cpp,v 1.1 2006-11-15 13:19:56 geuzaine Exp $ + // $Id: GModelIO_OCC.cpp,v 1.2 2006-11-15 14:35:03 remacle Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -26,6 +26,7 @@ #include "OCCVertex.h" #include "OCCEdge.h" #include "OCCFace.h" +#include "OCCRegion.h" class OCC_Internals { @@ -313,6 +314,14 @@ void OCC_Internals :: buildGModel (GModel *model) OCCFace *f = new OCCFace (model, face, i, emap); model->add(f); } + // building geom regions + int nvolumes = somap.Extent(); + for (int i = 1; i <= nvolumes; i++) + { + TopoDS_Solid solid = TopoDS::Solid(somap(i)); + OCCRegion *r = new OCCRegion (model, solid, i, fmap); + model->add(r); + } } diff --git a/Geo/Makefile b/Geo/Makefile index 5a50b492f7e10a2eaccfae375e90ec804a2ea07a..145032d249c727bebef1eedb58c823e750ec463d 100644 --- a/Geo/Makefile +++ b/Geo/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.107 2006-11-15 13:19:56 geuzaine Exp $ +# $Id: Makefile,v 1.108 2006-11-15 14:35:03 remacle Exp $ # # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle # @@ -38,15 +38,16 @@ SRC = CAD.cpp \ MVertex.cpp \ MElement.cpp \ GModel.cpp\ - GModelIO_Mesh.cpp\ - GModelIO_Geo.cpp\ - GModelIO_Fourier.cpp\ - GModelIO_OCC.cpp\ + GModelIO_Mesh.cpp\ + GModelIO_Geo.cpp\ + GModelIO_Fourier.cpp\ + GModelIO_OCC.cpp\ gmshEdge.cpp\ gmshFace.cpp\ gmshRegion.cpp\ OCCEdge.cpp\ OCCFace.cpp\ + OCCRegion.cpp\ SVector3.cpp\ SBoundingBox3d.cpp\ projectionFace.cpp\ diff --git a/Geo/OCCEdge.h b/Geo/OCCEdge.h index 8d9e5245dd76fc422f86c6bfe78d86bc34a9a46e..31c89d21135dde0dc15a55472aceb7e463e8b1c2 100644 --- a/Geo/OCCEdge.h +++ b/Geo/OCCEdge.h @@ -46,6 +46,7 @@ class OCCEdge : public GEdge { virtual int containsParam(double pt) const; virtual SVector3 firstDer(double par) const; virtual SPoint2 reparamOnFace(GFace * face, double epar, int dir) const { throw; } + ModelType getNativeType() const { return OpenCascadeModel; } void * getNativePtr() const { return (void*) &c; } virtual double parFromPoint(const SPoint3 &pt) const; virtual int minimumMeshSegments () const; diff --git a/Geo/OCCFace.cpp b/Geo/OCCFace.cpp index fee6ed52ffcaa9770740fc09621797463499d218..3fd9dbe05be2a2bf09c9f6627dfe08a560d96162 100644 --- a/Geo/OCCFace.cpp +++ b/Geo/OCCFace.cpp @@ -1,4 +1,4 @@ -// $Id: OCCFace.cpp,v 1.2 2006-11-14 20:20:18 remacle Exp $ +// $Id: OCCFace.cpp,v 1.3 2006-11-15 14:35:03 remacle Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -195,4 +195,15 @@ int OCCFace::containsPoint(const SPoint3 &pt) const { Msg(GERROR,"Not Done Yet ..."); } +// void OCCFace::buildVisTriangulation (); +// { +// TopLoc_Location loc; +// Handle(Poly_Triangulation) triangulation = BRep_Tool::Triangulation (occface, loc); +// int ntriangles = triangulation -> NbTriangles(); +// for (int j = 1; j <= ntriangles; j++) +// { +// Poly_Triangle triangle = (triangulation -> Triangles())(j); +// } +// } + #endif diff --git a/Geo/OCCFace.h b/Geo/OCCFace.h index 7f476cde4ddd88a323ca592d842cc0dd31f9e3f8..23a2153f8d3dfbc67d9a78763eef7a71eef58da8 100644 --- a/Geo/OCCFace.h +++ b/Geo/OCCFace.h @@ -31,7 +31,7 @@ class OCCFace : public GFace { TopoDS_Face s; Handle(Geom_Surface) occface; double umin, umax, vmin, vmax; - + void buildVisTriangulation (); public: OCCFace(GModel *m, TopoDS_Face s, int num, TopTools_IndexedMapOfShape &emap); @@ -58,6 +58,7 @@ class OCCFace : public GFace { virtual bool periodic(int dim) const { return false; } virtual bool degenerate(int dim) const { return false; } virtual double period(int dir) const {throw;} + ModelType getNativeType() const { return OpenCascadeModel; } void * getNativePtr() const { return (void*)&s; } virtual bool surfPeriodic(int dim) const {throw;} virtual SPoint2 parFromPoint(const SPoint3 &) const; diff --git a/Geo/OCCVertex.h b/Geo/OCCVertex.h index 3b74e43a5ca64bc41397dd4e4f2b1833b31a6b33..699284b2d13a8018a06b2f0c6cb9fac830a43d5b 100644 --- a/Geo/OCCVertex.h +++ b/Geo/OCCVertex.h @@ -56,6 +56,7 @@ class OCCVertex : public GVertex { gp_Pnt pnt = BRep_Tool::Pnt (v); return pnt.Z(); } + ModelType getNativeType() const { return OpenCascadeModel; } void * getNativePtr() const { return (void*) &v; } virtual double prescribedMeshSizeAtVertex() const { SBoundingBox3d b = model()->bounds();