From b8c11eeb8598fb6c6b185770d44cb48379f25fde Mon Sep 17 00:00:00 2001 From: dbv Date: Thu, 7 Apr 2016 12:35:18 +0300 Subject: [PATCH] Compilation fix. Validator fix. --- src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp | 3 ++- src/GeomValidators/GeomValidators_ZeroOffset.cpp | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp index b9d9a670e..69ab07cef 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -37,7 +38,7 @@ #include #include -#include +#include //================================================================================================= GeomAlgoAPI_Prism::GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape, diff --git a/src/GeomValidators/GeomValidators_ZeroOffset.cpp b/src/GeomValidators/GeomValidators_ZeroOffset.cpp index 3d08e9fd9..1ba9664d9 100644 --- a/src/GeomValidators/GeomValidators_ZeroOffset.cpp +++ b/src/GeomValidators/GeomValidators_ZeroOffset.cpp @@ -46,7 +46,9 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& int aSketchFacesNum = aConstruction->facesNum(); for(int aFaceIndex = 0; aFaceIndex < aSketchFacesNum; aFaceIndex++) { std::shared_ptr aFace = std::dynamic_pointer_cast(aConstruction->face(aFaceIndex)); - aFacesList.push_back(aFace); + if(aFace->isFace() && aFace->isPlanar()) { + aFacesList.push_back(aFace); + } } } } else if(theFeature->selectionList(*anIt)) { @@ -55,7 +57,9 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& AttributeSelectionPtr aFaceSel = aFacesSelectionList->value(anIndex); std::shared_ptr aFaceShape = aFaceSel->value(); if(aFaceShape.get() && !aFaceShape->isNull()) { // Getting face. - aFacesList.push_back(aFaceShape); + if(aFaceShape->isFace() && aFaceShape->isPlanar()) { + aFacesList.push_back(aFaceShape); + } } else { // This may be the whole sketch result selected, check and get faces. ResultPtr aContext = aFaceSel->context(); std::shared_ptr aContextShape = aContext->shape(); @@ -69,7 +73,9 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& int aFacesNum = aConstruction->facesNum(); for(int aFaceIndex = 0; aFaceIndex < aFacesNum || aFacesNum == -1; aFaceIndex++) { aFaceShape = std::dynamic_pointer_cast(aConstruction->face(aFaceIndex)); - aFacesList.push_back(aFaceShape); + if(aFaceShape->isFace() && aFaceShape->isPlanar()) { + aFacesList.push_back(aFaceShape); + } } } } -- 2.39.2