57 #include <QDoubleSpinBox>
60 #include <QPlainTextEdit>
62 #include <QPushButton>
63 #include <QToolButton>
65 #include "../vpatterndb/vtranslatevars.h"
66 #include "../../tools/vabstracttool.h"
67 #include "../../visualization/line/vistoolnormal.h"
68 #include "../../visualization/visualization.h"
69 #include "../ifc/xml/vabstractpattern.h"
70 #include "../ifc/xml/vdomdocument.h"
71 #include "../support/edit_formula_dialog.h"
72 #include "../vmisc/vabstractapplication.h"
73 #include "../vmisc/vcommonsettings.h"
74 #include "ui_dialognormal.h"
86 , formulaBaseHeight(0)
89 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
90 setWindowIcon(QIcon(
":/toolicon/32x32/normal.png"));
92 ui->lineEditNamePoint->setClearButtonEnabled(
true);
98 ui->plainTextEditFormula->installEventFilter(
this);
107 int index =
ui->lineColor_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineColor());
110 ui->lineColor_ComboBox->setCurrentIndex(index);
113 index =
ui->lineWeight_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineWeight());
116 ui->lineWeight_ComboBox->setCurrentIndex(index);
119 index =
ui->lineType_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineType());
122 ui->lineType_ComboBox->setCurrentIndex(index);
168 dialog->setWindowTitle(tr(
"Edit length"));
171 if (dialog->exec() == QDialog::Accepted)
181 AddVisualization<VisToolNormal>();
214 if (
SetObject(
id,
ui->comboBoxFirstPoint, tr(
"Select second point of line")))
228 this->setModal(
true);
244 formula =
ui->plainTextEditFormula->toPlainText();
246 angle =
ui->doubleSpinBoxAngle->value();
263 ui->plainTextEditFormula->blockSignals(
true);
303 ui->doubleSpinBoxAngle->setValue(
angle);
317 formula =
qApp->TrVars()->FormulaToUser(value,
qApp->Settings()->GetOsSeparator());
323 ui->plainTextEditFormula->setPlainText(
formula);
371 vis->setLineWeight(value);
404 return qApp->TrVars()->TryFormulaFromUser(
formula,
qApp->Settings()->GetOsSeparator());
The DialogNormal class dialog for ToolNormal. Help create point and edit option.
int formulaBaseHeight
formulaBaseHeight base height defined by dialogui
void setLineType(const QString &value)
setLineType set type of line
quint32 GetFirstPointId() const
GetFirstPointId return id of first point.
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
void SetFirstPointId(const quint32 &value)
SetFirstPointId set id of first point.
void SetPointName(const QString &value)
SetPointName set name of point.
DialogNormal(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
DialogNormal create dialog.
void FormulaTextChanged()
FormulaTextChanged when formula text changes for validation and calc.
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
void SetAngle(const qreal &value)
SetAngle set aditional angle of normal.
QString getLineType() const
getLineType return type of line
virtual ~DialogNormal() Q_DECL_OVERRIDE
QString formula
formula formula
QString getLineColor() const
virtual void ShowVisualization() Q_DECL_OVERRIDE
void DeployFormulaTextEdit()
DeployFormulaTextEdit grow or shrink formula input.
qreal angle
angle aditional angle of normal
qreal GetAngle() const
GetAngle return aditional angle of normal.
void setLineWeight(const QString &value)
setLineWeight set weight of the lines
void SetSecondPointId(const quint32 &value)
SetSecondPointId set id of second point.
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
virtual void PointNameChanged() Q_DECL_OVERRIDE
Ui::DialogNormal * ui
ui keeps information about user interface
void SetFormula(const QString &value)
SetFormula set string of formula.
QString getLineWeight() const
getLineWeight return weight of the lines
void setLineColor(const QString &value)
QString GetFormula() const
GetFormula return string of formula.
quint32 GetSecondPointId() const
GetSecondPointId return id of second point.
The VContainer class container of all variables.
void setLineWeight(const QString &value)
virtual void VisualMode(const quint32 &pointId)
void setObject1Id(const quint32 &value)
void setLineStyle(const Qt::PenStyle &value)
QString UnitsToStr(const Unit &unit, const bool translate)
UnitsToStr translate unit to string.
const QString LineTypeSolidLine
const QString LineTypeDashLine
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.