geom/src/GEOMGUI/GeometryGUI.h

182 lines
6.9 KiB
C
Raw Normal View History

2009-02-13 17:16:39 +05:00
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
2003-07-09 20:33:44 +06:00
//
2009-02-13 17:16:39 +05:00
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
2009-02-13 17:16:39 +05:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2003-07-09 20:33:44 +06:00
//
2009-02-13 17:16:39 +05:00
// GEOM GEOMGUI : GUI for Geometry component
// File : GeometryGUI.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
2003-07-09 20:33:44 +06:00
//
2004-01-07 20:46:21 +05:00
#ifndef GEOMETRYGUI_H
#define GEOMETRYGUI_H
2003-05-12 21:24:23 +06:00
#include "GEOM_GEOMGUI.hxx"
2009-02-13 17:16:39 +05:00
#include <SalomeApp_Module.h>
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
#include <GEOM_Client.hxx>
#include <SALOME_InteractiveObject.hxx>
#include <SALOMEDSClient.hxx>
2009-02-13 17:16:39 +05:00
#include "GEOMGUI.h"
// QT Includes
2009-02-13 17:16:39 +05:00
#include <QMap>
2004-12-01 15:39:14 +05:00
// OCCT Includes
#include <gp_Ax3.hxx>
// IDL headers
#include "SALOMEconfig.h"
#include CORBA_CLIENT_HEADER(SALOMEDS)
2004-12-01 15:39:14 +05:00
typedef QMap<QString, GEOMGUI*> GUIMap;
class QDialog;
2009-02-13 17:16:39 +05:00
class QMenu;
class GEOMGUI_OCCSelector;
class LightApp_VTKSelector;
class LightApp_Selection;
class SUIT_ViewManager;
2003-05-12 21:24:23 +06:00
//=================================================================================
// class : GeometryGUI
// purpose :
//=================================================================================
class GEOMGUI_EXPORT GeometryGUI : public SalomeApp_Module
2003-05-12 21:24:23 +06:00
{
2004-12-01 15:39:14 +05:00
Q_OBJECT;
public:
2004-12-01 15:39:14 +05:00
// Constructor
GeometryGUI();
2003-05-12 21:24:23 +06:00
2004-12-01 15:39:14 +05:00
// Destructor
2004-06-16 21:24:55 +06:00
~GeometryGUI();
2004-12-01 15:39:14 +05:00
virtual LightApp_Displayer* displayer();
virtual void initialize( CAM_Application* );
virtual QString engineIOR() const;
2004-12-01 15:39:14 +05:00
static bool InitGeomGen(); //BugID IPAL9186: SRN: To be called by Python scripts
2005-08-19 17:51:38 +06:00
static GEOM::GEOM_Gen_var GetGeomGen();// { return GeometryGUI::myComponentGeom; }
static CORBA::Object_var ClientSObjectToObject (_PTR(SObject) theSObject);
static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy);
2009-02-13 17:16:39 +05:00
static char* JoinObjectParameters(const QStringList& theParametersList);
2004-12-01 15:39:14 +05:00
GEOM_Client& GetShapeReader() { return myShapeReader; }
Standard_CString& GetFatherior() { return myFatherior; }
//void SetState( const int state ) { myState = state; }
//int GetState() const { return myState; }
2004-12-01 15:39:14 +05:00
// 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 );
void OnGUIEvent( int id );
// virtual bool SetSettings();
// virtual void SupportedViewType ( int* buffer, int bufferSize );
virtual void BuildPresentation( const Handle(SALOME_InteractiveObject)&, SUIT_ViewWindow* = 0 );
// virtual void DefinePopup( QString & theContext, QString & theParent, QString & theObject);
2009-02-13 17:16:39 +05:00
// virtual bool CustomPopup( QAD_Desktop* parent, QMenu* popup, const QString& theContext,
// const QString& theParent, const QString& theObject );
2004-12-01 15:39:14 +05:00
// The Working Plane management
void SetWorkingPlane( gp_Ax3 wp ) { myWorkingPlane = wp; }
gp_Ax3 GetWorkingPlane() { return myWorkingPlane; }
void ActiveWorkingPlane();
virtual void windows( QMap<int, int>& ) const;
virtual void viewManagers( QStringList& ) const;
2009-02-13 17:16:39 +05:00
virtual void contextMenuPopup( const QString&, QMenu*, QString& );
2005-06-22 12:29:29 +06:00
virtual void createPreferences();
virtual void preferencesChanged( const QString&, const QString& );
int getLocalSelectionMode() const;
void setLocalSelectionMode(const int mode);
2009-02-13 17:16:39 +05:00
virtual void storeVisualParameters (int savePoint);
virtual void restoreVisualParameters(int savePoint);
public slots:
virtual bool deactivateModule( SUIT_Study* );
virtual bool activateModule( SUIT_Study* );
virtual void OnKeyPress ( SUIT_ViewWindow*, QKeyEvent* );
virtual void OnMousePress( SUIT_ViewWindow*, QMouseEvent* );
virtual void OnMouseMove ( SUIT_ViewWindow*, QMouseEvent* );
protected slots:
virtual void onViewManagerAdded( SUIT_ViewManager* );
virtual void onViewManagerRemoved( SUIT_ViewManager* );
private slots:
void OnGUIEvent();
void onWindowActivated( SUIT_ViewWindow* );
2004-12-01 15:39:14 +05:00
signals :
void SignalDeactivateActiveDialog();
void SignalCloseAllDialogs();
void SignalDefaultStepValueChanged( double newVal );
protected:
virtual LightApp_Selection* createSelection() const;
private:
GEOMGUI* getLibrary( const QString& libraryName );
void createGeomAction( const int id, const QString& po_id,
const QString& icon_id = QString(""),
const int key = 0, const bool toggle = false );
void createPopupItem( const int, const QString& clients, const QString& types,
const bool isSingle = false, const int isVisible = -1,
const bool isExpandAll = false, const bool isOCC = false,
const int parentId = -1 );
2004-12-01 15:39:14 +05:00
2005-08-19 17:51:38 +06:00
public:
static GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine!!!
private:
GUIMap myGUIMap; // GUI libraries map
QDialog* myActiveDialogBox; // active dialog box
GEOM_Client myShapeReader; // geom shape reader
Standard_CString myFatherior;
int myState; // identify a method
gp_Ax3 myWorkingPlane;
QMap<int,QString> myRules; // popup rules
2009-02-13 17:16:39 +05:00
QList<GEOMGUI_OCCSelector*> myOCCSelectors;
QList<LightApp_VTKSelector*> myVTKSelectors;
2005-09-27 12:32:15 +06:00
LightApp_Displayer* myDisplayer;
int myLocalSelectionMode; //Select Only
friend class DisplayGUI;
2003-05-12 21:24:23 +06:00
};
#endif