1 // Copyright (C) 2007-2015 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, or (at your option) any later version.
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"
36 class SUIT_SelectionFilter;
39 class SMESHGUI_IdValidator;
41 #include <SALOMEconfig.h>
42 #include CORBA_SERVER_HEADER(SMESH_Mesh)
44 class SMESHGUI_EXPORT SMESHGUI_MinDistance : public QWidget
48 enum { NoTgt, FirstTgt, SecondTgt };
49 enum { OriginTgt, NodeTgt, ElementTgt, ObjectTgt };
52 SMESHGUI_MinDistance( QWidget* = 0 );
53 ~SMESHGUI_MinDistance();
55 bool eventFilter( QObject*, QEvent* );
56 void updateSelection();
60 void setTarget( int );
62 void displayPreview();
63 void createPreview( double, double, double, double, double, double );
66 void selectionChanged();
75 QButtonGroup* myFirst;
76 QButtonGroup* mySecond;
77 QLineEdit* myFirstTgt;
78 QLineEdit* mySecondTgt;
82 QLineEdit* myDistance;
84 SMESH::SMESH_IDSource_var myFirstSrc;
85 SMESH::SMESH_IDSource_var mySecondSrc;
86 SMESH_Actor* myFirstActor;
87 SMESH_Actor* mySecondActor;
88 SMESHGUI_IdValidator* myValidator;
89 SUIT_SelectionFilter* myFilter;
90 SALOME_Actor* myPreview;
93 class SMESHGUI_EXPORT SMESHGUI_BoundingBox : public QWidget
97 enum { ObjectsSrc, NodesSrc, ElementsSrc };
100 SMESHGUI_BoundingBox( QWidget* = 0 );
101 ~SMESHGUI_BoundingBox();
103 void updateSelection();
108 void displayPreview();
109 void createPreview( double, double, double, double, double, double );
112 void selectionChanged();
113 void sourceChanged();
119 typedef QList<SMESH::SMESH_IDSource_var> SourceList;
120 QButtonGroup* mySourceMode;
132 SMESH_Actor* myActor;
133 SMESHGUI_IdValidator* myValidator;
135 SUIT_SelectionFilter* myFilter;
136 SALOME_Actor* myPreview;
139 class SMESHGUI_EXPORT SMESHGUI_BasicProperties : public QWidget
145 enum Mode { Length, Area, Volume };
147 SMESHGUI_BasicProperties( QWidget* = 0 );
148 ~SMESHGUI_BasicProperties();
150 void setMode( const Mode );
152 void updateSelection();
156 void selectionChanged();
157 void modeChanged( int);
162 QButtonGroup* myMode;
164 QGroupBox* myResultGrp;
166 SMESH::SMESH_IDSource_var mySrc;
167 SUIT_SelectionFilter* myFilter;
170 class SMESHGUI_EXPORT SMESHGUI_MeasureDlg : public QDialog
174 enum { NodeMode, ElemMode };
179 MinDistance, //!< minimum distance
180 BoundingBox, //!< bounding box
186 SMESHGUI_MeasureDlg( QWidget* = 0, int = MinDistance );
187 ~SMESHGUI_MeasureDlg();
192 void keyPressEvent( QKeyEvent* );
193 void enterEvent( QEvent* );
197 void updateSelection();
202 QTabWidget* myTabWidget;
203 SMESHGUI_MinDistance* myMinDist;
204 SMESHGUI_BoundingBox* myBndBox;
205 SMESHGUI_BasicProperties* myBasicProps;
208 #endif // SMESHGUI_MEASUREMENTS_H