diff --git a/src/Mod/TechDraw/App/ShapeExtractor.cpp b/src/Mod/TechDraw/App/ShapeExtractor.cpp index 292f146a14..f28fb98c9c 100644 --- a/src/Mod/TechDraw/App/ShapeExtractor.cpp +++ b/src/Mod/TechDraw/App/ShapeExtractor.cpp @@ -116,15 +116,7 @@ TopoDS_Shape ShapeExtractor::getShapes(const std::vector l auto shape = Part::Feature::getShape(l); if(!shape.IsNull()) { // BRepTools::Write(shape, "DVPgetShape.brep"); //debug - if (shape.ShapeType() > TopAbs_COMPSOLID) { //simple shape - //do we need to apply placement here too?? - sourceShapes.push_back(shape); - } else { //complex shape - std::vector drawable = extractDrawableShapes(shape); - if (!drawable.empty()) { - sourceShapes.insert(sourceShapes.end(),drawable.begin(),drawable.end()); - } - } + sourceShapes.push_back(shape); } else { std::vector shapeList = getShapesFromObject(l); sourceShapes.insert(sourceShapes.end(),shapeList.begin(),shapeList.end()); @@ -203,14 +195,7 @@ std::vector ShapeExtractor::getXShapes(const App::Link* xLink) ts.transformGeometry(netTransform); shape = ts.getShape(); } - if (shape.ShapeType() > TopAbs_COMPSOLID) { //simple shape - xSourceShapes.push_back(shape); - } else { //complex shape - std::vector drawable = extractDrawableShapes(shape); - if (!drawable.empty()) { - xSourceShapes.insert(xSourceShapes.end(),drawable.begin(),drawable.end()); - } - } + xSourceShapes.push_back(shape); } else { Base::Console().Message("SE::getXShapes - no shape from getXShape\n"); } @@ -228,15 +213,7 @@ std::vector ShapeExtractor::getXShapes(const App::Link* xLink) ts.transformGeometry(netTransform); shape = ts.getShape(); } - - if (shape.ShapeType() > TopAbs_COMPSOLID) { //simple shape - xSourceShapes.push_back(shape); - } else { //complex shape - std::vector drawable = extractDrawableShapes(shape); - if (!drawable.empty()) { - xSourceShapes.insert(xSourceShapes.end(),drawable.begin(),drawable.end()); - } - } + xSourceShapes.push_back(shape); } } } @@ -316,61 +293,6 @@ TopoDS_Shape ShapeExtractor::getShapesFused(const std::vector ShapeExtractor::extractDrawableShapes(const TopoDS_Shape shapeIn) -{ -// Base::Console().Message("SE::extractDrawableShapes()\n"); - std::vector result; - std::vector extShapes; //extracted Shapes (solids mostly) - std::vector extEdges; //extracted loose Edges - if (shapeIn.ShapeType() == TopAbs_COMPOUND) { //Compound is most general shape type - //getSolids from Compound - TopExp_Explorer expSolid(shapeIn, TopAbs_SOLID); - for (int i = 1; expSolid.More(); expSolid.Next(), i++) { - TopoDS_Solid s = TopoDS::Solid(expSolid.Current()); - if (!s.IsNull() && !Part::TopoShape(s).isInfinite()) { - extShapes.push_back(s); - } - } - //get edges not part of a solid - //???? should this look for Faces(Wires?) before Edges? - TopExp_Explorer expEdge(shapeIn, TopAbs_EDGE, TopAbs_SOLID); - for (int i = 1; expEdge.More(); expEdge.Next(), i++) { - TopoDS_Shape s = expEdge.Current(); - if (!s.IsNull() && !Part::TopoShape(s).isInfinite()) { - extEdges.push_back(s); - } - } - } else if (shapeIn.ShapeType() == TopAbs_COMPSOLID) { - //get Solids from compSolid - TopExp_Explorer expSolid(shapeIn, TopAbs_SOLID); - for (int i = 1; expSolid.More(); expSolid.Next(), i++) { - TopoDS_Solid s = TopoDS::Solid(expSolid.Current()); - if (!s.IsNull() && !Part::TopoShape(s).isInfinite()) { - extShapes.push_back(s); - } - } - //vs using 2d geom as construction geom? - //get edges not part of a solid - //???? should this look for Faces(Wires?) before Edges? - TopExp_Explorer expEdge(shapeIn, TopAbs_EDGE, TopAbs_SOLID); - for (int i = 1; expEdge.More(); expEdge.Next(), i++) { - TopoDS_Shape s = expEdge.Current(); - if (!s.IsNull() && !Part::TopoShape(s).isInfinite()) { - extEdges.push_back(s); - } - } - } else { - //not a Compound or a CompSolid just push_back shape_In) - extShapes.push_back(shapeIn); - } - - result = extShapes; - if (!extEdges.empty()) { - result.insert(std::end(result), std::begin(extEdges), std::end(extEdges)); - } - return result; -} - bool ShapeExtractor::is2dObject(App::DocumentObject* obj) { bool result = false; diff --git a/src/Mod/TechDraw/App/ShapeExtractor.h b/src/Mod/TechDraw/App/ShapeExtractor.h index 02d7007159..d2a30ccb76 100644 --- a/src/Mod/TechDraw/App/ShapeExtractor.h +++ b/src/Mod/TechDraw/App/ShapeExtractor.h @@ -23,6 +23,8 @@ #ifndef _ShapeExtractor_h_ #define _ShapeExtractor_h_ +#include + #include #include @@ -50,7 +52,6 @@ public: static std::vector getXShapes(const App::Link* xLink); static std::vector getShapesFromObject(const App::DocumentObject* docObj); static TopoDS_Shape getShapesFused(const std::vector links); - static std::vector extractDrawableShapes(const TopoDS_Shape shapeIn); static bool is2dObject(App::DocumentObject* obj); static bool isEdgeType(App::DocumentObject* obj); @@ -59,7 +60,6 @@ public: static Base::Vector3d getLocation3dFromFeat(App::DocumentObject* obj); static bool prefAdd2d(void); - protected: private: