2014-08-17 20:49:29 +02:00
|
|
|
|
/************************************************************************
|
2013-09-18 21:16:19 +02:00
|
|
|
|
**
|
2013-11-15 13:50:05 +01:00
|
|
|
|
** @file dialoglineintersect.cpp
|
2014-04-30 07:38:52 +02:00
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
2013-11-15 13:50:05 +01:00
|
|
|
|
** @date November 15, 2013
|
2013-09-18 21:16:19 +02:00
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** @brief
|
|
|
|
|
** @copyright
|
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
2013-09-18 21:16:19 +02:00
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
2013-09-18 21:16:19 +02:00
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
** (at your option) any later version.
|
|
|
|
|
**
|
2013-10-27 13:36:29 +01:00
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
2013-09-18 21:16:19 +02:00
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
|
**
|
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
*************************************************************************/
|
2013-09-18 21:16:19 +02:00
|
|
|
|
|
2013-07-31 13:34:39 +02:00
|
|
|
|
#include "dialoglineintersect.h"
|
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
|
#include <QColor>
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QLine>
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
#include <QLineF>
|
|
|
|
|
#include <QPointF>
|
|
|
|
|
#include <QPointer>
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QSet>
|
|
|
|
|
#include <QSharedPointer>
|
|
|
|
|
#include <new>
|
|
|
|
|
|
2016-08-09 15:55:46 +02:00
|
|
|
|
#include "../../visualization/visualization.h"
|
2016-08-08 13:44:49 +02:00
|
|
|
|
#include "../../visualization/line/vistoollineintersect.h"
|
|
|
|
|
#include "../ifc/xml/vabstractpattern.h"
|
2015-10-08 20:11:50 +02:00
|
|
|
|
#include "../vgeometry/vpointf.h"
|
2016-08-08 13:44:49 +02:00
|
|
|
|
#include "../vmisc/vabstractapplication.h"
|
2015-10-08 20:11:50 +02:00
|
|
|
|
#include "../vpatterndb/vcontainer.h"
|
2016-08-09 15:55:46 +02:00
|
|
|
|
#include "dialogtool.h"
|
2016-08-08 13:44:49 +02:00
|
|
|
|
#include "ui_dialoglineintersect.h"
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-02 16:28:02 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief DialogLineIntersect create dialog
|
|
|
|
|
* @param data container with data
|
|
|
|
|
* @param parent parent widget
|
|
|
|
|
*/
|
2014-07-29 14:19:11 +02:00
|
|
|
|
DialogLineIntersect::DialogLineIntersect(const VContainer *data, const quint32 &toolId, QWidget *parent)
|
2015-05-21 21:24:31 +02:00
|
|
|
|
:DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersect), flagPoint(true)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2013-07-31 13:34:39 +02:00
|
|
|
|
ui->setupUi(this);
|
2015-12-09 11:40:43 +01:00
|
|
|
|
|
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
|
|
|
|
ui->lineEditNamePoint->setClearButtonEnabled(true);
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-07-31 13:34:39 +02:00
|
|
|
|
number = 0;
|
2014-08-14 17:48:31 +02:00
|
|
|
|
InitOkCancelApply(ui);
|
2014-09-05 10:01:46 +02:00
|
|
|
|
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
|
2013-10-06 18:22:21 +02:00
|
|
|
|
labelEditNamePoint = ui->labelEditNamePoint;
|
2013-12-21 12:36:51 +01:00
|
|
|
|
|
|
|
|
|
FillComboBoxPoints(ui->comboBoxP1Line1);
|
|
|
|
|
FillComboBoxPoints(ui->comboBoxP2Line1);
|
|
|
|
|
FillComboBoxPoints(ui->comboBoxP1Line2);
|
|
|
|
|
FillComboBoxPoints(ui->comboBoxP2Line2);
|
2013-07-31 13:34:39 +02:00
|
|
|
|
|
|
|
|
|
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogLineIntersect::NamePointChanged);
|
2014-07-14 17:01:14 +02:00
|
|
|
|
connect(ui->comboBoxP1Line1, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
|
|
|
|
this, &DialogLineIntersect::PointNameChanged);
|
|
|
|
|
connect(ui->comboBoxP2Line1, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
|
|
|
|
this, &DialogLineIntersect::PointNameChanged);
|
|
|
|
|
connect(ui->comboBoxP1Line2, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
|
|
|
|
this, &DialogLineIntersect::PointNameChanged);
|
|
|
|
|
connect(ui->comboBoxP2Line2, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
|
|
|
|
this, &DialogLineIntersect::PointNameChanged);
|
2014-08-14 17:48:31 +02:00
|
|
|
|
|
2015-05-21 21:24:31 +02:00
|
|
|
|
vis = new VisToolLineIntersect(data);
|
2013-07-31 13:34:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2013-11-04 21:35:15 +01:00
|
|
|
|
DialogLineIntersect::~DialogLineIntersect()
|
|
|
|
|
{
|
2013-07-31 13:34:39 +02:00
|
|
|
|
delete ui;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-02 16:28:02 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
|
|
|
* @param id id of point or detail
|
|
|
|
|
* @param type type of object
|
|
|
|
|
*/
|
2014-07-15 16:42:41 +02:00
|
|
|
|
void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2014-08-17 20:49:29 +02:00
|
|
|
|
if (prepare == false)// After first choose we ignore all objects
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2014-08-17 20:49:29 +02:00
|
|
|
|
if (type == SceneObject::Point)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2015-05-21 21:24:31 +02:00
|
|
|
|
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
|
2016-12-20 19:57:20 +01:00
|
|
|
|
SCASSERT(line != nullptr)
|
2015-05-21 21:24:31 +02:00
|
|
|
|
|
2014-08-17 20:49:29 +02:00
|
|
|
|
switch (number)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2014-08-17 20:49:29 +02:00
|
|
|
|
case 0:
|
|
|
|
|
if (SetObject(id, ui->comboBoxP1Line1, tr("Select second point of first line")))
|
|
|
|
|
{
|
|
|
|
|
number++;
|
|
|
|
|
line->VisualMode(id);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
2014-11-09 11:57:49 +01:00
|
|
|
|
if (getCurrentObjectId(ui->comboBoxP1Line1) != id)
|
2014-08-17 20:49:29 +02:00
|
|
|
|
{
|
2014-11-09 11:57:49 +01:00
|
|
|
|
if (SetObject(id, ui->comboBoxP2Line1, tr("Select first point of second line")))
|
|
|
|
|
{
|
|
|
|
|
number++;
|
|
|
|
|
line->setLine1P2Id(id);
|
|
|
|
|
line->RefreshGeometry();
|
|
|
|
|
}
|
2014-08-17 20:49:29 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
if (SetObject(id, ui->comboBoxP1Line2, tr("Select second point of second line")))
|
|
|
|
|
{
|
|
|
|
|
number++;
|
|
|
|
|
line->setLine2P1Id(id);
|
|
|
|
|
line->RefreshGeometry();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
2014-11-09 11:57:49 +01:00
|
|
|
|
{
|
|
|
|
|
QSet<quint32> set;
|
|
|
|
|
set.insert(getCurrentObjectId(ui->comboBoxP1Line1));
|
|
|
|
|
set.insert(getCurrentObjectId(ui->comboBoxP2Line1));
|
|
|
|
|
set.insert(getCurrentObjectId(ui->comboBoxP1Line2));
|
|
|
|
|
set.insert(id);
|
|
|
|
|
|
|
|
|
|
if (set.size() >= 3)
|
2014-08-17 20:49:29 +02:00
|
|
|
|
{
|
2014-11-09 11:57:49 +01:00
|
|
|
|
if (SetObject(id, ui->comboBoxP2Line2, ""))
|
|
|
|
|
{
|
|
|
|
|
line->setLine2P2Id(id);
|
|
|
|
|
line->RefreshGeometry();
|
|
|
|
|
prepare = true;
|
|
|
|
|
flagPoint = CheckIntersecion();
|
|
|
|
|
CheckState();
|
2015-07-03 21:22:52 +02:00
|
|
|
|
if (flagPoint)
|
|
|
|
|
{
|
|
|
|
|
DialogAccepted();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this->setModal(true);
|
|
|
|
|
this->show();
|
|
|
|
|
connect(ui->comboBoxP1Line1,
|
|
|
|
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
|
|
|
|
&DialogLineIntersect::PointChanged);
|
|
|
|
|
connect(ui->comboBoxP2Line1,
|
|
|
|
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
|
|
|
|
&DialogLineIntersect::PointChanged);
|
|
|
|
|
connect(ui->comboBoxP1Line2,
|
|
|
|
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
|
|
|
|
&DialogLineIntersect::PointChanged);
|
|
|
|
|
connect(ui->comboBoxP2Line2,
|
|
|
|
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
|
|
|
|
&DialogLineIntersect::PointChanged);
|
|
|
|
|
}
|
2014-11-09 11:57:49 +01:00
|
|
|
|
}
|
2014-08-17 20:49:29 +02:00
|
|
|
|
}
|
2014-11-09 11:57:49 +01:00
|
|
|
|
}
|
2014-08-17 20:49:29 +02:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
2013-07-31 13:34:39 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-08-13 12:20:30 +02:00
|
|
|
|
void DialogLineIntersect::SaveData()
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2013-07-31 13:34:39 +02:00
|
|
|
|
pointName = ui->lineEditNamePoint->text();
|
2014-08-14 17:48:31 +02:00
|
|
|
|
|
2015-05-21 21:24:31 +02:00
|
|
|
|
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
|
2016-12-20 19:57:20 +01:00
|
|
|
|
SCASSERT(line != nullptr)
|
2015-05-21 21:24:31 +02:00
|
|
|
|
|
2016-01-24 17:15:08 +01:00
|
|
|
|
line->setObject1Id(GetP1Line1());
|
2015-02-03 11:17:04 +01:00
|
|
|
|
line->setLine1P2Id(GetP2Line1());
|
|
|
|
|
line->setLine2P1Id(GetP1Line2());
|
|
|
|
|
line->setLine2P2Id(GetP2Line2());
|
2014-08-14 17:48:31 +02:00
|
|
|
|
line->RefreshGeometry();
|
2013-07-31 13:34:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-02 16:28:02 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief P1Line1Changed changed first point of first line
|
|
|
|
|
*/
|
2015-02-03 09:17:59 +01:00
|
|
|
|
void DialogLineIntersect::PointChanged()
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2013-07-31 13:34:39 +02:00
|
|
|
|
flagPoint = CheckIntersecion();
|
|
|
|
|
CheckState();
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-14 17:01:14 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void DialogLineIntersect::PointNameChanged()
|
|
|
|
|
{
|
|
|
|
|
QSet<quint32> set;
|
|
|
|
|
const quint32 p1Line1Id = getCurrentObjectId(ui->comboBoxP1Line1);
|
|
|
|
|
const quint32 p2Line1Id = getCurrentObjectId(ui->comboBoxP2Line1);
|
|
|
|
|
const quint32 p1Line2Id = getCurrentObjectId(ui->comboBoxP1Line2);
|
|
|
|
|
const quint32 p2Line2Id = getCurrentObjectId(ui->comboBoxP2Line2);
|
|
|
|
|
|
|
|
|
|
set.insert(p1Line1Id);
|
|
|
|
|
set.insert(p2Line1Id);
|
|
|
|
|
set.insert(p1Line2Id);
|
|
|
|
|
set.insert(p2Line2Id);
|
|
|
|
|
|
2014-08-21 14:44:40 +02:00
|
|
|
|
const QSharedPointer<VPointF> p1Line1 = data->GeometricObject<VPointF>(p1Line1Id);
|
|
|
|
|
const QSharedPointer<VPointF> p2Line1 = data->GeometricObject<VPointF>(p2Line1Id);
|
|
|
|
|
const QSharedPointer<VPointF> p1Line2 = data->GeometricObject<VPointF>(p1Line2Id);
|
|
|
|
|
const QSharedPointer<VPointF> p2Line2 = data->GeometricObject<VPointF>(p2Line2Id);
|
2014-07-14 17:01:14 +02:00
|
|
|
|
|
2016-05-14 21:28:09 +02:00
|
|
|
|
QLineF line1(*p1Line1, *p2Line1);
|
|
|
|
|
QLineF line2(*p1Line2, *p2Line2);
|
2014-07-14 17:01:14 +02:00
|
|
|
|
QPointF fPoint;
|
|
|
|
|
QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
|
|
|
|
|
|
2014-07-14 18:28:41 +02:00
|
|
|
|
QColor color = okColor;
|
2014-07-14 17:01:14 +02:00
|
|
|
|
if (set.size() < 3 || intersect == QLineF::NoIntersection)
|
|
|
|
|
{
|
|
|
|
|
flagError = false;
|
2014-07-14 18:28:41 +02:00
|
|
|
|
color = errorColor;
|
2014-07-14 17:01:14 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
flagError = true;
|
2014-07-14 18:28:41 +02:00
|
|
|
|
color = okColor;
|
2014-07-14 17:01:14 +02:00
|
|
|
|
}
|
2014-07-14 18:28:41 +02:00
|
|
|
|
ChangeColor(ui->labelP1Line1, color);
|
|
|
|
|
ChangeColor(ui->labelP2Line1, color);
|
|
|
|
|
ChangeColor(ui->labelP1Line2, color);
|
|
|
|
|
ChangeColor(ui->labelP2Line2, color);
|
2014-07-14 17:01:14 +02:00
|
|
|
|
CheckState();
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-14 17:48:31 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void DialogLineIntersect::ShowVisualization()
|
|
|
|
|
{
|
2015-05-21 21:24:31 +02:00
|
|
|
|
AddVisualization<VisToolLineIntersect>();
|
2014-08-14 17:48:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-02 16:28:02 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief CheckState check state of dialog. Enable or disable button ok.
|
|
|
|
|
*/
|
2013-11-04 21:35:15 +01:00
|
|
|
|
void DialogLineIntersect::CheckState()
|
|
|
|
|
{
|
2016-12-20 19:57:20 +01:00
|
|
|
|
SCASSERT(bOk != nullptr)
|
2013-09-12 15:25:24 +02:00
|
|
|
|
bOk->setEnabled(flagName && flagPoint);
|
2013-07-31 13:34:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-02 16:28:02 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief CheckIntersecion check intersection of points
|
|
|
|
|
* @return true - line have intersection, false = don't have
|
|
|
|
|
*/
|
2013-11-04 21:35:15 +01:00
|
|
|
|
bool DialogLineIntersect::CheckIntersecion()
|
|
|
|
|
{
|
2015-02-03 11:17:04 +01:00
|
|
|
|
const QSharedPointer<VPointF> p1L1 = data->GeometricObject<VPointF>(GetP1Line1());
|
|
|
|
|
const QSharedPointer<VPointF> p2L1 = data->GeometricObject<VPointF>(GetP2Line1());
|
|
|
|
|
const QSharedPointer<VPointF> p1L2 = data->GeometricObject<VPointF>(GetP1Line2());
|
|
|
|
|
const QSharedPointer<VPointF> p2L2 = data->GeometricObject<VPointF>(GetP2Line2());
|
2013-07-31 13:34:39 +02:00
|
|
|
|
|
2016-05-14 21:28:09 +02:00
|
|
|
|
QLineF line1(*p1L1, *p2L1);
|
|
|
|
|
QLineF line2(*p1L2, *p2L2);
|
2013-07-31 13:34:39 +02:00
|
|
|
|
QPointF fPoint;
|
|
|
|
|
QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
|
2013-11-04 21:35:15 +01:00
|
|
|
|
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
|
|
|
|
|
{
|
2013-07-31 13:34:39 +02:00
|
|
|
|
return true;
|
2013-11-04 21:35:15 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-07-31 13:34:39 +02:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-02 16:28:02 +02:00
|
|
|
|
/**
|
2015-02-03 11:17:04 +01:00
|
|
|
|
* @brief SetP2Line2 set id second point of second line
|
2014-06-02 16:28:02 +02:00
|
|
|
|
* @param value id
|
|
|
|
|
*/
|
2015-02-03 11:17:04 +01:00
|
|
|
|
void DialogLineIntersect::SetP2Line2(const quint32 &value)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2015-02-03 09:17:59 +01:00
|
|
|
|
setCurrentPointId(ui->comboBoxP2Line2, value);
|
2015-05-21 21:24:31 +02:00
|
|
|
|
|
|
|
|
|
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
|
2016-12-20 19:57:20 +01:00
|
|
|
|
SCASSERT(line != nullptr)
|
2015-02-03 09:17:59 +01:00
|
|
|
|
line->setLine2P2Id(value);
|
2013-07-31 13:34:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-02 16:28:02 +02:00
|
|
|
|
/**
|
2015-02-03 11:17:04 +01:00
|
|
|
|
* @brief SetP1Line2 set id first point of second line
|
2014-06-02 16:28:02 +02:00
|
|
|
|
* @param value id
|
|
|
|
|
*/
|
2015-02-03 11:17:04 +01:00
|
|
|
|
void DialogLineIntersect::SetP1Line2(const quint32 &value)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2015-02-03 09:17:59 +01:00
|
|
|
|
setCurrentPointId(ui->comboBoxP1Line2, value);
|
2015-05-21 21:24:31 +02:00
|
|
|
|
|
|
|
|
|
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
|
2016-12-20 19:57:20 +01:00
|
|
|
|
SCASSERT(line != nullptr)
|
2015-02-03 09:17:59 +01:00
|
|
|
|
line->setLine2P1Id(value);
|
2013-07-31 13:34:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-02 16:28:02 +02:00
|
|
|
|
/**
|
2015-02-03 11:17:04 +01:00
|
|
|
|
* @brief SetP2Line1 set id second point of first line
|
2014-06-02 16:28:02 +02:00
|
|
|
|
* @param value id
|
|
|
|
|
*/
|
2015-02-03 11:17:04 +01:00
|
|
|
|
void DialogLineIntersect::SetP2Line1(const quint32 &value)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2015-02-03 09:17:59 +01:00
|
|
|
|
setCurrentPointId(ui->comboBoxP2Line1, value);
|
2015-05-21 21:24:31 +02:00
|
|
|
|
|
|
|
|
|
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
|
2016-12-20 19:57:20 +01:00
|
|
|
|
SCASSERT(line != nullptr)
|
2015-02-03 09:17:59 +01:00
|
|
|
|
line->setLine1P2Id(value);
|
2013-07-31 13:34:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-02 16:28:02 +02:00
|
|
|
|
/**
|
2015-02-03 11:17:04 +01:00
|
|
|
|
* @brief SetP1Line1 set id first point of first line
|
2014-06-02 16:28:02 +02:00
|
|
|
|
* @param value id
|
|
|
|
|
*/
|
2015-02-03 11:17:04 +01:00
|
|
|
|
void DialogLineIntersect::SetP1Line1(const quint32 &value)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2015-02-03 09:17:59 +01:00
|
|
|
|
setCurrentPointId(ui->comboBoxP1Line1, value);
|
2015-05-21 21:24:31 +02:00
|
|
|
|
|
|
|
|
|
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
|
2016-12-20 19:57:20 +01:00
|
|
|
|
SCASSERT(line != nullptr)
|
2016-01-24 17:15:08 +01:00
|
|
|
|
line->setObject1Id(value);
|
2013-07-31 13:34:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-02 16:28:02 +02:00
|
|
|
|
/**
|
2015-02-03 11:17:04 +01:00
|
|
|
|
* @brief SetPointName set name of point
|
2014-06-02 16:28:02 +02:00
|
|
|
|
* @param value name of point
|
|
|
|
|
*/
|
2015-02-03 11:17:04 +01:00
|
|
|
|
void DialogLineIntersect::SetPointName(const QString &value)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2013-07-31 13:34:39 +02:00
|
|
|
|
pointName = value;
|
|
|
|
|
ui->lineEditNamePoint->setText(pointName);
|
|
|
|
|
}
|
2015-02-02 16:11:48 +01:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
2015-02-03 11:17:04 +01:00
|
|
|
|
* @brief GetP1Line1 return id first point of first line
|
2015-02-02 16:11:48 +01:00
|
|
|
|
* @return id
|
|
|
|
|
*/
|
2015-02-03 11:17:04 +01:00
|
|
|
|
quint32 DialogLineIntersect::GetP1Line1() const
|
2015-02-02 16:11:48 +01:00
|
|
|
|
{
|
2015-02-03 09:17:59 +01:00
|
|
|
|
return getCurrentObjectId(ui->comboBoxP1Line1);
|
2015-02-02 16:11:48 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
2015-02-03 11:17:04 +01:00
|
|
|
|
* @brief GetP2Line1 return id second point of first line
|
2015-02-02 16:11:48 +01:00
|
|
|
|
* @return id
|
|
|
|
|
*/
|
2015-02-03 11:17:04 +01:00
|
|
|
|
quint32 DialogLineIntersect::GetP2Line1() const
|
2015-02-02 16:11:48 +01:00
|
|
|
|
{
|
2015-02-03 09:17:59 +01:00
|
|
|
|
return getCurrentObjectId(ui->comboBoxP2Line1);
|
2015-02-02 16:11:48 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
2015-02-03 11:17:04 +01:00
|
|
|
|
* @brief GetP1Line2 return id first point of second line
|
2015-02-02 16:11:48 +01:00
|
|
|
|
* @return id
|
|
|
|
|
*/
|
2015-02-03 11:17:04 +01:00
|
|
|
|
quint32 DialogLineIntersect::GetP1Line2() const
|
2015-02-02 16:11:48 +01:00
|
|
|
|
{
|
2015-02-03 09:17:59 +01:00
|
|
|
|
return getCurrentObjectId(ui->comboBoxP1Line2);
|
2015-02-02 16:11:48 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
2015-02-03 11:17:04 +01:00
|
|
|
|
* @brief GetP2Line2 return id second point of second line
|
2015-02-02 16:11:48 +01:00
|
|
|
|
* @return id
|
|
|
|
|
*/
|
2015-02-03 11:17:04 +01:00
|
|
|
|
quint32 DialogLineIntersect::GetP2Line2() const
|
2015-02-02 16:11:48 +01:00
|
|
|
|
{
|
2015-02-03 09:17:59 +01:00
|
|
|
|
return getCurrentObjectId(ui->comboBoxP2Line2);
|
2015-02-02 16:11:48 +01:00
|
|
|
|
}
|