Only unique points allowed.
--HG-- branch : develop
This commit is contained in:
parent
aa0b73d930
commit
7563446cf9
|
@ -139,10 +139,11 @@ void DialogAlongLine::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == SceneObject::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
|
const QString toolTip = tr("Select second point of line");
|
||||||
switch (number)
|
switch (number)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (SetObject(id, ui->comboBoxFirstPoint, tr("Select second point of line")))
|
if (SetObject(id, ui->comboBoxFirstPoint, toolTip))
|
||||||
{
|
{
|
||||||
number++;
|
number++;
|
||||||
line->VisualMode(id);
|
line->VisualMode(id);
|
||||||
|
@ -151,11 +152,18 @@ void DialogAlongLine::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
case 1:
|
case 1:
|
||||||
if (SetObject(id, ui->comboBoxSecondPoint, ""))
|
if (SetObject(id, ui->comboBoxSecondPoint, ""))
|
||||||
{
|
{
|
||||||
line->setPoint2Id(id);
|
if (flagError)
|
||||||
line->RefreshGeometry();
|
{
|
||||||
prepare = true;
|
line->setPoint2Id(id);
|
||||||
this->setModal(true);
|
line->RefreshGeometry();
|
||||||
this->show();
|
prepare = true;
|
||||||
|
this->setModal(true);
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
emit ToolTip(toolTip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -158,22 +158,35 @@ void DialogBisector::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (SetObject(id, ui->comboBoxSecondPoint, tr("Select third point of angle")))
|
if (getCurrentObjectId(ui->comboBoxFirstPoint) != id)
|
||||||
{
|
{
|
||||||
number++;
|
if (SetObject(id, ui->comboBoxSecondPoint, tr("Select third point of angle")))
|
||||||
line->setPoint2Id(id);
|
{
|
||||||
line->RefreshGeometry();
|
number++;
|
||||||
|
line->setPoint2Id(id);
|
||||||
|
line->RefreshGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (SetObject(id, ui->comboBoxThirdPoint, ""))
|
{
|
||||||
|
QSet<quint32> set;
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxFirstPoint));
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxSecondPoint));
|
||||||
|
set.insert(id);
|
||||||
|
|
||||||
|
if (set.size() == 3)
|
||||||
{
|
{
|
||||||
line->setPoint3Id(id);
|
if (SetObject(id, ui->comboBoxThirdPoint, ""))
|
||||||
line->RefreshGeometry();
|
{
|
||||||
prepare = true;
|
line->setPoint3Id(id);
|
||||||
this->setModal(true);
|
line->RefreshGeometry();
|
||||||
this->show();
|
prepare = true;
|
||||||
|
this->setModal(true);
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -151,22 +151,35 @@ void DialogHeight::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (1):
|
case (1):
|
||||||
if (SetObject(id, ui->comboBoxP1Line, tr("Select second point of line")))
|
if (getCurrentObjectId(ui->comboBoxBasePoint) != id)
|
||||||
{
|
{
|
||||||
number++;
|
if (SetObject(id, ui->comboBoxP1Line, tr("Select second point of line")))
|
||||||
line->setLineP1Id(id);
|
{
|
||||||
line->RefreshGeometry();
|
number++;
|
||||||
|
line->setLineP1Id(id);
|
||||||
|
line->RefreshGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (2):
|
case (2):
|
||||||
if (SetObject(id, ui->comboBoxP2Line, ""))
|
{
|
||||||
|
QSet<quint32> set;
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxBasePoint));
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxP1Line));
|
||||||
|
set.insert(id);
|
||||||
|
|
||||||
|
if (set.size() == 3)
|
||||||
{
|
{
|
||||||
line->setLineP2Id(id);
|
if (SetObject(id, ui->comboBoxP2Line, ""))
|
||||||
line->RefreshGeometry();
|
{
|
||||||
prepare = true;
|
line->setLineP2Id(id);
|
||||||
this->setModal(true);
|
line->RefreshGeometry();
|
||||||
this->show();
|
prepare = true;
|
||||||
|
this->setModal(true);
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -99,12 +99,15 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (SetObject(id, ui->comboBoxP2Line1, tr("Select first point of second line")))
|
if (getCurrentObjectId(ui->comboBoxP1Line1) != id)
|
||||||
{
|
{
|
||||||
number++;
|
if (SetObject(id, ui->comboBoxP2Line1, tr("Select first point of second line")))
|
||||||
p2Line1 = id;
|
{
|
||||||
line->setLine1P2Id(id);
|
number++;
|
||||||
line->RefreshGeometry();
|
p2Line1 = id;
|
||||||
|
line->setLine1P2Id(id);
|
||||||
|
line->RefreshGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -117,29 +120,40 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (SetObject(id, ui->comboBoxP2Line2, ""))
|
{
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
p2Line2 = id;
|
if (SetObject(id, ui->comboBoxP2Line2, ""))
|
||||||
line->setLine2P2Id(id);
|
{
|
||||||
line->RefreshGeometry();
|
p2Line2 = id;
|
||||||
prepare = true;
|
line->setLine2P2Id(id);
|
||||||
flagPoint = CheckIntersecion();
|
line->RefreshGeometry();
|
||||||
CheckState();
|
prepare = true;
|
||||||
this->setModal(true);
|
flagPoint = CheckIntersecion();
|
||||||
this->show();
|
CheckState();
|
||||||
connect(ui->comboBoxP1Line1,
|
this->setModal(true);
|
||||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
this->show();
|
||||||
&DialogLineIntersect::P1Line1Changed);
|
connect(ui->comboBoxP1Line1,
|
||||||
connect(ui->comboBoxP2Line1,
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
&DialogLineIntersect::P1Line1Changed);
|
||||||
&DialogLineIntersect::P2Line1Changed);
|
connect(ui->comboBoxP2Line1,
|
||||||
connect(ui->comboBoxP1Line2,
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
&DialogLineIntersect::P2Line1Changed);
|
||||||
&DialogLineIntersect::P1Line2Changed);
|
connect(ui->comboBoxP1Line2,
|
||||||
connect(ui->comboBoxP2Line2,
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
&DialogLineIntersect::P1Line2Changed);
|
||||||
&DialogLineIntersect::P2Line2Changed);
|
connect(ui->comboBoxP2Line2,
|
||||||
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
|
&DialogLineIntersect::P2Line2Changed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -146,13 +146,16 @@ void DialogNormal::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (SetObject(id, ui->comboBoxSecondPoint, ""))
|
if (getCurrentObjectId(ui->comboBoxFirstPoint) != id)
|
||||||
{
|
{
|
||||||
line->setPoint2Id(id);
|
if (SetObject(id, ui->comboBoxSecondPoint, ""))
|
||||||
line->RefreshGeometry();
|
{
|
||||||
prepare = true;
|
line->setPoint2Id(id);
|
||||||
this->setModal(true);
|
line->RefreshGeometry();
|
||||||
this->show();
|
prepare = true;
|
||||||
|
this->setModal(true);
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -171,22 +171,35 @@ void DialogPointOfContact::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (SetObject(id, ui->comboBoxSecondPoint, tr("Select point of center of arc")))
|
if (getCurrentObjectId(ui->comboBoxFirstPoint) != id)
|
||||||
{
|
{
|
||||||
number++;
|
if (SetObject(id, ui->comboBoxSecondPoint, tr("Select point of center of arc")))
|
||||||
line->setLineP2Id(id);
|
{
|
||||||
line->RefreshGeometry();
|
number++;
|
||||||
|
line->setLineP2Id(id);
|
||||||
|
line->RefreshGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (SetObject(id, ui->comboBoxCenter, ""))
|
{
|
||||||
|
QSet<quint32> set;
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxFirstPoint));
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxSecondPoint));
|
||||||
|
set.insert(id);
|
||||||
|
|
||||||
|
if (set.size() == 3)
|
||||||
{
|
{
|
||||||
line->setRadiusId(id);
|
if (SetObject(id, ui->comboBoxCenter, ""))
|
||||||
line->RefreshGeometry();
|
{
|
||||||
prepare = true;
|
line->setRadiusId(id);
|
||||||
this->setModal(true);
|
line->RefreshGeometry();
|
||||||
this->show();
|
prepare = true;
|
||||||
|
this->setModal(true);
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -104,13 +104,16 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (SetObject(id, ui->comboBoxSecondPoint, ""))
|
if (getCurrentObjectId(ui->comboBoxFirstPoint) != id)
|
||||||
{
|
{
|
||||||
line->setPoint2Id(id);
|
if (SetObject(id, ui->comboBoxSecondPoint, ""))
|
||||||
line->RefreshGeometry();
|
{
|
||||||
prepare = true;
|
line->setPoint2Id(id);
|
||||||
this->setModal(true);
|
line->RefreshGeometry();
|
||||||
this->show();
|
prepare = true;
|
||||||
|
this->setModal(true);
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -157,22 +157,35 @@ void DialogShoulderPoint::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (SetObject(id, ui->comboBoxP1Line, tr("Select second point of line")))
|
if (getCurrentObjectId(ui->comboBoxP3) != id)
|
||||||
{
|
{
|
||||||
number++;
|
if (SetObject(id, ui->comboBoxP1Line, tr("Select second point of line")))
|
||||||
line->setLineP1Id(id);
|
{
|
||||||
line->RefreshGeometry();
|
number++;
|
||||||
|
line->setLineP1Id(id);
|
||||||
|
line->RefreshGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (SetObject(id, ui->comboBoxP2Line, ""))
|
{
|
||||||
|
QSet<quint32> set;
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxP3));
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxP1Line));
|
||||||
|
set.insert(id);
|
||||||
|
|
||||||
|
if (set.size() == 3)
|
||||||
{
|
{
|
||||||
line->setLineP2Id(id);
|
if (SetObject(id, ui->comboBoxP2Line, ""))
|
||||||
line->RefreshGeometry();
|
{
|
||||||
prepare = true;
|
line->setLineP2Id(id);
|
||||||
this->setModal(true);
|
line->RefreshGeometry();
|
||||||
this->show();
|
prepare = true;
|
||||||
|
this->setModal(true);
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -97,29 +97,32 @@ void DialogSpline::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(id);
|
if (getCurrentObjectId(ui->comboBoxP1) != id)
|
||||||
qint32 index = ui->comboBoxP4->findText(point->name());
|
|
||||||
if ( index != -1 )
|
|
||||||
{ // -1 for not found
|
|
||||||
ui->comboBoxP4->setCurrentIndex(index);
|
|
||||||
emit ToolTip("");
|
|
||||||
index = ui->comboBoxP1->currentIndex();
|
|
||||||
quint32 p1Id = qvariant_cast<quint32>(ui->comboBoxP1->itemData(index));
|
|
||||||
|
|
||||||
QPointF p1 = data->GeometricObject<VPointF>(p1Id)->toQPointF();
|
|
||||||
QPointF p4 = data->GeometricObject<VPointF>(id)->toQPointF();
|
|
||||||
|
|
||||||
ui->spinBoxAngle1->setValue(static_cast<qint32>(QLineF(p1, p4).angle()));
|
|
||||||
ui->spinBoxAngle2->setValue(static_cast<qint32>(QLineF(p4, p1).angle()));
|
|
||||||
|
|
||||||
path->setPoint4Id(id);
|
|
||||||
path->RefreshGeometry();
|
|
||||||
prepare = true;
|
|
||||||
DialogAccepted();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
qWarning()<<"Can't find object by name"<<point->name();
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(id);
|
||||||
|
qint32 index = ui->comboBoxP4->findText(point->name());
|
||||||
|
if ( index != -1 )
|
||||||
|
{ // -1 for not found
|
||||||
|
ui->comboBoxP4->setCurrentIndex(index);
|
||||||
|
emit ToolTip("");
|
||||||
|
index = ui->comboBoxP1->currentIndex();
|
||||||
|
quint32 p1Id = qvariant_cast<quint32>(ui->comboBoxP1->itemData(index));
|
||||||
|
|
||||||
|
QPointF p1 = data->GeometricObject<VPointF>(p1Id)->toQPointF();
|
||||||
|
QPointF p4 = data->GeometricObject<VPointF>(id)->toQPointF();
|
||||||
|
|
||||||
|
ui->spinBoxAngle1->setValue(static_cast<qint32>(QLineF(p1, p4).angle()));
|
||||||
|
ui->spinBoxAngle2->setValue(static_cast<qint32>(QLineF(p4, p1).angle()));
|
||||||
|
|
||||||
|
path->setPoint4Id(id);
|
||||||
|
path->RefreshGeometry();
|
||||||
|
prepare = true;
|
||||||
|
DialogAccepted();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qWarning()<<"Can't find object by name"<<point->name();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,30 +98,54 @@ void DialogTriangle::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (1):
|
case (1):
|
||||||
if (SetObject(id, ui->comboBoxAxisP2, tr("Select first point")))
|
if (getCurrentObjectId(ui->comboBoxAxisP1) != id)
|
||||||
{
|
{
|
||||||
number++;
|
if (SetObject(id, ui->comboBoxAxisP2, tr("Select first point")))
|
||||||
line->setPoint2Id(id);
|
{
|
||||||
line->RefreshGeometry();
|
number++;
|
||||||
|
line->setPoint2Id(id);
|
||||||
|
line->RefreshGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (2):
|
case (2):
|
||||||
if (SetObject(id, ui->comboBoxFirstPoint, tr("Select second point")))
|
{
|
||||||
|
QSet<quint32> set;
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxAxisP1));
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxAxisP2));
|
||||||
|
set.insert(id);
|
||||||
|
|
||||||
|
if (set.size() == 3)
|
||||||
{
|
{
|
||||||
number++;
|
if (SetObject(id, ui->comboBoxFirstPoint, tr("Select second point")))
|
||||||
line->setHypotenuseP1Id(id);
|
{
|
||||||
line->RefreshGeometry();
|
number++;
|
||||||
|
line->setHypotenuseP1Id(id);
|
||||||
|
line->RefreshGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case (3):
|
case (3):
|
||||||
if (SetObject(id, ui->comboBoxSecondPoint, ""))
|
{
|
||||||
|
QSet<quint32> set;
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxAxisP1));
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxAxisP2));
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxFirstPoint));
|
||||||
|
set.insert(id);
|
||||||
|
|
||||||
|
if (set.size() == 4)
|
||||||
{
|
{
|
||||||
line->setHypotenuseP2Id(id);
|
if (SetObject(id, ui->comboBoxSecondPoint, ""))
|
||||||
line->RefreshGeometry();
|
{
|
||||||
prepare = true;
|
line->setHypotenuseP2Id(id);
|
||||||
this->setModal(true);
|
line->RefreshGeometry();
|
||||||
this->show();
|
prepare = true;
|
||||||
|
this->setModal(true);
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user