52 #include <QPlainTextEdit>
54 #include <QPushButton>
56 #include <QToolButton>
59 #include "../ifc/xml/vdomdocument.h"
60 #include "../support/edit_formula_dialog.h"
61 #include "../vmisc/vabstractapplication.h"
62 #include "../vmisc/vcommonsettings.h"
63 #include "../vpatterndb/vtranslatevars.h"
64 #include "../../visualization/visualization.h"
65 #include "../../visualization/path/vistoolarcwithlength.h"
67 #include "ui_dialogarcwithlength.h"
76 , timerRadius(nullptr)
78 , timerLength(nullptr)
82 , formulaBaseHeightRadius(0)
83 , formulaBaseHeightF1(0)
84 , formulaBaseHeightLength(0)
91 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
92 setWindowIcon(QIcon(
":/toolicon/32x32/arc_with_length.png"));
101 ui->plainTextEditRadius->installEventFilter(
this);
102 ui->plainTextEditF1->installEventFilter(
this);
103 ui->plainTextEditLength->installEventFilter(
this);
121 ui->lineType_ComboBox->removeItem(index);
124 index =
ui->lineColor_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineColor());
127 ui->lineColor_ComboBox->setCurrentIndex(index);
130 index =
ui->lineWeight_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineWeight());
133 ui->lineWeight_ComboBox->setCurrentIndex(index);
136 index =
ui->lineType_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineType());
139 ui->lineType_ComboBox->setCurrentIndex(index);
190 vis->setObject1Id(value);
196 return qApp->TrVars()->TryFormulaFromUser(
radius,
qApp->Settings()->GetOsSeparator());
202 radius =
qApp->TrVars()->FormulaToUser(value,
qApp->Settings()->GetOsSeparator());
208 ui->plainTextEditRadius->setPlainText(
radius);
220 return qApp->TrVars()->TryFormulaFromUser(
f1,
qApp->Settings()->GetOsSeparator());
225 f1 =
qApp->TrVars()->FormulaToUser(value,
qApp->Settings()->GetOsSeparator());
227 if (
f1.length() > 80)
231 ui->plainTextEditF1->setPlainText(
f1);
243 return qApp->TrVars()->TryFormulaFromUser(
length,
qApp->Settings()->GetOsSeparator());
249 length =
qApp->TrVars()->FormulaToUser(value,
qApp->Settings()->GetOsSeparator());
255 ui->plainTextEditLength->setPlainText(
length);
319 this->setModal(
true);
374 dialog->setWindowTitle(tr(
"Edit radius"));
377 if (dialog->exec() == QDialog::Accepted)
388 dialog->setWindowTitle(tr(
"Edit the first angle"));
391 if (dialog->exec() == QDialog::Accepted)
402 dialog->setWindowTitle(tr(
"Edit the arc length"));
405 if (dialog->exec() == QDialog::Accepted)
437 ui->name_LineEdit->setText(
qApp->TrVars()->VarToUser(arc.
name() +
"_" + QString().setNum(
m_Id)));
460 AddVisualization<VisToolArcWithLength>();
466 radius =
ui->plainTextEditRadius->toPlainText();
467 radius.replace(
"\n",
" ");
469 f1 =
ui->plainTextEditF1->toPlainText();
470 f1.replace(
"\n",
" ");
472 length =
ui->plainTextEditLength->toPlainText();
473 length.replace(
"\n",
" ");
488 ui->plainTextEditRadius->blockSignals(
true);
489 ui->plainTextEditF1->blockSignals(
true);
490 ui->plainTextEditLength->blockSignals(
true);
505 ui->labelResultRadius->setText(tr(
"Error"));
506 ui->labelResultRadius->setToolTip(tr(
"Radius can't be negative"));
523 ui->labelResultLength->setText(tr(
"Error"));
524 ui->labelResultLength->setToolTip(tr(
"Length can't be equal 0"));
QTimer * timerF1
timerF1 timer of check formula of first angle
void setArc(const VArc &arc)
virtual void ShowVisualization() Q_DECL_OVERRIDE
QString GetRadius() const
QString radius
radius formula of radius
DialogArcWithLength(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
virtual void CheckState() Q_DECL_FINAL
CheckState enable, when all is correct, or disable, when something wrong, button ok.
bool flagF1
flagF1 true if value of first angle is correct
void SetF1(const QString &value)
void setLineColor(const QString &value)
int formulaBaseHeightLength
bool flagRadius
flagRadius true if value of radius is correct
void setPenStyle(const QString &value)
QString getLineWeight() const
getLineWeight return weight of the lines
void DeployLengthTextEdit()
void SetRadius(const QString &value)
int formulaBaseHeightRadius
formulaBaseHeight base height defined by dialogui
QTimer * timerRadius
timerRadius timer of check formula of radius
void SetLength(const QString &value)
void setLineWeight(const QString &value)
setLineWeight set weight of the lines
Ui::DialogArcWithLength * ui
void SetCenter(const quint32 &value)
QString GetLength() const
QString f1
f1 formula of first angle
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
QString getPenStyle() const
void DeployRadiusTextEdit()
DeployFormulaTextEdit grow or shrink formula input.
QString getLineColor() const
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
quint32 GetCenter() const
virtual VPointF GetCenter() const
void SetDuplicate(quint32 number)
VArc class for anticlockwise arc.
The VContainer class container of all variables.
static bool IsUnique(const QString &name)
const QSharedPointer< T > GeometricObject(const quint32 &id) const
virtual QString name() const
name return name graphical object.
quint32 id() const
id return id object.
The VPointF class keep data of point.
void setObject1Id(const quint32 &value)
const QString degreeSymbol
QString UnitsToStr(const Unit &unit, const bool translate)
UnitsToStr translate unit to string.
const QString LineTypeSolidLine
const QString LineTypeNone