]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task #3236: Generalization of extrusion
authorArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Tue, 30 Jun 2020 22:02:04 +0000 (01:02 +0300)
committerArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Tue, 30 Jun 2020 22:02:16 +0000 (01:02 +0300)
Fix validator for ExtrusionCut

src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h
src/FeaturesPlugin/FeaturesPlugin_Validators.cpp

index 13a0434682055e820fe128239c3242b63e4acff3..5509d4387a13adf10e771d0bed670afbb8bb0874 100644 (file)
@@ -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;
index a47e06a67e62f09c994f82dac6a6b2e3e2431f2c..1d785d378583bffcbfd77e9fe883036a2e06a018 100644 (file)
@@ -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<FeaturesPlugin_CompositeBoolean> aComposite =
+            std::dynamic_pointer_cast<FeaturesPlugin_CompositeBoolean>(
+            ModelAPI_Feature::feature(theAttribute->owner()));
+        if (aComposite &&
+            aComposite->operationType() == FeaturesPlugin_CompositeBoolean::BOOL_CUT) {
+          return aShape->shapeType() == GeomAPI_Shape::WIRE ||
+                 aShape->shapeType() == GeomAPI_Shape::FACE;
+        }
       }
     }