Salome HOME
d8ffff0d4835507537810b31c1f2faec97e7b42f
[modules/geom.git] / src / RepairGUI / RepairGUI_InspectObjectDlg.h
1 // Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef RepairGUI_InspectObjectDlg_H
21 #define RepairGUI_InspectObjectDlg_H
22
23 // GEOM includes
24 #include <GEOMBase_Helper.h>
25
26 // Qt includes
27 #include <QDialog>
28 #include <QPointer>
29 #include <QIcon>
30
31 class GeometryGUI;
32 class SalomeApp_DoubleSpinBox;
33
34 class QButtonGroup;
35 class QComboBox;
36 class QGroupBox;
37 class QLabel;
38 class QLineEdit;
39 class QPushButton;
40 class QStackedLayout;
41 class QTreeWidget;
42 class QTreeWidgetItem;
43
44 class TopTools_IndexedMapOfShape;
45
46 class RepairGUI_InspectObjectDlg : public QDialog, public GEOMBase_Helper
47
48   Q_OBJECT
49
50   class TreeWidgetItem;
51   class Delegate;
52
53 public:
54   RepairGUI_InspectObjectDlg(GeometryGUI*, SUIT_Desktop* );
55   ~RepairGUI_InspectObjectDlg();
56
57 private slots:
58   void                    onEditMainShape();
59
60   void                    onItemClicked( QTreeWidgetItem*, int );
61   void                    onItemChanged( QTreeWidgetItem*, int );
62   void                    onItemSelectionChanged();
63   void                    onItemExpanded( QTreeWidgetItem* );
64   void                    onHeaderClicked( int );
65
66   void                    onViewSelectionChanged();
67
68   void                    onWindowActivated( SUIT_ViewWindow* );
69   void                    onCloseView( SUIT_ViewWindow* );
70
71   void                    clickOnShow();
72   void                    clickOnShowOnly();
73   void                    clickOnHide();
74   void                    clickOnPublish();
75   void                    clickOnHelp();
76   void                    clickOnResetToMin();
77   void                    clickOnResetToMax();
78   void                    clickOnShowAll();
79   void                    clickOnHideAll();
80   void                    DeactivateActiveDialog();
81   void                    ActivateThisDialog();
82   void                    onFilterToggled(bool);
83   void                    onInitFilteredData();
84   void                    onFilterData();
85
86 private:
87   void                    createTreeWidget(QTreeWidget *&theTreeObjects);
88   void                    init();
89   void                    initSpinBox(SalomeApp_DoubleSpinBox* spinBox, 
90                                       double min,  double max, 
91                                       double step, const char* quantity);
92   void                    initTreeWidget(QTreeWidget *theTopLevelItem);
93   void                    enterEvent( QEvent* );
94   void                    checkVisibleIcon();
95   void                    addSubObjects( TreeWidgetItem*, const TopTools_IndexedMapOfShape &);
96
97   void                    displayItem( TreeWidgetItem* );
98   void                    setItemDisplayStatus( TreeWidgetItem* theItem, bool theIsVisible );
99   void                    setMainObjectTransparency( double );
100   void                    restoreParam();
101   void                    updateViewer(const bool theIsHideOtherTree);
102
103   QPointer<SUIT_ViewWindow>  myViewWindow;
104   GeometryGUI*               myGeomGUI;
105
106   QIcon                      myVisible;
107   QIcon                      myInvisible;
108
109   QTreeWidget               *myTreeObjects;
110   QTreeWidget               *myFilteredTreeObjects;
111   QTreeWidget               *myCurrentTreeObjects;
112   QLineEdit                 *myEditMainShape;
113   QGroupBox                 *myTolFilterGrp;
114   QButtonGroup              *myShapeTypeBtnGrp;
115   QComboBox                 *myComparisonCompo;
116   SalomeApp_DoubleSpinBox   *myTolEdit;
117   QLabel                    *myMinTolValLabel;
118   QLabel                    *myMaxTolValLabel;
119   QStackedLayout            *myTreesLayout;
120   QPushButton               *myMinTolResetBtn;
121   QPushButton               *myMaxTolResetBtn;
122   double                     myMaxTol;
123   double                     myMinTol;
124   bool                       myIsSelectAll;
125   double                     myTransparency;
126
127 };
128
129 #endif