59 #include <QPlainTextEdit>
61 #include <QPushButton>
63 #include <QToolButton>
65 #include "../../visualization/line/vistoolbisector.h"
66 #include "../../visualization/visualization.h"
67 #include "../ifc/xml/vabstractpattern.h"
68 #include "../ifc/xml/vdomdocument.h"
69 #include "../support/edit_formula_dialog.h"
70 #include "../vmisc/vabstractapplication.h"
71 #include "../vmisc/vcommonsettings.h"
72 #include "../vpatterndb/vtranslatevars.h"
73 #include "ui_dialogbisector.h"
85 , formulaBaseHeight(0)
88 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
89 setWindowIcon(QIcon(
":/toolicon/32x32/bisector.png"));
91 ui->lineEditNamePoint->setClearButtonEnabled(
true);
97 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);
175 dialog->setWindowTitle(tr(
"Edit length"));
178 if (dialog->exec() == QDialog::Accepted)
188 AddVisualization<VisToolBisector>();
221 if (
SetObject(
id,
ui->comboBoxFirstPoint, tr(
"Select second point of angle")))
230 if (
SetObject(
id,
ui->comboBoxSecondPoint, tr(
"Select third point of angle")))
252 this->setModal(
true);
315 vis->setLineWeight(value);
344 formula =
qApp->TrVars()->FormulaToUser(value,
qApp->Settings()->GetOsSeparator());
350 ui->plainTextEditFormula->setPlainText(
formula);
406 formula =
ui->plainTextEditFormula->toPlainText();
424 ui->plainTextEditFormula->blockSignals(
true);
435 return qApp->TrVars()->TryFormulaFromUser(
formula,
qApp->Settings()->GetOsSeparator());
The DialogBisector class dialog for ToolBisector. Help create point and edit option.
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
void setLineType(const QString &value)
setLineType set type of line
quint32 GetFirstPointId() const
GetFirstPointId return id of first point.
virtual void ShowVisualization() Q_DECL_OVERRIDE
void DeployFormulaTextEdit()
DeployFormulaTextEdit grow or shrink formula input.
quint32 GetSecondPointId() const
GetSecondPointId return id of second point.
void setLineColor(const QString &value)
void SetSecondPointId(const quint32 &value)
SetSecondPointId set id of second point.
quint32 GetThirdPointId() const
GetThirdPointId return id of third point.
QString GetFormula() const
GetFormula return string of formula.
QString formula
formula formula
QString getLineColor() const
getLineColor get the color of line
void setLineWeight(const QString &value)
setLineWeight set weight of the lines
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.
DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
DialogBisector create dialog.
virtual void PointNameChanged() Q_DECL_OVERRIDE
void SetFirstPointId(const quint32 &value)
SetFirstPointId set id of first point.
QString getLineWeight() const
getLineWeight return weight of the lines
void SetThirdPointId(const quint32 &value)
SetThirdPointId set id of third point.
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
void FormulaTextChanged()
FormulaTextChanged when formula text changes for validation and calc.
int formulaBaseHeight
formulaBaseHeight base height defined by dialogui
void SetPointName(const QString &value)
SetPointName set name of point.
QString getLineType() const
getLineType return type of line
Ui::DialogBisector * ui
ui keeps information about user interface
void SetFormula(const QString &value)
SetFormula set string of formula.
virtual ~DialogBisector() Q_DECL_OVERRIDE
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.