: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- myViewWindow( SMESH::GetViewWindow( theModule ) ),
- mySelector( myViewWindow->GetSelector() )
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
- QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_POINTS")));
- QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
- QPixmap image2 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
+ QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_POINTS")));
+ QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
+ QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_TranslationDlg");
GroupArguments->show();
RadioButton1->setChecked(TRUE);
+ mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
// Costruction of the logical filter
if (myEditCurrentArgument != (QWidget*)LineEditElements) {
SMESH::SetPointRepresentation(false);
if (!CheckBoxMesh->isChecked())
-
- myViewWindow->SetSelectionMode( CellSelection );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( CellSelection );
}
myEditCurrentArgument = (QWidget*)LineEditElements;
mySelectionMgr->clearFilters();
mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false);
- myViewWindow->SetSelectionMode( ActorSelection );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( ActorSelection );
mySMESHGUI->ResetState();
reject();
}
aMesh = myActor->GetObject()->GetMesh();
if (aMesh) {
- //mySelectionMgr->clearSelected();
- //mySelectionMgr->AddIObject(myActor->getIO());
- SALOME_ListIO aList;
- aList.Append(myActor->getIO());
- mySelectionMgr->setSelectedObjects(aList, false);
-
- TColStd_IndexedMapOfInteger selectedIndices;
+ Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
+
TColStd_MapOfInteger newIndices;
- mySelector->GetIndex( myActor->getIO(), selectedIndices );
QStringList aListId = QStringList::split(" ", theNewText, false);
if (send == LineEditElements) {
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
- if (e) {
- //if (!mySelectionMgr->IsIndexSelected(myActor->getIO(), e->GetID())) {
- if (selectedIndices.Add(e->GetID())) {
- //mySelectionMgr->AddOrRemoveIndex (myActor->getIO(), e->GetID(), true);
- newIndices.Add(e->GetID());
- }
- myNbOkElements++;
- }
+ if (e)
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
}
-
- if (newIndices.Extent() > 0){
- mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, true );
- myViewWindow->highlight( myActor->getIO(), true, true );
- }
-
- myElementsId = theNewText;
}
+
+ mySelector->AddOrRemoveIndex( anIO, newIndices, false );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( anIO, true, true );
+
+ myElementsId = theNewText;
}
if (myNbOkElements) {
myEditCurrentArgument = (QWidget*)LineEditElements;
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
- myViewWindow->SetSelectionMode( ActorSelection );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( ActorSelection );
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
- myViewWindow->SetSelectionMode( CellSelection );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( CellSelection );
}
} else if (send == SelectButton1) {
myEditCurrentArgument = (QWidget*)SpinBox1_1;
SMESH::SetPointRepresentation(true);
- myViewWindow->SetSelectionMode( NodeSelection );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( NodeSelection );
} else if (send == SelectButton2) {
myEditCurrentArgument = (QWidget*)SpinBox2_1;
SMESH::SetPointRepresentation(true);
- myViewWindow->SetSelectionMode( NodeSelection );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( NodeSelection );
}
myEditCurrentArgument->setFocus();
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
- myViewWindow->SetSelectionMode( CellSelection );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( CellSelection );
SelectionIntoArgument();
}
SMESH::SetPointRepresentation(false);
if (toSelectMesh) {
- myViewWindow->SetSelectionMode( ActorSelection );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( ActorSelection );
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
LineEditElements->setReadOnly(true);
} else {
- myViewWindow->SetSelectionMode( CellSelection );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode( CellSelection );
LineEditElements->setReadOnly(false);
onTextChange(LineEditElements->text());
}