1 // GEOM GEOMGUI : GUI for Geometry component
3 // Copyright (C) 2003 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 : MeasureGUI.cxx
23 // Author : Damien COQUERET, Open CASCADE S.A.S.
26 #include "MeasureGUI.h"
28 #include <GeometryGUI.h>
29 #include <SUIT_Desktop.h>
30 #include <SalomeApp_Application.h>
32 #include "MeasureGUI_PropertiesDlg.h" // Method PROPERTIES
33 #include "MeasureGUI_CenterMassDlg.h" // Method CENTER MASS
34 #include "MeasureGUI_InertiaDlg.h" // Method INERTIA
35 #include "MeasureGUI_BndBoxDlg.h" // Method BNDBOX
36 #include "MeasureGUI_DistanceDlg.h" // Method DISTANCE
37 #include "MeasureGUI_MaxToleranceDlg.h" // Method MAXTOLERANCE
38 #include "MeasureGUI_WhatisDlg.h" // Method WHATIS
39 #include "MeasureGUI_CheckShapeDlg.h" // Method CHECKSHAPE
40 #include "MeasureGUI_CheckCompoundOfBlocksDlg.h" // Method CHECKCOMPOUND
41 #include "MeasureGUI_PointDlg.h" // Method POINTCOORDINATES
43 #include <QApplication>
45 //=======================================================================
46 // function : MeasureGUI()
47 // purpose : Constructor
48 //=======================================================================
49 MeasureGUI::MeasureGUI( GeometryGUI* parent ) : GEOMGUI( parent )
53 //=======================================================================
54 // function : ~MeasureGUI()
55 // purpose : Destructor
56 //=======================================================================
57 MeasureGUI::~MeasureGUI()
62 //=======================================================================
63 // function : OnGUIEvent()
65 //=======================================================================
66 bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
68 SalomeApp_Application* app = getGeometryGUI()->getApp();
69 if ( !app ) return false;
71 getGeometryGUI()->EmitSignalDeactivateDialog();
74 switch ( theCommandID ) {
76 dlg = new MeasureGUI_PropertiesDlg( getGeometryGUI(), parent );
77 break; // LENGTH, AREA AND VOLUME
79 dlg = new MeasureGUI_CenterMassDlg( getGeometryGUI(), parent );
82 dlg = new MeasureGUI_InertiaDlg( getGeometryGUI(), parent );
85 dlg = new MeasureGUI_BndBoxDlg( getGeometryGUI(), parent );
86 break; // BOUNDING BOX
88 dlg = new MeasureGUI_DistanceDlg( getGeometryGUI(), parent );
89 break; // MIN DISTANCE
91 dlg = new MeasureGUI_MaxToleranceDlg( getGeometryGUI(), parent );
92 break; // MAXTOLERANCE
94 dlg = new MeasureGUI_WhatisDlg( getGeometryGUI(), parent );
97 dlg = new MeasureGUI_CheckShapeDlg( getGeometryGUI(), parent );
100 dlg = new MeasureGUI_CheckCompoundOfBlocksDlg( getGeometryGUI(), parent );
101 break; // CHECKCOMPOUND
103 dlg = new MeasureGUI_PointDlg( getGeometryGUI(), parent );
104 break; // POINT COORDINATES
106 app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
110 dlg->updateGeometry();
111 dlg->resize( dlg->minimumSize() );
118 //=====================================================================================
120 //=====================================================================================
124 __declspec( dllexport )
126 GEOMGUI* GetLibGUI( GeometryGUI* parent )
128 return new MeasureGUI( parent );