Version: 8.3.0
SMESHGUI_Measurements.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File : SMESHGUI_Measurements.h
23 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
24 
25 #ifndef SMESHGUI_MEASUREMENTS_H
26 #define SMESHGUI_MEASUREMENTS_H
27 
28 #include "SMESH_SMESHGUI.hxx"
29 
30 #include <QDialog>
31 
32 class QButtonGroup;
33 class QLineEdit;
34 class QTabWidget;
35 class QGroupBox;
37 class SALOME_Actor;
38 class SMESH_Actor;
40 
41 #include <SALOMEconfig.h>
42 #include CORBA_SERVER_HEADER(SMESH_Mesh)
43 
45 {
46  Q_OBJECT;
47 
48  enum { NoTgt, FirstTgt, SecondTgt };
49  enum { OriginTgt, NodeTgt, ElementTgt, ObjectTgt };
50 
51 public:
54 
55  bool eventFilter( QObject*, QEvent* );
56  void updateSelection();
57  void deactivate();
58 
59 private:
60  void setTarget( int );
61  void erasePreview();
62  void displayPreview();
63  void createPreview( double, double, double, double, double, double );
64 
65 private slots:
66  void selectionChanged();
67  void firstChanged();
68  void secondChanged();
69  void firstEdited();
70  void secondEdited();
71  void compute();
72  void clear();
73 
74 private:
75  QButtonGroup* myFirst;
76  QButtonGroup* mySecond;
77  QLineEdit* myFirstTgt;
78  QLineEdit* mySecondTgt;
79  QLineEdit* myDX;
80  QLineEdit* myDY;
81  QLineEdit* myDZ;
82  QLineEdit* myDistance;
84  SMESH::SMESH_IDSource_var myFirstSrc;
85  SMESH::SMESH_IDSource_var mySecondSrc;
91 };
92 
94 {
95  Q_OBJECT;
96 
97  enum { ObjectsSrc, NodesSrc, ElementsSrc };
98 
99 public:
102 
103  void updateSelection();
104  void deactivate();
105  void erasePreview();
106 
107 private:
108  void displayPreview();
109  void createPreview( double, double, double, double, double, double );
110 
111 private slots:
112  void selectionChanged();
113  void sourceChanged();
114  void sourceEdited();
115  void compute();
116  void clear();
117 
118 private:
119  typedef QList<SMESH::SMESH_IDSource_var> SourceList;
120  QButtonGroup* mySourceMode;
121  QLineEdit* mySource;
122  QLineEdit* myXmin;
123  QLineEdit* myXmax;
124  QLineEdit* myDX;
125  QLineEdit* myYmin;
126  QLineEdit* myYmax;
127  QLineEdit* myDY;
128  QLineEdit* myZmin;
129  QLineEdit* myZmax;
130  QLineEdit* myDZ;
134  QString myIDs;
137 };
138 
140 {
141  Q_OBJECT;
142 
143 public:
145  enum Mode { Length, Area, Volume };
146 
149 
150  void setMode( const Mode );
151 
152  void updateSelection();
153  void deactivate();
154 
155 private slots:
156  void selectionChanged();
157  void modeChanged( int);
158  void compute();
159  void clear();
160 
161 private:
162  QButtonGroup* myMode;
163  QLineEdit* mySource;
165  QLineEdit* myResult;
166  SMESH::SMESH_IDSource_var mySrc;
168 };
169 
171 {
172  Q_OBJECT;
173 
174  enum { NodeMode, ElemMode };
175 
176 public:
178  enum {
184  };
185 
186  SMESHGUI_MeasureDlg( QWidget* = 0, int = MinDistance );
188 
189  void reject();
190 
191 protected:
192  void keyPressEvent( QKeyEvent* );
193  void enterEvent( QEvent* );
194 
195 private slots:
196  void help();
197  void updateSelection();
198  void activate();
199  void deactivate();
200 
201 private:
202  QTabWidget* myTabWidget;
206 };
207 
208 #endif // SMESHGUI_MEASUREMENTS_H