Salome HOME
Spell-checking
[modules/shaper.git] / src / ModelAPI / ModelAPI_CompositeFeature.h
index 878ca849fb5d0fe0cfe9900eeb17840ccd9b522e..0814141b71830ecc0b49527a1ab9b2c45cfefda0 100644 (file)
@@ -1,38 +1,47 @@
-// File:        ModelAPI_CompositeFeature.hxx
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:        ModelAPI_CompositeFeature.h
 // Created:     20 Oct 2014
 // Author:      Mikhail PONIKAROV
 
-#ifndef ModelAPI_CompositeFeature_H_
-#define ModelAPI_CompositeFeature_H_
+#ifndef MODELAPI_COMPOSITEFEATURE_H_
+#define MODELAPI_COMPOSITEFEATURE_H_
 
+#include "ModelAPI.h"
 #include "ModelAPI_Feature.h"
 
 /**\class ModelAPI_CompositeFeature
  * \ingroup DataModel
  * \brief Feature that consists of other features: like sketcher
- * with edges inside. It just allows t oadd a feature to this feature only
+ * with edges inside. It just allows tadd a feature to this feature only
  * instead of adding in both document and this feature.
  */
 class ModelAPI_CompositeFeature : public ModelAPI_Feature
 {
 public:
+  MODELAPI_EXPORT virtual ~ModelAPI_CompositeFeature();
+
   /// Adds feature to the sketch and to its document
-  virtual boost::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) = 0;
+  virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) = 0;
 
   /// Returns the number of sub-elements
-  virtual int numberOfSubs() const = 0;
+  virtual int numberOfSubs(bool forTree = false) const = 0;
 
   /// Returns the sub-feature by zero-base index
-  virtual boost::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex) const = 0;
+  virtual std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex, bool forTree = false) const = 0;
 
   /// Returns the sub-feature unique identifier in this composite feature by zero-base index
   virtual int subFeatureId(const int theIndex) const = 0;
 
-  /// Returns true if feature or reuslt belong to this composite feature as subs
+  /// Returns true if feature or result belong to this composite feature as subs
   virtual bool isSub(ObjectPtr theObject) const = 0;
+
+  /// This method to inform that sub-feature is removed and must be removed from the internal data
+  /// structures of the owner (the remove from the document will be done outside just after)
+  virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature) = 0;
 };
 
 //! Pointer on the composite feature object
-typedef boost::shared_ptr<ModelAPI_CompositeFeature> CompositeFeaturePtr;
+typedef std::shared_ptr<ModelAPI_CompositeFeature> CompositeFeaturePtr;
 
 #endif