From: Artem Zhidkov Date: Tue, 30 Jun 2020 22:02:04 +0000 (+0300) Subject: Task #3236: Generalization of extrusion X-Git-Tag: V9_6_0a1~60^2~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5fada679c831fa80136d45ed7e8d8093ad4c9a6c;p=modules%2Fshaper.git Task #3236: Generalization of extrusion Fix validator for ExtrusionCut --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h index 13a043468..5509d4387 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h @@ -49,6 +49,8 @@ public: /// Performs the algorithm and stores results it in the data structure. FEATURESPLUGIN_EXPORT virtual void executeCompositeBoolean(); + const OperationType& operationType() const { return myOperationType; } + protected: struct ResultBaseAlgo { ResultBodyPtr resultBody; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index a47e06a67..1d785d378 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -23,6 +23,7 @@ #include "FeaturesPlugin_BooleanFuse.h" #include "FeaturesPlugin_BooleanCommon.h" #include "FeaturesPlugin_BooleanSmash.h" +#include "FeaturesPlugin_CompositeBoolean.h" #include "FeaturesPlugin_Extrusion.h" #include "FeaturesPlugin_Pipe.h" #include "FeaturesPlugin_Union.h" @@ -440,6 +441,16 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute if(aConstruction->facesNum() > 0) { return true; } + } else { + // CUT operation supports only FACE or WIRE as a tool base + std::shared_ptr aComposite = + std::dynamic_pointer_cast( + ModelAPI_Feature::feature(theAttribute->owner())); + if (aComposite && + aComposite->operationType() == FeaturesPlugin_CompositeBoolean::BOOL_CUT) { + return aShape->shapeType() == GeomAPI_Shape::WIRE || + aShape->shapeType() == GeomAPI_Shape::FACE; + } } }