20 #ifndef FeaturesPlugin_CompositeSketch_H_
21 #define FeaturesPlugin_CompositeSketch_H_
23 #include "FeaturesPlugin.h"
25 #include <ModelAPI_CompositeFeature.h>
27 #include <ModelAPI_ResultBody.h>
38 static const std::string MY_SKETCH_ID(
"sketch");
45 static const std::string MY_BASE_OBJECTS_ID(
"base");
46 return MY_BASE_OBJECTS_ID;
50 FEATURESPLUGIN_EXPORT
virtual std::shared_ptr<ModelAPI_Feature>
addFeature(std::string theID);
53 FEATURESPLUGIN_EXPORT
virtual int numberOfSubs(
bool forTree =
false)
const;
56 FEATURESPLUGIN_EXPORT
virtual
57 std::shared_ptr<ModelAPI_Feature>
subFeature(
const int theIndex,
bool forTree =
false);
60 FEATURESPLUGIN_EXPORT
virtual int subFeatureId(
const int theIndex)
const;
63 FEATURESPLUGIN_EXPORT
virtual bool isSub(ObjectPtr theObject)
const;
67 FEATURESPLUGIN_EXPORT
virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature);
71 InitSketchLauncher = 1 << 0,
72 InitBaseObjectsList = 1 << 1
83 void getBaseShapes(ListOfShape& theBaseShapesList,
const bool theIsMakeShells =
true);
87 const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
88 const int theIndex = 0);
92 const GeomShapePtr theBaseShape,
93 const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
96 void storeShapes(
const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
97 ResultBodyPtr theResultBody,
99 const ListOfShape& theShapes,
100 const std::string theName);
103 std::string myCurrentSelectionType;
Interface for the composite sketch feature.
Definition: FeaturesPlugin_CompositeSketch.h:33
static const std::string & BASE_OBJECTS_ID()
Attribute name of base objects.
Definition: FeaturesPlugin_CompositeSketch.h:43
void getBaseShapes(ListOfShape &theBaseShapesList, const bool theIsMakeShells=true)
Returns list of base shapes.
Definition: FeaturesPlugin_CompositeSketch.cpp:137
virtual void removeFeature(std::shared_ptr< ModelAPI_Feature > theFeature)
This method to inform that sub-feature is removed and must be removed from the internal data structur...
Definition: FeaturesPlugin_CompositeSketch.cpp:126
void initCompositeSketchAttribtues(const int theInitFlags)
Initializes composite sketch attributes.
Definition: FeaturesPlugin_CompositeSketch.cpp:44
void storeShapes(const std::shared_ptr< GeomAlgoAPI_MakeShape > theMakeShape, ResultBodyPtr theResultBody, const GeomAPI_Shape::ShapeType theBaseShapeType, const ListOfShape &theShapes, const std::string theName)
Used to store from and to shapes: generated, or in common modified tag.
Definition: FeaturesPlugin_CompositeSketch.cpp:231
void storeResult(const GeomShapePtr theBaseShape, const std::shared_ptr< GeomAlgoAPI_MakeShape > theMakeShape, const int theIndex=0)
Stores result of generation.
Definition: FeaturesPlugin_CompositeSketch.cpp:149
virtual std::shared_ptr< ModelAPI_Feature > subFeature(const int theIndex, bool forTree=false)
Definition: FeaturesPlugin_CompositeSketch.cpp:87
virtual bool isSub(ObjectPtr theObject) const
Definition: FeaturesPlugin_CompositeSketch.cpp:113
virtual std::shared_ptr< ModelAPI_Feature > addFeature(std::string theID)
Appends a feature to the sketch sub-elements container.
Definition: FeaturesPlugin_CompositeSketch.cpp:67
virtual int subFeatureId(const int theIndex) const
Definition: FeaturesPlugin_CompositeSketch.cpp:99
virtual int numberOfSubs(bool forTree=false) const
Definition: FeaturesPlugin_CompositeSketch.cpp:80
void storeGenerationHistory(ResultBodyPtr theResultBody, const GeomShapePtr theBaseShape, const std::shared_ptr< GeomAlgoAPI_MakeShape > theMakeShape)
Stores generation history.
Definition: FeaturesPlugin_CompositeSketch.cpp:166
static const std::string & SKETCH_ID()
Attribute name of sketch feature.
Definition: FeaturesPlugin_CompositeSketch.h:36
ShapeType
Shape type enum.
Definition: GeomAPI_Shape.h:46
Feature that consists of other features: like sketcher with edges inside.
Definition: ModelAPI_CompositeFeature.h:33