From 6aff3d0f3d1f1fb76ada0505cbc0af0bf2474753 Mon Sep 17 00:00:00 2001 From: Ken Arroyo Ohori Date: Mon, 6 Feb 2017 16:22:36 -0600 Subject: [PATCH] Conversion result for breps --- .../kernels/cgal/CgalEntityMapping.cpp | 60 +++++++++---------- src/ifcgeom/kernels/cgal/CgalKernel.h | 8 +-- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/ifcgeom/kernels/cgal/CgalEntityMapping.cpp b/src/ifcgeom/kernels/cgal/CgalEntityMapping.cpp index 4509a8de7e..dea961cf7c 100644 --- a/src/ifcgeom/kernels/cgal/CgalEntityMapping.cpp +++ b/src/ifcgeom/kernels/cgal/CgalEntityMapping.cpp @@ -85,29 +85,29 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcManifoldSolidBrep* l, Conv cgal_shape_t s; const SurfaceStyle* collective_style = get_style(l); if (convert_shape(l->Outer(),s) ) { -// const SurfaceStyle* indiv_style = get_style(l->Outer()); -// -// IfcSchema::IfcClosedShell::list::ptr voids(new IfcSchema::IfcClosedShell::list); -// if (l->is(IfcSchema::Type::IfcFacetedBrepWithVoids)) { -// voids = l->as()->Voids(); -// } -//#ifdef USE_IFC4 -// if (l->is(IfcSchema::Type::IfcAdvancedBrepWithVoids)) { -// voids = l->as()->Voids(); -// } -//#endif -// -// for (IfcSchema::IfcClosedShell::list::it it = voids->begin(); it != voids->end(); ++it) { + const SurfaceStyle* indiv_style = get_style(l->Outer()); + + IfcSchema::IfcClosedShell::list::ptr voids(new IfcSchema::IfcClosedShell::list); + if (l->is(IfcSchema::Type::IfcFacetedBrepWithVoids)) { + voids = l->as()->Voids(); + } +#ifdef USE_IFC4 + if (l->is(IfcSchema::Type::IfcAdvancedBrepWithVoids)) { + voids = l->as()->Voids(); + } +#endif + + for (IfcSchema::IfcClosedShell::list::it it = voids->begin(); it != voids->end(); ++it) { // TopoDS_Shape s2; // /// @todo No extensive shapefixing since shells should be disjoint. // /// @todo Awaiting generalized boolean ops module with appropriate checking // if (convert_shape(l->Outer(), s2)) { // s = BRepAlgoAPI_Cut(s, s2).Shape(); // } -// } -// -// shape.push_back(ConversionResult(new OpenCascadeShape(s), indiv_style ? indiv_style : collective_style)); -// return true; + } + + shape.push_back(ConversionResult(new CgalShape(s), indiv_style ? indiv_style : collective_style)); + return true; } return false; } @@ -132,19 +132,19 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcConnectedFaceSet* l, cgal_ face_list.push_back(face); } - for (auto const &face : face_list) { - std::cout << "Face" << std::endl; - std::cout << "\touter: "; - for (auto const &point: *face->outer) { - std::cout << "(" << point << ") "; - } std::cout << std::endl; - for (auto const &inner: face->inner) { - std::cout << "\tinner: "; - for (auto const &point: *inner) { - std::cout << "(" << point << ") "; - } std::cout << std::endl; - } - } +// for (auto const &face : face_list) { +// std::cout << "Face" << std::endl; +// std::cout << "\touter: "; +// for (auto const &point: *face->outer) { +// std::cout << "(" << point << ") "; +// } std::cout << std::endl; +// for (auto const &inner: face->inner) { +// std::cout << "\tinner: "; +// for (auto const &point: *inner) { +// std::cout << "(" << point << ") "; +// } std::cout << std::endl; +// } +// } cgal_shape_t polyhedron = new CGAL::Polyhedron_3(); PolyhedronBuilder builder(&face_list); diff --git a/src/ifcgeom/kernels/cgal/CgalKernel.h b/src/ifcgeom/kernels/cgal/CgalKernel.h index b32435793d..b6a042770d 100644 --- a/src/ifcgeom/kernels/cgal/CgalKernel.h +++ b/src/ifcgeom/kernels/cgal/CgalKernel.h @@ -85,18 +85,18 @@ public: builder.begin_surface(points_map.size(), facet_vertices.size()); for (auto const &point: points_map) { - std::cout << "Adding point " << point.first << std::endl; +// std::cout << "Adding point " << point.first << std::endl; builder.add_vertex(point.first); } for (auto const &facet: facet_vertices) { builder.begin_facet(); - std::cout << "Adding facet "; +// std::cout << "Adding facet "; for (auto const &vertex: facet) { - std::cout << vertex << " "; +// std::cout << vertex << " "; builder.add_vertex_to_facet(vertex); } - std::cout << std::endl; +// std::cout << std::endl; builder.end_facet(); }