1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESHGUI_Measurements.h
23 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
25 #ifndef SMESHGUI_MEASUREMENTS_H
26 #define SMESHGUI_MEASUREMENTS_H
28 #include "SMESH_SMESHGUI.hxx"
35 class SUIT_SelectionFilter;
38 class SMESHGUI_IdValidator;
40 #include <SALOMEconfig.h>
41 #include CORBA_SERVER_HEADER(SMESH_Mesh)
43 class SMESHGUI_EXPORT SMESHGUI_MinDistance : public QWidget
47 enum { NoTgt, FirstTgt, SecondTgt };
48 enum { OriginTgt, NodeTgt, ElementTgt, ObjectTgt };
51 SMESHGUI_MinDistance( QWidget* = 0 );
52 ~SMESHGUI_MinDistance();
54 bool eventFilter( QObject*, QEvent* );
55 void updateSelection();
59 void setTarget( int );
61 void displayPreview();
62 void createPreview( double, double, double, double, double, double );
65 void selectionChanged();
74 QButtonGroup* myFirst;
75 QButtonGroup* mySecond;
76 QLineEdit* myFirstTgt;
77 QLineEdit* mySecondTgt;
81 QLineEdit* myDistance;
83 SMESH::SMESH_IDSource_var myFirstSrc;
84 SMESH::SMESH_IDSource_var mySecondSrc;
85 SMESH_Actor* myFirstActor;
86 SMESH_Actor* mySecondActor;
87 SMESHGUI_IdValidator* myValidator;
88 SUIT_SelectionFilter* myFilter;
89 SALOME_Actor* myPreview;
92 class SMESHGUI_EXPORT SMESHGUI_BoundingBox : public QWidget
96 enum { ObjectsSrc, NodesSrc, ElementsSrc };
99 SMESHGUI_BoundingBox( QWidget* = 0 );
100 ~SMESHGUI_BoundingBox();
102 void updateSelection();
107 void displayPreview();
108 void createPreview( double, double, double, double, double, double );
111 void selectionChanged();
112 void sourceChanged();
118 typedef QList<SMESH::SMESH_IDSource_var> SourceList;
119 QButtonGroup* mySourceMode;
131 SMESH_Actor* myActor;
132 SMESHGUI_IdValidator* myValidator;
134 SUIT_SelectionFilter* myFilter;
135 SALOME_Actor* myPreview;
138 class SMESHGUI_EXPORT SMESHGUI_MeasureDlg : public QDialog
142 enum { NodeMode, ElemMode };
147 MinDistance, //!< minimum distance
148 BoundingBox //!< bounding box
151 SMESHGUI_MeasureDlg( QWidget* = 0, int = MinDistance );
152 ~SMESHGUI_MeasureDlg();
157 void keyPressEvent( QKeyEvent* );
158 void enterEvent( QEvent* );
162 void updateSelection();
167 QTabWidget* myTabWidget;
168 SMESHGUI_MinDistance* myMinDist;
169 SMESHGUI_BoundingBox* myBndBox;
172 #endif // SMESHGUI_MEASUREMENTS_H