Fix for bug IPAL9258(/dn06/../current1706): SIGSEGV after trying to close dialog box after closing VTK viewer).

This commit is contained in:
mzn 2005-07-01 10:42:32 +00:00
parent c981fa08d9
commit b33324fe60
47 changed files with 395 additions and 238 deletions

View File

@ -216,14 +216,13 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*> SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
(SUIT_Session::session()->activeApplication()); (SUIT_Session::session()->activeApplication());
myIsPoly = false; myIsPoly = false;
mySimulation = new SMESH::TElementSimulation (anApp); mySimulation = new SMESH::TElementSimulation (anApp);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
// verify nb nodes and type // verify nb nodes and type
myNbNodes = nbNodes; myNbNodes = nbNodes;
@ -420,7 +419,8 @@ void SMESHGUI_AddMeshElementDlg::Init()
// set selection mode // set selection mode
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode( NodeSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( NodeSelection );
myBusy = false; myBusy = false;
@ -491,7 +491,8 @@ void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
mySimulation->SetVisibility(false); mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode( ActorSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection );
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
@ -532,7 +533,8 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
} }
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false ); mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
myViewWindow->highlight( myActor->getIO(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
bool aNodesOK = false; bool aNodesOK = false;
if (myIsPoly && myElementType == SMDSAbs_Face && aListId.count() >=3 ){ if (myIsPoly && myElementType == SMDSAbs_Face && aListId.count() >=3 ){
@ -693,7 +695,8 @@ void SMESHGUI_AddMeshElementDlg::ActivateThisDialog()
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode( NodeSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( NodeSelection );
SelectionIntoArgument(); SelectionIntoArgument();
} }

View File

@ -88,7 +88,6 @@ private:
SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */ SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */
int myNbOkNodes; /* to check when arguments is defined */ int myNbOkNodes; /* to check when arguments is defined */
bool myBusy; bool myBusy;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QLineEdit* myEditCurrentArgument; /* Current LineEdit */ QLineEdit* myEditCurrentArgument; /* Current LineEdit */

View File

@ -88,9 +88,7 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule,
: QDialog( SMESH::GetDesktop( theModule ), theName, false, : QDialog( SMESH::GetDesktop( theModule ), theName, false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
setCaption(tr("CAPTION")); setCaption(tr("CAPTION"));
@ -104,6 +102,9 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule,
aDlgLay->setStretchFactor(aMainFrame, 1); aDlgLay->setStretchFactor(aMainFrame, 1);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
mySelector = aViewWindow->GetSelector();
Init(theType); Init(theType);
} }
@ -386,7 +387,8 @@ void SMESHGUI_CreatePatternDlg::onSave()
tr("ERROR_OF_SAVING"), QMessageBox::Ok); tr("ERROR_OF_SAVING"), QMessageBox::Ok);
} else { } else {
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
@ -435,7 +437,8 @@ void SMESHGUI_CreatePatternDlg::onOk()
return; return;
} else { } else {
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
@ -454,7 +457,8 @@ void SMESHGUI_CreatePatternDlg::onOk()
//======================================================================= //=======================================================================
void SMESHGUI_CreatePatternDlg::onClose() void SMESHGUI_CreatePatternDlg::onClose()
{ {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
@ -682,7 +686,8 @@ void SMESHGUI_CreatePatternDlg::activateSelection()
{ {
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
if (myType == Type_2d) { if (myType == Type_2d) {
mySelectionMgr->installFilter(new SMESH_NumberFilter mySelectionMgr->installFilter(new SMESH_NumberFilter

View File

@ -130,7 +130,6 @@ private:
QCheckBox* myProjectChk; QCheckBox* myProjectChk;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
int myNbPoints; int myNbPoints;

View File

@ -191,9 +191,7 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI
bool modal, WFlags fl ) bool modal, WFlags fl )
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH",tr("ICON_SELECT"))); QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH",tr("ICON_SELECT")));
@ -310,6 +308,8 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI
Preview = new QCheckBox( GroupContent, "Preview" ); Preview = new QCheckBox( GroupContent, "Preview" );
Preview->setText( tr( "SMESH_POLYEDRE_PREVIEW" ) ); Preview->setText( tr( "SMESH_POLYEDRE_PREVIEW" ) );
GroupContentLayout->addWidget( Preview , 5, 0 ); GroupContentLayout->addWidget( Preview , 5, 0 );
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
SMESHGUI_CreatePolyhedralVolumeDlgLayout->addWidget( GroupContent, 1, 0 ); SMESHGUI_CreatePolyhedralVolumeDlgLayout->addWidget( GroupContent, 1, 0 );
@ -403,7 +403,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ConstructorsClicked(int constructorId)
} }
else else
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
AddButton->setEnabled(false); AddButton->setEnabled(false);
RemoveButton->setEnabled(false); RemoveButton->setEnabled(false);
@ -426,7 +427,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ConstructorsClicked(int constructorId)
} else { } else {
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
} }
myViewWindow->SetSelectionMode(FaceSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
TextLabelIds->setText( tr( "SMESH_ID_FACES" ) ); TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
myFacesByNodesLabel->hide(); myFacesByNodesLabel->hide();
@ -554,7 +556,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel()
mySelectionMgr->setSelectedObjects( aList ); mySelectionMgr->setSelectedObjects( aList );
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
mySimulation->SetVisibility(false); mySimulation->SetVisibility(false);
myViewWindow->SetSelectionMode( ActorSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 ); disconnect( mySelectionMgr, 0, this, 0 );
mySMESHGUI->ResetState() ; mySMESHGUI->ResetState() ;
reject() ; reject() ;
@ -591,7 +594,9 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText)
} }
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false ); mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
myViewWindow->highlight( myActor->getIO(), true, true );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
if ( myNbOkElements>0 && aListId.count()>=3) if ( myNbOkElements>0 && aListId.count()>=3)
AddButton->setEnabled(true); AddButton->setEnabled(true);
@ -622,7 +627,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText)
} }
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false ); mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
myViewWindow->highlight( myActor->getIO(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
if ( myNbOkElements ) { if ( myNbOkElements ) {
if (aListId.count()>1){ if (aListId.count()>1){
@ -853,7 +859,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ActivateThisDialog()
mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ; mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
myViewWindow->SetSelectionMode( FaceSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( FaceSelection );
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -982,7 +989,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onListSelectionChanged()
if(isSelected) RemoveButton->setEnabled(true); if(isSelected) RemoveButton->setEnabled(true);
else RemoveButton->setEnabled(false); else RemoveButton->setEnabled(false);
mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, true ); mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, true );
myViewWindow->highlight( myActor->getIO(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
aList.Append( myActor->getIO() ); aList.Append( myActor->getIO() );
mySelectionMgr->setSelectedObjects( aList ); mySelectionMgr->setSelectedObjects( aList );

View File

@ -78,7 +78,6 @@ private:
SMESHGUI* mySMESHGUI ; /* Current SMESHGUI object */ SMESHGUI* mySMESHGUI ; /* Current SMESHGUI object */
SalomeApp_SelectionMgr* mySelectionMgr ; /* User shape selection */ SalomeApp_SelectionMgr* mySelectionMgr ; /* User shape selection */
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QString myIDs; QString myIDs;
int myNbOkElements ; /* to check when elements are defined */ int myNbOkElements ; /* to check when elements are defined */

View File

@ -76,7 +76,6 @@ SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule):
false, false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)), mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
myViewWindow(SMESH::GetViewWindow(mySMESHGUI)),
mySMESHGUI(theModule) mySMESHGUI(theModule)
{ {
setCaption(tr("CAPTION")); setCaption(tr("CAPTION"));
@ -170,7 +169,8 @@ void SMESHGUI_DeleteGroupDlg::Init ()
// set selection mode // set selection mode
mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP)); mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP));
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
onSelectionDone(); onSelectionDone();
return; return;
@ -235,7 +235,8 @@ void SMESHGUI_DeleteGroupDlg::onOk()
//================================================================================= //=================================================================================
void SMESHGUI_DeleteGroupDlg::onClose() void SMESHGUI_DeleteGroupDlg::onClose()
{ {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
@ -289,7 +290,8 @@ void SMESHGUI_DeleteGroupDlg::enterEvent (QEvent*)
{ {
mySMESHGUI->EmitSignalDeactivateDialog(); mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true); setEnabled(true);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP)); mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
} }

View File

@ -86,7 +86,6 @@ private:
QListBox* myListBox; QListBox* myListBox;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;
SVTK_ViewWindow* myViewWindow;
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
QValueList<SMESH::SMESH_GroupBase_var> myListGrp; QValueList<SMESH::SMESH_GroupBase_var> myListGrp;

View File

@ -97,9 +97,7 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
: QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionAlongPathDlg", modal, : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionAlongPathDlg", modal,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap edgeImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE"))); QPixmap edgeImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
@ -317,6 +315,8 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
ZSpin->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3); ZSpin->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3);
AngleSpin->RangeStepAndValidator(-999999.999, +999999.999, 5.0, 3); AngleSpin->RangeStepAndValidator(-999999.999, +999999.999, 5.0, 3);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
mySMESHGUI->SetActiveDialogBox(this); mySMESHGUI->SetActiveDialogBox(this);
// Costruction of the logical filter for the elements: mesh/sub-mesh/group // Costruction of the logical filter for the elements: mesh/sub-mesh/group
@ -448,13 +448,20 @@ void SMESHGUI_ExtrusionAlongPathDlg::ConstructorsClicked (int type)
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (MeshCheck->isChecked()) { if (MeshCheck->isChecked()) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myElementsFilter); mySelectionMgr->installFilter(myElementsFilter);
} else { } else {
if (type == 0) if (type == 0)
myViewWindow->SetSelectionMode(EdgeSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
if (type == 1) if (type == 1)
myViewWindow->SetSelectionMode(FaceSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
} }
} }
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
@ -660,7 +667,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::reject()
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPickable(); // ??? SMESH::SetPickable(); // ???
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
QDialog::reject(); QDialog::reject();
} }
@ -713,7 +721,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
} }
} }
mySelector->AddOrRemoveIndex(anIO, newIndices, false); mySelector->AddOrRemoveIndex(anIO, newIndices, false);
myViewWindow->highlight( anIO, true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
} }
} else if (send == StartPointLineEdit && } else if (send == StartPointLineEdit &&
myEditCurrentArgument == StartPointLineEdit) { myEditCurrentArgument == StartPointLineEdit) {
@ -738,7 +747,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
TColStd_MapOfInteger newIndices; TColStd_MapOfInteger newIndices;
newIndices.Add(n->GetID()); newIndices.Add(n->GetID());
mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false ); mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
myViewWindow->highlight( aPathActor->getIO(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( aPathActor->getIO(), true, true );
} }
} }
} }
@ -940,24 +950,33 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
myEditCurrentArgument = ElementsLineEdit; myEditCurrentArgument = ElementsLineEdit;
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (MeshCheck->isChecked()) { if (MeshCheck->isChecked()) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myElementsFilter); mySelectionMgr->installFilter(myElementsFilter);
} else { } else {
if (Elements1dRB->isChecked()) if (Elements1dRB->isChecked())
myViewWindow->SetSelectionMode(EdgeSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (Elements2dRB->isChecked()) else if (Elements2dRB->isChecked())
myViewWindow->SetSelectionMode(FaceSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
} }
} else if (button == SelectPathMeshButton) { } else if (button == SelectPathMeshButton) {
myEditCurrentArgument = PathMeshLineEdit; myEditCurrentArgument = PathMeshLineEdit;
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myPathMeshFilter); mySelectionMgr->installFilter(myPathMeshFilter);
} }
else if (button == SelectPathShapeButton) { else if (button == SelectPathShapeButton) {
myEditCurrentArgument = PathShapeLineEdit; myEditCurrentArgument = PathShapeLineEdit;
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
if (!myPathMesh->_is_nil()) { if (!myPathMesh->_is_nil()) {
GEOM::GEOM_Object_var aMainShape = myPathMesh->GetShapeToMesh(); GEOM::GEOM_Object_var aMainShape = myPathMesh->GetShapeToMesh();
@ -975,7 +994,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh); SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
if (aPathActor) { if (aPathActor) {
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
SMESH::SetPickable(aPathActor); SMESH::SetPickable(aPathActor);
} }
} }
@ -983,7 +1003,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
else if (button == SelectBasePointButton) { else if (button == SelectBasePointButton) {
myEditCurrentArgument = XSpin; myEditCurrentArgument = XSpin;
SMESH::SetPointRepresentation(true); 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* aMeshOrSubMeshFilter = new SMESH_TypeFilter(MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter(GROUP); SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter(GROUP);

View File

@ -88,7 +88,6 @@ private:
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */ SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QWidget* myEditCurrentArgument; /* Current argument */ QWidget* myEditCurrentArgument; /* Current argument */

View File

@ -88,9 +88,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule,
: QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionDlg", modal, WStyle_Customize | : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionDlg", modal, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_EDGE"))); QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE"))); QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
@ -324,14 +322,20 @@ void SMESHGUI_ExtrusionDlg::ConstructorsClicked (int constructorId)
{ {
GroupArguments->setTitle(tr("EXTRUSION_1D")); GroupArguments->setTitle(tr("EXTRUSION_1D"));
if (!CheckBoxMesh->isChecked()) if (!CheckBoxMesh->isChecked())
myViewWindow->SetSelectionMode(EdgeSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
break; break;
} }
case 1: case 1:
{ {
GroupArguments->setTitle(tr("EXTRUSION_2D")); GroupArguments->setTitle(tr("EXTRUSION_2D"));
if (!CheckBoxMesh->isChecked()) if (!CheckBoxMesh->isChecked())
myViewWindow->SetSelectionMode(FaceSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
break; break;
} }
} }
@ -407,7 +411,8 @@ void SMESHGUI_ExtrusionDlg::ClickOnCancel()
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPickable(); // ??? SMESH::SetPickable(); // ???
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
} }
@ -450,7 +455,8 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText)
myNbOkElements++; myNbOkElements++;
} }
mySelector->AddOrRemoveIndex(anIO, newIndices, false); mySelector->AddOrRemoveIndex(anIO, newIndices, false);
myViewWindow->highlight( anIO, true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText; myElementsId = theNewText;
} }
} }
@ -608,14 +614,21 @@ void SMESHGUI_ExtrusionDlg::SetEditCurrentArgument()
if (send == SelectElementsButton) { if (send == SelectElementsButton) {
myEditCurrentArgument = LineEditElements; myEditCurrentArgument = LineEditElements;
if (CheckBoxMesh->isChecked()) { if (CheckBoxMesh->isChecked()) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else { } else {
int aConstructorId = GetConstructorId(); int aConstructorId = GetConstructorId();
if (aConstructorId == 0) if (aConstructorId == 0)
myViewWindow->SetSelectionMode(EdgeSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 1) else if (aConstructorId == 1)
myViewWindow->SetSelectionMode(FaceSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
} }
} }
@ -706,15 +719,22 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
if (toSelectMesh) { if (toSelectMesh) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
LineEditElements->setReadOnly(true); LineEditElements->setReadOnly(true);
} else { } else {
int aConstructorId = GetConstructorId(); int aConstructorId = GetConstructorId();
if (aConstructorId == 0) if (aConstructorId == 0)
myViewWindow->SetSelectionMode(EdgeSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 0) else if (aConstructorId == 0)
myViewWindow->SetSelectionMode(FaceSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
LineEditElements->setReadOnly(false); LineEditElements->setReadOnly(false);
onTextChange(LineEditElements->text()); onTextChange(LineEditElements->text());

View File

@ -80,7 +80,6 @@ private:
QLineEdit* myEditCurrentArgument; /* Current LineEdit */ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
QString myElementsId; QString myElementsId;
int myNbOkElements; /* to check when elements are defined */ int myNbOkElements; /* to check when elements are defined */
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
bool myBusy; bool myBusy;

View File

@ -1604,10 +1604,11 @@ SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI* theModule,
: QDialog( SMESH::GetDesktop( theModule ), theName, false, : QDialog( SMESH::GetDesktop( theModule ), theName, false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
mySelector = aViewWindow->GetSelector();
construct(theTypes); construct(theTypes);
} }
@ -1623,8 +1624,8 @@ SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI* theModule,
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{ {
myViewWindow = SMESH::GetViewWindow( theModule ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
mySelector = myViewWindow->GetSelector(); mySelector = aViewWindow->GetSelector();
QValueList<int> aTypes; QValueList<int> aTypes;
aTypes.append(theType); aTypes.append(theType);
construct(aTypes); construct(aTypes);
@ -1885,7 +1886,8 @@ void SMESHGUI_FilterDlg::onClose()
aResMap.Add(anIndMap(i)); aResMap.Add(anIndMap(i));
mySelector->AddOrRemoveIndex( anIter.Key(), aResMap, false); mySelector->AddOrRemoveIndex( anIter.Key(), aResMap, false);
myViewWindow->highlight( anIter.Key(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIter.Key(), true, true );
} }
mySelectionMgr->setSelectedObjects(aList, false); mySelectionMgr->setSelectedObjects(aList, false);
} }
@ -2361,12 +2363,13 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QValueList<int
// Set new selection mode if necessary // Set new selection mode if necessary
Selection_Mode aSelMode = getSelMode(theType); Selection_Mode aSelMode = getSelMode(theType);
if (myViewWindow->SelectionMode()!=aSelMode) { SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && aViewWindow->SelectionMode()!=aSelMode) {
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
if (aSelMode == NodeSelection) if (aSelMode == NodeSelection)
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(aSelMode); aViewWindow->SetSelectionMode(aSelMode);
} }
// Clear selection // Clear selection
@ -2399,7 +2402,8 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QValueList<int
// Set new selection // Set new selection
mySelector->AddOrRemoveIndex(anIO, aMap, false); mySelector->AddOrRemoveIndex(anIO, aMap, false);
myViewWindow->highlight( anIO, true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
// insert previously stored filter in viewer if necessary // insert previously stored filter in viewer if necessary
if (!aFilter.IsNull()) if (!aFilter.IsNull())

View File

@ -293,7 +293,6 @@ private:
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
SVTK_ViewWindow* myViewWindow;
SMESH::SMESH_Mesh_ptr myMesh; SMESH::SMESH_Mesh_ptr myMesh;
QWidget* mySourceWg; QWidget* mySourceWg;

View File

@ -89,8 +89,6 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
WStyle_Title | WStyle_SysMenu | WDestructiveClose), WStyle_Title | WStyle_SysMenu | WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() ),
myIsBusy( false ), myIsBusy( false ),
myActor( 0 ) myActor( 0 )
{ {
@ -105,6 +103,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
myGeomGroupLine->setEnabled(false); myGeomGroupLine->setEnabled(false);
} }
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
/* Move widget on the botton right corner of main widget */ /* Move widget on the botton right corner of main widget */
int x, y ; int x, y ;
mySMESHGUI->DefineDlgPosition(this, x, y); mySMESHGUI->DefineDlgPosition(this, x, y);
@ -121,8 +121,6 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
WStyle_Title | WStyle_SysMenu | WDestructiveClose), WStyle_Title | WStyle_SysMenu | WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() ),
myIsBusy( false ) myIsBusy( false )
{ {
if (!name) setName("SMESHGUI_GroupDlg"); if (!name) setName("SMESHGUI_GroupDlg");
@ -134,6 +132,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
mySelectGroup->setEnabled(false); mySelectGroup->setEnabled(false);
} }
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
/* Move widget on the botton right corner of main widget */ /* Move widget on the botton right corner of main widget */
int x, y ; int x, y ;
mySMESHGUI->DefineDlgPosition(this, x, y); mySMESHGUI->DefineDlgPosition(this, x, y);
@ -543,19 +543,24 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
myActor->SetPointRepresentation(true); myActor->SetPointRepresentation(true);
else else
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
break; break;
case 1: case 1:
myViewWindow->SetSelectionMode(EdgeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
break; break;
case 2: case 2:
myViewWindow->SetSelectionMode(FaceSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
break; break;
default: default:
myViewWindow->SetSelectionMode(VolumeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(VolumeSelection);
} }
} else { } else {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
if (theMode == 4) if (theMode == 4)
mySelectionMgr->installFilter(mySubMeshFilter); mySelectionMgr->installFilter(mySubMeshFilter);
else if (theMode == 5) else if (theMode == 5)
@ -707,7 +712,8 @@ void SMESHGUI_GroupDlg::onListSelectionChanged()
SALOME_ListIO aList; SALOME_ListIO aList;
aList.Append(myActor->getIO()); aList.Append(myActor->getIO());
mySelectionMgr->setSelectedObjects(aList,false); mySelectionMgr->setSelectedObjects(aList,false);
myViewWindow->highlight( myActor->getIO(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
} }
myIsBusy = false; myIsBusy = false;
} }
@ -1392,7 +1398,8 @@ void SMESHGUI_GroupDlg::onClose()
} }
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();

View File

@ -119,7 +119,6 @@ private:
int myGrpTypeId; /* Current group type id : standalone or group on geometry */ int myGrpTypeId; /* Current group type id : standalone or group on geometry */
int myTypeId; /* Current type id = radio button id */ int myTypeId; /* Current type id = radio button id */
QLineEdit* myCurrentLineEdit; /* Current LineEdit */ QLineEdit* myCurrentLineEdit; /* Current LineEdit */
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QPushButton* myMeshGroupBtn; QPushButton* myMeshGroupBtn;

View File

@ -68,9 +68,7 @@ SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule, const int theMode
: QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_GroupOpDlg", false, : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_GroupOpDlg", false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
myMode = theMode; myMode = theMode;
@ -78,6 +76,8 @@ SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule, const int theMode
else if (myMode == INTERSECT) setCaption(tr("INTERSECTION_OF_TWO_GROUPS")); else if (myMode == INTERSECT) setCaption(tr("INTERSECTION_OF_TWO_GROUPS"));
else setCaption(tr("CUT_OF_TWO_GROUPS")); else setCaption(tr("CUT_OF_TWO_GROUPS"));
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING); QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING);
QFrame* aMainFrame = createMainFrame (this); QFrame* aMainFrame = createMainFrame (this);
@ -191,7 +191,8 @@ void SMESHGUI_GroupOpDlg::Init()
this->show(); this->show();
// set selection mode // set selection mode
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP)); mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
return; return;
@ -284,7 +285,8 @@ void SMESHGUI_GroupOpDlg::onOk()
//======================================================================= //=======================================================================
void SMESHGUI_GroupOpDlg::onClose() void SMESHGUI_GroupOpDlg::onClose()
{ {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
@ -343,7 +345,8 @@ void SMESHGUI_GroupOpDlg::enterEvent (QEvent*)
{ {
mySMESHGUI->EmitSignalDeactivateDialog(); mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true); setEnabled(true);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP)); mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
} }

View File

@ -97,7 +97,6 @@ private:
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
int myMode; int myMode;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QLineEdit* myFocusWg; QLineEdit* myFocusWg;

View File

@ -79,9 +79,7 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char*
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES"))); QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
@ -247,6 +245,8 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char*
myActor = 0; myActor = 0;
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH); myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
@ -356,7 +356,8 @@ void SMESHGUI_MergeNodesDlg::ClickOnCancel()
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
@ -388,7 +389,8 @@ void SMESHGUI_MergeNodesDlg::updateControls()
{ {
if (ListCoincident->childCount() < 1) { if (ListCoincident->childCount() < 1) {
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
return; return;
} }
@ -476,7 +478,8 @@ void SMESHGUI_MergeNodesDlg::onSelectNodesGroup()
mySelectionMgr->setSelectedObjects(aList, false); mySelectionMgr->setSelectedObjects(aList, false);
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
ListEdit->selectAll(true); ListEdit->selectAll(true);
} }
@ -590,7 +593,8 @@ void SMESHGUI_MergeNodesDlg::SetEditCurrentArgument()
if (send == SelectMeshButton) { if (send == SelectMeshButton) {
myEditCurrentArgument = (QWidget*)LineEditMesh; myEditCurrentArgument = (QWidget*)LineEditMesh;
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshFilter); mySelectionMgr->installFilter(myMeshOrSubMeshFilter);
} }

View File

@ -83,7 +83,6 @@ private:
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */ SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QWidget* myEditCurrentArgument; QWidget* myEditCurrentArgument;

View File

@ -110,9 +110,7 @@ SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule,
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
myBusy(false), myBusy(false),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
setCaption(tr("CAPTION")); setCaption(tr("CAPTION"));
@ -127,6 +125,9 @@ SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule,
aDlgLay->setStretchFactor(aMainFrame, 1); aDlgLay->setStretchFactor(aMainFrame, 1);
myCreationDlg = 0; myCreationDlg = 0;
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
Init(); Init();
} }
@ -462,7 +463,8 @@ void SMESHGUI_MeshPatternDlg::onClose()
{ {
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
SMESH::SetPickable(); SMESH::SetPickable();
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
@ -963,14 +965,21 @@ void SMESHGUI_MeshPatternDlg::activateSelection()
SMESH::SetPickable(anActor); SMESH::SetPickable(anActor);
if (myType == Type_2d) if (myType == Type_2d)
myViewWindow->SetSelectionMode(FaceSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
else else
myViewWindow->SetSelectionMode(CellSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
}
} }
else { else {
SMESH::SetPickable(); SMESH::SetPickable();
//mySelectionMgr->setSelectionModes(ActorSelection); //mySelectionMgr->setSelectionModes(ActorSelection);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
} }
if (mySelInput == Object && !myMeshShape->_is_nil()) { if (mySelInput == Object && !myMeshShape->_is_nil()) {
@ -1265,7 +1274,8 @@ void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText)
newIndices.Add(e->GetID()); newIndices.Add(e->GetID());
} }
mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false); mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
myViewWindow->highlight( anActor->getIO(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anActor->getIO(), true, true );
} }
myBusy = false; myBusy = false;

View File

@ -156,7 +156,6 @@ private:
QCheckBox* myPreviewChk; QCheckBox* myPreviewChk;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
int mySelInput; int mySelInput;

View File

@ -93,9 +93,7 @@ SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg (SMESHGUI* theModule,
theName, theName,
false, false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)), mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
myViewWindow(SMESH::GetViewWindow(theModule)),
mySMESHGUI(theModule) mySMESHGUI(theModule)
{ {
myPreviewActor = 0; myPreviewActor = 0;
@ -113,6 +111,8 @@ SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg (SMESHGUI* theModule,
aDlgLay->setStretchFactor(aMainFrame, 1); aDlgLay->setStretchFactor(aMainFrame, 1);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
Init(); Init();
} }
@ -230,7 +230,8 @@ void SMESHGUI_MoveNodesDlg::Init()
// set selection mode // set selection mode
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
onSelectionDone(); onSelectionDone();
} }
@ -323,7 +324,8 @@ void SMESHGUI_MoveNodesDlg::onClose()
{ {
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
@ -356,7 +358,8 @@ void SMESHGUI_MoveNodesDlg::onTextChange (const QString& theNewText)
TColStd_MapOfInteger aListInd; TColStd_MapOfInteger aListInd;
aListInd.Add(anElem->GetID()); aListInd.Add(anElem->GetID());
mySelector->AddOrRemoveIndex(anIO,aListInd, false); mySelector->AddOrRemoveIndex(anIO,aListInd, false);
myViewWindow->highlight(anIO,true,true); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight(anIO,true,true);
onSelectionDone(); onSelectionDone();
} }
@ -423,7 +426,8 @@ void SMESHGUI_MoveNodesDlg::enterEvent (QEvent*)
// set selection mode // set selection mode
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
redisplayPreview(); redisplayPreview();
@ -438,7 +442,8 @@ void SMESHGUI_MoveNodesDlg::enterEvent (QEvent*)
void SMESHGUI_MoveNodesDlg::closeEvent (QCloseEvent*) void SMESHGUI_MoveNodesDlg::closeEvent (QCloseEvent*)
{ {
onClose(); onClose();
myViewWindow->Repaint(); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->Repaint();
} }
//======================================================================= //=======================================================================
@ -471,10 +476,13 @@ void SMESHGUI_MoveNodesDlg::erasePreview()
if (myPreviewActor == 0) if (myPreviewActor == 0)
return; return;
myViewWindow->RemoveActor(myPreviewActor); SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if (aViewWindow)
aViewWindow->RemoveActor(myPreviewActor);
myPreviewActor->Delete(); myPreviewActor->Delete();
myPreviewActor = 0; myPreviewActor = 0;
myViewWindow->Repaint(); if (aViewWindow)
aViewWindow->Repaint();
} }
//======================================================================= //=======================================================================
@ -548,6 +556,9 @@ void SMESHGUI_MoveNodesDlg::redisplayPreview()
myPreviewActor->SetProperty(aProp); myPreviewActor->SetProperty(aProp);
aProp->Delete(); aProp->Delete();
myViewWindow->AddActor(myPreviewActor); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
myViewWindow->Repaint(); {
aViewWindow->AddActor(myPreviewActor);
aViewWindow->Repaint();
}
} }

View File

@ -97,7 +97,6 @@ private:
SMESHGUI_SpinBox* myZ; SMESHGUI_SpinBox* myZ;
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;

View File

@ -111,7 +111,6 @@ SMESHGUI_MultiEditDlg
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)), mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
myViewWindow(SMESH::GetViewWindow(theModule)),
mySMESHGUI(theModule) mySMESHGUI(theModule)
{ {
myFilterDlg = 0; myFilterDlg = 0;
@ -372,7 +371,8 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds()
//======================================================================= //=======================================================================
void SMESHGUI_MultiEditDlg::onClose() void SMESHGUI_MultiEditDlg::onClose()
{ {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
@ -762,7 +762,8 @@ void SMESHGUI_MultiEditDlg::onListSelectionChanged()
} }
mySelector->AddOrRemoveIndex(anActor->getIO(),anIndexes,false); mySelector->AddOrRemoveIndex(anActor->getIO(),anIndexes,false);
myViewWindow->highlight(anActor->getIO(),true,true); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight(anActor->getIO(),true,true);
} }
//======================================================================= //=======================================================================
@ -833,19 +834,23 @@ void SMESHGUI_MultiEditDlg::setSelectionMode()
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
if (mySubmeshChk->isChecked()) { if (mySubmeshChk->isChecked()) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(new SMESH_TypeFilter(SUBMESH)); mySelectionMgr->installFilter(new SMESH_TypeFilter(SUBMESH));
} }
else if (myGroupChk->isChecked()) { else if (myGroupChk->isChecked()) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP)); mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP));
} }
if (entityType()) { if (entityType()) {
myViewWindow->SetSelectionMode(VolumeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(VolumeSelection);
SMESH::SetFilter(new SMESHGUI_VolumesFilter()); SMESH::SetFilter(new SMESHGUI_VolumesFilter());
} else { } else {
myViewWindow->SetSelectionMode(FaceSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
if (myFilterType == SMESHGUI_TriaFilter) if (myFilterType == SMESHGUI_TriaFilter)
SMESH::SetFilter(new SMESHGUI_TriangleFilter()); SMESH::SetFilter(new SMESHGUI_TriangleFilter());
else if (myFilterType == SMESHGUI_QuadFilter) else if (myFilterType == SMESHGUI_QuadFilter)

View File

@ -124,7 +124,6 @@ protected:
SMESH::SMESH_Mesh_var myMesh; SMESH::SMESH_Mesh_var myMesh;
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;

View File

@ -230,10 +230,9 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)), mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
myViewWindow(SMESH::GetViewWindow(theModule)),
mySMESHGUI(theModule) mySMESHGUI(theModule)
{ {
mySimulation = new SMESH::TNodeSimulation(myViewWindow); mySimulation = new SMESH::TNodeSimulation(SMESH::GetViewWindow( mySMESHGUI ));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_NODE"))); QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
if (!name) if (!name)
@ -382,7 +381,8 @@ void SMESHGUI_NodesDlg::Init ()
// set selection mode // set selection mode
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -468,7 +468,8 @@ bool SMESHGUI_NodesDlg::ClickOnApply()
void SMESHGUI_NodesDlg::ClickOnCancel() void SMESHGUI_NodesDlg::ClickOnCancel()
{ {
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySimulation->SetVisibility(false); mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
@ -571,7 +572,8 @@ void SMESHGUI_NodesDlg::ActivateThisDialog()
GroupButtons->setEnabled(true); GroupButtons->setEnabled(true);
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
SelectionIntoArgument(); SelectionIntoArgument();
} }

View File

@ -75,7 +75,6 @@ public:
private: private:
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;

View File

@ -82,7 +82,6 @@ SMESHGUI_RemoveElementsDlg
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)), mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
myViewWindow(SMESH::GetViewWindow(theModule)),
mySMESHGUI(theModule), mySMESHGUI(theModule),
myBusy(false) myBusy(false)
{ {
@ -225,7 +224,8 @@ void SMESHGUI_RemoveElementsDlg::Init()
this->move(x, y); this->move(x, y);
this->show(); /* displays Dialog */ this->show(); /* displays Dialog */
myViewWindow->SetSelectionMode(CellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -286,7 +286,8 @@ void SMESHGUI_RemoveElementsDlg::ClickOnOk()
void SMESHGUI_RemoveElementsDlg::ClickOnCancel() void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
{ {
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
@ -324,7 +325,8 @@ void SMESHGUI_RemoveElementsDlg::onTextChange (const QString& theNewText)
} }
mySelector->AddOrRemoveIndex(anIO,newIndices,false); mySelector->AddOrRemoveIndex(anIO,newIndices,false);
myViewWindow->highlight(anIO,true,true); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight(anIO,true,true);
} }
} }
@ -446,7 +448,8 @@ void SMESHGUI_RemoveElementsDlg::ActivateThisDialog()
mySMESHGUI->SetActiveDialogBox((QDialog*)this); // ?? mySMESHGUI->SetActiveDialogBox((QDialog*)this); // ??
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
SelectionIntoArgument(); // ?? SelectionIntoArgument(); // ??
} }

View File

@ -77,7 +77,6 @@ private:
void hideEvent ( QHideEvent * ); /* ESC key */ void hideEvent ( QHideEvent * ); /* ESC key */
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;

View File

@ -82,7 +82,6 @@ SMESHGUI_RemoveNodesDlg
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)), mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
myViewWindow(SMESH::GetViewWindow(theModule)),
mySMESHGUI(theModule), mySMESHGUI(theModule),
myBusy(false) myBusy(false)
{ {
@ -226,7 +225,9 @@ void SMESHGUI_RemoveNodesDlg::Init()
this->show(); /* displays Dialog */ this->show(); /* displays Dialog */
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -289,7 +290,8 @@ void SMESHGUI_RemoveNodesDlg::ClickOnCancel()
{ {
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
@ -325,7 +327,8 @@ void SMESHGUI_RemoveNodesDlg::onTextChange (const QString& theNewText)
} }
mySelector->AddOrRemoveIndex(anIO,newIndices,false); mySelector->AddOrRemoveIndex(anIO,newIndices,false);
myViewWindow->highlight(anIO,true,true); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight(anIO,true,true);
} }
} }
@ -448,7 +451,8 @@ void SMESHGUI_RemoveNodesDlg::ActivateThisDialog()
mySMESHGUI->SetActiveDialogBox((QDialog*)this); // ?? mySMESHGUI->SetActiveDialogBox((QDialog*)this); // ??
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
SelectionIntoArgument(); // ?? SelectionIntoArgument(); // ??
} }

View File

@ -80,7 +80,6 @@ private:
void hideEvent ( QHideEvent * ); /* ESC key */ void hideEvent ( QHideEvent * ); /* ESC key */
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;

View File

@ -83,9 +83,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char*
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE"))); QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
@ -298,6 +296,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char*
GroupArguments->show(); GroupArguments->show();
RadioButton1->setChecked(TRUE); RadioButton1->setChecked(TRUE);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
// Costruction of the logical filter // Costruction of the logical filter
@ -416,7 +416,10 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
} }
if (!CheckBoxMesh->isChecked()) if (!CheckBoxMesh->isChecked())
myViewWindow->SetSelectionMode(aSelMode); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(aSelMode);
}
myEditCurrentArgument = (QWidget*)LineEditElements; myEditCurrentArgument = (QWidget*)LineEditElements;
LineEditElements->setFocus(); LineEditElements->setFocus();
@ -493,7 +496,8 @@ void SMESHGUI_RevolutionDlg::ClickOnCancel()
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
} }
@ -536,7 +540,8 @@ void SMESHGUI_RevolutionDlg::onTextChange (const QString& theNewText)
} }
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
myViewWindow->highlight( myActor->getIO(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
myElementsId = theNewText; myElementsId = theNewText;
} }
@ -726,23 +731,32 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument()
myEditCurrentArgument = (QWidget*)LineEditElements; myEditCurrentArgument = (QWidget*)LineEditElements;
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) { if (CheckBoxMesh->isChecked()) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else { } else {
int aConstructorId = GetConstructorId(); int aConstructorId = GetConstructorId();
if (aConstructorId == 0) if (aConstructorId == 0)
myViewWindow->SetSelectionMode(EdgeSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 1) else if (aConstructorId == 1)
myViewWindow->SetSelectionMode(FaceSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
} }
} else if (send == SelectPointButton) { } else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X; myEditCurrentArgument = (QWidget*)SpinBox_X;
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
} else if (send == SelectVectorButton) { } else if (send == SelectVectorButton) {
myEditCurrentArgument = (QWidget*)SpinBox_DX; myEditCurrentArgument = (QWidget*)SpinBox_DX;
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
} else { } else {
} }
@ -834,15 +848,22 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (toSelectMesh) { if (toSelectMesh) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
LineEditElements->setReadOnly(true); LineEditElements->setReadOnly(true);
} else { } else {
int aConstructorId = GetConstructorId(); int aConstructorId = GetConstructorId();
if (aConstructorId == 0) if (aConstructorId == 0)
myViewWindow->SetSelectionMode(EdgeSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 0) else if (aConstructorId == 0)
myViewWindow->SetSelectionMode(FaceSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
LineEditElements->setReadOnly(false); LineEditElements->setReadOnly(false);
onTextChange(LineEditElements->text()); onTextChange(LineEditElements->text());

View File

@ -86,7 +86,6 @@ private:
int myNbOkElements; /* to check when elements are defined */ int myNbOkElements; /* to check when elements are defined */
QString myElementsId; QString myElementsId;
QWidget* myEditCurrentArgument; /* Current argument */ QWidget* myEditCurrentArgument; /* Current argument */
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
bool myBusy; bool myBusy;

View File

@ -82,9 +82,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_ROTATION"))); QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_ROTATION")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
@ -287,6 +285,8 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam
myConstructorId = 0; myConstructorId = 0;
RadioButton1->setChecked(TRUE); RadioButton1->setChecked(TRUE);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
// Costruction of the logical filter // Costruction of the logical filter
@ -450,7 +450,8 @@ void SMESHGUI_RotationDlg::ClickOnCancel()
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
} }
@ -492,7 +493,8 @@ void SMESHGUI_RotationDlg::onTextChange (const QString& theNewText)
} }
mySelector->AddOrRemoveIndex( anIO, newIndices, false ); mySelector->AddOrRemoveIndex( anIO, newIndices, false );
myViewWindow->highlight( anIO, true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText; myElementsId = theNewText;
} }
@ -660,26 +662,28 @@ void SMESHGUI_RotationDlg::SetEditCurrentArgument()
switch (myConstructorId) { switch (myConstructorId) {
case 0: /* default constructor */ case 0: /* default constructor */
{ {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if (send == SelectElementsButton) { if (send == SelectElementsButton) {
myEditCurrentArgument = (QWidget*)LineEditElements; myEditCurrentArgument = (QWidget*)LineEditElements;
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) { if (CheckBoxMesh->isChecked()) {
myViewWindow->SetSelectionMode(ActorSelection); if ( aViewWindow )
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else { } else {
if ( aViewWindow )
myViewWindow->SetSelectionMode( CellSelection ); aViewWindow->SetSelectionMode( CellSelection );
} }
} else if (send == SelectPointButton) { } else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X; myEditCurrentArgument = (QWidget*)SpinBox_X;
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
if ( aViewWindow )
myViewWindow->SetSelectionMode( NodeSelection ); aViewWindow->SetSelectionMode( NodeSelection );
} else if (send == SelectVectorButton) { } else if (send == SelectVectorButton) {
myEditCurrentArgument = (QWidget*)SpinBox_DX; myEditCurrentArgument = (QWidget*)SpinBox_DX;
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
if ( aViewWindow )
myViewWindow->SetSelectionMode( NodeSelection ); aViewWindow->SetSelectionMode( NodeSelection );
} }
break; break;
} }
@ -719,7 +723,8 @@ void SMESHGUI_RotationDlg::ActivateThisDialog()
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myViewWindow->SetSelectionMode( CellSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( CellSelection );
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -773,11 +778,13 @@ void SMESHGUI_RotationDlg::onSelectMesh (bool toSelectMesh)
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (toSelectMesh) { if (toSelectMesh) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
LineEditElements->setReadOnly(true); LineEditElements->setReadOnly(true);
} else { } else {
myViewWindow->SetSelectionMode( CellSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( CellSelection );
LineEditElements->setReadOnly(false); LineEditElements->setReadOnly(false);
onTextChange(LineEditElements->text()); onTextChange(LineEditElements->text());
} }

View File

@ -83,7 +83,6 @@ private:
SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */ SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */
int myNbOkElements; /* to check when elements are defined */ int myNbOkElements; /* to check when elements are defined */
QString myElementsId; QString myElementsId;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QWidget* myEditCurrentArgument; /* Current LineEdit */ QWidget* myEditCurrentArgument; /* Current LineEdit */

View File

@ -75,9 +75,7 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name,
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap image0 (mgr->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_FREEBORDERS"))); QPixmap image0 (mgr->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_FREEBORDERS")));
@ -284,6 +282,8 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name,
LineEdit5->setValidator(new SMESHGUI_IdValidator(this, "validator", 1)); LineEdit5->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
LineEdit6->setValidator(new SMESHGUI_IdValidator(this, "validator", 1)); LineEdit6->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
Init(); Init();
@ -452,7 +452,8 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(CellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
break; break;
} }
} }
@ -470,7 +471,8 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
} }
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
@ -593,7 +595,8 @@ void SMESHGUI_SewingDlg::ClickOnCancel()
{ {
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
@ -643,13 +646,15 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
if (GetConstructorId() != 3 || (send != LineEdit1 && send != LineEdit4)) { if (GetConstructorId() != 3 || (send != LineEdit1 && send != LineEdit4)) {
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt()); const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt());
if (n) { if (n) {
newIndices.Add(n->GetID()); newIndices.Add(n->GetID());
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
myViewWindow->highlight( myActor->getIO(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
if (send == LineEdit1) if (send == LineEdit1)
myOk1 = true; myOk1 = true;
@ -667,7 +672,8 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
} else { } else {
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(CellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
QStringList aListId = QStringList::split(" ", theNewText, false); QStringList aListId = QStringList::split(" ", theNewText, false);
@ -684,7 +690,8 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
myViewWindow->highlight( myActor->getIO(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
if (isEvenOneExists) { if (isEvenOneExists) {
if (send == LineEdit1) if (send == LineEdit1)
@ -821,11 +828,13 @@ void SMESHGUI_SewingDlg::SetEditCurrentArgument()
if (GetConstructorId() != 3 || (send != SelectButton1 && send != SelectButton4)) { if (GetConstructorId() != 3 || (send != SelectButton1 && send != SelectButton4)) {
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
} else { } else {
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(CellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
} }
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();

View File

@ -79,7 +79,6 @@ private:
SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */ SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */
int myOk1, myOk2, myOk3, myOk4, myOk5, myOk6; int myOk1, myOk2, myOk3, myOk4, myOk5, myOk6;
QLineEdit* myEditCurrentArgument; /* Current LineEdit */ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
bool myBusy; bool myBusy;

View File

@ -113,7 +113,6 @@ SMESHGUI_SingleEditDlg
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)), mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
myViewWindow(SMESH::GetViewWindow(theModule)),
mySMESHGUI(theModule) mySMESHGUI(theModule)
{ {
QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING); QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING);
@ -240,7 +239,8 @@ void SMESHGUI_SingleEditDlg::Init()
this->show(); this->show();
// set selection mode // set selection mode
myViewWindow->SetSelectionMode(EdgeOfCellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeOfCellSelection);
onSelectionDone(); onSelectionDone();
} }
@ -262,7 +262,8 @@ void SMESHGUI_SingleEditDlg::onOk()
//======================================================================= //=======================================================================
void SMESHGUI_SingleEditDlg::onClose() void SMESHGUI_SingleEditDlg::onClose()
{ {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
@ -442,7 +443,8 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*)
{ {
if (!isEnabled()) { if (!isEnabled()) {
mySMESHGUI->EmitSignalDeactivateDialog(); mySMESHGUI->EmitSignalDeactivateDialog();
myViewWindow->SetSelectionMode(EdgeOfCellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeOfCellSelection);
setEnabled(true); setEnabled(true);
} }
} }

View File

@ -89,7 +89,6 @@ protected:
SMESH_Actor* myActor; SMESH_Actor* myActor;
SalomeApp_SelectionMgr* mySelectionMgr; SalomeApp_SelectionMgr* mySelectionMgr;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;
}; };

View File

@ -89,9 +89,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING"))); QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
@ -253,6 +251,8 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n
GroupArguments->show(); GroupArguments->show();
myConstructorId = 0; myConstructorId = 0;
Constructor1->setChecked(TRUE); Constructor1->setChecked(TRUE);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
mySMESHGUI->SetActiveDialogBox(this); mySMESHGUI->SetActiveDialogBox(this);
@ -424,7 +424,8 @@ void SMESHGUI_SmoothingDlg::ClickOnCancel()
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPickable(); // ??? SMESH::SetPickable(); // ???
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
} }
@ -470,7 +471,8 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText)
myNbOkElements++; myNbOkElements++;
} }
mySelector->AddOrRemoveIndex(anIO, newIndices, false); mySelector->AddOrRemoveIndex(anIO, newIndices, false);
myViewWindow->highlight( anIO, true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText; myElementsId = theNewText;
} else if (send == LineEditNodes) { } else if (send == LineEditNodes) {
@ -483,7 +485,8 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText)
myNbOkNodes++; myNbOkNodes++;
} }
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
myViewWindow->highlight( myActor->getIO(), true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
} }
} }
@ -633,12 +636,14 @@ void SMESHGUI_SmoothingDlg::SetEditCurrentArgument()
mySelectionMgr->setSelectionModes(ActorSelection); mySelectionMgr->setSelectionModes(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else { } else {
myViewWindow->SetSelectionMode(CellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
} }
} else if (send == SelectNodesButton) { } else if (send == SelectNodesButton) {
myEditCurrentArgument = LineEditNodes; myEditCurrentArgument = LineEditNodes;
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
} }
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
@ -677,7 +682,8 @@ void SMESHGUI_SmoothingDlg::ActivateThisDialog()
GroupButtons->setEnabled(true); GroupButtons->setEnabled(true);
mySMESHGUI->SetActiveDialogBox(this); mySMESHGUI->SetActiveDialogBox(this);
myViewWindow->SetSelectionMode(CellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -735,7 +741,8 @@ void SMESHGUI_SmoothingDlg::onSelectMesh (bool toSelectMesh)
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
LineEditElements->setReadOnly(true); LineEditElements->setReadOnly(true);
} else { } else {
myViewWindow->SetSelectionMode(CellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
LineEditElements->setReadOnly(false); LineEditElements->setReadOnly(false);
onTextChange(LineEditElements->text()); onTextChange(LineEditElements->text());
} }

View File

@ -87,7 +87,6 @@ private:
int myNbOkNodes; /* to check when fixed nodes are defined */ int myNbOkNodes; /* to check when fixed nodes are defined */
int myConstructorId; /* Current constructor id = radio button id */ int myConstructorId; /* Current constructor id = radio button id */
QLineEdit* myEditCurrentArgument; /* Current LineEdit */ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
bool myBusy; bool myBusy;

View File

@ -82,9 +82,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_POINT"))); QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_POINT")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_AXIS"))); QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_AXIS")));
@ -281,6 +279,8 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam
GroupArguments->show(); GroupArguments->show();
RadioButton1->setChecked(TRUE); RadioButton1->setChecked(TRUE);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
// Costruction of the logical filter // Costruction of the logical filter
@ -420,7 +420,10 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId)
if (myEditCurrentArgument != (QWidget*)LineEditElements) { if (myEditCurrentArgument != (QWidget*)LineEditElements) {
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (!CheckBoxMesh->isChecked()) if (!CheckBoxMesh->isChecked())
myViewWindow->SetSelectionMode(CellSelection); {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
}
} }
myEditCurrentArgument = (QWidget*)LineEditElements; myEditCurrentArgument = (QWidget*)LineEditElements;
@ -509,7 +512,8 @@ void SMESHGUI_SymmetryDlg::ClickOnCancel()
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
} }
@ -552,7 +556,8 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText)
} }
mySelector->AddOrRemoveIndex( anIO, newIndices, false ); mySelector->AddOrRemoveIndex( anIO, newIndices, false );
myViewWindow->highlight( anIO, true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText; myElementsId = theNewText;
} }
@ -721,20 +726,24 @@ void SMESHGUI_SymmetryDlg::SetEditCurrentArgument()
myEditCurrentArgument = (QWidget*)LineEditElements; myEditCurrentArgument = (QWidget*)LineEditElements;
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) { if (CheckBoxMesh->isChecked()) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else { } else {
myViewWindow->SetSelectionMode(CellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
} }
} else if (send == SelectPointButton) { } else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X; myEditCurrentArgument = (QWidget*)SpinBox_X;
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
} else if (send == SelectVectorButton) { } else if (send == SelectVectorButton) {
myEditCurrentArgument = (QWidget*)SpinBox_DX; myEditCurrentArgument = (QWidget*)SpinBox_DX;
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode(NodeSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
} else { } else {
} }
@ -772,7 +781,8 @@ void SMESHGUI_SymmetryDlg::ActivateThisDialog()
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myViewWindow->SetSelectionMode(CellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -826,11 +836,13 @@ void SMESHGUI_SymmetryDlg::onSelectMesh (bool toSelectMesh)
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (toSelectMesh) { if (toSelectMesh) {
myViewWindow->SetSelectionMode(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
LineEditElements->setReadOnly(true); LineEditElements->setReadOnly(true);
} else { } else {
myViewWindow->SetSelectionMode(CellSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
LineEditElements->setReadOnly(false); LineEditElements->setReadOnly(false);
onTextChange(LineEditElements->text()); onTextChange(LineEditElements->text());
} }

View File

@ -83,7 +83,6 @@ private:
SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */ SalomeApp_SelectionMgr* mySelectionMgr; /* User shape selection */
int myNbOkElements; /* to check when elements are defined */ int myNbOkElements; /* to check when elements are defined */
QString myElementsId; QString myElementsId;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QWidget* myEditCurrentArgument; /* Current LineEdit */ QWidget* myEditCurrentArgument; /* Current LineEdit */

View File

@ -83,9 +83,7 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{ {
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_POINTS"))); 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 image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
@ -261,6 +259,8 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha
GroupArguments->show(); GroupArguments->show();
RadioButton1->setChecked(TRUE); RadioButton1->setChecked(TRUE);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
// Costruction of the logical filter // Costruction of the logical filter
@ -395,8 +395,8 @@ void SMESHGUI_TranslationDlg::ConstructorsClicked (int constructorId)
if (myEditCurrentArgument != (QWidget*)LineEditElements) { if (myEditCurrentArgument != (QWidget*)LineEditElements) {
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (!CheckBoxMesh->isChecked()) if (!CheckBoxMesh->isChecked())
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
myViewWindow->SetSelectionMode( CellSelection ); aViewWindow->SetSelectionMode( CellSelection );
} }
myEditCurrentArgument = (QWidget*)LineEditElements; myEditCurrentArgument = (QWidget*)LineEditElements;
@ -474,7 +474,8 @@ void SMESHGUI_TranslationDlg::ClickOnCancel()
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myViewWindow->SetSelectionMode( ActorSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection );
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); reject();
} }
@ -518,7 +519,8 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText)
} }
mySelector->AddOrRemoveIndex( anIO, newIndices, false ); mySelector->AddOrRemoveIndex( anIO, newIndices, false );
myViewWindow->highlight( anIO, true, true ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText; myElementsId = theNewText;
} }
@ -686,22 +688,26 @@ void SMESHGUI_TranslationDlg::SetEditCurrentArgument()
myEditCurrentArgument = (QWidget*)LineEditElements; myEditCurrentArgument = (QWidget*)LineEditElements;
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) { if (CheckBoxMesh->isChecked()) {
myViewWindow->SetSelectionMode( ActorSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection );
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else { } else {
myViewWindow->SetSelectionMode( CellSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( CellSelection );
} }
} else if (send == SelectButton1) { } else if (send == SelectButton1) {
myEditCurrentArgument = (QWidget*)SpinBox1_1; myEditCurrentArgument = (QWidget*)SpinBox1_1;
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode( NodeSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( NodeSelection );
} else if (send == SelectButton2) { } else if (send == SelectButton2) {
myEditCurrentArgument = (QWidget*)SpinBox2_1; myEditCurrentArgument = (QWidget*)SpinBox2_1;
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
myViewWindow->SetSelectionMode( NodeSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( NodeSelection );
} }
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
@ -738,7 +744,8 @@ void SMESHGUI_TranslationDlg::ActivateThisDialog()
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myViewWindow->SetSelectionMode( CellSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( CellSelection );
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -793,11 +800,13 @@ void SMESHGUI_TranslationDlg::onSelectMesh (bool toSelectMesh)
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (toSelectMesh) { if (toSelectMesh) {
myViewWindow->SetSelectionMode( ActorSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection );
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
LineEditElements->setReadOnly(true); LineEditElements->setReadOnly(true);
} else { } else {
myViewWindow->SetSelectionMode( CellSelection ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( CellSelection );
LineEditElements->setReadOnly(false); LineEditElements->setReadOnly(false);
onTextChange(LineEditElements->text()); onTextChange(LineEditElements->text());
} }

View File

@ -82,7 +82,6 @@ private:
QString myElementsId; QString myElementsId;
int myNbOkElements; /* to check when elements are defined */ int myNbOkElements; /* to check when elements are defined */
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QWidget* myEditCurrentArgument; QWidget* myEditCurrentArgument;

View File

@ -497,7 +497,8 @@ namespace SMESH{
void SetFilter(const Handle(VTKViewer_Filter)& theFilter, void SetFilter(const Handle(VTKViewer_Filter)& theFilter,
SVTK_InteractorStyle* theStyle) SVTK_InteractorStyle* theStyle)
{ {
theStyle->SetFilter(theFilter); if (theStyle)
theStyle->SetFilter(theFilter);
} }
Handle(VTKViewer_Filter) GetFilter(int theId, SVTK_InteractorStyle* theStyle) Handle(VTKViewer_Filter) GetFilter(int theId, SVTK_InteractorStyle* theStyle)