Salome HOME
Sketch with the Fixed constraints only should be processed as usual sketch
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Interface.h
index 7d61ffbfb69ee940f6f987d0075f216881beb53a..7c9774e3aa540cbde44096bb82aa02013e24f41d 100644 (file)
@@ -1,5 +1,6 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 // Name   : ModelHighAPI_Interface.h
-// Purpose: 
+// Purpose:
 //
 // History:
 // 17/05/16 - Sergey POKHODENKO - Creation of the file
@@ -11,6 +12,7 @@
 #include "ModelHighAPI.h"
 
 #include <list>
+#include <map>
 #include <memory>
 #include <string>
 #include <iostream>
@@ -18,6 +20,7 @@
 class ModelAPI_Feature;
 class ModelAPI_Result;
 class ModelHighAPI_Selection;
+class ModelHighAPI_Dumper;
 //--------------------------------------------------------------------------------------
 /**\class ModelHighAPI_Interface
  * \ingroup CPPHighAPI
@@ -37,18 +40,31 @@ public:
   MODELHIGHAPI_EXPORT
   std::shared_ptr<ModelAPI_Feature> feature() const;
 
+  /// If feature is composite return intefrace for sub-feature by zero-based index,
+  /// or empty pointer if feature not composite or does not have sub-feature with such index.
+  MODELHIGHAPI_EXPORT
+  std::shared_ptr<ModelHighAPI_Interface> subFeature(const int theIndex) const;
+
   /// Shortcut for feature()->getKind()
   MODELHIGHAPI_EXPORT
   const std::string& getKind() const;
 
   /// Shortcut for feature()->execute()
+  /// \param isForce start execution of feature instead of sending events
+  MODELHIGHAPI_EXPORT
+  void execute(bool isForce = false);
+
+  /// Shortcut for feature()->data()->setName()
+  MODELHIGHAPI_EXPORT
+  void setName(const std::string& theName);
+
+  /// Return firts object of the feature
   MODELHIGHAPI_EXPORT
-  void execute();
+  virtual ModelHighAPI_Selection result() const;
 
-  // TODO(spo): rename to selectAll()
   /// Return all objects of the feature
   MODELHIGHAPI_EXPORT
-  virtual std::list<ModelHighAPI_Selection> result() const;
+  virtual std::list<ModelHighAPI_Selection> results() const;
 
   /// Return default result. Default implementation feature()->lastResult()
   MODELHIGHAPI_EXPORT
@@ -58,8 +74,18 @@ public:
   MODELHIGHAPI_EXPORT
   void throwException(const std::string & theDescription);
 
+  /// Return name of getter for specified attribute
+  MODELHIGHAPI_EXPORT
+  const std::string& attributeGetter(const std::string& theAttrName);
+
+  /// Dump wrapped feature
+  MODELHIGHAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const {}
+
 protected:
-  std::shared_ptr<ModelAPI_Feature> myFeature;
+  std::shared_ptr<ModelAPI_Feature> myFeature; ///< feature of this interface
+
+  std::map<std::string, std::string> myAttrGetter; ///< names of attributes and their getters
 };
 
 //! Pointer on Interface object