61 #include "../../tools/vabstracttool.h"
62 #include "../../visualization/path/vistoolcubicbezier.h"
63 #include "../../visualization/visualization.h"
64 #include "../vgeometry/vpointf.h"
65 #include "../vpatterndb/vcontainer.h"
67 #include "ui_dialogcubicbezier.h"
77 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
78 setWindowIcon(QIcon(
":/toolicon/32x32/cubic_bezier.png"));
90 ui->lineType_ComboBox->removeItem(index);
93 index =
ui->lineColor_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineColor());
96 ui->lineColor_ComboBox->setCurrentIndex(index);
99 index =
ui->lineWeight_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineWeight());
102 ui->lineWeight_ComboBox->setCurrentIndex(index);
105 index =
ui->lineType_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineType());
108 ui->lineType_ComboBox->setCurrentIndex(index);
143 ui->lineEditSplineName->setText(
qApp->TrVars()->VarToUser(
spl.
name()));
145 auto path = qobject_cast<VisToolCubicBezier *>(
vis);
205 auto *path = qobject_cast<VisToolCubicBezier *>(
vis);
211 if (
SetObject(
id,
ui->comboBoxP1, tr(
"Select the second point of curve")))
214 path->VisualMode(
id);
218 if (
SetObject(
id,
ui->comboBoxP2, tr(
"Select the third point of curve")))
222 path->setObject2Id(
id);
223 path->RefreshGeometry();
227 if (
SetObject(
id,
ui->comboBoxP3, tr(
"Select the fourth point of curve")))
231 path->setObject3Id(
id);
232 path->RefreshGeometry();
242 path->setObject4Id(
id);
243 path->RefreshGeometry();
265 ui->lineEditSplineName->setText(tr(
"Invalid spline"));
276 ui->lineEditSplineName->setText(
qApp->TrVars()->VarToUser(
spl.
name()));
287 ui->lineEditSplineName->setText(
qApp->TrVars()->VarToUser(spline.
name()));
301 AddVisualization<VisToolCubicBezier>();
307 const auto p1 =
GetP1();
308 const auto p2 =
GetP2();
309 const auto p3 =
GetP3();
310 const auto p4 =
GetP4();
317 auto path = qobject_cast<VisToolCubicBezier *>(
vis);
320 path->setObject1Id(p1->id());
321 path->setObject2Id(p2->id());
322 path->setObject3Id(p3->id());
323 path->setObject4Id(p4->id());
325 path->RefreshGeometry();
const QSharedPointer< VPointF > GetP3() const
virtual void ShowVisualization() Q_DECL_OVERRIDE
const QSharedPointer< VPointF > GetP4() const
void SetSpline(const VCubicBezier &spline)
const QSharedPointer< VPointF > GetP2() const
void setLineWeight(const QString &value)
setLineWeight set weight of the lines
void setPenStyle(const QString &value)
VCubicBezier GetSpline() const
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
QString getLineColor() const
DialogCubicBezier(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
QString getPenStyle() const
const QSharedPointer< VPointF > GetP1() const
VCubicBezier spl
spl spline
Ui::DialogCubicBezier * ui
void setLineColor(const QString &value)
virtual void PointNameChanged() Q_DECL_OVERRIDE
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
virtual ~DialogCubicBezier()
QString getLineWeight() const
getLineWeight return weight of the lines
void SetDuplicate(quint32 number)
quint32 GetDuplicate() const
The VContainer class container of all variables.
static bool IsUnique(const QString &name)
const QSharedPointer< T > GeometricObject(const quint32 &id) const
virtual VPointF GetP1() const Q_DECL_OVERRIDE
virtual VPointF GetP3() const Q_DECL_OVERRIDE
virtual VPointF GetP2() const Q_DECL_OVERRIDE
virtual VPointF GetP4() const Q_DECL_OVERRIDE
virtual QString name() const
name return name graphical object.
quint32 id() const
id return id object.
The VPointF class keep data of point.
const QString LineTypeSolidLine
const QString LineTypeNone