SMESHGUI_PrecisionDlg.cxx \
SMESHGUI_VTKUtils.cxx \
SMESHGUI_Selection.cxx \
- SMESHGUI_CreatePolyhedralVolumeDlg.cxx
+ SMESHGUI_CreatePolyhedralVolumeDlg.cxx \
+ SMESHGUI_Operation.cxx
LIB_MOC = \
SMESHGUI.h \
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 \
#include "SalomeApp_Application.h"
#include "SalomeApp_Preferences.h"
#include "SalomeApp_VTKSelector.h"
+#include "SalomeApp_Operation.h"
#include "SalomeApp_ImportOperation.h"
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 );
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;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
class SUIT_ViewWindow;
class SUIT_ResourceMgr;
class SUIT_ViewManager;
+class SUIT_Operation;
class SalomeApp_Study;
class SalomeApp_SelectionMgr;
+class SalomeApp_Operation;
//=================================================================================
private slots:
void OnGUIEvent();
void onViewManagerAdded( SUIT_ViewManager* );
+ void onOperationCommited( SUIT_Operation* );
+ void onOperationAborted( SUIT_Operation* );
signals:
void SignalDeactivateActiveDialog() ;
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
--- /dev/null
+// 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()
+{
+
+}
+
+
+
--- /dev/null
+// 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
+
+
+
+
+
+