1 // Name : ModelHighAPI_Interface.h
5 // 17/05/16 - Sergey POKHODENKO - Creation of the file
7 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_
8 #define SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_
10 //--------------------------------------------------------------------------------------
11 #include "ModelHighAPI.h"
16 //--------------------------------------------------------------------------------------
17 class ModelAPI_Feature;
18 class ModelAPI_Result;
19 class ModelHighAPI_Selection;
20 //--------------------------------------------------------------------------------------
21 /**\class ModelHighAPI_Interface
23 * \brief Base class for feature interfaces
25 class ModelHighAPI_Interface
30 explicit ModelHighAPI_Interface(const std::shared_ptr<ModelAPI_Feature> & theFeature);
33 virtual ~ModelHighAPI_Interface();
35 /// Return ModelAPI_Feature
37 std::shared_ptr<ModelAPI_Feature> feature() const;
39 /// Shortcut for feature()->getKind()
41 const std::string& getKind() const;
43 /// Shortcut for feature()->execute()
47 // TODO(spo): rename to selectAll()
48 /// Return all objects of the feature
50 virtual std::list<ModelHighAPI_Selection> result() const;
52 /// Return default result. Default implementation feature()->lastResult()
54 virtual std::shared_ptr<ModelAPI_Result> defaultResult() const;
56 /// Throw exception to event loop
58 void throwException(const std::string & theDescription);
61 std::shared_ptr<ModelAPI_Feature> myFeature;
64 //--------------------------------------------------------------------------------------
65 //--------------------------------------------------------------------------------------
66 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ */