1 // File: ModelAPI_Feature.hxx
2 // Created: 21 Mar 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef ModelAPI_Feature_HeaderFile
6 #define ModelAPI_Feature_HeaderFile
12 class ModelAPI_Object;
14 /**\class ModelAPI_Feature
16 * \brief Functionality of the model object: to update result,
17 * to initialize attributes, etc.
20 class MODELAPI_EXPORT ModelAPI_Feature
22 std::shared_ptr<ModelAPI_Object> myData; ///< manager of the data model of a feature
25 /// Returns the kind of a feature (like "Point")
26 virtual std::string getKind() = 0;
28 /// Request for initialization of data model of the feature: adding all attributes
29 virtual void initAttributes() = 0;
31 /// Computes or recomputes the result
32 virtual void execute() = 0;
34 /// Returns the data manager of this feature
35 std::shared_ptr<ModelAPI_Object> data() {return myData;}
38 /// Use plugin manager for features creation: this method is
39 /// defined here only for SWIG-wrapping
43 /// Sets the data manager of an object (document does)
44 void setData(std::shared_ptr<ModelAPI_Object> theData) {myData = theData;}
45 friend class Model_Document;