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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : TransformationGUI.cxx
25 // Author : Damien COQUERET
30 #include "TransformationGUI.h"
31 #include "GeometryGUI.h"
33 #include "SUIT_Session.h"
34 #include "SUIT_Desktop.h"
36 #include "TransformationGUI_MultiTranslationDlg.h" // Method MULTI TRANSLATION
37 #include "TransformationGUI_MultiRotationDlg.h" // Method MULTI ROTATION
38 #include "TransformationGUI_TranslationDlg.h" // Method TRANSLATION
39 #include "TransformationGUI_RotationDlg.h" // Method ROTATION
40 #include "TransformationGUI_MirrorDlg.h" // Method MIRROR
41 #include "TransformationGUI_ScaleDlg.h" // Method SCALE
42 #include "TransformationGUI_OffsetDlg.h" // Method OFFSET
43 #include "TransformationGUI_PositionDlg.h" // Method POSITION
45 TransformationGUI* TransformationGUI::myGUIObject = 0;
47 //=======================================================================
48 // function : GetTransformationGUI()
49 // purpose : Get the only TransformationGUI object [ static ]
50 //=======================================================================
51 TransformationGUI* TransformationGUI::GetTransformationGUI( GeometryGUI* parent )
53 if ( myGUIObject == 0 ) {
54 // init TransformationGUI only once
55 myGUIObject = new TransformationGUI( parent );
60 //=======================================================================
61 // function : TransformationGUI()
62 // purpose : Constructor
63 //=======================================================================
64 TransformationGUI::TransformationGUI(GeometryGUI* parent) : GEOMGUI(parent)
69 //=======================================================================
70 // function : ~TransformationGUI()
71 // purpose : Destructor
72 //=======================================================================
73 TransformationGUI::~TransformationGUI()
78 //=======================================================================
79 // function : OnGUIEvent()
81 //=======================================================================
82 bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
84 getGeometryGUI()->EmitSignalDeactivateDialog();
89 case 5021: // TRANSLATION
91 aDlg = new TransformationGUI_TranslationDlg( getGeometryGUI(), parent, "" );
94 case 5022: // ROTATION
96 aDlg = new TransformationGUI_RotationDlg( parent, "" );
99 case 5023: // POSITION
101 aDlg = new TransformationGUI_PositionDlg( parent, "" );
106 aDlg = new TransformationGUI_MirrorDlg( parent, "" );
111 aDlg = new TransformationGUI_ScaleDlg( getGeometryGUI(), parent, "" );
116 aDlg = new TransformationGUI_OffsetDlg( parent, "" );
119 case 5027: // MULTI TRANSLATION
121 aDlg = new TransformationGUI_MultiTranslationDlg( getGeometryGUI(), parent, "" );
124 case 5028: // MULTI ROTATION
126 aDlg = new TransformationGUI_MultiRotationDlg( getGeometryGUI(), parent, "" );
131 SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
143 //=====================================================================================
145 //=====================================================================================
148 GEOMGUI* GetLibGUI( GeometryGUI* parent )
150 return TransformationGUI::GetTransformationGUI( parent );