X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetValidated.h;h=0ac6657e7d302fe66846362903933581a8412ec6;hb=c8e35a67c60489a46aaf7c8ff75001511ac2635b;hp=31e7b81ac27a43e2167c06f44355b97db40e129a;hpb=a24b7e6f4d112d5e7889fd76f030298fc428cd01;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.h b/src/ModuleBase/ModuleBase_WidgetValidated.h index 31e7b81ac..0ac6657e7 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.h +++ b/src/ModuleBase/ModuleBase_WidgetValidated.h @@ -18,6 +18,8 @@ class QWidget; class ModuleBase_IWorkshop; +class ModuleBase_ISelection; +class ModelAPI_Validator; class Config_WidgetAPI; class Handle_SelectMgr_EntityOwner; @@ -41,14 +43,15 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidated : public ModuleBase_ModelWidg /// Checks all widget validator if the owner is valid /// \param theOwner a selected owner in the view /// \return a boolean value - bool isValid(const Handle_SelectMgr_EntityOwner& theOwner); + bool isValidSelection(const ModuleBase_ViewerPrs& theValue); /// Set the given wrapped value to the current widget /// This value should be processed in the widget according to the needs /// The method is called by the current operation to process the operation preselection. /// It is redefined to check the value validity and if it is, fill the attribute with by value - /// \param theValue the wrapped widget value - virtual bool setSelection(ModuleBase_ViewerPrs theValue); + /// \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& theValues, int& thePosition); protected: /// Creates a backup of the current values of the attribute @@ -64,7 +67,7 @@ protected: /// Fills the attribute with the value of the selected owner /// \param theOwner a selected owner - virtual bool setSelection(const Handle_SelectMgr_EntityOwner& theOwner) = 0; + virtual bool setSelectionCustom(const ModuleBase_ViewerPrs& thePrs) = 0; virtual void removePresentations() {}; @@ -76,6 +79,22 @@ protected: /// \param theWorkshop an active workshop /// \param toActivate a flag about activation or deactivation the filters virtual void activateFilters(ModuleBase_IWorkshop* theWorkshop, const bool toActivate) const; + + /// Puts additional validators to the given list + /// \param theValidators a list of validators + /// \param theArguments a list of validators arguments + virtual void customValidators(std::list& theValidators, + std::list >& theArguments) const; + + /// Returns a list of selected presentations. Firstly it is obtained from the viewer, + /// if there are not selected objects in the viewer, it get the selection from the object browser. + /// If the browser has selected objects, the viewer prs objects are created with only object + /// field of the presentation initialized. The widget should accept the selection in the object + /// browser at the same way as in the viewer. + /// \param theSelection a selection, where the selected objects and presentations are found + /// \return a list of presentations + QList getSelectedEntitiesOrObjects(ModuleBase_ISelection* theSelection) const; + }; #endif /* MODULEBASE_WIDGETVALIDATED_H_ */