33 #include "ui_intersect_circletangent_dialog.h"
35 #include "../ifc/xml/vdomdocument.h"
36 #include "../support/edit_formula_dialog.h"
37 #include "../vmisc/vabstractapplication.h"
38 #include "../vmisc/vcommonsettings.h"
39 #include "../vpatterndb/vtranslatevars.h"
40 #include "../../visualization/visualization.h"
41 #include "../../visualization/line/intersect_circletangent_visual.h"
49 #include <QPlainTextEdit>
51 #include <QPushButton>
53 #include <QToolButton>
61 , flagCircleRadius(false)
62 , timerCircleRadius(nullptr)
64 , formulaBaseHeightCircleRadius(0)
67 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
68 setWindowIcon(QIcon(
":/toolicon/32x32/point_from_circle_and_tangent.png"));
70 ui->lineEditNamePoint->setClearButtonEnabled(
true);
78 ui->plainTextEditRadius->installEventFilter(
this);
90 connect(
ui->lineEditNamePoint, &QLineEdit::textChanged,
93 connect(
ui->comboBoxCircleCenter, &QComboBox::currentTextChanged,
96 connect(
ui->toolButtonExprRadius, &QPushButton::clicked,
99 connect(
ui->plainTextEditRadius, &QPlainTextEdit::textChanged,
this,
102 connect(
ui->pushButtonGrowRadius, &QPushButton::clicked,
this,
140 return qApp->TrVars()->TryFormulaFromUser(
ui->plainTextEditRadius->toPlainText(),
141 qApp->Settings()->GetOsSeparator());
147 const QString formula =
qApp->TrVars()->FormulaToUser(value,
qApp->Settings()->GetOsSeparator());
149 if (formula.length() > 80)
153 ui->plainTextEditRadius->setPlainText(formula);
181 return getCurrentCrossPoint<CrossCirclesPoint>(
ui->comboBoxResult);
187 const qint32 index =
ui->comboBoxResult->findData(
static_cast<int>(p));
190 ui->comboBoxResult->setCurrentIndex(index);
211 if (
SetObject(
id,
ui->comboBoxTangentPoint, tr(
"Select a circle center")))
226 this->setModal(
true);
276 dialog->setWindowTitle(tr(
"Edit radius"));
279 if (dialog->exec() == QDialog::Accepted)
292 ui->labelResultCircleRadius, postfix);
298 ui->labelResultCircleRadius->setText(tr(
"Error"));
299 ui->labelResultCircleRadius->setToolTip(tr(
"Radius can't be negative"));
308 AddVisualization<IntersectCircleTangentVisual>();
316 QString radius =
ui->plainTextEditRadius->toPlainText();
317 radius.replace(
"\n",
" ");
332 ui->plainTextEditRadius->blockSignals(
true);
void SetCircleCenterId(const quint32 &value)
~IntersectCircleTangentDialog()
quint32 GetCircleCenterId() const
IntersectCircleTangentDialog(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
quint32 GetTangentPointId() const
void SetCircleRadius(const QString &value)
void DeployCircleRadiusTextEdit()
void SetPointName(const QString &value)
int formulaBaseHeightCircleRadius
void SetTangentPointId(const quint32 &value)
void CircleRadiusChanged()
CrossCirclesPoint GetCrossCirclesPoint() const
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
QTimer * timerCircleRadius
virtual void ShowVisualization() Q_DECL_OVERRIDE
QString GetCircleRadius() const
Ui::IntersectCircleTangentDialog * ui
virtual void CheckState() Q_DECL_FINAL
CheckState enable, when all is correct, or disable, when something wrong, button ok.
void setCirclesCrossPoint(const CrossCirclesPoint &p)
virtual void RefreshGeometry() Q_DECL_OVERRIDE
void setCRadius(const QString &value)
void setCrossPoint(const CrossCirclesPoint &value)
void setObject2Id(const quint32 &value)
The VContainer class container of all variables.
virtual void VisualMode(const quint32 &pointId)
void setObject1Id(const quint32 &value)
QString UnitsToStr(const Unit &unit, const bool translate)
UnitsToStr translate unit to string.