Salome HOME
Merge with OCC-V2_1_0_deb
[modules/geom.git] / src / GEOMGUI / GeometryGUI.h
index 06649f6226f723d8552b4a2b3597109eda8726d1..255c46f128d50d95318eae5590d65d142a04ecfa 100644 (file)
 #define GEOMETRYGUI_H
 
 #include "SALOMEGUI.h"
-#include "GEOMContext.h"
+
+#include "GEOMGUI.h"
+#include "GEOM_Client.hxx"
+#include "SALOME_InteractiveObject.hxx"
+#include <qmap.h>
+
+#include "gp_Ax3.hxx"
+
+typedef QMap<QString, GEOMGUI*> GUIMap;
+
+class QDialog;
+class QPopupMenu;
 
 //=================================================================================
 // class    : GeometryGUI
 //=================================================================================
 class GeometryGUI : public SALOMEGUI
 {
-  Q_OBJECT /* for QT compatibility */
+  Q_OBJECT;
+
+protected:
+  // Constructor
+  GeometryGUI(); // hide constructor to avoid direct creation
+  // get or load GUI library by name
+  GEOMGUI* getLibrary( const QString& libraryName );
 
-public :
-  GeometryGUI( const QString& name = "", QObject* parent = 0 );
+public:
+  // Destructor
   ~GeometryGUI();
+
+  // Get the only GeometryGUI object
+  static GeometryGUI*         GetGeomGUI();
+
+  static CORBA::ORB_var       GetORB();
+
+  GEOM::GEOM_Gen_ptr          GetGeomGen()        { return myComponentGeom; }
+  GEOM_Client&                GetShapeReader()    { return myShapeReader; }
+  Standard_CString&           GetFatherior()      { return myFatherior; }
+  void                        SetState( const int state ) { myState = state; }
+  int                         GetState() const    { return myState; }
   
-  static GEOMContext* GetOrCreateGeometryGUI(QAD_Desktop* desktop);
-  
-  /* Managed by IAPP */
+  // Get active dialog box
+  QDialog*                    GetActiveDialogBox(){ return myActiveDialogBox; }
+  // Set active dialog box
+  void                        SetActiveDialogBox( QDialog* aDlg );
+
+  // Non modal dialog boxes management
+  void                        EmitSignalDeactivateDialog();
+  void                        EmitSignalCloseAllDialogs();
+  void                        EmitSignalDefaultStepValueChanged( double newVal );
+
+  // The following methods are called from IAPP
   virtual bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
   virtual bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
   virtual bool OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
   virtual bool OnKeyPress(QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
   virtual bool SetSettings(QAD_Desktop* parent);
   virtual bool ActiveStudyChanged(QAD_Desktop* parent);
-  virtual void BuildPresentation(const Handle(SALOME_InteractiveObject)&);
+  virtual void Deactivate();
+  virtual void BuildPresentation( const Handle(SALOME_InteractiveObject)&,
+                                  QAD_ViewFrame*  = 0 );
+  virtual void SupportedViewType (int* buffer, int bufferSize);
   virtual void DefinePopup(QString & theContext, QString & theParent, QString & theObject);
   virtual bool CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext,
                           const QString& theParent, const QString& theObject);
-  virtual void SupportedViewType (int* buffer, int bufferSize);
-  virtual void Deactivate        ();
+
+  // The Working Plane management
+  void SetWorkingPlane(gp_Ax3 WorkingPlane) { myWorkingPlane = WorkingPlane; };
+  gp_Ax3 GetWorkingPlane() { return myWorkingPlane; };
+  void ActiveWorkingPlane();
+
+signals :
+  void SignalDeactivateActiveDialog();
+  void SignalCloseAllDialogs();
+  void SignalDefaultStepValueChanged( double newVal );
+
+private:
+  static GeometryGUI* myContext;         // the only GeometryGUI object
+
+  GUIMap              myGUIMap;          // GUI libraries map
+  QDialog*            myActiveDialogBox; // active dialog box
+  GEOM_Client         myShapeReader;     // geom shape reader
+  Standard_CString    myFatherior;
+  GEOM::GEOM_Gen_var  myComponentGeom;   // GEOM engine
+  int                 myState;           // identify a method
+  gp_Ax3              myWorkingPlane;
 };
 
 #endif