1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_CompositeFeature.hxx
4 // Created: 20 Oct 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef ModelAPI_CompositeFeature_H_
8 #define ModelAPI_CompositeFeature_H_
10 #include "ModelAPI_Feature.h"
12 /**\class ModelAPI_CompositeFeature
14 * \brief Feature that consists of other features: like sketcher
15 * with edges inside. It just allows t oadd a feature to this feature only
16 * instead of adding in both document and this feature.
18 class ModelAPI_CompositeFeature : public ModelAPI_Feature
21 /// Adds feature to the sketch and to its document
22 virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) = 0;
24 /// Returns the number of sub-elements
25 virtual int numberOfSubs() const = 0;
27 /// Returns the sub-feature by zero-base index
28 virtual std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex) const = 0;
30 /// Returns the sub-feature unique identifier in this composite feature by zero-base index
31 virtual int subFeatureId(const int theIndex) const = 0;
33 /// Returns true if feature or reuslt belong to this composite feature as subs
34 virtual bool isSub(ObjectPtr theObject) const = 0;
37 //! Pointer on the composite feature object
38 typedef std::shared_ptr<ModelAPI_CompositeFeature> CompositeFeaturePtr;