Salome HOME
Bug #1170: wrong object names in Main objects field Partition
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_CompositeBoolean.h
index 6838e931bb972ef32f3995eeb0feaeaa67d5f175..f171bc6e85dbee548714b7a769794c8c5cdd7283 100644 (file)
@@ -15,6 +15,7 @@
 
 /** \class FeaturesPlugin_CompositeBoolean
  *  \ingroup Plugins
+ *  \brief Interface for the composite boolean feature.
  */
 class FeaturesPlugin_CompositeBoolean : public ModelAPI_CompositeFeature
 {
@@ -26,6 +27,13 @@ class FeaturesPlugin_CompositeBoolean : public ModelAPI_CompositeFeature
     return MY_SKETCH_OBJECT_ID;
   }
 
+  /// Attribute name of sketch feature.
+  inline static const std::string& SKETCH_SELECTION_ID()
+  {
+    static const std::string MY_SKETCH_SELECTION_ID("sketch_selection");
+    return MY_SKETCH_SELECTION_ID;
+  }
+
   /// Attribute name of objects for boolean operation.
   inline static const std::string& BOOLEAN_OBJECTS_ID()
   {
@@ -46,7 +54,7 @@ class FeaturesPlugin_CompositeBoolean : public ModelAPI_CompositeFeature
   FEATURESPLUGIN_EXPORT virtual int numberOfSubs(bool forTree = false) const;
 
   /// \return the sub-feature by zero-base index.
-  FEATURESPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex, bool forTree = false) const;
+  FEATURESPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex, bool forTree = false);
 
   /// \return the sub-feature unique identifier in this composite feature by zero-base index.
   FEATURESPLUGIN_EXPORT virtual int subFeatureId(const int theIndex) const;
@@ -68,14 +76,22 @@ protected:
   virtual void initMakeSolidsAttributes() = 0;
 
   /// Define this function to create solids from faces with extrusion/revolution.
-  virtual ListOfShape MakeSolids(const ListOfShape& theFaces) = 0;
-
-  void LoadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
+  virtual void makeSolids(const ListOfShape& theFaces,
+                          ListOfShape& theResults,
+                          ListOfMakeShape& theAlgos) = 0;
+
+  /// Results naming.
+  void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
+                    const ListOfShape& theShells,
+                    ListOfMakeShape& theSolidsAlgos,
+                    const std::shared_ptr<GeomAPI_Shape> theBaseShape,
                     const ListOfShape& theTools,
-                    const GeomAlgoAPI_Boolean& theAlgo);
+                    const std::shared_ptr<GeomAPI_Shape> theResultShape,
+                    GeomAlgoAPI_MakeShape& theMakeShape,
+                    GeomAPI_DataMapOfShapeShape& theMapOfShapes);
 
 protected:
+  /// Type of boolean operation.
   GeomAlgoAPI_Boolean::OperationType myBooleanOperationType;
 };