X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHEXABLOCKGUI%2FMyBasicGUI_PointDlg.cxx;h=279b50392968f1447243ee504d7f4dba510004d9;hb=b807e66955ae476b30f59bc29f1fe6c813837063;hp=48666d18628f9f03c191d8dbd71dc695adbc6493;hpb=ab53385205fe062af0e87d4e14296b1492fe3611;p=modules%2Fhexablock.git diff --git a/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx b/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx index 48666d1..279b503 100644 --- a/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx +++ b/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D +// Copyright (C) 2009-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -26,7 +26,6 @@ #include "MyDlgRef.hxx" -#include #include #include @@ -35,6 +34,7 @@ #include #include #include +#include #include #include @@ -100,8 +100,8 @@ MyBasicGUI_PointDlg::MyBasicGUI_PointDlg(QWidget* parent, Qt::WindowFlags fl) QPixmap image7 (aResMgr->loadPixmap("GEOM", tr("ICO_WIRE"))); setWindowTitle( tr("Vertex Association") ); - setMinimumWidth(260); - setMinimumHeight(400); +// setMinimumWidth(260); +// setMinimumHeight(400); mainFrame()->GroupConstructors->setTitle(tr("GEOM_POINTS")); mainFrame()->RadioButton1->setIcon(image0); @@ -116,19 +116,23 @@ MyBasicGUI_PointDlg::MyBasicGUI_PointDlg(QWidget* parent, Qt::WindowFlags fl) myParamCoord = new QButtonGroup(myParamGroup); QHBoxLayout* boxLayout = new QHBoxLayout(myParamGroup); boxLayout->setMargin(MARGIN); boxLayout->setSpacing(SPACING); + QRadioButton* btn = new QRadioButton(tr("By Param"), myParamGroup); myParamCoord->addButton(btn, PARAM_VALUE); boxLayout->addWidget(btn); + btn = new QRadioButton(tr("By Length"), myParamGroup); myParamCoord->addButton(btn, LENGTH_VALUE); boxLayout->addWidget(btn); + btn = new QRadioButton(tr("By Coords"), myParamGroup); myParamCoord->addButton(btn, COORD_VALUE); boxLayout->addWidget(btn); + myParamCoord->setExclusive(true); myParamCoord->button(PARAM_VALUE)->setChecked(true); - GroupXYZ = new DlgRef_3Spin(centralWidget()); + GroupXYZ = new MyDlgRef_3Spin(centralWidget()); GroupXYZ->GroupBox1->setTitle(tr("GEOM_COORDINATES")); GroupXYZ->TextLabel1->setText(tr("GEOM_X")); GroupXYZ->TextLabel2->setText(tr("GEOM_Y")); @@ -137,7 +141,7 @@ MyBasicGUI_PointDlg::MyBasicGUI_PointDlg(QWidget* parent, Qt::WindowFlags fl) coordsInputValue[GEOM_POINT_EDGE] = new QVector3D(0, 0, 0); coordsInputValue[GEOM_POINT_SURF] = new QVector3D(0, 0, 0); - GroupOnCurve = new DlgRef_2Sel1Spin(centralWidget()); + GroupOnCurve = new MyDlgRef_2Sel1Spin(centralWidget()); GroupOnCurve->GroupBox1->setTitle(tr("GEOM_POINT_ON_EDGE")); GroupOnCurve->TextLabel1->setText(tr("GEOM_EDGE")); GroupOnCurve->TextLabel2->setText(tr("GEOM_START_POINT")); @@ -145,13 +149,13 @@ MyBasicGUI_PointDlg::MyBasicGUI_PointDlg(QWidget* parent, Qt::WindowFlags fl) paramInputValue[PARAM_VALUE] = 0.5; paramInputValue[LENGTH_VALUE] = 0.5; - GroupOnSurface = new DlgRef_1Sel2Spin(centralWidget()); + GroupOnSurface = new MyDlgRef_1Sel2Spin(centralWidget()); GroupOnSurface->GroupBox1->setTitle(tr("GEOM_POINT_ON_FACE")); GroupOnSurface->TextLabel1->setText(tr("GEOM_FACE")); GroupOnSurface->TextLabel2->setText(tr("GEOM_UPARAMETER")); GroupOnSurface->TextLabel3->setText(tr("GEOM_VPARAMETER")); - GroupRefPoint = new DlgRef_1Sel3Spin(centralWidget()); + GroupRefPoint = new MyDlgRef_1Sel3Spin(centralWidget()); GroupRefPoint->GroupBox1->setTitle(tr("GEOM_REF_POINT")); GroupRefPoint->TextLabel1->setText(tr("GEOM_POINT")); GroupRefPoint->TextLabel2->setText(tr("GEOM_DX")); @@ -171,7 +175,7 @@ MyBasicGUI_PointDlg::MyBasicGUI_PointDlg(QWidget* parent, Qt::WindowFlags fl) action_line2_edge = myBtnPopup2->addAction(ico_line, tr("GEOM_EDGE")); action_line2_wire = myBtnPopup2->addAction(ico_wire, tr("GEOM_WIRE")); - GroupLineIntersection = new DlgRef_2Sel(centralWidget()); + GroupLineIntersection = new MyDlgRef_2Sel(centralWidget()); GroupLineIntersection->GroupBox1->setTitle(tr("GEOM_LINE_INTERSECTION")); GroupLineIntersection->TextLabel1->setText(tr("GEOM_LINE1")); GroupLineIntersection->TextLabel2->setText(tr("GEOM_LINE2")); @@ -672,9 +676,9 @@ void MyBasicGUI_PointDlg::onUpdateResults(const QString& data) return; } gp_Pnt pnt = BRep_Tool::Pnt(vertex); - myX->setText(DlgRef::PrintDoubleValue(pnt.X(), 6)); - myY->setText(DlgRef::PrintDoubleValue(pnt.Y(), 6)); - myZ->setText(DlgRef::PrintDoubleValue(pnt.Z(), 6)); + myX->setText(MyDlgRef::PrintDoubleValue(pnt.X(), 6)); + myY->setText(MyDlgRef::PrintDoubleValue(pnt.Y(), 6)); + myZ->setText(MyDlgRef::PrintDoubleValue(pnt.Z(), 6)); } TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomVertex(bool preview) @@ -965,13 +969,13 @@ void MyBasicGUI_PointDlg::updateParamCoord(bool theIsUpdate) } } else if (id == GEOM_POINT_SURF) { - GroupOnSurface->TextLabel2->setShown(isParam); - GroupOnSurface->TextLabel3->setShown(isParam); - GroupOnSurface->SpinBox_DX->setShown(isParam); - GroupOnSurface->SpinBox_DY->setShown(isParam); + GroupOnSurface->TextLabel2->setVisible(isParam); + GroupOnSurface->TextLabel3->setVisible(isParam); + GroupOnSurface->SpinBox_DX->setVisible(isParam); + GroupOnSurface->SpinBox_DY->setVisible(isParam); } - GroupXYZ->setShown(!isParam && !isLength); + GroupXYZ->setVisible(!isParam && !isLength); } //================================================================================= @@ -1059,9 +1063,23 @@ void MyBasicGUI_PointDlg::clear() void MyBasicGUI_PointDlg::onWindowActivated(SUIT_ViewManager* vm) { QString vmType = vm->getType(); - if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ){ - mainFrame()->_vertex_le->setFocus(); - } else if ( vmType == OCCViewer_Viewer::Type() ){ - // ... + if ( ((vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type())) && + !mainFrame()->RadioButton4->isChecked() && + !myParamCoord->button(LENGTH_VALUE)->isChecked() ){ + // VSR 2020-04-06 bos #17637 + // next line is commented out to prevent resetting focus when mouse enters the view + //mainFrame()->_vertex_le->setFocus(); + } + else if ( vmType == OCCViewer_Viewer::Type() ){ + if (mainFrame()->RadioButton1->isChecked()) + // Make the field "Vertex of the model" lose the focus + mainFrame()->RadioButton1->click(); + else if (mainFrame()->RadioButton2->isChecked()) + GroupRefPoint->LineEdit1->setFocus(); + else if (mainFrame()->RadioButton3->isChecked() && + !myParamCoord->button(LENGTH_VALUE)->isChecked()) + GroupOnCurve->LineEdit1->setFocus(); + else if (mainFrame()->RadioButton5->isChecked()) + GroupOnSurface->LineEdit1->setFocus(); } }