]> SALOME platform Git repositories - modules/geom.git/blob - src/MeasureGUI/MeasureGUI.cxx
Salome HOME
Fix issue 0020479: EDF 1116 GEOM: Create a group, "Add" button is inactive but "Selec...
[modules/geom.git] / src / MeasureGUI / MeasureGUI.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  GEOM GEOMGUI : GUI for Geometry component
23 //  File   : MeasureGUI.cxx
24 //  Author : Damien COQUERET
25 //  Module : GEOM
26 //  $Header$
27 //
28 #include "MeasureGUI.h"
29 #include "SUIT_Desktop.h"
30 #include "SUIT_Session.h"
31
32 #include "SalomeApp_Tools.h"
33 #include "SalomeApp_Application.h"
34
35 #include "MeasureGUI_PropertiesDlg.h"    // Method PROPERTIES
36 #include "MeasureGUI_CenterMassDlg.h"    // Method CENTER MASS
37 #include "MeasureGUI_NormaleDlg.h"       // Method NORMALE
38 #include "MeasureGUI_InertiaDlg.h"       // Method INERTIA
39 #include "MeasureGUI_BndBoxDlg.h"        // Method BNDBOX
40 #include "MeasureGUI_DistanceDlg.h"      // Method DISTANCE
41 #include "MeasureGUI_AngleDlg.h"         // Method ANGLE
42 #include "MeasureGUI_MaxToleranceDlg.h"  // Method MAXTOLERANCE
43 #include "MeasureGUI_WhatisDlg.h"        // Method WHATIS
44 #include "MeasureGUI_CheckShapeDlg.h"    // Method CHECKSHAPE
45 #include "MeasureGUI_CheckCompoundOfBlocksDlg.h" // Method CHECKCOMPOUND
46 #include "MeasureGUI_PointDlg.h"         // Method POINTCOORDINATES
47
48 //=======================================================================
49 // function : MeasureGUI()
50 // purpose  : Constructor
51 //=======================================================================
52 MeasureGUI::MeasureGUI( GeometryGUI* parent ) : GEOMGUI( parent )
53 {
54 }
55
56 //=======================================================================
57 // function : ~MeasureGUI()
58 // purpose  : Destructor
59 //=======================================================================
60 MeasureGUI::~MeasureGUI()
61 {
62 }
63
64
65 //=======================================================================
66 // function : OnGUIEvent()
67 // purpose  : 
68 //=======================================================================
69 bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
70 {
71   SalomeApp_Application* app = getGeometryGUI()->getApp();
72   if ( !app ) return false;
73
74   getGeometryGUI()->EmitSignalDeactivateDialog();
75
76   switch ( theCommandID )
77   {
78     case 701 : new MeasureGUI_PropertiesDlg  (getGeometryGUI(), parent); break; // LENGTH, AREA AND VOLUME
79     case 702 : new MeasureGUI_CenterMassDlg  (getGeometryGUI(), parent); break; // CENTER MASS
80     case 703 : new MeasureGUI_InertiaDlg     (getGeometryGUI(), parent); break; // INERTIA
81     case 704 : new MeasureGUI_NormaleDlg     (getGeometryGUI(), parent); break; // NORMALE
82     case 7041: new MeasureGUI_BndBoxDlg      (getGeometryGUI(), parent); break; // BOUNDING BOX
83     case 7042: new MeasureGUI_DistanceDlg    (getGeometryGUI(), parent); break; // MIN DISTANCE
84     case 7043: new MeasureGUI_AngleDlg       (getGeometryGUI(), parent); break; // ANGLE
85     case 705 : new MeasureGUI_MaxToleranceDlg(getGeometryGUI(), parent); break; // MAXTOLERANCE
86     case 706 : new MeasureGUI_WhatisDlg      (getGeometryGUI(), parent); break; // WHATIS
87     case 707 : new MeasureGUI_CheckShapeDlg  (getGeometryGUI(), parent); break; // CHECKSHAPE
88     case 7072: new MeasureGUI_CheckCompoundOfBlocksDlg  (getGeometryGUI(), parent); break; // CHECKCOMPOUND
89     case 708 : new MeasureGUI_PointDlg       (getGeometryGUI(), parent); break; // POINT COORDINATES
90
91     default: 
92       app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); 
93       break;
94   }
95   return true;
96 }
97
98
99 //=====================================================================================
100 // EXPORTED METHODS
101 //=====================================================================================
102 extern "C"
103 {
104 GEOM_MEASUREGUI_EXPORT
105   GEOMGUI* GetLibGUI( GeometryGUI* parent )
106   {
107     return new MeasureGUI( parent );
108   }
109 }