Fixed vera++ warnings.
--HG-- branch : feature
This commit is contained in:
parent
8e82a80463
commit
3b1a654581
|
@ -36,7 +36,7 @@ qint64 VContainer::_id = 0;
|
|||
VContainer::VContainer()
|
||||
:base(QHash<QString, qint32>()), gObjects(QHash<qint64, VGObject *>()),
|
||||
standartTable(QHash<QString, VStandartTableRow>()), incrementTable(QHash<QString, VIncrementTableRow>()),
|
||||
lengthLines(QHash<QString, qreal>()),lineAngles(QHash<QString, qreal>()), lengthSplines(QHash<QString, qreal>()),
|
||||
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), lengthSplines(QHash<QString, qreal>()),
|
||||
lengthArcs(QHash<QString, qreal>()), details(QHash<qint64, VDetail>())
|
||||
{
|
||||
SetSize(500);
|
||||
|
@ -77,24 +77,24 @@ void VContainer::setData(const VContainer &data)
|
|||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
switch(i.value()->getType())
|
||||
switch (i.value()->getType())
|
||||
{
|
||||
case(GObject::Arc):
|
||||
case (GObject::Arc):
|
||||
{
|
||||
CopyGObject<VArc>(data, i.key());
|
||||
break;
|
||||
}
|
||||
case(GObject::Point):
|
||||
case (GObject::Point):
|
||||
{
|
||||
CopyGObject<VPointF>(data, i.key());
|
||||
break;
|
||||
}
|
||||
case(GObject::Spline):
|
||||
case (GObject::Spline):
|
||||
{
|
||||
CopyGObject<VSpline>(data, i.key());
|
||||
break;
|
||||
}
|
||||
case(GObject::SplinePath):
|
||||
case (GObject::SplinePath):
|
||||
{
|
||||
CopyGObject<VSplinePath>(data, i.key());
|
||||
break;
|
||||
|
@ -625,7 +625,7 @@ void VContainer::Clear()
|
|||
|
||||
void VContainer::ClearObject()
|
||||
{
|
||||
if(gObjects.size()>0)
|
||||
if (gObjects.size()>0)
|
||||
{
|
||||
qDeleteAll(gObjects);
|
||||
}
|
||||
|
@ -715,7 +715,7 @@ void VContainer::UpdateGObject(qint64 id, VGObject* obj)
|
|||
UpdateObject(gObjects, id, obj);
|
||||
}
|
||||
|
||||
void VContainer::UpdateDetail(qint64 id,VDetail detail)
|
||||
void VContainer::UpdateDetail(qint64 id, VDetail detail)
|
||||
{
|
||||
Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0");
|
||||
details[id] = detail;
|
||||
|
|
|
@ -31,8 +31,9 @@
|
|||
|
||||
#include "dialogtool.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogCutSpline;
|
||||
namespace Ui
|
||||
{
|
||||
class DialogCutSpline;
|
||||
}
|
||||
|
||||
class DialogCutSpline : public DialogTool
|
||||
|
|
|
@ -31,8 +31,9 @@
|
|||
|
||||
#include "dialogtool.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogCutSplinePath;
|
||||
namespace Ui
|
||||
{
|
||||
class DialogCutSplinePath;
|
||||
}
|
||||
|
||||
class DialogCutSplinePath : public DialogTool
|
||||
|
|
|
@ -75,7 +75,7 @@ void DialogTool::FillComboBoxPoints(QComboBox *box, const qint64 &id) const
|
|||
if (i.key() != id)
|
||||
{
|
||||
VGObject *obj = i.value();
|
||||
if(obj->getType() == GObject::Point && obj->getMode() == Draw::Calculation)
|
||||
if (obj->getType() == GObject::Point && obj->getMode() == Draw::Calculation)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(i.key());
|
||||
box->addItem(point->name(), i.key());
|
||||
|
@ -93,12 +93,12 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const qint64 &id, ComboMode
|
|||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
if(cut == ComboMode::CutSpline)
|
||||
if (cut == ComboMode::CutSpline)
|
||||
{
|
||||
if (i.key() != id + 1 && i.key() != id + 2)
|
||||
{
|
||||
VGObject *obj = i.value();
|
||||
if(obj->getType() == GObject::Spline && obj->getMode() == Draw::Calculation)
|
||||
if (obj->getType() == GObject::Spline && obj->getMode() == Draw::Calculation)
|
||||
{
|
||||
const VSpline *spl = data->GeometricObject<const VSpline *>(i.key());
|
||||
box->addItem(spl->name(), i.key());
|
||||
|
@ -110,7 +110,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const qint64 &id, ComboMode
|
|||
if (i.key() != id)
|
||||
{
|
||||
VGObject *obj = i.value();
|
||||
if(obj->getType() == GObject::Spline && obj->getMode() == Draw::Calculation)
|
||||
if (obj->getType() == GObject::Spline && obj->getMode() == Draw::Calculation)
|
||||
{
|
||||
const VSpline *spl = data->GeometricObject<const VSpline *>(i.key());
|
||||
box->addItem(spl->name(), i.key());
|
||||
|
@ -129,12 +129,12 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const qint64 &id, Combo
|
|||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
if(cut == ComboMode::CutSpline)
|
||||
if (cut == ComboMode::CutSpline)
|
||||
{
|
||||
if (i.key() != id + 1 && i.key() != id + 2)
|
||||
{
|
||||
VGObject *obj = i.value();
|
||||
if(obj->getType() == GObject::SplinePath && obj->getMode() == Draw::Calculation)
|
||||
if (obj->getType() == GObject::SplinePath && obj->getMode() == Draw::Calculation)
|
||||
{
|
||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(i.key());
|
||||
box->addItem(splPath->name(), i.key());
|
||||
|
@ -146,7 +146,7 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const qint64 &id, Combo
|
|||
if (i.key() != id)
|
||||
{
|
||||
VGObject *obj = i.value();
|
||||
if(obj->getType() == GObject::SplinePath && obj->getMode() == Draw::Calculation)
|
||||
if (obj->getType() == GObject::SplinePath && obj->getMode() == Draw::Calculation)
|
||||
{
|
||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(i.key());
|
||||
box->addItem(splPath->name(), i.key());
|
||||
|
|
|
@ -47,7 +47,7 @@ DialogUnionDetails::~DialogUnionDetails()
|
|||
|
||||
void DialogUnionDetails::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||
{
|
||||
if(numberD == 0)
|
||||
if (numberD == 0)
|
||||
{
|
||||
ChoosedDetail(id, type, d1, d1P1, d1P2);
|
||||
}
|
||||
|
@ -98,13 +98,13 @@ void DialogUnionDetails::ChoosedDetail(const qint64 &id, const Scene::Scenes &ty
|
|||
}
|
||||
if (numberP == 1)
|
||||
{
|
||||
if(id == p1)
|
||||
if (id == p1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
p2 = id;
|
||||
++numberD;
|
||||
if(numberD > 1)
|
||||
if (numberD > 1)
|
||||
{
|
||||
++numberP;
|
||||
emit ToolTip("");
|
||||
|
|
|
@ -31,16 +31,17 @@
|
|||
|
||||
#include "dialogtool.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogUnionDetails;
|
||||
namespace Ui
|
||||
{
|
||||
class DialogUnionDetails;
|
||||
}
|
||||
|
||||
class DialogUnionDetails : public DialogTool
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DialogUnionDetails(const VContainer *data, QWidget *parent = 0);
|
||||
~DialogUnionDetails();
|
||||
explicit DialogUnionDetails(const VContainer *data, QWidget *parent = 0);
|
||||
~DialogUnionDetails();
|
||||
inline qint64 getD1() const {return d1;}
|
||||
inline qint64 getD2() const {return d2;}
|
||||
inline qint64 getD1P1() const {return d1P1;}
|
||||
|
|
|
@ -40,8 +40,8 @@ VArc::VArc ()
|
|||
|
||||
VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
||||
QString formulaF2, qint64 idObject, Draw::Draws mode)
|
||||
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2), radius(radius),
|
||||
formulaRadius(formulaRadius),center(center)
|
||||
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
||||
radius(radius), formulaRadius(formulaRadius), center(center)
|
||||
{
|
||||
//TODO Change name of arc in formula. Name now not unique.
|
||||
_name = QString ("Arc_%1").arg(this->GetCenter().name());
|
||||
|
|
|
@ -111,4 +111,3 @@ void VDetail::setId(const qint64 &id)
|
|||
{
|
||||
_id = id;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,8 +74,8 @@ VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm
|
|||
}
|
||||
|
||||
VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, qint64 idObject, Draw::Draws mode)
|
||||
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1), kAsm2(1),
|
||||
kCurve(1)
|
||||
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1),
|
||||
kAsm2(1), kCurve(1)
|
||||
{
|
||||
CreateName();
|
||||
|
||||
|
@ -145,7 +145,7 @@ QLineF::IntersectType VSpline::CrossingSplLine ( const QLineF &line, QPointF *in
|
|||
|
||||
qreal VSpline::LengthT(qreal t) const
|
||||
{
|
||||
if(t < 0 || t > 1)
|
||||
if (t < 0 || t > 1)
|
||||
{
|
||||
qWarning()<<"Wrong value t.";
|
||||
return 0;
|
||||
|
@ -180,7 +180,7 @@ qreal VSpline::LengthT(qreal t) const
|
|||
QPointF VSpline::CutSpline ( qreal length, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2, QPointF &spl2p3 ) const
|
||||
{
|
||||
//Always need return two splines, so we must correct wrong length.
|
||||
if(length < GetLength()*0.02)
|
||||
if (length < GetLength()*0.02)
|
||||
{
|
||||
length = GetLength()*0.02;
|
||||
}
|
||||
|
@ -199,7 +199,8 @@ QPointF VSpline::CutSpline ( qreal length, QPointF &spl1p2, QPointF &spl1p3, QPo
|
|||
{
|
||||
parT = parT + step;
|
||||
qreal splLength = LengthT(parT);
|
||||
if(splLength >= length || parT > 1){
|
||||
if (splLength >= length || parT > 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,14 +174,14 @@ const VSplinePoint &VSplinePath::at(ptrdiff_t indx) const
|
|||
QPointF VSplinePath::CutSplinePath(qreal length, qint32 &p1, qint32 &p2, QPointF &spl1p2, QPointF &spl1p3,
|
||||
QPointF &spl2p2, QPointF &spl2p3) const
|
||||
{
|
||||
if(Count() < 2)
|
||||
if (Count() < 2)
|
||||
{
|
||||
throw VException(tr("Can't cut spline path with one point"));
|
||||
}
|
||||
|
||||
//Always need return two spline paths, so we must correct wrong length.
|
||||
qreal fullLength = GetLength();
|
||||
if(length < fullLength * 0.02)
|
||||
if (length < fullLength * 0.02)
|
||||
{
|
||||
length = fullLength * 0.02;
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ QPointF VSplinePath::CutSplinePath(qreal length, qint32 &p1, qint32 &p2, QPointF
|
|||
VSpline spl = VSpline(path[i-1].P(), path[i].P(), path[i-1].Angle2(), path[i].Angle1(), path[i-1].KAsm2(),
|
||||
path[i].KAsm1(), kCurve);
|
||||
fullLength += spl.GetLength();
|
||||
if(fullLength > length)
|
||||
if (fullLength > length)
|
||||
{
|
||||
p1 = i-1;
|
||||
p2 = i;
|
||||
|
|
|
@ -1084,7 +1084,7 @@ void MainWindow::SetEnableTool(bool enable)
|
|||
{
|
||||
bool drawTools = false;
|
||||
bool modelingTools = false;
|
||||
if(mode == Draw::Calculation)
|
||||
if (mode == Draw::Calculation)
|
||||
{
|
||||
drawTools = enable;
|
||||
}
|
||||
|
|
|
@ -259,7 +259,7 @@ void VToolCutSpline::RefreshSpline(VSimpleSpline *spline, qint64 splid, SimpleSp
|
|||
QPainterPath path;
|
||||
path.addPath(spl->GetPath());
|
||||
path.setFillRule( Qt::WindingFill );
|
||||
if(tr == SimpleSpline::FirstPoint)
|
||||
if (tr == SimpleSpline::FirstPoint)
|
||||
{
|
||||
path.translate(-spl->GetP1().toQPointF().x(), -spl->GetP1().toQPointF().y());
|
||||
}
|
||||
|
|
|
@ -120,13 +120,15 @@ void VToolCutSplinePath::Create(const qint64 _id, const QString &pointName, cons
|
|||
Q_ASSERT(splPath1);
|
||||
VSplinePath *splPath2 = new VSplinePath();
|
||||
Q_ASSERT(splPath2);
|
||||
for(qint32 i = 0; i < splPath->CountPoint(); i++)
|
||||
for (qint32 i = 0; i < splPath->CountPoint(); i++)
|
||||
{
|
||||
if(i <= p1 && i < p2){
|
||||
if(i == p1)
|
||||
if (i <= p1 && i < p2)
|
||||
{
|
||||
if (i == p1)
|
||||
{
|
||||
splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1(), spl1.GetKasm1()));
|
||||
VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2()+180, spl2.GetKasm1());
|
||||
VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2()+180,
|
||||
spl2.GetKasm1());
|
||||
splPath1->append(cutPoint);
|
||||
continue;
|
||||
}
|
||||
|
@ -134,7 +136,7 @@ void VToolCutSplinePath::Create(const qint64 _id, const QString &pointName, cons
|
|||
}
|
||||
else
|
||||
{
|
||||
if(i == p2)
|
||||
if (i == p2)
|
||||
{
|
||||
VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl2.GetAngle1(), spl2.GetKasm1());
|
||||
splPath2->append(cutPoint);
|
||||
|
@ -169,13 +171,15 @@ void VToolCutSplinePath::Create(const qint64 _id, const QString &pointName, cons
|
|||
Q_ASSERT(splPath1 != 0);
|
||||
VSplinePath *splPath2 = new VSplinePath();
|
||||
Q_ASSERT(splPath2 != 0);
|
||||
for(qint32 i = 0; i < splPath->CountPoint(); i++)
|
||||
for (qint32 i = 0; i < splPath->CountPoint(); i++)
|
||||
{
|
||||
if(i <= p1 && i < p2){
|
||||
if(i == p1)
|
||||
if (i <= p1 && i < p2)
|
||||
{
|
||||
if (i == p1)
|
||||
{
|
||||
splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1(), spl1.GetKasm1()));
|
||||
VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2()+180, spl2.GetKasm1());
|
||||
VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2()+180,
|
||||
spl2.GetKasm1());
|
||||
splPath1->append(cutPoint);
|
||||
continue;
|
||||
}
|
||||
|
@ -183,7 +187,7 @@ void VToolCutSplinePath::Create(const qint64 _id, const QString &pointName, cons
|
|||
}
|
||||
else
|
||||
{
|
||||
if(i == p2)
|
||||
if (i == p2)
|
||||
{
|
||||
VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl2.GetAngle1(), spl2.GetKasm1());
|
||||
splPath2->append(cutPoint);
|
||||
|
@ -326,7 +330,7 @@ void VToolCutSplinePath::RefreshSpline(VSimpleSpline *spline, qint64 splPathid,
|
|||
QPainterPath path;
|
||||
path.addPath(splPath->GetPath());
|
||||
path.setFillRule( Qt::WindingFill );
|
||||
if(tr == SimpleSpline::FirstPoint)
|
||||
if (tr == SimpleSpline::FirstPoint)
|
||||
{
|
||||
VSpline spl = splPath->GetSpline(1);
|
||||
path.translate(-spl.GetP1().toQPointF().x(), -spl.GetP1().toQPointF().y());
|
||||
|
|
|
@ -63,7 +63,7 @@ VToolUnionDetails::VToolUnionDetails(VDomDocument *doc, VContainer *data, const
|
|||
|
||||
void VToolUnionDetails::CorectPoints(const VDetail &detail, qint64 &p1, qint64 &p2)
|
||||
{
|
||||
if(p1 == p2)
|
||||
if (p1 == p2)
|
||||
{
|
||||
qWarning()<<"Union points equal.";
|
||||
return;
|
||||
|
@ -72,21 +72,21 @@ void VToolUnionDetails::CorectPoints(const VDetail &detail, qint64 &p1, qint64 &
|
|||
bool p2flag = false;
|
||||
for (ptrdiff_t i = 0; i< detail.CountNode(); ++i)
|
||||
{
|
||||
if(detail.at(i).getTypeTool() == Tool::NodePoint)
|
||||
if (detail.at(i).getTypeTool() == Tool::NodePoint)
|
||||
{
|
||||
if(p1 == detail.at(i).getId())
|
||||
if (p1 == detail.at(i).getId())
|
||||
{
|
||||
p1flag = true;
|
||||
}
|
||||
if(p2 == detail.at(i).getId())
|
||||
if (p2 == detail.at(i).getId())
|
||||
{
|
||||
p2flag = true;
|
||||
}
|
||||
if(p1flag == true && p2flag == false)
|
||||
if (p1flag == true && p2flag == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(p2flag == true && p1flag == false)
|
||||
if (p2flag == true && p1flag == false)
|
||||
{
|
||||
qint64 p = p1;
|
||||
p1 = p2;
|
||||
|
@ -108,7 +108,7 @@ void VToolUnionDetails::AddToNewDetail(VContainer *data, VDetail newDetail, cons
|
|||
{
|
||||
case (Tool::NodePoint):
|
||||
{
|
||||
if( qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && (pRotate == 0))
|
||||
if ( qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && (pRotate == 0))
|
||||
{
|
||||
id = det.at(i).getId();
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ void VToolUnionDetails::AddToNewDetail(VContainer *data, VDetail newDetail, cons
|
|||
break;
|
||||
case (Tool::NodeArc):
|
||||
{
|
||||
if(qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
if (qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
{
|
||||
id = det.at(i).getId();
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ void VToolUnionDetails::AddToNewDetail(VContainer *data, VDetail newDetail, cons
|
|||
break;
|
||||
case (Tool::NodeSpline):
|
||||
{
|
||||
if(qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
if (qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
{
|
||||
id = det.at(i).getId();
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ void VToolUnionDetails::AddToNewDetail(VContainer *data, VDetail newDetail, cons
|
|||
break;
|
||||
case (Tool::NodeSplinePath):
|
||||
{
|
||||
if(qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
if (qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
{
|
||||
id = det.at(i).getId();
|
||||
}
|
||||
|
@ -205,22 +205,26 @@ void VToolUnionDetails::AddToNewDetail(VContainer *data, VDetail newDetail, cons
|
|||
|
||||
VPointF *p1 = new VPointF(spline.GetP1());
|
||||
Q_ASSERT(p1 != 0);
|
||||
BiasRotatePoint(p1, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||
BiasRotatePoint(p1, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||
angle);
|
||||
qint64 idP1 = data->AddGObject(p1);
|
||||
|
||||
VPointF p2 = VPointF(spline.GetP2());
|
||||
BiasRotatePoint(&p2, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||
BiasRotatePoint(&p2, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||
angle);
|
||||
|
||||
VPointF p3 = VPointF(spline.GetP3());
|
||||
BiasRotatePoint(&p3, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||
BiasRotatePoint(&p3, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||
angle);
|
||||
|
||||
VPointF *p4 = new VPointF(spline.GetP4());
|
||||
Q_ASSERT(p4 != 0);
|
||||
BiasRotatePoint(p4, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||
BiasRotatePoint(p4, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||
angle);
|
||||
qint64 idP4 = data->AddGObject(p4);
|
||||
|
||||
VSpline spl = VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline.GetKcurve());
|
||||
if(i==1)
|
||||
if (i==1)
|
||||
{
|
||||
path->append(VSplinePoint(*p1, splinePath->at(i-1).KAsm1(), spl.GetAngle1(),
|
||||
splinePath->at(i-1).KAsm1()));
|
||||
|
@ -252,7 +256,7 @@ void VToolUnionDetails::UpdatePoints(const qint64 &idDetail, VContainer *data, c
|
|||
{
|
||||
case (Tool::NodePoint):
|
||||
{
|
||||
if(qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
if (qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
{
|
||||
++idCount;
|
||||
}
|
||||
|
@ -268,7 +272,7 @@ void VToolUnionDetails::UpdatePoints(const qint64 &idDetail, VContainer *data, c
|
|||
break;
|
||||
case (Tool::NodeArc):
|
||||
{
|
||||
if(qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
if (qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
{
|
||||
++idCount;
|
||||
}
|
||||
|
@ -281,7 +285,8 @@ void VToolUnionDetails::UpdatePoints(const qint64 &idDetail, VContainer *data, c
|
|||
BiasRotatePoint(&p2, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||
VPointF *center = new VPointF(arc->GetCenter());
|
||||
Q_ASSERT(center != 0);
|
||||
BiasRotatePoint(center, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||
BiasRotatePoint(center, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||
angle);
|
||||
|
||||
QLineF l1(center->toQPointF(), p1.toQPointF());
|
||||
QLineF l2(center->toQPointF(), p2.toQPointF());
|
||||
|
@ -296,7 +301,7 @@ void VToolUnionDetails::UpdatePoints(const qint64 &idDetail, VContainer *data, c
|
|||
break;
|
||||
case (Tool::NodeSpline):
|
||||
{
|
||||
if(qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
if (qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
{
|
||||
++idCount;
|
||||
}
|
||||
|
@ -329,7 +334,7 @@ void VToolUnionDetails::UpdatePoints(const qint64 &idDetail, VContainer *data, c
|
|||
break;
|
||||
case (Tool::NodeSplinePath):
|
||||
{
|
||||
if(qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
if (qFuzzyCompare(dx+1, 1) && qFuzzyCompare(dy+1, 1) && pRotate == 0)
|
||||
{
|
||||
++idCount;
|
||||
}
|
||||
|
@ -346,22 +351,26 @@ void VToolUnionDetails::UpdatePoints(const qint64 &idDetail, VContainer *data, c
|
|||
|
||||
VPointF *p1 = new VPointF(spline.GetP1());
|
||||
Q_ASSERT(p1 != 0);
|
||||
BiasRotatePoint(p1, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||
BiasRotatePoint(p1, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||
angle);
|
||||
qint64 idP1 = data->AddGObject(p1);
|
||||
|
||||
VPointF p2 = VPointF(spline.GetP2());
|
||||
BiasRotatePoint(&p2, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||
BiasRotatePoint(&p2, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||
angle);
|
||||
|
||||
VPointF p3 = VPointF(spline.GetP3());
|
||||
BiasRotatePoint(&p3, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||
BiasRotatePoint(&p3, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||
angle);
|
||||
|
||||
VPointF *p4 = new VPointF(spline.GetP4());
|
||||
Q_ASSERT(p4 != 0);
|
||||
BiasRotatePoint(p4, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||
BiasRotatePoint(p4, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(),
|
||||
angle);
|
||||
qint64 idP4 = data->AddGObject(p4);
|
||||
|
||||
VSpline spl = VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline.GetKcurve());
|
||||
if(i==1)
|
||||
if (i==1)
|
||||
{
|
||||
path->append(VSplinePoint(*p1, splinePath->at(i-1).KAsm1(), spl.GetAngle1(),
|
||||
splinePath->at(i-1).KAsm1()));
|
||||
|
@ -386,10 +395,10 @@ void VToolUnionDetails::BiasRotatePoint(VPointF *point, const qreal &dx, const q
|
|||
{
|
||||
point->setX(point->x()+dx);
|
||||
point->setY(point->y()+dy);
|
||||
QLineF l(pRotate, point->toQPointF());
|
||||
l.setAngle(angle);
|
||||
point->setX(l.p2().x());
|
||||
point->setY(l.p2().y());
|
||||
QLineF line(pRotate, point->toQPointF());
|
||||
line.setAngle(angle);
|
||||
point->setX(line.p2().x());
|
||||
point->setY(line.p2().y());
|
||||
}
|
||||
|
||||
void VToolUnionDetails::Create(QSharedPointer<DialogUnionDetails> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
||||
|
@ -439,7 +448,7 @@ void VToolUnionDetails::Create(const qint64 _id, const VDetail &d1, const VDetai
|
|||
|
||||
}
|
||||
|
||||
if(typeCreation == Tool::FromGui)
|
||||
if (typeCreation == Tool::FromGui)
|
||||
{
|
||||
//Update corected points
|
||||
qint64 d1P1 = unionDetails->getD1P1();
|
||||
|
|
|
@ -40,7 +40,8 @@ VItem::VItem (const QPainterPath & path, int numInList, QGraphicsItem * parent )
|
|||
void VItem::checkItemChange()
|
||||
{
|
||||
QRectF rect;
|
||||
if(paper == 0){
|
||||
if (paper == 0)
|
||||
{
|
||||
qDebug()<<"Don't set paper for detail!!!!";
|
||||
rect = this->scene()->sceneRect();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
VSimpleSpline::VSimpleSpline(qint64 id, Qt::GlobalColor *currentColor, qreal *factor, QObject *parent)
|
||||
:QObject(parent), QGraphicsPathItem(), id (id), factor(factor), currentColor(currentColor)
|
||||
{
|
||||
if(factor == 0)
|
||||
if (factor == 0)
|
||||
{
|
||||
setPen(QPen(Qt::black, widthHairLine));
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ void VSimpleSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
void VSimpleSpline::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
if(factor == 0)
|
||||
if (factor == 0)
|
||||
{
|
||||
this->setPen(QPen(*currentColor, widthMainLine));
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ void VSimpleSpline::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
|||
void VSimpleSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
if(factor == 0)
|
||||
if (factor == 0)
|
||||
{
|
||||
this->setPen(QPen(*currentColor, widthHairLine));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user