mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-05 20:54:17 +05:00
new files for dialog and operation
This commit is contained in:
parent
c981fa08d9
commit
949d8df2c5
@ -106,7 +106,8 @@ LIB_SRC = SMESHGUI.cxx \
|
||||
SMESHGUI_PrecisionDlg.cxx \
|
||||
SMESHGUI_VTKUtils.cxx \
|
||||
SMESHGUI_Selection.cxx \
|
||||
SMESHGUI_CreatePolyhedralVolumeDlg.cxx
|
||||
SMESHGUI_CreatePolyhedralVolumeDlg.cxx \
|
||||
SMESHGUI_Operation.cxx
|
||||
|
||||
LIB_MOC = \
|
||||
SMESHGUI.h \
|
||||
@ -149,7 +150,8 @@ LIB_MOC = \
|
||||
SMESHGUI_SewingDlg.h \
|
||||
SMESHGUI_PrecisionDlg.h \
|
||||
SMESHGUI_MergeNodesDlg.h \
|
||||
SMESHGUI_CreatePolyhedralVolumeDlg.h
|
||||
SMESHGUI_CreatePolyhedralVolumeDlg.h \
|
||||
SMESHGUI_Operation.h
|
||||
|
||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
||||
GEOM_Gen.idl \
|
||||
|
@ -99,6 +99,7 @@
|
||||
#include "SalomeApp_Application.h"
|
||||
#include "SalomeApp_Preferences.h"
|
||||
#include "SalomeApp_VTKSelector.h"
|
||||
#include "SalomeApp_Operation.h"
|
||||
|
||||
#include "SalomeApp_ImportOperation.h"
|
||||
|
||||
@ -1099,6 +1100,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
||||
if( !mgr )
|
||||
return false;
|
||||
|
||||
SUIT_Operation* anOp = getOperation( theCommandID );
|
||||
if ( anOp != 0 )
|
||||
{
|
||||
anOp->start();
|
||||
return true;
|
||||
}
|
||||
|
||||
SUIT_ViewWindow* view = application()->desktop()->activeWindow();
|
||||
SVTK_ViewWindow* vtkwnd = dynamic_cast<SVTK_ViewWindow*>( view );
|
||||
|
||||
@ -3212,3 +3220,74 @@ void SMESHGUI::createPreferences()
|
||||
void SMESHGUI::preferencesChanged( const QString&, const QString& )
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : onOperationCommited
|
||||
// purpose : SLOT called when operation commited. Set default selection mode
|
||||
//=======================================================================
|
||||
void SMESHGUI::onOperationCommited( SUIT_Operation* )
|
||||
{
|
||||
SVTK_ViewWindow* vtkWnd =
|
||||
dynamic_cast<SVTK_ViewWindow*>( application()->desktop()->activeWindow() );
|
||||
if ( vtkWnd )
|
||||
vtkWnd->SetSelectionMode( ActorSelection );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : onOperationAborted
|
||||
// purpose : SLOT called when operation commited. Set default selection mode
|
||||
//=======================================================================
|
||||
void SMESHGUI::onOperationAborted( SUIT_Operation* )
|
||||
{
|
||||
SVTK_ViewWindow* vtkWnd =
|
||||
dynamic_cast<SVTK_ViewWindow*>( application()->desktop()->activeWindow() );
|
||||
if ( vtkWnd )
|
||||
vtkWnd->SetSelectionMode( ActorSelection );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : getOperation
|
||||
// purpose : Get operation corresponding to the given Id
|
||||
//=======================================================================
|
||||
SalomeApp_Operation* SMESHGUI::getOperation( const int theId )
|
||||
{
|
||||
if ( myOperations.contains( theId ) )
|
||||
return myOperations[ theId ];
|
||||
|
||||
// to do:
|
||||
SalomeApp_Operation* anOp = 0;
|
||||
/*switch( theId )
|
||||
{
|
||||
case ... :
|
||||
anOp = ...;
|
||||
break;
|
||||
}*/
|
||||
|
||||
if ( anOp != 0 )
|
||||
{
|
||||
anOp->setModule( this );
|
||||
connect( anOp, SIGNAL( aborted( SUIT_Operation* ) ),
|
||||
this, SLOT( onOperationAborted( SUIT_Operation* ) ) );
|
||||
connect( anOp, SIGNAL( commited( SUIT_Operation* ) ),
|
||||
this, SLOT( onOperationCommited( SUIT_Operation* ) ) );
|
||||
myOperations[ theId ] = anOp;
|
||||
|
||||
}
|
||||
|
||||
return anOp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -43,9 +43,11 @@ class SUIT_Study;
|
||||
class SUIT_ViewWindow;
|
||||
class SUIT_ResourceMgr;
|
||||
class SUIT_ViewManager;
|
||||
class SUIT_Operation;
|
||||
|
||||
class SalomeApp_Study;
|
||||
class SalomeApp_SelectionMgr;
|
||||
class SalomeApp_Operation;
|
||||
|
||||
|
||||
//=================================================================================
|
||||
@ -108,6 +110,8 @@ public slots:
|
||||
private slots:
|
||||
void OnGUIEvent();
|
||||
void onViewManagerAdded( SUIT_ViewManager* );
|
||||
void onOperationCommited( SUIT_Operation* );
|
||||
void onOperationAborted( SUIT_Operation* );
|
||||
|
||||
signals:
|
||||
void SignalDeactivateActiveDialog() ;
|
||||
@ -120,11 +124,14 @@ protected:
|
||||
void createPopupItem( const int, const QString&, const QString&,
|
||||
const QString& = QString::null, const int = -1 );
|
||||
|
||||
SalomeApp_Operation* getOperation( const int );
|
||||
|
||||
private :
|
||||
static SMESH::SMESH_Gen_var myComponentSMESH;
|
||||
QDialog* myActiveDialogBox;
|
||||
int myState;
|
||||
QMap<int,QString> myRules;
|
||||
QMap<int, SalomeApp_Operation*> myOperations;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
35
src/SMESHGUI/SMESHGUI_Operation.cxx
Executable file
35
src/SMESHGUI/SMESHGUI_Operation.cxx
Executable file
@ -0,0 +1,35 @@
|
||||
// SALOME SMESHGUI
|
||||
//
|
||||
// Copyright (C) 2005 CEA/DEN, EDF R&D
|
||||
//
|
||||
//
|
||||
//
|
||||
// File : SMESHGUI_Operation.h
|
||||
// Author : Sergey LITONIN
|
||||
// Module : SALOME
|
||||
|
||||
#include "SMESHGUI_Operation.h"
|
||||
|
||||
|
||||
/*
|
||||
Class : SMESHGUI_Operation
|
||||
Description : Base class for all SMESH operations
|
||||
*/
|
||||
|
||||
//=======================================================================
|
||||
// name : SMESHGUI_Operation
|
||||
// Purpose : Constructor
|
||||
//=======================================================================
|
||||
SMESHGUI_Operation::SMESHGUI_Operation( SalomeApp_Application* theApp )
|
||||
: SalomeApp_Operation( theApp )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SMESHGUI_Operation::~SMESHGUI_Operation()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
39
src/SMESHGUI/SMESHGUI_Operation.h
Executable file
39
src/SMESHGUI/SMESHGUI_Operation.h
Executable file
@ -0,0 +1,39 @@
|
||||
// SALOME SMESHGUI
|
||||
//
|
||||
// Copyright (C) 2005 CEA/DEN, EDF R&D
|
||||
//
|
||||
//
|
||||
//
|
||||
// File : SMESHGUI_Operation.h
|
||||
// Author : Sergey LITONIN
|
||||
// Module : SALOME
|
||||
|
||||
|
||||
#ifndef SMESHGUI_Operation_H
|
||||
#define SMESHGUI_Operation_H
|
||||
|
||||
#include <SalomeApp_Operation.h>
|
||||
|
||||
/*
|
||||
Class : SMESHGUI_Operation
|
||||
Description : Base class for all SMESH operations
|
||||
*/
|
||||
|
||||
class SMESHGUI_Operation : public SalomeApp_Operation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
SMESHGUI_Operation( SalomeApp_Application* );
|
||||
virtual ~SMESHGUI_Operation();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user