58 #include <QLatin1String>
60 #include <QPlainTextEdit>
62 #include <QPushButton>
63 #include <QSharedPointer>
64 #include <QToolButton>
67 #include "../../visualization/line/vistoolalongline.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 "../vgeometry/../ifc/ifcdef.h"
73 #include "../vgeometry/vpointf.h"
74 #include "../vmisc/vabstractapplication.h"
75 #include "../vmisc/vcommonsettings.h"
76 #include "../vpatterndb/vcontainer.h"
77 #include "../vpatterndb/variables/vlinelength.h"
78 #include "../vpatterndb/vtranslatevars.h"
79 #include "ui_dialogalongline.h"
89 formula(QString()), formulaBaseHeight(0), buildMidpoint(false)
92 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
93 setWindowIcon(QIcon(
":/toolicon/32x32/along_line.png"));
95 ui->lineEditNamePoint->setClearButtonEnabled(
true);
102 ui->plainTextEditFormula->installEventFilter(
this);
111 int index =
ui->lineColor_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineColor());
114 ui->lineColor_ComboBox->setCurrentIndex(index);
117 index =
ui->lineWeight_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineWeight());
120 ui->lineWeight_ComboBox->setCurrentIndex(index);
123 index =
ui->lineType_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineType());
126 ui->lineType_ComboBox->setCurrentIndex(index);
173 dialog->setWindowTitle(tr(
"Edit length"));
176 if (dialog->exec() == QDialog::Accepted)
186 AddVisualization<VisToolAlongLine>();
216 const QString toolTip = tr(
"Select second point of line");
220 if (
SetObject(
id,
ui->comboBoxFirstPoint, toolTip))
238 this->setModal(
true);
259 formula =
ui->plainTextEditFormula->toPlainText();
276 ui->plainTextEditFormula->blockSignals(
true);
338 formula =
qApp->TrVars()->FormulaToUser(value,
qApp->Settings()->GetOsSeparator());
344 ui->plainTextEditFormula->setPlainText(
formula);
404 vis->setLineWeight(value);
425 return qApp->TrVars()->TryFormulaFromUser(
formula,
qApp->Settings()->GetOsSeparator());
The DialogAlongLine class dialog for ToolAlongLine. Help create point and edit option.
void setLineWeight(const QString &value)
setLineWeight set weight of the lines
QString getLineType() const
getLineType return type of line
void SetPointName(const QString &value)
SetPointName set name of point.
virtual ~DialogAlongLine() Q_DECL_OVERRIDE
QString GetFormula() const
GetFormula return string of formula.
virtual void ShowVisualization() Q_DECL_OVERRIDE
quint32 GetSecondPointId() const
GetSecondPointId return id second point of line.
virtual void Build(const Tool &type) Q_DECL_OVERRIDE
quint32 GetFirstPointId() const
GetFirstPointId return id first point of line.
Ui::DialogAlongLine * ui
ui keeps information about user interface
void SetFormula(const QString &value)
SetFormula set string of formula.
QString formula
formula formula
QString getLineColor() const
DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
DialogAlongLine create dialog.
QString getLineWeight() const
getLineWeight return weight of the lines
void SetFirstPointId(const quint32 &value)
SetFirstPointId set id first point of line.
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
void DeployFormulaTextEdit()
DeployFormulaTextEdit grow or shrink formula input.
void setLineType(const QString &value)
setLineType set type of line
void FormulaTextChanged()
FormulaTextChanged when formula text changes for validation and calc.
int formulaBaseHeight
formulaBaseHeight base height defined by dialogui
void setLineColor(const QString &value)
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
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 SetSecondPointId(const quint32 &value)
SetSecondPointId set id second point of line.
The VContainer class container of all variables.
void AddVariable(const QString &name, T *var)
const QSharedPointer< T > GeometricObject(const quint32 &id) const
const Unit * GetPatternUnit() const
The VPointF class keep data of point.
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 LineTypeNone
const QString currentLength
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.