/** \class FeaturesPlugin_CompositeBoolean
* \ingroup Plugins
+ * \brief Interface for the composite boolean feature.
*/
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()
{
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;
/// structures of the owner (the remove from the document will be done outside just after)
FEATURESPLUGIN_EXPORT virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature);
+ /// removes also all sub-sketch
+ FEATURESPLUGIN_EXPORT virtual void erase();
+
protected:
FeaturesPlugin_CompositeBoolean(){};
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;
};