2003-07-10 19:18:22 +06:00
|
|
|
// SMESH SMESHGUI : GUI for SMESH component
|
|
|
|
//
|
|
|
|
// Copyright (C) 2003 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
|
2005-06-07 19:22:20 +06:00
|
|
|
// Lesser General Public License for more details.
|
2003-07-10 19:18:22 +06:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
//
|
|
|
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// File : SMESHGUI.h
|
|
|
|
// Author : Nicolas REJNERI
|
|
|
|
// Module : SMESH
|
2003-05-19 20:07:00 +06:00
|
|
|
// $Header$
|
|
|
|
|
|
|
|
#ifndef SMESHGUI_HeaderFile
|
|
|
|
#define SMESHGUI_HeaderFile
|
|
|
|
|
|
|
|
// SALOME Includes
|
2005-06-07 19:22:20 +06:00
|
|
|
#include <SalomeApp_Module.h>
|
|
|
|
#include <SALOME_InteractiveObject.hxx>
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
#include <SALOMEconfig.h>
|
|
|
|
#include CORBA_SERVER_HEADER(SMESH_Gen)
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
class QDialog;
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
class SUIT_Desktop;
|
|
|
|
class SUIT_Study;
|
|
|
|
class SUIT_ViewWindow;
|
|
|
|
class SUIT_ResourceMgr;
|
|
|
|
class SUIT_ViewManager;
|
|
|
|
|
2005-08-23 14:47:31 +06:00
|
|
|
class SalomeApp_Operation;
|
2005-06-07 19:22:20 +06:00
|
|
|
class SalomeApp_Study;
|
|
|
|
class SalomeApp_SelectionMgr;
|
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// class : SMESHGUI
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
class SMESHGUI : public SalomeApp_Module
|
2003-05-19 20:07:00 +06:00
|
|
|
{
|
2004-12-01 15:48:31 +05:00
|
|
|
Q_OBJECT;
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
public :
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESHGUI();
|
2004-12-01 15:48:31 +05:00
|
|
|
~SMESHGUI();
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
static SMESH::SMESH_Gen_var GetSMESHGen();
|
|
|
|
static SMESHGUI* GetSMESHGUI();
|
|
|
|
static SalomeApp_SelectionMgr* selectionMgr();
|
|
|
|
static SUIT_ResourceMgr* resourceMgr();
|
|
|
|
static SUIT_Desktop* desktop() ;
|
|
|
|
static SalomeApp_Study* activeStudy();
|
|
|
|
bool isActiveStudyLocked();
|
|
|
|
|
2005-06-27 17:29:58 +06:00
|
|
|
static bool automaticUpdate();
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
virtual QString engineIOR() const;
|
|
|
|
virtual void initialize( CAM_Application* );
|
|
|
|
virtual void windows( QMap<int, int>& ) const;
|
|
|
|
virtual void viewManagers( QStringList& ) const;
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
QDialog* GetActiveDialogBox() ;
|
|
|
|
void SetActiveDialogBox(QDialog* aDlg) ;
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
void ResetState() ;
|
2004-12-01 15:48:31 +05:00
|
|
|
void SetState(int aState) ;
|
2003-05-19 20:07:00 +06:00
|
|
|
bool DefineDlgPosition(QWidget* aDlg, int& x, int& y) ;
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
virtual bool OnGUIEvent ( int id );
|
|
|
|
virtual bool OnMousePress ( QMouseEvent*, SUIT_ViewWindow* );
|
|
|
|
virtual bool OnMouseMove ( QMouseEvent*, SUIT_ViewWindow* );
|
|
|
|
virtual bool OnKeyPress ( QKeyEvent*, SUIT_ViewWindow* );
|
|
|
|
|
|
|
|
virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
|
|
|
|
|
|
|
|
virtual void BuildPresentation ( const Handle(SALOME_InteractiveObject)&,
|
|
|
|
SUIT_ViewWindow* = 0 );
|
|
|
|
|
|
|
|
/* Non modal dialog boxes management */
|
2003-05-19 20:07:00 +06:00
|
|
|
void EmitSignalDeactivateDialog() ;
|
2004-12-01 15:48:31 +05:00
|
|
|
void EmitSignalStudyFrameChanged() ;
|
2003-05-19 20:07:00 +06:00
|
|
|
void EmitSignalCloseAllDialogs() ;
|
|
|
|
|
2005-06-27 17:29:58 +06:00
|
|
|
virtual void createPreferences();
|
|
|
|
virtual void preferencesChanged( const QString&, const QString& );
|
2005-08-23 14:47:31 +06:00
|
|
|
|
|
|
|
virtual void update( const int );
|
2005-06-27 17:29:58 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
public slots:
|
2005-06-08 18:45:25 +06:00
|
|
|
virtual bool deactivateModule( SUIT_Study* );
|
|
|
|
virtual bool activateModule( SUIT_Study* );
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
private slots:
|
2005-08-23 14:47:31 +06:00
|
|
|
void OnGUIEvent();
|
|
|
|
void onViewManagerAdded( SUIT_ViewManager* );
|
|
|
|
void onOperationCommited( SUIT_Operation* );
|
|
|
|
void onOperationAborted( SUIT_Operation* );
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
signals:
|
|
|
|
void SignalDeactivateActiveDialog() ;
|
2004-12-01 15:48:31 +05:00
|
|
|
void SignalStudyFrameChanged() ;
|
2003-05-19 20:07:00 +06:00
|
|
|
void SignalCloseAllDialogs() ;
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
protected:
|
|
|
|
void createSMESHAction( const int, const QString&, const QString& = QString(""),
|
|
|
|
const int = 0, const bool = false );
|
|
|
|
void createPopupItem( const int, const QString&, const QString&,
|
|
|
|
const QString& = QString::null, const int = -1 );
|
2005-08-23 14:47:31 +06:00
|
|
|
|
|
|
|
virtual SalomeApp_Operation* createOperation( const int ) const;
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2005-08-17 16:44:08 +06:00
|
|
|
private:
|
|
|
|
void OnEditDelete();
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
private :
|
|
|
|
static SMESH::SMESH_Gen_var myComponentSMESH;
|
|
|
|
QDialog* myActiveDialogBox;
|
|
|
|
int myState;
|
|
|
|
QMap<int,QString> myRules;
|
2003-05-19 20:07:00 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|