#include "SMDS_Mesh.hxx"
#include "SMDS_MeshNode.hxx"
-#include "SalomeApp_SelectionMgr.h"
+#include "LightApp_SelectionMgr.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Desktop.h"
#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <vtkDataSetMapper.h>
+#include <vtkProperty.h>
// QT includes
#include <qgroupbox.h>
theName,
false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
- myViewWindow(SMESH::GetViewWindow(theModule)),
mySMESHGUI(theModule)
{
myPreviewActor = 0;
aDlgLay->setStretchFactor(aMainFrame, 1);
+ mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
Init();
}
{
QFrame* aFrame = new QFrame(theParent);
- QPixmap iconMoveNode (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_MOVE_NODE")));
- QPixmap iconSelect (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
+ QPixmap iconMoveNode (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_MOVE_NODE")));
+ QPixmap iconSelect (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
QButtonGroup* aPixGrp = new QButtonGroup(1, Qt::Vertical, tr("MESH_NODE"), aFrame);
aPixGrp->setExclusive(TRUE);
reset();
setEnabled(true);
- int x, y;
- mySMESHGUI->DefineDlgPosition(this, x, y);
- this->move(x, y);
this->show();
// set selection mode
SMESH::SetPointRepresentation(true);
- myViewWindow->SetSelectionMode(NodeSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
onSelectionDone();
}
//=======================================================================
bool SMESHGUI_MoveNodesDlg::onApply()
{
- if (SMESHGUI::GetSMESHGUI()->isActiveStudyLocked())
+ if (mySMESHGUI->isActiveStudyLocked())
return false;
if (!isValid(true))
//=======================================================================
void SMESHGUI_MoveNodesDlg::onClose()
{
- mySelectionMgr->clearSelected();
+ //mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false);
- mySelector->SetSelectionMode(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0);
+ erasePreview();
mySMESHGUI->ResetState();
reject();
}
if(const SMDS_MeshElement *anElem = aMesh->FindElement(theNewText.toInt())) {
TColStd_MapOfInteger aListInd;
aListInd.Add(anElem->GetID());
- mySelector->AddOrRemoveIndex(anIO,aListInd, true);
- myViewWindow->highlight(anIO,true,true);
+ mySelector->AddOrRemoveIndex(anIO,aListInd, false);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight(anIO,true,true);
+
+ onSelectionDone();
}
}
}
void SMESHGUI_MoveNodesDlg::enterEvent (QEvent*)
{
if (!isEnabled()) {
- SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
+ mySMESHGUI->EmitSignalDeactivateDialog();
// set selection mode
SMESH::SetPointRepresentation(true);
- myViewWindow->SetSelectionMode(NodeSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
redisplayPreview();
void SMESHGUI_MoveNodesDlg::closeEvent (QCloseEvent*)
{
onClose();
- myViewWindow->Repaint();
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->Repaint();
}
//=======================================================================
if (myPreviewActor == 0)
return;
- myViewWindow->RemoveActor(myPreviewActor);
+ SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+ if (aViewWindow)
+ aViewWindow->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
myPreviewActor = 0;
- myViewWindow->Repaint();
+ if (aViewWindow)
+ aViewWindow->Repaint();
}
//=======================================================================
myPreviewActor->SetProperty(aProp);
aProp->Delete();
- myViewWindow->AddActor(myPreviewActor);
- myViewWindow->Repaint();
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ {
+ aViewWindow->AddActor(myPreviewActor);
+ aViewWindow->Repaint();
+ }
}