using namespace std;
-static VisuGUI_SelectionDlg* mySelectionDlg = NULL;
-
VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (const SalomeApp_Module* theModule):
QDialog(VISU::GetDesktop(theModule),
0,
mySelectionMgr(NULL),
myModule(theModule)
{
- if (mySelectionDlg)
- mySelectionDlg->close(true);
-
setCaption( "Data on elements" );
setSizeGripEnabled(TRUE);
if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule))
aViewWindow->SetSelectionMode(NodeSelection);
onSelectionEvent();
-
- mySelectionDlg = this;
}
VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg()
{
+ SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
+ if ( !aViewWindow )
+ return;
+
+ switch ( aViewWindow->SelectionMode() ) {
+ case NodeSelection:
+ case CellSelection:
+ aViewWindow->SetSelectionMode(ActorSelection);
+ break;
+ }
}
void VisuGUI_SelectionDlg::onSelectionChange (int theId)
void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent)
{
- if (mySelectionDlg) {
- mySelectionDlg = NULL;
- disconnect(mySelectionMgr,0,0,0);
- if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule)) {
- switch(aViewWindow->SelectionMode()){
- case NodeSelection:
- case CellSelection:
- aViewWindow->SetSelectionMode(ActorSelection);
- break;
- }
- }
- }
QDialog::closeEvent(theEvent);
}