1 // File: ModelAPI_CompositeFeature.hxx
2 // Created: 20 Oct 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef ModelAPI_CompositeFeature_H_
6 #define ModelAPI_CompositeFeature_H_
8 #include "ModelAPI_Feature.h"
10 /**\class ModelAPI_CompositeFeature
12 * \brief Feature that consists of other features: like sketcher
13 * with edges inside. It just allows t oadd a feature to this feature only
14 * instead of adding in both document and this feature.
16 class ModelAPI_CompositeFeature : public ModelAPI_Feature
19 /// Adds feature to the sketch and to its document
20 virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) = 0;
22 /// Returns the number of sub-elements
23 virtual int numberOfSubs() const = 0;
25 /// Returns the sub-feature by zero-base index
26 virtual std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex) const = 0;
28 /// Returns the sub-feature unique identifier in this composite feature by zero-base index
29 virtual int subFeatureId(const int theIndex) const = 0;
31 /// Returns true if feature or reuslt belong to this composite feature as subs
32 virtual bool isSub(ObjectPtr theObject) const = 0;
35 //! Pointer on the composite feature object
36 typedef std::shared_ptr<ModelAPI_CompositeFeature> CompositeFeaturePtr;