]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelHighAPI/ModelHighAPI_Interface.h
Salome HOME
Add resilt() and selectFace()
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Interface.h
1 // Name   : ModelHighAPI_Interface.h
2 // Purpose: 
3 //
4 // History:
5 // 17/05/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_
8 #define SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_
9
10 //--------------------------------------------------------------------------------------
11 #include "ModelHighAPI.h"
12
13 #include <list>
14 #include <memory>
15 #include <string>
16 //--------------------------------------------------------------------------------------
17 class ModelAPI_Feature;
18 class ModelHighAPI_Selection;
19 //--------------------------------------------------------------------------------------
20 /**\class ModelHighAPI_Interface
21  * \ingroup CPPHighAPI
22  * \brief Base class for feature interfaces
23  */
24 class ModelHighAPI_Interface
25 {
26 public:
27   /// Constructor
28   MODELHIGHAPI_EXPORT
29   explicit ModelHighAPI_Interface(const std::shared_ptr<ModelAPI_Feature> & theFeature);
30   /// Destructor
31   MODELHIGHAPI_EXPORT
32   virtual ~ModelHighAPI_Interface();
33
34   /// Return ModelAPI_Feature
35   MODELHIGHAPI_EXPORT
36   std::shared_ptr<ModelAPI_Feature> feature() const;
37
38   /// Shortcut for feature()->getKind()
39   MODELHIGHAPI_EXPORT
40   const std::string& getKind() const;
41
42   /// Shortcut for feature()->execute()
43   MODELHIGHAPI_EXPORT
44   void execute();
45
46   /// Return all objects of the feature
47   MODELHIGHAPI_EXPORT
48   virtual std::list<ModelHighAPI_Selection> result() const;
49
50   /// Throw exception to event loop
51   MODELHIGHAPI_EXPORT
52   void throwException(const std::string & theDescription);
53
54 protected:
55   std::shared_ptr<ModelAPI_Feature> myFeature;
56 };
57
58 //--------------------------------------------------------------------------------------
59 //--------------------------------------------------------------------------------------
60 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ */