Salome HOME
Reanud's patch for modern Cpp11 compilers applied
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetShapeSelector.h
index 7284d8ae59ec8c7e305457122850d1a75f53c1b3..7757d3141070cc520073ac17c7d3a7e7f4d971cd 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        ModuleBase_WidgetShapeSelector.h
 // Created:     2 June 2014
 // Author:      Vitaly Smetannikov
@@ -35,13 +37,10 @@ Q_OBJECT
   virtual ~ModuleBase_WidgetShapeSelector();
 
   /// Saves the internal parameters to the given feature
-  /// \param theObject a model feature to be changed
   virtual bool storeValue() const;
 
   virtual bool restoreValue();
 
-  virtual bool focusTo();
-
   /// Returns the internal parent wiget control, that can be shown anywhere
   /// \returns the widget
   QWidget* getControl() const
@@ -61,7 +60,15 @@ Q_OBJECT
   /// Set the given wrapped value to the current widget
   /// This value should be processed in the widget according to the needs
   /// \param theValue the wrapped widget value
-  virtual bool setValue(ModuleBase_WidgetValue* theValue);
+  virtual bool setSelection(ModuleBase_ViewerPrs theValue);
+
+
+  /// The methiod called when widget is activated
+  virtual void activate();
+
+  /// The methiod called when widget is deactivated
+  virtual void deactivate();
+
 
  public slots:
 
@@ -72,14 +79,12 @@ Q_OBJECT
   void onSelectionChanged();
 
  protected:
-  bool eventFilter(QObject* theObj, QEvent* theEvent);
-
   void updateSelectionName();
   void raisePanel() const;
 
   /// Returns true if shape of given object corresponds to requested shape type
   /// This method is called only in non sub-shapes selection mode
-  virtual bool acceptObjectShape(const ObjectPtr theObject) const;
+  //virtual bool acceptObjectShape(const ObjectPtr theObject) const;
 
   /// Returns true if selected shape corresponds to requested shape types
   /// This method is called only in sub-shapes selection mode
@@ -93,8 +98,14 @@ Q_OBJECT
   // Set the given object as a value of the widget
   void setObject(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape = std::shared_ptr<GeomAPI_Shape>());
 
+  /// Check the selected with validators if installed
+  virtual bool isValid(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape);
+
+  /// Clear attribute
+  void clearAttribute();
+
   //----------- Class members -------------
- private:
+ protected:
   QWidget* myContainer;
   QLabel* myLabel;
   QLineEdit* myTextLine;
@@ -107,9 +118,6 @@ Q_OBJECT
   QStringList myShapeTypes;
   QStringList myObjectTypes;
 
-  /// If true then local selector has to be activated in context
-  bool myUseSubShapes;
-
   bool myIsActive;
 
   Handle(ModuleBase_ObjectTypesFilter) myObjTypeFilter;