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 : GeometryGUI.h
25 // Author : Lucien PIGNOLONI
32 #include "SALOMEGUI.h"
35 #include "GEOM_Client.hxx"
36 #include "SALOME_InteractiveObject.hxx"
41 typedef QMap<QString, GEOMGUI*> GUIMap;
46 //=================================================================================
47 // class : GeometryGUI
49 //=================================================================================
50 class GeometryGUI : public SALOMEGUI
56 GeometryGUI(); // hide constructor to avoid direct creation
57 // get or load GUI library by name
58 GEOMGUI* getLibrary( const QString& libraryName );
64 // Get the only GeometryGUI object
65 static GeometryGUI* GetGeomGUI();
67 static CORBA::ORB_var GetORB();
69 GEOM::GEOM_Gen_ptr GetGeomGen() { return myComponentGeom; }
70 GEOM_Client& GetShapeReader() { return myShapeReader; }
71 Standard_CString& GetFatherior() { return myFatherior; }
72 void SetState( const int state ) { myState = state; }
73 int GetState() const { return myState; }
75 // Get active dialog box
76 QDialog* GetActiveDialogBox(){ return myActiveDialogBox; }
77 // Set active dialog box
78 void SetActiveDialogBox( QDialog* aDlg );
80 // Non modal dialog boxes management
81 void EmitSignalDeactivateDialog();
82 void EmitSignalCloseAllDialogs();
83 void EmitSignalDefaultStepValueChanged( double newVal );
85 // The following methods are called from IAPP
86 virtual bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
87 virtual bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
88 virtual bool OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
89 virtual bool OnKeyPress(QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
90 virtual bool SetSettings(QAD_Desktop* parent);
91 virtual bool ActiveStudyChanged(QAD_Desktop* parent);
92 virtual void Deactivate();
93 virtual void BuildPresentation( const Handle(SALOME_InteractiveObject)&,
95 virtual void SupportedViewType (int* buffer, int bufferSize);
96 virtual void DefinePopup(QString & theContext, QString & theParent, QString & theObject);
97 virtual bool CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext,
98 const QString& theParent, const QString& theObject);
100 // The Working Plane management
101 void SetWorkingPlane(gp_Ax3 WorkingPlane) { myWorkingPlane = WorkingPlane; };
102 gp_Ax3 GetWorkingPlane() { return myWorkingPlane; };
103 void ActiveWorkingPlane();
106 void SignalDeactivateActiveDialog();
107 void SignalCloseAllDialogs();
108 void SignalDefaultStepValueChanged( double newVal );
111 static GeometryGUI* myContext; // the only GeometryGUI object
113 GUIMap myGUIMap; // GUI libraries map
114 QDialog* myActiveDialogBox; // active dialog box
115 GEOM_Client myShapeReader; // geom shape reader
116 Standard_CString myFatherior;
117 GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine
118 int myState; // identify a method
119 gp_Ax3 myWorkingPlane;