X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_RevolutionDlg.cxx;h=04f1a08f0888146bcb3200f6b512572e3c301c5b;hb=HEAD;hp=a62c7bfc87becdd59c902a6fb7a1a2c6abd03475;hpb=6c4a9f32ed7b4416d79e0d0d293919609a8eb178;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index a62c7bfc8..04f1a08f0 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -57,7 +57,7 @@ #include #include #include -#include +//#include // OCCT includes #include @@ -202,13 +202,15 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule ) MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments); MakeGroupsCheck->setChecked(true); - GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 1, 4); - GroupArgumentsLayout->addWidget(GroupAxis, 1, 0, 1, 4); - GroupArgumentsLayout->addWidget(GroupAngleBox, 2, 0, 1, 4); - GroupArgumentsLayout->addWidget(TextLabelTolerance, 3, 0, 1, 2); - GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 3, 2, 1, 2); - GroupArgumentsLayout->addWidget(myPreviewCheckBox, 4, 0, 1, 4); - GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0, 1, 4); + GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 3, 4); + GroupArgumentsLayout->addWidget(GroupAxis, 0, 4, 1, 4); + GroupArgumentsLayout->addWidget(GroupAngleBox, 1, 4, 1, 4); + GroupArgumentsLayout->addWidget(TextLabelTolerance, 2, 4, 1, 2); + GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 2, 6, 1, 2); + GroupArgumentsLayout->addWidget(myPreviewCheckBox, 3, 0, 1, 2); + GroupArgumentsLayout->addWidget(MakeGroupsCheck, 3, 2, 1, 2); + SelectorWdg->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); + SelectorWdg->setMinimumWidth(320); SelectorWdg->GetButtonGroup()->addButton( SelectVectorButton ); SelectorWdg->GetButtonGroup()->addButton( SelectPointButton ); @@ -261,7 +263,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule ) mySMESHGUI->SetActiveDialogBox((QDialog*)this); - myHelpFileName = "revolution_page.html"; + myHelpFileName = "revolution.html"; Init(); @@ -296,7 +298,9 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule ) connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation())); connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); + connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView())); + connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView())); connect(GroupAngle, SIGNAL(buttonClicked(int)), this, SLOT(toDisplaySimulation())); connect(SpinBox_Angle, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation())); @@ -390,7 +394,7 @@ bool SMESHGUI_RevolutionDlg::isValid() //================================================================================= bool SMESHGUI_RevolutionDlg::ClickOnApply() { - if (mySMESHGUI->isActiveStudyLocked()) + if (SMESHGUI::isStudyLocked()) return false; if (!isValid()) @@ -434,7 +438,7 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply() SMESH::SMESH_Mesh_var mesh = SelectorWdg->GetMesh(); - mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + mesh->SetParameters( aParameters.join(":").toUtf8().constData() ); SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources(); SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources(); @@ -517,6 +521,32 @@ void SMESHGUI_RevolutionDlg::reject() QDialog::reject(); } +//================================================================================= +// function : onOpenView() +// purpose : +//================================================================================= +void SMESHGUI_RevolutionDlg::onOpenView() +{ + if ( mySelector ) { + mySimulation->SetVisibility(false); + SMESH::SetPointRepresentation(false); + } + else { + mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector(); + ActivateThisDialog(); + } +} + +//================================================================================= +// function : onCloseView() +// purpose : +//================================================================================= +void SMESHGUI_RevolutionDlg::onCloseView() +{ + DeactivateActiveDialog(); + mySelector = 0; +} + //================================================================================= // function : ClickOnHelp() // purpose : @@ -545,7 +575,7 @@ void SMESHGUI_RevolutionDlg::ClickOnHelp() // function : onAngleTextChange() // purpose : //======================================================================= -void SMESHGUI_RevolutionDlg::onAngleTextChange (const QString& theNewText) +void SMESHGUI_RevolutionDlg::onAngleTextChange (const QString& /*theNewText*/) { bool isNumber; SpinBox_Angle->text().toDouble( &isNumber ); @@ -574,7 +604,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument() return; Handle(SALOME_InteractiveObject) IO = aList.First(); - TColStd_IndexedMapOfInteger aMapIndex; + SVTK_TIndexedMapOfVtkId aMapIndex; mySelector->GetIndex(IO,aMapIndex); if ( aMapIndex.Extent() != 1 ) return; @@ -584,9 +614,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument() if ( !aMesh ) return; - int aNbUnits = 0; - - bool isNodeSelected = (myEditCurrentArgument == (QWidget*)SpinBox_X || + bool isNodeSelected = ((myEditCurrentArgument == (QWidget*)SpinBox_X ) || (myEditCurrentArgument == (QWidget*)SpinBox_DX && myVectorDefinition==POINT_SELECT)); @@ -615,7 +643,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument() else if ( isFaceSelected ) { const SMDS_MeshFace* face = - dynamic_cast(aMesh->FindElement(aMapIndex(1))); + SMDS_Mesh::DownCast( aMesh->FindElement( aMapIndex( 1 ))); if (!face) return; gp_XYZ aNormale = SMESH::getNormale(face); @@ -690,8 +718,13 @@ void SMESHGUI_RevolutionDlg::ActivateThisDialog() //================================================================================= void SMESHGUI_RevolutionDlg::enterEvent (QEvent*) { - if (!GroupButtons->isEnabled()) + if (!GroupButtons->isEnabled()) { + SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); + if ( aViewWindow && !mySelector) { + mySelector = aViewWindow->GetSelector(); + } ActivateThisDialog(); + } } //================================================================================= @@ -765,7 +798,7 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview) anAxis, anAngle, aNbSteps, aTolerance, makeGroups ); SMESH::MeshPreviewStruct_var aMeshPreviewStruct = meshEditor->GetPreviewData(); - mySimulation->SetData( aMeshPreviewStruct._retn() ); + mySimulation->SetData( aMeshPreviewStruct.in() ); } catch (...) {} }