Salome HOME
Merge branch 'BR_PYTHON_PLUGIN' of newgeom:newgeom.git into Dev_0.6.1
[modules/shaper.git] / src / ModelAPI / ModelAPI_CompositeFeature.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_CompositeFeature.hxx
4 // Created:     20 Oct 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ModelAPI_CompositeFeature_H_
8 #define ModelAPI_CompositeFeature_H_
9
10 #include "ModelAPI_Feature.h"
11
12 /**\class ModelAPI_CompositeFeature
13  * \ingroup DataModel
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.
17  */
18 class ModelAPI_CompositeFeature : public ModelAPI_Feature
19 {
20 public:
21   /// Adds feature to the sketch and to its document
22   virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) = 0;
23
24   /// Returns the number of sub-elements
25   virtual int numberOfSubs() const = 0;
26
27   /// Returns the sub-feature by zero-base index
28   virtual std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex) const = 0;
29
30   /// Returns the sub-feature unique identifier in this composite feature by zero-base index
31   virtual int subFeatureId(const int theIndex) const = 0;
32
33   /// Returns true if feature or reuslt belong to this composite feature as subs
34   virtual bool isSub(ObjectPtr theObject) const = 0;
35 };
36
37 //! Pointer on the composite feature object
38 typedef std::shared_ptr<ModelAPI_CompositeFeature> CompositeFeaturePtr;
39
40 #endif