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 class ModelHighAPI_Dumper;
22 //--------------------------------------------------------------------------------------
23 /**\class ModelHighAPI_Interface
25 * \brief Base class for feature interfaces
27 class ModelHighAPI_Interface
32 explicit ModelHighAPI_Interface(const std::shared_ptr<ModelAPI_Feature> & theFeature);
35 virtual ~ModelHighAPI_Interface();
37 /// Return ModelAPI_Feature
39 std::shared_ptr<ModelAPI_Feature> feature() const;
41 /// Shortcut for feature()->getKind()
43 const std::string& getKind() const;
45 /// Shortcut for feature()->execute()
49 // TODO(spo): rename to selectAll()
50 /// Return all objects of the feature
52 virtual std::list<ModelHighAPI_Selection> result() const;
54 /// Return default result. Default implementation feature()->lastResult()
56 virtual std::shared_ptr<ModelAPI_Result> defaultResult() const;
58 /// Throw exception to event loop
60 void throwException(const std::string & theDescription);
62 /// Dump wrapped feature
64 virtual void dump(ModelHighAPI_Dumper& theDumper) const {}
67 std::shared_ptr<ModelAPI_Feature> myFeature;
70 //! Pointer on Interface object
71 typedef std::shared_ptr<ModelHighAPI_Interface> InterfacePtr;
73 //--------------------------------------------------------------------------------------
74 //--------------------------------------------------------------------------------------
75 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ */