From 32dbb28fad617a31eb5da8022149411e865eb634 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 25 Mar 2015 16:19:48 +0300 Subject: [PATCH] Make extrusion made on prism is modified after sketch update: regression fix --- .gitignore | 2 ++ src/GeomAPI/GeomAPI_Edge.cpp | 2 ++ src/GeomAPI/GeomAPI_Vertex.cpp | 2 ++ src/Model/Model_ResultConstruction.cpp | 4 ++-- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f55ecf287..b3e5bb13f 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ start.bat *.orig *~ /.project +*DFBrowser* + diff --git a/src/GeomAPI/GeomAPI_Edge.cpp b/src/GeomAPI/GeomAPI_Edge.cpp index f9572daa7..b5736f4b6 100644 --- a/src/GeomAPI/GeomAPI_Edge.cpp +++ b/src/GeomAPI/GeomAPI_Edge.cpp @@ -131,6 +131,8 @@ std::shared_ptr GeomAPI_Edge::line() bool GeomAPI_Edge::isEqual(const std::shared_ptr theEdge) const { + if (!theEdge.get() || ! theEdge->isEdge()) + return false; const TopoDS_Shape& aMyShape = const_cast(this)->impl(); const TopoDS_Shape& aInShape = theEdge->impl(); diff --git a/src/GeomAPI/GeomAPI_Vertex.cpp b/src/GeomAPI/GeomAPI_Vertex.cpp index d881d79b5..b917837a0 100644 --- a/src/GeomAPI/GeomAPI_Vertex.cpp +++ b/src/GeomAPI/GeomAPI_Vertex.cpp @@ -37,6 +37,8 @@ std::shared_ptr GeomAPI_Vertex::point() bool GeomAPI_Vertex::isEqual(const std::shared_ptr theVert) const { + if (!theVert.get() || ! theVert->isVertex()) + return false; const TopoDS_Shape& aMyShape = const_cast(this)->impl(); const TopoDS_Shape& aInShape = theVert->impl(); diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index 17b20df98..2998e9f2d 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -28,9 +28,9 @@ void Model_ResultConstruction::colorConfigInfo(std::string& theSection, std::str void Model_ResultConstruction::setShape(std::shared_ptr theShape) { - if (myShape != theShape) { + if (myShape != theShape && (!theShape.get() || !theShape->isEqual(myShape))) { myShape = theShape; - if (theShape.get() && (!myShape.get() || !theShape->isEqual(myShape))) { + if (theShape.get()) { myFacesUpToDate = false; myFaces.clear(); } -- 2.39.2