: 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_DLG_ROTATION")));
- QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
+ QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_ROTATION")));
+ QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_RotationDlg");
myConstructorId = 0;
RadioButton1->setChecked(TRUE);
+ mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
// Costruction of the logical filter
mySelectionMgr->clearFilters();
mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false);
- myViewWindow->SetSelectionMode(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
reject();
}
if (aMesh) {
if (send == LineEditElements) {
- //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);
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 (newIndices.Extent() > 0){
- mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, true );
- myViewWindow->highlight( myActor->getIO(), true, true );
+ if (e)
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
}
+ mySelector->AddOrRemoveIndex( anIO, newIndices, false );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( anIO, true, true );
+
myElementsId = theNewText;
}
}
switch (myConstructorId) {
case 0: /* default constructor */
{
+ SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if (send == SelectElementsButton) {
myEditCurrentArgument = (QWidget*)LineEditElements;
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
- myViewWindow->SetSelectionMode(ActorSelection);
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
-
- myViewWindow->SetSelectionMode( CellSelection );
- }
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode( CellSelection );
+ }
} else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X;
SMESH::SetPointRepresentation(true);
-
- myViewWindow->SetSelectionMode( NodeSelection );
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode( NodeSelection );
} else if (send == SelectVectorButton) {
myEditCurrentArgument = (QWidget*)SpinBox_DX;
SMESH::SetPointRepresentation(true);
-
- myViewWindow->SetSelectionMode( NodeSelection );
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode( NodeSelection );
}
break;
}
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());
}