20 #ifndef PartSetPlugin_Part_H_
21 #define PartSetPlugin_Part_H_
23 #include "PartSetPlugin.h"
24 #include <ModelAPI_CompositeFeature.h>
35 inline static const std::string&
ID()
37 static const std::string MY_PART_KIND(
"Part");
41 PARTSETPLUGIN_EXPORT
virtual const std::string&
getKind()
49 PARTSETPLUGIN_EXPORT
virtual const std::string&
getGroup()
51 static std::string MY_GROUP =
"Parts";
57 PARTSETPLUGIN_EXPORT
virtual void execute();
63 PARTSETPLUGIN_EXPORT
virtual const std::string&
documentToAdd();
68 virtual std::shared_ptr<ModelAPI_Feature>
addFeature(std::string theID);
74 virtual std::shared_ptr<ModelAPI_Feature>
subFeature(
const int theIndex,
bool forTree =
false);
80 virtual bool isSub(ObjectPtr theObject)
const;
84 virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature) {}
90 PARTSETPLUGIN_EXPORT
virtual void erase();
Feature that consists of other features: like sketcher with edges inside.
Definition: ModelAPI_CompositeFeature.h:33
Feature for creation of the new part in PartSet.
Definition: PartSetPlugin_Part.h:32
virtual void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: PartSetPlugin_Part.cpp:32
virtual bool isSub(ObjectPtr theObject) const
Returns true if feature or reuslt belong to this composite feature as subs.
Definition: PartSetPlugin_Part.cpp:113
virtual const std::string & getKind()
Returns the kind of a feature.
Definition: PartSetPlugin_Part.h:41
static const std::string & ID()
Part kind.
Definition: PartSetPlugin_Part.h:35
PartSetPlugin_Part()
Use plugin manager for features creation.
Definition: PartSetPlugin_Part.cpp:28
virtual std::shared_ptr< ModelAPI_Feature > addFeature(std::string theID)
Adds feature to its document.
Definition: PartSetPlugin_Part.cpp:66
virtual const std::string & documentToAdd()
Part must be added only to PartSet.
Definition: PartSetPlugin_Part.cpp:60
virtual int subFeatureId(const int theIndex) const
Returns the sub-feature unique identifier in this composite feature by zero-base index.
Definition: PartSetPlugin_Part.cpp:101
virtual void erase()
Just removes all features of the part without touching the document data (to be able undo)
Definition: PartSetPlugin_Part.cpp:123
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: PartSetPlugin_Part.h:84
virtual std::shared_ptr< ModelAPI_Feature > subFeature(const int theIndex, bool forTree=false)
Returns the sub-feature by zero-base index.
Definition: PartSetPlugin_Part.cpp:88
virtual int numberOfSubs(bool forTree=false) const
Returns the number of sub-features of the document.
Definition: PartSetPlugin_Part.cpp:77
virtual const std::string & getGroup()
Returns to which group in the document must be added feature.
Definition: PartSetPlugin_Part.h:49
virtual void execute()
Creates a new part document if needed.
Definition: PartSetPlugin_Part.cpp:36