2010-05-14 21:32:37 +06:00
|
|
|
// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
|
2003-07-10 19:18:22 +06:00
|
|
|
//
|
2009-02-17 10:27:49 +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
|
2005-06-07 19:22:20 +06:00
|
|
|
// Lesser General Public License for more details.
|
2003-07-10 19:18:22 +06:00
|
|
|
//
|
2009-02-17 10:27:49 +05: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
|
2003-07-10 19:18:22 +06:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2003-07-10 19:18:22 +06:00
|
|
|
//
|
2010-05-14 21:32:37 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SMESH SMESHGUI : GUI for SMESH component
|
|
|
|
// File : SMESHGUI.h
|
|
|
|
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
|
|
|
|
//
|
|
|
|
#ifndef SMESHGUI_H
|
|
|
|
#define SMESHGUI_H
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SMESH includes
|
2008-03-07 12:47:05 +05:00
|
|
|
#include "SMESH_SMESHGUI.hxx"
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SALOME GUI includes
|
2005-06-07 19:22:20 +06:00
|
|
|
#include <SalomeApp_Module.h>
|
2010-05-14 21:32:37 +06:00
|
|
|
#include <VTKViewer_MarkerDef.h>
|
2005-06-07 19:22:20 +06:00
|
|
|
#include <SALOME_InteractiveObject.hxx>
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// IDL includes
|
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-11-03 13:38:17 +05:00
|
|
|
class LightApp_Operation;
|
2005-06-07 19:22:20 +06:00
|
|
|
class SalomeApp_Study;
|
2009-02-17 10:27:49 +05:00
|
|
|
class LightApp_Selection;
|
2005-11-03 13:38:17 +05:00
|
|
|
class LightApp_SelectionMgr;
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
class SMESHGUI_FilterLibraryDlg;
|
|
|
|
|
2010-05-14 21:32:37 +06:00
|
|
|
typedef std::map<int, VTK::MarkerMap> SMESHGUI_StudyId2MarkerMap;
|
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
//=================================================================================
|
|
|
|
// class : SMESHGUI
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
2008-03-07 12:47:05 +05:00
|
|
|
class SMESHGUI_EXPORT 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();
|
2005-11-03 13:38:17 +05:00
|
|
|
static LightApp_SelectionMgr* selectionMgr();
|
2005-06-07 19:22:20 +06:00
|
|
|
static SUIT_ResourceMgr* resourceMgr();
|
2009-02-17 10:27:49 +05:00
|
|
|
static SUIT_Desktop* desktop();
|
2005-06-07 19:22:20 +06:00
|
|
|
static SalomeApp_Study* activeStudy();
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
bool isActiveStudyLocked();
|
|
|
|
|
2005-06-27 17:29:58 +06:00
|
|
|
static bool automaticUpdate();
|
|
|
|
|
2010-06-10 15:43:07 +06:00
|
|
|
static void Modified( bool = true );
|
|
|
|
|
2005-11-03 13:38:17 +05:00
|
|
|
virtual LightApp_Displayer* displayer();
|
2009-02-17 10:27:49 +05: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
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
QDialog* GetActiveDialogBox();
|
|
|
|
void SetActiveDialogBox( QDialog* );
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
void ResetState();
|
|
|
|
void SetState( int );
|
|
|
|
bool DefineDlgPosition( QWidget*, int&, int& );
|
|
|
|
void switchToOperation( int );
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
virtual bool OnGUIEvent( int );
|
|
|
|
virtual bool OnMousePress( QMouseEvent*, SUIT_ViewWindow* );
|
|
|
|
virtual bool OnMouseMove( QMouseEvent*, SUIT_ViewWindow* );
|
|
|
|
virtual bool OnKeyPress( QKeyEvent*, SUIT_ViewWindow* );
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
virtual LightApp_Selection* createSelection() const;
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
virtual void BuildPresentation ( const Handle(SALOME_InteractiveObject)&,
|
|
|
|
SUIT_ViewWindow* = 0 );
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
/* Non modal dialog boxes management */
|
2009-02-17 10:27:49 +05:00
|
|
|
void EmitSignalDeactivateDialog();
|
|
|
|
void EmitSignalStudyFrameChanged();
|
|
|
|
void EmitSignalCloseAllDialogs();
|
2009-10-02 13:17:29 +06:00
|
|
|
void EmitSignalVisibilityChanged();
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
virtual void contextMenuPopup( const QString&, QMenu*, QString& );
|
|
|
|
virtual void createPreferences();
|
|
|
|
virtual void preferencesChanged( const QString&, const QString& );
|
|
|
|
|
|
|
|
virtual void update( const int );
|
|
|
|
|
|
|
|
static SALOMEDS::Color getUniqueColor( const QList<SALOMEDS::Color>& );
|
2005-06-27 17:29:58 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
virtual void storeVisualParameters (int savePoint);
|
|
|
|
virtual void restoreVisualParameters(int savePoint);
|
2008-03-07 12:47:05 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
public slots:
|
2009-02-17 10:27:49 +05:00
|
|
|
virtual bool deactivateModule( SUIT_Study* );
|
|
|
|
virtual bool activateModule( SUIT_Study* );
|
|
|
|
virtual void studyClosed( SUIT_Study* );
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
private slots:
|
2009-02-17 10:27:49 +05:00
|
|
|
void OnGUIEvent();
|
|
|
|
void onViewManagerActivated( SUIT_ViewManager* );
|
|
|
|
void onOperationCommited( SUIT_Operation* );
|
|
|
|
void onOperationAborted( SUIT_Operation* );
|
2009-09-04 14:21:40 +06:00
|
|
|
void onHypothesisEdit( int result );
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
signals:
|
2009-02-17 10:27:49 +05:00
|
|
|
void SignalDeactivateActiveDialog();
|
|
|
|
void SignalStudyFrameChanged();
|
|
|
|
void SignalCloseAllDialogs();
|
2009-10-02 13:17:29 +06:00
|
|
|
void SignalVisibilityChanged();
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
protected:
|
2009-02-17 10:27:49 +05:00
|
|
|
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(),
|
|
|
|
const int = -1 );
|
|
|
|
|
|
|
|
virtual LightApp_Operation* createOperation( const int ) const;
|
|
|
|
|
|
|
|
virtual bool isSelectionCompatible();
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-12-03 17:31:27 +05:00
|
|
|
virtual bool reusableOperation( const int id );
|
|
|
|
|
2005-08-17 16:44:08 +06:00
|
|
|
private:
|
2009-02-17 10:27:49 +05:00
|
|
|
void OnEditDelete();
|
|
|
|
int addVtkFontPref( const QString& label,
|
|
|
|
const int pId,
|
|
|
|
const QString& param );
|
2005-08-17 16:44:08 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
private :
|
2009-02-17 10:27:49 +05:00
|
|
|
static SMESH::SMESH_Gen_var myComponentSMESH;
|
|
|
|
QDialog* myActiveDialogBox;
|
|
|
|
int myState;
|
|
|
|
QMap<int, QString> myRules;
|
|
|
|
LightApp_Displayer* myDisplayer;
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
SMESHGUI_FilterLibraryDlg* myFilterLibraryDlg;
|
2010-05-14 21:32:37 +06:00
|
|
|
|
|
|
|
SMESHGUI_StudyId2MarkerMap myMarkerMap;
|
2003-05-19 20:07:00 +06:00
|
|
|
};
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
#endif // SMESHGUI_H
|