1 // Copyright (C) 2007-2010 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;
37 class SMESHGUI_IdValidator;
39 #include <SALOMEconfig.h>
40 #include CORBA_SERVER_HEADER(SMESH_Mesh)
42 class SMESHGUI_EXPORT SMESHGUI_MinDistance : public QWidget
46 enum { NoTgt, FirstTgt, SecondTgt };
47 enum { OriginTgt, NodeTgt, ElementTgt, ObjectTgt };
50 SMESHGUI_MinDistance( QWidget* = 0 );
51 ~SMESHGUI_MinDistance();
53 bool eventFilter( QObject*, QEvent* );
54 void updateSelection();
58 void setTarget( int );
61 void selectionChanged();
70 QButtonGroup* myFirst;
71 QButtonGroup* mySecond;
72 QLineEdit* myFirstTgt;
73 QLineEdit* mySecondTgt;
77 QLineEdit* myDistance;
79 SMESH::SMESH_IDSource_var myFirstSrc;
80 SMESH::SMESH_IDSource_var mySecondSrc;
81 SMESH_Actor* myFirstActor;
82 SMESH_Actor* mySecondActor;
83 SMESHGUI_IdValidator* myValidator;
84 SUIT_SelectionFilter* myFilter;
87 class SMESHGUI_EXPORT SMESHGUI_BoundingBox : public QWidget
91 enum { ObjectsSrc, NodesSrc, ElementsSrc };
94 SMESHGUI_BoundingBox( QWidget* = 0 );
95 ~SMESHGUI_BoundingBox();
97 void updateSelection();
101 void selectionChanged();
102 void sourceChanged();
108 typedef QList<SMESH::SMESH_IDSource_var> SourceList;
109 QButtonGroup* mySourceMode;
121 SMESH_Actor* myActor;
122 SMESHGUI_IdValidator* myValidator;
124 SUIT_SelectionFilter* myFilter;
127 class SMESHGUI_EXPORT SMESHGUI_MeasureDlg : public QDialog
131 enum { NodeMode, ElemMode };
136 MinDistance, //!< minimum distance
137 BoundingBox //!< bounding box
140 SMESHGUI_MeasureDlg( QWidget* = 0, int = MinDistance );
141 ~SMESHGUI_MeasureDlg();
146 void keyPressEvent( QKeyEvent* );
147 void enterEvent( QEvent* );
151 void updateSelection();
156 QTabWidget* myTabWidget;
157 SMESHGUI_MinDistance* myMinDist;
158 SMESHGUI_BoundingBox* myBndBox;
161 #endif // SMESHGUI_MEASUREMENTS_H