-// 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
#include "MyDlgRef.hxx"
-#include <GEOMImpl_Types.hxx>
#include <QApplication>
#include <QButtonGroup>
#include <QRadioButton>
#include <QMenu>
#include <QTimer>
+#include <QVector3D>
#include <gp_Pnt.hxx>
#include <TopoDS_Shape.hxx>
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);
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"));
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"));
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"));
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"));
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)
}
}
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);
}
//=================================================================================
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();
}
}