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"
17 //--------------------------------------------------------------------------------------
18 class ModelAPI_Feature;
19 class ModelAPI_Result;
20 class ModelHighAPI_Selection;
21 //--------------------------------------------------------------------------------------
22 /**\class ModelHighAPI_Interface
24 * \brief Base class for feature interfaces
26 class ModelHighAPI_Interface
31 explicit ModelHighAPI_Interface(const std::shared_ptr<ModelAPI_Feature> & theFeature);
34 virtual ~ModelHighAPI_Interface();
36 /// Return ModelAPI_Feature
38 std::shared_ptr<ModelAPI_Feature> feature() const;
40 /// Shortcut for feature()->getKind()
42 const std::string& getKind() const;
44 /// Shortcut for feature()->execute()
48 // TODO(spo): rename to selectAll()
49 /// Return all objects of the feature
51 virtual std::list<ModelHighAPI_Selection> result() const;
53 /// Return default result. Default implementation feature()->lastResult()
55 virtual std::shared_ptr<ModelAPI_Result> defaultResult() const;
57 /// Throw exception to event loop
59 void throwException(const std::string & theDescription);
62 std::shared_ptr<ModelAPI_Feature> myFeature;
65 //! Pointer on Interface object
66 typedef std::shared_ptr<ModelHighAPI_Interface> InterfacePtr;
68 //--------------------------------------------------------------------------------------
69 //--------------------------------------------------------------------------------------
70 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ */