From 33e092c8d5443ece3548ac81a145876d21b996b6 Mon Sep 17 00:00:00 2001 From: aothms Date: Fri, 3 Apr 2020 12:01:30 +0000 Subject: [PATCH] Update occt tree --- src/ifcgeom/kernels/opencascade/IfcGeomTree.h | 23 +++++++------------ .../kernels/opencascade/OpenCascadeKernel.h | 6 ++--- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/ifcgeom/kernels/opencascade/IfcGeomTree.h b/src/ifcgeom/kernels/opencascade/IfcGeomTree.h index 060217a2c7..5cd590658a 100644 --- a/src/ifcgeom/kernels/opencascade/IfcGeomTree.h +++ b/src/ifcgeom/kernels/opencascade/IfcGeomTree.h @@ -24,7 +24,7 @@ #include "../../../ifcgeom/schema_agnostic/IfcGeomElement.h" #include "../../../ifcgeom/schema_agnostic/IfcGeomIterator.h" #include "../../../ifcgeom/schema_agnostic/Converter.h" -#include "../../../ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h" +#include "../../../ifcgeom/kernels/opencascade/OpenCascadeKernel.h" #include #include @@ -114,8 +114,7 @@ namespace ifcopenshell { namespace geometry { std::vector ts_filtered; const TopoDS_Shape& A = shapes_.find(t)->second; - OpenCascadeShape SA(A); - if (IfcGeom::Kernel::count(&SA, (int) TopAbs_SHELL) == 0) { + if (kernels::OpenCascadeKernel::count(A, TopAbs_SHELL) == 0) { return ts_filtered; } @@ -124,24 +123,21 @@ namespace ifcopenshell { namespace geometry { typename std::vector::const_iterator it = ts.begin(); for (it = ts.begin(); it != ts.end(); ++it) { const TopoDS_Shape& B = shapes_.find(*it)->second; - OpenCascadeShape SB(B); - if (IfcGeom::Kernel::count(&SB, (int) TopAbs_SHELL) == 0) { + if (kernels::OpenCascadeKernel::count(B, TopAbs_SHELL) == 0) { continue; } if (completely_within) { BRepAlgoAPI_Cut cut(B, A); if (cut.IsDone()) { - OpenCascadeShape Sc(cut.Shape()); - if (IfcGeom::Kernel::count(&Sc, (int) TopAbs_SHELL) == 0) { + if (kernels::OpenCascadeKernel::count(cut.Shape(), TopAbs_SHELL) == 0) { ts_filtered.push_back(*it); } } } else { BRepAlgoAPI_Common common(A, B); if (common.IsDone()) { - OpenCascadeShape Sc(common.Shape()); - if (IfcGeom::Kernel::count(&Sc, (int) TopAbs_SHELL) > 0) { + if (kernels::OpenCascadeKernel::count(common.Shape(), TopAbs_SHELL) > 0) { ts_filtered.push_back(*it); } } @@ -157,8 +153,7 @@ namespace ifcopenshell { namespace geometry { std::vector ts; - OpenCascadeShape Ss(s); - if (IfcGeom::Kernel::count(&Ss, (int) TopAbs_SHELL) == 0) { + if (kernels::OpenCascadeKernel::count(s, TopAbs_SHELL) == 0) { return ts; } @@ -175,15 +170,13 @@ namespace ifcopenshell { namespace geometry { for (it = ts.begin(); it != ts.end(); ++it) { const TopoDS_Shape& B = shapes_.find(*it)->second; - OpenCascadeShape SB(B); - if (IfcGeom::Kernel::count(&SB, (int) TopAbs_SHELL) == 0) { + if (kernels::OpenCascadeKernel::count(B, TopAbs_SHELL) == 0) { continue; } BRepAlgoAPI_Common common(s, B); if (common.IsDone()) { - OpenCascadeShape Sc(common.Shape());; - if (IfcGeom::Kernel::count(&Sc, (int) TopAbs_SHELL) > 0) { + if (kernels::OpenCascadeKernel::count(common.Shape(), TopAbs_SHELL) > 0) { ts_filtered.push_back(*it); } } diff --git a/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.h b/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.h index 9f49245e58..be38bd19d8 100644 --- a/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.h +++ b/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.h @@ -227,9 +227,9 @@ namespace kernels { *this = other; } - double shape_volume(const TopoDS_Shape&); - double face_area(const TopoDS_Face&); - int count(const TopoDS_Shape& s, TopAbs_ShapeEnum t, bool unique = false); + static double shape_volume(const TopoDS_Shape&); + static double face_area(const TopoDS_Face&); + static int count(const TopoDS_Shape& s, TopAbs_ShapeEnum t, bool unique = false); bool create_solid_from_compound(const TopoDS_Shape& compound, TopoDS_Shape& shape); bool create_solid_from_faces(const TopTools_ListOfShape& face_list, TopoDS_Shape& shape);