62 #include <QPushButton>
64 #include <QSharedPointer>
67 #include "../../visualization/visualization.h"
68 #include "../../visualization/line/vistoollineintersect.h"
69 #include "../ifc/xml/vabstractpattern.h"
70 #include "../vgeometry/vpointf.h"
71 #include "../vmisc/vabstractapplication.h"
72 #include "../vpatterndb/vcontainer.h"
74 #include "ui_dialoglineintersect.h"
88 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
89 setWindowIcon(QIcon(
":/toolicon/32x32/intersect.png"));
91 ui->lineEditNamePoint->setClearButtonEnabled(
true);
136 if (
SetObject(
id,
ui->comboBoxP1Line1, tr(
"Select second point of first line")))
145 if (
SetObject(
id,
ui->comboBoxP2Line1, tr(
"Select first point of second line")))
154 if (
SetObject(
id,
ui->comboBoxP1Line2, tr(
"Select second point of second line")))
184 this->setModal(
true);
187 connect(
ui->comboBoxP1Line1, &QComboBox::currentTextChanged,
this,
189 connect(
ui->comboBoxP2Line1, &QComboBox::currentTextChanged,
this,
191 connect(
ui->comboBoxP1Line2, &QComboBox::currentTextChanged,
this,
193 connect(
ui->comboBoxP2Line2, &QComboBox::currentTextChanged,
this,
241 set.insert(p1Line1Id);
242 set.insert(p2Line1Id);
243 set.insert(p1Line2Id);
244 set.insert(p2Line2Id);
251 QLineF line1(
static_cast<QPointF
>(*p1Line1),
static_cast<QPointF
>(*p2Line1));
252 QLineF line2(
static_cast<QPointF
>(*p1Line2),
static_cast<QPointF
>(*p2Line2));
254 QLineF::IntersectType intersect = line1.intersects(line2, &fPoint);
257 if (set.size() < 3 || intersect == QLineF::NoIntersection)
277 AddVisualization<VisToolLineIntersect>();
302 QLineF line1(
static_cast<QPointF
>(*p1L1),
static_cast<QPointF
>(*p2L1));
303 QLineF line2(
static_cast<QPointF
>(*p1L2),
static_cast<QPointF
>(*p2L2));
305 QLineF::IntersectType intersect = line1.intersects(line2, &fPoint);
306 if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
The DialogLineIntersect class dialog for ToolLineIntersect. Help create point and edit option.
void SetP2Line2(const quint32 &value)
SetP2Line2 set id second point of second line.
quint32 GetP2Line1() const
GetP2Line1 return id second point of first line.
virtual void ShowVisualization() Q_DECL_OVERRIDE
quint32 GetP1Line2() const
GetP1Line2 return id first point of second line.
virtual void PointNameChanged() Q_DECL_OVERRIDE
void SetP1Line1(const quint32 &value)
SetP1Line1 set id first point of first line.
Ui::DialogLineIntersect * ui
ui keeps information about user interface
DialogLineIntersect(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
DialogLineIntersect create dialog.
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
virtual void CheckState() Q_DECL_FINAL
CheckState check state of dialog. Enable or disable button ok.
void SetP1Line2(const quint32 &value)
SetP1Line2 set id first point of second line.
quint32 GetP2Line2() const
GetP2Line2 return id second point of second line.
virtual ~DialogLineIntersect() Q_DECL_OVERRIDE
void SetPointName(const QString &value)
SetPointName set name of point.
quint32 GetP1Line1() const
GetP1Line1 return id first point of first line.
void SetP2Line1(const quint32 &value)
SetP2Line1 set id second point of first line.
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.
bool CheckIntersecion()
CheckIntersecion check intersection of points.
void PointChanged()
P1Line1Changed changed first point of first line.
bool flagPoint
flagPoint keep state of point
The VContainer class container of all variables.
const QSharedPointer< T > GeometricObject(const quint32 &id) const
The VPointF class keep data of point.
virtual void VisualMode(const quint32 &pointId)
void setObject1Id(const quint32 &value)