1 // Copyright (C) 2007-2021 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;
40 class SMESHGUI_MeshEditPreview;
42 #include <SALOMEconfig.h>
43 #include CORBA_SERVER_HEADER(SMESH_Mesh)
47 class SMESHGUI_EXPORT SMESHGUI_MinDistance : public QWidget
51 enum { NoTgt, FirstTgt, SecondTgt };
52 enum { OriginTgt, NodeTgt, ElementTgt, ObjectTgt };
55 SMESHGUI_MinDistance( QWidget* = 0 );
56 ~SMESHGUI_MinDistance();
58 bool eventFilter( QObject*, QEvent* );
59 void updateSelection();
63 void setTarget( int );
65 void displayPreview();
66 void createPreview( double, double, double, double, double, double );
69 void selectionChanged();
78 QButtonGroup* myFirst;
79 QButtonGroup* mySecond;
80 QLineEdit* myFirstTgt;
81 QLineEdit* mySecondTgt;
85 QLineEdit* myDistance;
87 SMESH::SMESH_IDSource_var myFirstSrc;
88 SMESH::SMESH_IDSource_var mySecondSrc;
89 SMESH_Actor* myFirstActor;
90 SMESH_Actor* mySecondActor;
91 SMESHGUI_IdValidator* myValidator;
92 SUIT_SelectionFilter* myFilter;
93 SALOME_Actor* myPreview;
96 class SMESHGUI_EXPORT SMESHGUI_BoundingBox : public QWidget
100 enum { ObjectsSrc, NodesSrc, ElementsSrc };
103 SMESHGUI_BoundingBox( QWidget* = 0 );
104 ~SMESHGUI_BoundingBox();
106 void updateSelection();
111 void displayPreview();
112 void createPreview( double, double, double, double, double, double );
115 void selectionChanged();
116 void sourceChanged();
122 typedef QList<SMESH::SMESH_IDSource_var> SourceList;
123 QButtonGroup* mySourceMode;
135 SMESH_Actor* myActor;
136 SMESHGUI_IdValidator* myValidator;
138 SUIT_SelectionFilter* myFilter;
139 SALOME_Actor* myPreview;
142 class SMESHGUI_EXPORT SMESHGUI_BasicProperties : public QWidget
148 enum Mode { Length, Area, Volume };
150 SMESHGUI_BasicProperties( QWidget* = 0 );
151 ~SMESHGUI_BasicProperties();
153 void setMode( const Mode );
155 void updateSelection();
159 void selectionChanged();
160 void modeChanged( int);
165 QButtonGroup* myMode;
167 QGroupBox* myResultGrp;
169 SMESH::SMESH_IDSource_var mySrc;
170 SUIT_SelectionFilter* myFilter;
173 class SMESHGUI_EXPORT SMESHGUI_Angle : public QWidget
179 SMESHGUI_Angle( QWidget* = 0 );
183 void updateSelection();
186 void selectionChanged();
193 bool addPointByActor( int id );
194 bool addPointByIDSource( int id );
195 gp_Vec getNormal(const gp_Vec& vec10 );
200 SMESH::SMESH_IDSource_var myIDSrc;
201 SMESH_Actor* myActor;
203 std::vector< SMESH::PointStruct > myPoints;
204 SMESHGUI_MeshEditPreview* myPreview;
207 class SMESHGUI_EXPORT SMESHGUI_MeasureDlg : public QDialog
211 enum { NodeMode, ElemMode };
216 MinDistance, //!< minimum distance
217 BoundingBox, //!< bounding box
224 SMESHGUI_MeasureDlg( QWidget* = 0, int = MinDistance );
225 ~SMESHGUI_MeasureDlg();
230 void keyPressEvent( QKeyEvent* );
231 void enterEvent( QEvent* );
235 void updateSelection();
240 QTabWidget* myTabWidget;
241 SMESHGUI_MinDistance* myMinDist;
242 SMESHGUI_BoundingBox* myBndBox;
243 SMESHGUI_BasicProperties* myBasicProps;
244 SMESHGUI_Angle* myAngle;
247 #endif // SMESHGUI_MEASUREMENTS_H