Salome HOME
#1658 New widget supporting nested option buttons
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetShapeSelector.h
index ec1fe5f4970ed4e78408241f2aceb0ade8a328e2..6ac087fbb9530e0e66900111674517323609cb7a 100644 (file)
@@ -10,7 +10,6 @@
 #include "ModuleBase.h"
 #include "ModuleBase_WidgetSelector.h"
 #include "ModuleBase_ViewerFilters.h"
-#include <ModuleBase_ViewerPrs.h>
 
 #include <ModelAPI_Object.h>
 #include <ModelAPI_Attribute.h>
@@ -26,6 +25,7 @@ class QLabel;
 class QLineEdit;
 class QToolButton;
 class ModuleBase_IWorkshop;
+class ModuleBase_ViewerPrs;
 class ModelAPI_Validator;
 
 /**
@@ -74,7 +74,7 @@ Q_OBJECT
   /// It is redefined to check the value validity and if it is, fill the attribute with by value
   /// \param theValues the wrapped selection values
   /// \param theToValidate a flag on validation of the values
-  virtual bool setSelection(QList<ModuleBase_ViewerPrs>& theValues,
+  virtual bool setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues,
                             const bool theToValidate);
 
   /// Returns list of widget controls
@@ -84,21 +84,10 @@ Q_OBJECT
  protected:
   /// Saves the internal parameters to the given feature
   /// \return True in success
-  virtual bool storeValueCustom() const;
+  virtual bool storeValueCustom();
 
   virtual bool restoreValueCustom();
 
-  /// Creates a backup of the current values of the attribute
-  /// It should be realized in the specific widget because of different
-  /// parameters of the current attribute
-  virtual void storeAttributeValue();
-
-  /// Creates a backup of the current values of the attribute
-  /// It should be realized in the specific widget because of different
-  /// parameters of the current attribute
-  /// \param theValid a boolean flag, if restore happens for valid parameters
-  virtual void restoreAttributeValue(const bool theValid);
-
   /// Computes and updates name of selected object in the widget
   virtual void updateSelectionName();
 
@@ -107,7 +96,7 @@ Q_OBJECT
 
   /// Retunrs a list of possible shape types
   /// \return a list of shapes
-  virtual QIntList getShapeTypes() const;
+  virtual QIntList shapeTypes() const;
 
   /// Get the shape from the attribute if the attribute contains a shape, e.g. selection attribute
   /// \return a shape
@@ -116,7 +105,7 @@ Q_OBJECT
   /// Return the attribute values wrapped in a list of viewer presentations
   /// \return a list of viewer presentations, which contains an attribute result and
   /// a shape. If the attribute do not uses the shape, it is empty
-  virtual QList<ModuleBase_ViewerPrs> getAttributeSelection() const;
+  virtual QList<std::shared_ptr<ModuleBase_ViewerPrs>> getAttributeSelection() const;
 
   //----------- Class members -------------
   protected:
@@ -128,18 +117,6 @@ Q_OBJECT
 
   /// List of accepting shapes types
   QStringList myShapeTypes;
-
-  /// backup parameters of the model attribute. The class processes three types of attribute:
-  /// Reference, RefAttr and Selection. Depending on the attribute type, only the attribute parameter
-  /// values are reserved in the backup
-  /// An attribute object
-  ObjectPtr myObject;
-  /// An attribute shape
-  GeomShapePtr myShape;
-  /// A reference of the attribute
-  AttributePtr myRefAttribute;
-  /// A boolean value whether refAttr uses reference of object
-  bool myIsObject;
 };
 
 #endif