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 "SalomeApp_Module.h"
35 #include "GEOM_Client.hxx"
36 #include "SALOME_InteractiveObject.hxx"
41 typedef QMap<QString, GEOMGUI*> GUIMap;
45 class GEOMGUI_OCCSelector;
46 class SalomeApp_VTKSelector;
47 class SUIT_ViewManager;
50 //=================================================================================
51 // class : GeometryGUI
53 //=================================================================================
54 class GeometryGUI : public SalomeApp_Module
65 virtual void initialize( CAM_Application* );
66 virtual QString engineIOR() const;
68 static GEOM::GEOM_Gen_var 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 void OnGUIEvent( int id );
87 virtual bool OnKeyPress( QKeyEvent*, SUIT_ViewWindow* );
88 virtual bool OnMousePress( QMouseEvent*, SUIT_ViewWindow* );
89 virtual bool OnMouseMove( QMouseEvent*, SUIT_ViewWindow* );
91 // virtual bool SetSettings();
92 // virtual void SupportedViewType ( int* buffer, int bufferSize );
93 virtual void BuildPresentation( const Handle(SALOME_InteractiveObject)&, SUIT_ViewWindow* = 0 );
95 // virtual void DefinePopup( QString & theContext, QString & theParent, QString & theObject);
96 // virtual bool CustomPopup( QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext,
97 // const QString& theParent, const QString& theObject );
99 // The Working Plane management
100 void SetWorkingPlane( gp_Ax3 wp ) { myWorkingPlane = wp; }
101 gp_Ax3 GetWorkingPlane() { return myWorkingPlane; }
102 void ActiveWorkingPlane();
104 virtual void windows( QMap<int, int>& ) const;
105 virtual void viewManagers( QStringList& ) const;
109 virtual void deactivateModule( SUIT_Study* );
110 virtual void activateModule( SUIT_Study* );
114 void onViewManagerAdded( SUIT_ViewManager* );
115 void onViewManagerRemoved( SUIT_ViewManager* );
116 void onWindowActivated( SUIT_ViewWindow* );
119 void SignalDeactivateActiveDialog();
120 void SignalCloseAllDialogs();
121 void SignalDefaultStepValueChanged( double newVal );
124 virtual SalomeApp_Selection* createSelection() const;
127 GEOMGUI* getLibrary( const QString& libraryName );
128 void createGeomAction( const int id, const QString& po_id, const QString& icon_id = QString(""), const int key = 0, const bool toggle = false );
129 void createPopupItem( const int, const QString& clients, const QString& types,
130 const bool isSingle = false, const int isVisible = -1,
131 const bool isExpandAll = false, const bool isOCC = false, const int parentId = -1 );
134 static GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine
136 GUIMap myGUIMap; // GUI libraries map
137 QDialog* myActiveDialogBox; // active dialog box
138 GEOM_Client myShapeReader; // geom shape reader
139 Standard_CString myFatherior;
140 int myState; // identify a method
141 gp_Ax3 myWorkingPlane;
142 QMap<int,QString> myRules; // popup rules
144 QPtrList<GEOMGUI_OCCSelector> myOCCSelectors;
145 QPtrList<SalomeApp_VTKSelector> myVTKSelectors;