- virtual ~ModuleBase_ModelWidget() {};
-
- /// Saves the internal parameters to the given feature
- /// \param theFeature a model feature to be changed
- virtual bool storeValue(FeaturePtr theFeature) const = 0;
-
- virtual bool restoreValue(FeaturePtr theFeature) = 0;
-
- /// Returns whether the widget can accept focus, or if it corresponds to the given attribute
- /// \param theAttribute name
- bool canFocusTo(const std::string& theAttributeName) const;
+ virtual ~ModuleBase_ModelWidget()
+ {
+ }
+
+ /// Fills the widget with default values
+ virtual void reset() {};
+
+ /// Returns the state whether the attribute of the feature is initialized
+ /// \param theObject a model feature to be checked
+ /// \return the boolean result
+ bool isInitialized(ObjectPtr theObject) const;
+
+ /// Returns true, if default value of the widget should be computed
+ /// on operation's execute, like radius for circle's constraint (can not be zero)
+ bool isComputedDefault() const { return myIsComputedDefault; }
+
+ /// Returns true, if default value of the widget is defined in the XML and it is not the
+ /// computed value
+ /// \return the boolean result
+ std::string getDefaultValue() const { return myDefaultValue; }
+
+ /// Returns true, if the obligatory value of the widget is not defined in the XML or has true value
+ /// \return the boolean result
+ bool isObligatory() const { return myIsObligatory; }
+
+ /// Defines if it is supposed that the widget should interact with the viewer.
+ virtual bool isViewerSelector() { return false; }
+
+ /// Defines if it is supported to set the value in this widget
+ /// By default it returns true
+ virtual bool canSetValue() const { return true; };
+
+ /// Set the given wrapped value to the current widget
+ /// This value should be processed in the widget according to the needs
+ /// \param theValues the wrapped selection values
+ /// \param thePosition an index in the list of values, the values should be get from the index
+ virtual bool setSelection(const QList<ModuleBase_ViewerPrs>& theValues, int& thePosition)
+ {
+ return false;
+ }
+
+ /// Restore value from attribute data to the widget's control
+ virtual bool restoreValue() = 0;