Fixed vera++ warnings.
--HG-- branch : feature
This commit is contained in:
parent
8e82a80463
commit
3b1a654581
|
@ -31,7 +31,8 @@
|
||||||
|
|
||||||
#include "dialogtool.h"
|
#include "dialogtool.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
|
{
|
||||||
class DialogCutSpline;
|
class DialogCutSpline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,8 @@
|
||||||
|
|
||||||
#include "dialogtool.h"
|
#include "dialogtool.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
|
{
|
||||||
class DialogCutSplinePath;
|
class DialogCutSplinePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,8 @@
|
||||||
|
|
||||||
#include "dialogtool.h"
|
#include "dialogtool.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
|
{
|
||||||
class DialogUnionDetails;
|
class DialogUnionDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ VArc::VArc ()
|
||||||
|
|
||||||
VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
||||||
QString formulaF2, qint64 idObject, Draw::Draws mode)
|
QString formulaF2, qint64 idObject, Draw::Draws mode)
|
||||||
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2), radius(radius),
|
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
||||||
formulaRadius(formulaRadius),center(center)
|
radius(radius), formulaRadius(formulaRadius), center(center)
|
||||||
{
|
{
|
||||||
//TODO Change name of arc in formula. Name now not unique.
|
//TODO Change name of arc in formula. Name now not unique.
|
||||||
_name = QString ("Arc_%1").arg(this->GetCenter().name());
|
_name = QString ("Arc_%1").arg(this->GetCenter().name());
|
||||||
|
|
|
@ -111,4 +111,3 @@ void VDetail::setId(const qint64 &id)
|
||||||
{
|
{
|
||||||
_id = 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)
|
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),
|
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1),
|
||||||
kCurve(1)
|
kAsm2(1), kCurve(1)
|
||||||
{
|
{
|
||||||
CreateName();
|
CreateName();
|
||||||
|
|
||||||
|
@ -199,7 +199,8 @@ QPointF VSpline::CutSpline ( qreal length, QPointF &spl1p2, QPointF &spl1p3, QPo
|
||||||
{
|
{
|
||||||
parT = parT + step;
|
parT = parT + step;
|
||||||
qreal splLength = LengthT(parT);
|
qreal splLength = LengthT(parT);
|
||||||
if(splLength >= length || parT > 1){
|
if (splLength >= length || parT > 1)
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,11 +122,13 @@ void VToolCutSplinePath::Create(const qint64 _id, const QString &pointName, cons
|
||||||
Q_ASSERT(splPath2);
|
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 && i < p2)
|
||||||
|
{
|
||||||
if (i == p1)
|
if (i == p1)
|
||||||
{
|
{
|
||||||
splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1(), spl1.GetKasm1()));
|
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);
|
splPath1->append(cutPoint);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -171,11 +173,13 @@ void VToolCutSplinePath::Create(const qint64 _id, const QString &pointName, cons
|
||||||
Q_ASSERT(splPath2 != 0);
|
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 && i < p2)
|
||||||
|
{
|
||||||
if (i == p1)
|
if (i == p1)
|
||||||
{
|
{
|
||||||
splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1(), spl1.GetKasm1()));
|
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);
|
splPath1->append(cutPoint);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,18 +205,22 @@ void VToolUnionDetails::AddToNewDetail(VContainer *data, VDetail newDetail, cons
|
||||||
|
|
||||||
VPointF *p1 = new VPointF(spline.GetP1());
|
VPointF *p1 = new VPointF(spline.GetP1());
|
||||||
Q_ASSERT(p1 != 0);
|
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);
|
qint64 idP1 = data->AddGObject(p1);
|
||||||
|
|
||||||
VPointF p2 = VPointF(spline.GetP2());
|
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());
|
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());
|
VPointF *p4 = new VPointF(spline.GetP4());
|
||||||
Q_ASSERT(p4 != 0);
|
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);
|
qint64 idP4 = data->AddGObject(p4);
|
||||||
|
|
||||||
VSpline spl = VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline.GetKcurve());
|
VSpline spl = VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline.GetKcurve());
|
||||||
|
@ -281,7 +285,8 @@ void VToolUnionDetails::UpdatePoints(const qint64 &idDetail, VContainer *data, c
|
||||||
BiasRotatePoint(&p2, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
BiasRotatePoint(&p2, dx, dy, data->GeometricObject<const VPointF *>(pRotate)->toQPointF(), angle);
|
||||||
VPointF *center = new VPointF(arc->GetCenter());
|
VPointF *center = new VPointF(arc->GetCenter());
|
||||||
Q_ASSERT(center != 0);
|
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 l1(center->toQPointF(), p1.toQPointF());
|
||||||
QLineF l2(center->toQPointF(), p2.toQPointF());
|
QLineF l2(center->toQPointF(), p2.toQPointF());
|
||||||
|
@ -346,18 +351,22 @@ void VToolUnionDetails::UpdatePoints(const qint64 &idDetail, VContainer *data, c
|
||||||
|
|
||||||
VPointF *p1 = new VPointF(spline.GetP1());
|
VPointF *p1 = new VPointF(spline.GetP1());
|
||||||
Q_ASSERT(p1 != 0);
|
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);
|
qint64 idP1 = data->AddGObject(p1);
|
||||||
|
|
||||||
VPointF p2 = VPointF(spline.GetP2());
|
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());
|
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());
|
VPointF *p4 = new VPointF(spline.GetP4());
|
||||||
Q_ASSERT(p4 != 0);
|
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);
|
qint64 idP4 = data->AddGObject(p4);
|
||||||
|
|
||||||
VSpline spl = VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline.GetKcurve());
|
VSpline spl = VSpline(*p1, p2.toQPointF(), p3.toQPointF(), *p4, spline.GetKcurve());
|
||||||
|
@ -386,10 +395,10 @@ void VToolUnionDetails::BiasRotatePoint(VPointF *point, const qreal &dx, const q
|
||||||
{
|
{
|
||||||
point->setX(point->x()+dx);
|
point->setX(point->x()+dx);
|
||||||
point->setY(point->y()+dy);
|
point->setY(point->y()+dy);
|
||||||
QLineF l(pRotate, point->toQPointF());
|
QLineF line(pRotate, point->toQPointF());
|
||||||
l.setAngle(angle);
|
line.setAngle(angle);
|
||||||
point->setX(l.p2().x());
|
point->setX(line.p2().x());
|
||||||
point->setY(l.p2().y());
|
point->setY(line.p2().y());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolUnionDetails::Create(QSharedPointer<DialogUnionDetails> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
void VToolUnionDetails::Create(QSharedPointer<DialogUnionDetails> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
||||||
|
|
|
@ -40,7 +40,8 @@ VItem::VItem (const QPainterPath & path, int numInList, QGraphicsItem * parent )
|
||||||
void VItem::checkItemChange()
|
void VItem::checkItemChange()
|
||||||
{
|
{
|
||||||
QRectF rect;
|
QRectF rect;
|
||||||
if(paper == 0){
|
if (paper == 0)
|
||||||
|
{
|
||||||
qDebug()<<"Don't set paper for detail!!!!";
|
qDebug()<<"Don't set paper for detail!!!!";
|
||||||
rect = this->scene()->sceneRect();
|
rect = this->scene()->sceneRect();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user