]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModelAPI/ModelAPI_Feature.h
Salome HOME
Add tools
[modules/shaper.git] / src / ModelAPI / ModelAPI_Feature.h
index 8631c3e08b2d53beb32c0ad5fb951e2e5064337a..6cc9c8b50a5561ad1f0dbea3adb6648bb2fb22a0 100644 (file)
@@ -72,7 +72,7 @@ class ModelAPI_Feature : public ModelAPI_Object
   /// returns the current results of the feature
   MODELAPI_EXPORT const std::list<std::shared_ptr<ModelAPI_Result> >& results();
   /// returns the first result in the list or NULL reference
-  MODELAPI_EXPORT std::shared_ptr<ModelAPI_Result> firstResult();
+  MODELAPI_EXPORT std::shared_ptr<ModelAPI_Result> firstResult() const;
   /// returns the last result in the list or NULL reference
   MODELAPI_EXPORT std::shared_ptr<ModelAPI_Result> lastResult();
   /// sets the alone result
@@ -82,7 +82,7 @@ class ModelAPI_Feature : public ModelAPI_Object
                                  const int theIndex);
   /// removes the result from the feature
   MODELAPI_EXPORT void removeResult(const std::shared_ptr<ModelAPI_Result>& theResult);
-  /// removes all results starting from the gived index (zero-based)
+  /// removes all results starting from the given index (zero-based)
   /// \param theSinceIndex - index of the deleted result and all after also will be deleted
   /// \param theFlush - if it is false, REDISPLAY message is not flushed
   MODELAPI_EXPORT void removeResults(const int theSinceIndex, const bool theFlush = true);
@@ -124,7 +124,7 @@ class ModelAPI_Feature : public ModelAPI_Object
   MODELAPI_EXPORT virtual bool setDisabled(const bool theFlag);
 
   /// Returns the feature is disabled or not.
-  MODELAPI_EXPORT virtual bool isDisabled() const;
+  MODELAPI_EXPORT virtual bool isDisabled();
 
   /// To virtually destroy the fields of successors
   MODELAPI_EXPORT virtual ~ModelAPI_Feature();
@@ -195,7 +195,13 @@ class ModelAPI_Feature : public ModelAPI_Object
   {
     return data()->attribute(theID);
   }
- // -----------------------------------------------------------------------------------------------
+  protected:
+  /// This method is called just after creation of the object: it must initialize
+  /// all fields, normally initialized in the constructor
+  MODELAPI_EXPORT virtual void init();
+
+  friend class Model_Document;
+  friend class Model_Objects;
 };
 
 //! Pointer on feature object