Refactoring. Use everywhere NULL_ID instead 0.
--HG-- branch : develop
This commit is contained in:
parent
1c2abdb2ca
commit
fa24b86d32
|
@ -63,12 +63,12 @@ void VisToolAlongLine::setLength(const QString &expression)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolAlongLine::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(lineP1, first->toQPointF(), supportColor);
|
||||
|
||||
if (point2Id <= 0)
|
||||
if (point2Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(line, QLineF(first->toQPointF(), Visualization::scenePos), supportColor);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ VisToolArc::~VisToolArc()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolArc::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(arcCenter, first->toQPointF(), supportColor);
|
||||
|
|
|
@ -71,12 +71,12 @@ VisToolBisector::~VisToolBisector()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolBisector::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(line1P1, first->toQPointF(), supportColor);
|
||||
|
||||
if (point2Id <= 0)
|
||||
if (point2Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(line1, QLineF(first->toQPointF(), Visualization::scenePos), supportColor);
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ void VisToolBisector::RefreshGeometry()
|
|||
|
||||
DrawLine(line1, QLineF(first->toQPointF(), second->toQPointF()), supportColor);
|
||||
|
||||
if (point3Id <= 0)
|
||||
if (point3Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(line2, QLineF(second->toQPointF(), Visualization::scenePos), supportColor);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ VisToolCutArc::~VisToolCutArc()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolCutArc::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VArc> arc = Visualization::data->GeometricObject<VArc>(point1Id);
|
||||
DrawPath(this, arc->GetPath(PathDirection::Show), supportColor, Qt::SolidLine, Qt::RoundCap);
|
||||
|
|
|
@ -51,7 +51,7 @@ VisToolCutSpline::~VisToolCutSpline()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolCutSpline::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VSpline> spl = Visualization::data->GeometricObject<VSpline>(point1Id);
|
||||
DrawPath(this, spl->GetPath(PathDirection::Show), supportColor, Qt::SolidLine, Qt::RoundCap);
|
||||
|
|
|
@ -51,7 +51,7 @@ VisToolCutSplinePath::~VisToolCutSplinePath()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolCutSplinePath::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VSplinePath> splPath = Visualization::data->GeometricObject<VSplinePath>(point1Id);
|
||||
DrawPath(this, splPath->GetPath(PathDirection::Show), supportColor, Qt::SolidLine, Qt::RoundCap);
|
||||
|
|
|
@ -51,12 +51,12 @@ VisToolHeight::~VisToolHeight()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolHeight::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(base_point, first->toQPointF(), supportColor);
|
||||
|
||||
if (lineP1Id <= 0)
|
||||
if (lineP1Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(this, QLineF(first->toQPointF(), Visualization::scenePos), mainColor);
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ void VisToolHeight::RefreshGeometry()
|
|||
DrawPoint(lineP1, second->toQPointF(), supportColor);
|
||||
|
||||
QLineF base_line;
|
||||
if (lineP2Id <= 0)
|
||||
if (lineP2Id <= NULL_ID)
|
||||
{
|
||||
base_line = QLineF(second->toQPointF(), Visualization::scenePos);
|
||||
DrawLine(line, base_line, supportColor);
|
||||
|
|
|
@ -47,7 +47,7 @@ void VisToolLine::RefreshGeometry()
|
|||
{
|
||||
QLineF line;
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
if (point2Id == 0)
|
||||
if (point2Id == NULL_ID)
|
||||
{
|
||||
line = QLineF(first->toQPointF(), Visualization::scenePos);
|
||||
}
|
||||
|
|
|
@ -52,12 +52,12 @@ VisToolLineIntersect::~VisToolLineIntersect()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolLineIntersect::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(line1P1, first->toQPointF(), supportColor);
|
||||
|
||||
if (line1P2Id <= 0)
|
||||
if (line1P2Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(line1, QLineF(first->toQPointF(), Visualization::scenePos), supportColor);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ void VisToolLineIntersect::RefreshGeometry()
|
|||
|
||||
DrawLine(line1, QLineF(first->toQPointF(), second->toQPointF()), supportColor);
|
||||
|
||||
if (line2P1Id <= 0)
|
||||
if (line2P1Id <= NULL_ID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ void VisToolLineIntersect::RefreshGeometry()
|
|||
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(line2P1Id);
|
||||
DrawPoint(line2P1, third->toQPointF(), supportColor);
|
||||
|
||||
if (line2P2Id <= 0)
|
||||
if (line2P2Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(this, QLineF(third->toQPointF(), Visualization::scenePos), supportColor);
|
||||
|
||||
|
|
|
@ -54,12 +54,12 @@ VisToolLineIntersectAxis::~VisToolLineIntersectAxis()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolLineIntersectAxis::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(lineP1, first->toQPointF(), supportColor);
|
||||
|
||||
if (point2Id <= 0)
|
||||
if (point2Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(baseLine, QLineF(first->toQPointF(), Visualization::scenePos), supportColor);
|
||||
}
|
||||
|
|
|
@ -51,12 +51,12 @@ VisToolNormal::~VisToolNormal()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolNormal::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(lineP1, first->toQPointF(), supportColor);
|
||||
|
||||
if (point2Id <= 0)
|
||||
if (point2Id <= NULL_ID)
|
||||
{
|
||||
QLineF line_mouse(first->toQPointF(), Visualization::scenePos);
|
||||
DrawLine(line, line_mouse, supportColor);
|
||||
|
|
|
@ -50,12 +50,12 @@ VisToolPointOfContact::~VisToolPointOfContact()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolPointOfContact::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(lineP1, first->toQPointF(), supportColor);
|
||||
|
||||
if (lineP2Id <= 0)
|
||||
if (lineP2Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(this, QLineF(first->toQPointF(), Visualization::scenePos), supportColor);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ void VisToolPointOfContact::RefreshGeometry()
|
|||
DrawPoint(lineP2, second->toQPointF(), supportColor);
|
||||
DrawLine(this, QLineF(first->toQPointF(), second->toQPointF()), supportColor);
|
||||
|
||||
if (radiusId <= 0)
|
||||
if (radiusId <= NULL_ID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ VisToolPointOfIntersection::~VisToolPointOfIntersection()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolPointOfIntersection::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(axisP1, first->toQPointF(), supportColor);
|
||||
|
@ -57,7 +57,7 @@ void VisToolPointOfIntersection::RefreshGeometry()
|
|||
DrawLine(this, axisL1, supportColor, Qt::DashLine);
|
||||
|
||||
QLineF axisL2;
|
||||
if (point2Id <= 0)
|
||||
if (point2Id <= NULL_ID)
|
||||
{
|
||||
axisL2 = Axis(Visualization::scenePos, 180);
|
||||
}
|
||||
|
|
|
@ -53,12 +53,12 @@ VisToolShoulderPoint::~VisToolShoulderPoint()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolShoulderPoint::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(line1P1, first->toQPointF(), supportColor);
|
||||
|
||||
if (lineP1Id <= 0)
|
||||
if (lineP1Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(line1, QLineF(first->toQPointF(), Visualization::scenePos), supportColor);
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ void VisToolShoulderPoint::RefreshGeometry()
|
|||
|
||||
DrawLine(line1, QLineF(first->toQPointF(), second->toQPointF()), supportColor);
|
||||
|
||||
if (lineP2Id <= 0)
|
||||
if (lineP2Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(line2, QLineF(second->toQPointF(), Visualization::scenePos), supportColor);
|
||||
}
|
||||
|
|
|
@ -50,12 +50,12 @@ VisToolSpline::~VisToolSpline()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolSpline::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(lineP1, first->toQPointF(), supportColor);
|
||||
|
||||
if (point4Id <= 0)
|
||||
if (point4Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(line, QLineF(first->toQPointF(), Visualization::scenePos), mainColor);
|
||||
}
|
||||
|
|
|
@ -56,12 +56,12 @@ VisToolTriangle::~VisToolTriangle()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VisToolTriangle::RefreshGeometry()
|
||||
{
|
||||
if (point1Id > 0)
|
||||
if (point1Id > NULL_ID)
|
||||
{
|
||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(point1Id);
|
||||
DrawPoint(axisP1, first->toQPointF(), supportColor);
|
||||
|
||||
if (point2Id <= 0)
|
||||
if (point2Id <= NULL_ID)
|
||||
{
|
||||
DrawAimedAxis(axis, QLineF(first->toQPointF(), Visualization::scenePos), supportColor);
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ void VisToolTriangle::RefreshGeometry()
|
|||
|
||||
DrawAimedAxis(axis, QLineF(first->toQPointF(), second->toQPointF()), supportColor);
|
||||
|
||||
if (hypotenuseP1Id <= 0)
|
||||
if (hypotenuseP1Id <= NULL_ID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ void VisToolTriangle::RefreshGeometry()
|
|||
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(hypotenuseP1Id);
|
||||
DrawPoint(hypotenuseP1, third->toQPointF(), supportColor);
|
||||
|
||||
if (hypotenuseP2Id <= 0)
|
||||
if (hypotenuseP2Id <= NULL_ID)
|
||||
{
|
||||
DrawLine(this, QLineF(third->toQPointF(), Visualization::scenePos), supportColor, Qt::DashLine);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user