1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_WidgetConcealedObjects.h
4 // Created: 29 Jul 2016
5 // Author: Natalia ERMOLAEVA
7 #ifndef MODULEBASE_WIDGETCONCEALEDOBJECTS_H_
8 #define MODULEBASE_WIDGETCONCEALEDOBJECTS_H_
10 #include <ModuleBase.h>
11 #include <ModuleBase_ModelWidget.h>
17 class ModelAPI_Object;
24 * Implementation of model widget for table of concealed objects.
26 class MODULEBASE_EXPORT ModuleBase_WidgetConcealedObjects : public ModuleBase_ModelWidget
31 /// \param theParent the parent object
32 /// \param theData the widget configuration.
33 ModuleBase_WidgetConcealedObjects(QWidget* theParent,
34 const Config_WidgetAPI* theData);
35 virtual ~ModuleBase_WidgetConcealedObjects();
37 /// Redefinition of virtual method
38 virtual QList<QWidget*> getControls() const;
40 /// The widget can not accept focus
41 virtual bool canAcceptFocus() const { return false; };
44 /// Saves the internal parameters to the given feature
45 /// \return True in success
46 virtual bool storeValueCustom();
48 /// Redefinition of virtual method
49 virtual bool restoreValueCustom();
52 /// Creates a row in view
53 /// \param theResult a result for the row
54 void addViewRow(const std::shared_ptr<ModelAPI_Result>& theResult);
57 /// Processes the display button click in the view.
58 /// \param theState a new state
59 void onItemToggled(bool theState);
62 std::string myBaseShapeAttribute; ///< attribute of the base object
63 QTableWidget* myView; ///< table view of visibility states
65 std::shared_ptr<ModelAPI_Feature> myBaseFeature; ///< backup of feature of filling the table view
66 /// backup of visualized in the view concealed objects, stored to avoid table rebuild by restore
67 std::map<int, std::shared_ptr<ModelAPI_Result> > myConcealedResults;
70 #endif /* MODULEBASE_WIDGETCONCEALEDOBJECTS_H_ */