: QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionAlongPathDlg", 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 ) )
{
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap edgeImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
ZSpin->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3);
AngleSpin->RangeStepAndValidator(-999999.999, +999999.999, 5.0, 3);
+ mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
mySMESHGUI->SetActiveDialogBox(this);
// Costruction of the logical filter for the elements: mesh/sub-mesh/group
SMESH::SetPointRepresentation(false);
if (MeshCheck->isChecked()) {
- myViewWindow->SetSelectionMode(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myElementsFilter);
} else {
if (type == 0)
- myViewWindow->SetSelectionMode(EdgeSelection);
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ }
if (type == 1)
- myViewWindow->SetSelectionMode(FaceSelection);
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
}
}
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
return false;
}
- mySelectionMgr->clearSelected();
- SMESH::UpdateView();
+ //mySelectionMgr->clearSelected();
+ SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() );
+ //SMESH::UpdateView();
Init(false);
ConstructorsClicked(GetConstructorId());
return true;
{
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
- mySelectionMgr->clearSelected();
+ //mySelectionMgr->clearSelected();
SMESH::SetPickable(); // ???
SMESH::SetPointRepresentation(false);
- myViewWindow->SetSelectionMode(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
QDialog::reject();
}
QStringList aListId = QStringList::split(" ", theNewText, false);
bool bOk;
const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO();
- TColStd_IndexedMapOfInteger selectedIndices;
TColStd_MapOfInteger newIndices;
- mySelector->GetIndex(anIO, selectedIndices);
for (int i = 0; i < aListId.count(); i++) {
long ind = aListId[ i ].toLong(&bOk);
if (bOk) {
// check also type of element
bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
- if (typeMatch) {
- if (selectedIndices.Add(e->GetID())) {
- newIndices.Add(e->GetID());
- }
- }
+ if (typeMatch)
+ newIndices.Add(e->GetID());
}
}
}
- if (newIndices.Extent() > 0) {
- mySelector->AddOrRemoveIndex(anIO, newIndices, true);
- myViewWindow->highlight( anIO, true, true );
- }
+ mySelector->AddOrRemoveIndex(anIO, newIndices, false);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( anIO, true, true );
}
} else if (send == StartPointLineEdit &&
myEditCurrentArgument == StartPointLineEdit) {
const SMDS_MeshNode* n = aMesh->FindNode(ind);
if (n) {
//if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
- TColStd_IndexedMapOfInteger selectedIndices;
TColStd_MapOfInteger newIndices;
- mySelector->GetIndex(aPathActor->getIO(), selectedIndices);
- if (selectedIndices.Add(n->GetID())) {
- newIndices.Add(n->GetID());
- mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, true );
- myViewWindow->highlight( aPathActor->getIO(), true, true );
- }
+ newIndices.Add(n->GetID());
+ mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( aPathActor->getIO(), true, true );
}
}
}
// try to get shape from selection
Handle(SALOME_InteractiveObject) IO = aList.First();
+ SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
+ if ( !aPathActor )
+ return;
+
QString aString;
- int aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, myMeshActor->getIO(), aString);
+ int aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aPathActor->getIO(), aString);
if (aNbUnits == 1)
StartPointLineEdit->setText(aString.stripWhiteSpace());
myEditCurrentArgument = ElementsLineEdit;
SMESH::SetPointRepresentation(false);
if (MeshCheck->isChecked()) {
- myViewWindow->SetSelectionMode(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myElementsFilter);
} else {
if (Elements1dRB->isChecked())
- myViewWindow->SetSelectionMode(EdgeSelection);
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ }
else if (Elements2dRB->isChecked())
- myViewWindow->SetSelectionMode(FaceSelection);
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
}
} else if (button == SelectPathMeshButton) {
myEditCurrentArgument = PathMeshLineEdit;
SMESH::SetPointRepresentation(false);
- myViewWindow->SetSelectionMode(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myPathMeshFilter);
}
else if (button == SelectPathShapeButton) {
myEditCurrentArgument = PathShapeLineEdit;
SMESH::SetPointRepresentation(false);
- myViewWindow->SetSelectionMode(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
if (!myPathMesh->_is_nil()) {
GEOM::GEOM_Object_var aMainShape = myPathMesh->GetShapeToMesh();
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
if (aPathActor) {
SMESH::SetPointRepresentation(true);
- myViewWindow->SetSelectionMode(NodeSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
SMESH::SetPickable(aPathActor);
}
}
else if (button == SelectBasePointButton) {
myEditCurrentArgument = XSpin;
SMESH::SetPointRepresentation(true);
- myViewWindow->SetSelectionMode(NodeSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter(MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter(GROUP);