Documentation for class VContainer.
--HG-- branch : feature
This commit is contained in:
parent
70e2daf8f9
commit
c44bf1c517
|
@ -47,6 +47,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief eval calculate formula.
|
* @brief eval calculate formula.
|
||||||
* @param prog string of formula.
|
* @param prog string of formula.
|
||||||
|
* @param errorMsg keep error message.
|
||||||
* @return value of formula.
|
* @return value of formula.
|
||||||
*/
|
*/
|
||||||
qreal eval(QString prog, QString *errorMsg);
|
qreal eval(QString prog, QString *errorMsg);
|
||||||
|
|
|
@ -33,13 +33,13 @@ qint64 VContainer::_id = 0;
|
||||||
|
|
||||||
VContainer::VContainer()
|
VContainer::VContainer()
|
||||||
:base(QHash<QString, qint32>()), points(QHash<qint64, VPointF>()),
|
:base(QHash<QString, qint32>()), points(QHash<qint64, VPointF>()),
|
||||||
modelingPoints(QHash<qint64, VPointF>()),
|
pointsModeling(QHash<qint64, VPointF>()),
|
||||||
standartTable(QHash<QString, VStandartTableCell>()), incrementTable(QHash<QString, VIncrementTableRow>()),
|
standartTable(QHash<QString, VStandartTableCell>()), incrementTable(QHash<QString, VIncrementTableRow>()),
|
||||||
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), splines(QHash<qint64, VSpline>()),
|
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), splines(QHash<qint64, VSpline>()),
|
||||||
modelingSplines(QHash<qint64, VSpline>()),
|
splinesModeling(QHash<qint64, VSpline>()),
|
||||||
lengthSplines(QHash<QString, qreal>()), arcs(QHash<qint64, VArc>()), modelingArcs(QHash<qint64, VArc>()),
|
lengthSplines(QHash<QString, qreal>()), arcs(QHash<qint64, VArc>()), arcsModeling(QHash<qint64, VArc>()),
|
||||||
lengthArcs(QHash<QString, qreal>()),
|
lengthArcs(QHash<QString, qreal>()),
|
||||||
splinePaths(QHash<qint64, VSplinePath>()), modelingSplinePaths(QHash<qint64, VSplinePath>()),
|
splinePaths(QHash<qint64, VSplinePath>()), splinePathsModeling(QHash<qint64, VSplinePath>()),
|
||||||
details(QHash<qint64, VDetail>())
|
details(QHash<qint64, VDetail>())
|
||||||
{
|
{
|
||||||
SetSize(500);
|
SetSize(500);
|
||||||
|
@ -55,13 +55,13 @@ VContainer &VContainer::operator =(const VContainer &data)
|
||||||
|
|
||||||
VContainer::VContainer(const VContainer &data)
|
VContainer::VContainer(const VContainer &data)
|
||||||
:base(QHash<QString, qint32>()), points(QHash<qint64, VPointF>()),
|
:base(QHash<QString, qint32>()), points(QHash<qint64, VPointF>()),
|
||||||
modelingPoints(QHash<qint64, VPointF>()),
|
pointsModeling(QHash<qint64, VPointF>()),
|
||||||
standartTable(QHash<QString, VStandartTableCell>()), incrementTable(QHash<QString, VIncrementTableRow>()),
|
standartTable(QHash<QString, VStandartTableCell>()), incrementTable(QHash<QString, VIncrementTableRow>()),
|
||||||
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), splines(QHash<qint64, VSpline>()),
|
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), splines(QHash<qint64, VSpline>()),
|
||||||
modelingSplines(QHash<qint64, VSpline>()),
|
splinesModeling(QHash<qint64, VSpline>()),
|
||||||
lengthSplines(QHash<QString, qreal>()), arcs(QHash<qint64, VArc>()), modelingArcs(QHash<qint64, VArc>()),
|
lengthSplines(QHash<QString, qreal>()), arcs(QHash<qint64, VArc>()), arcsModeling(QHash<qint64, VArc>()),
|
||||||
lengthArcs(QHash<QString, qreal>()),
|
lengthArcs(QHash<QString, qreal>()),
|
||||||
splinePaths(QHash<qint64, VSplinePath>()), modelingSplinePaths(QHash<qint64, VSplinePath>()),
|
splinePaths(QHash<qint64, VSplinePath>()), splinePathsModeling(QHash<qint64, VSplinePath>()),
|
||||||
details(QHash<qint64, VDetail>())
|
details(QHash<qint64, VDetail>())
|
||||||
{
|
{
|
||||||
setData(data);
|
setData(data);
|
||||||
|
@ -71,19 +71,19 @@ void VContainer::setData(const VContainer &data)
|
||||||
{
|
{
|
||||||
base = *data.DataBase();
|
base = *data.DataBase();
|
||||||
points = *data.DataPoints();
|
points = *data.DataPoints();
|
||||||
modelingPoints = *data.DataModelingPoints();
|
pointsModeling = *data.DataPointsModeling();
|
||||||
standartTable = *data.DataStandartTable();
|
standartTable = *data.DataStandartTable();
|
||||||
incrementTable = *data.DataIncrementTable();
|
incrementTable = *data.DataIncrementTable();
|
||||||
lengthLines = *data.DataLengthLines();
|
lengthLines = *data.DataLengthLines();
|
||||||
lineAngles = *data.DataLineAngles();
|
lineAngles = *data.DataLineAngles();
|
||||||
splines = *data.DataSplines();
|
splines = *data.DataSplines();
|
||||||
modelingSplines = *data.DataModelingSplines();
|
splinesModeling = *data.DataSplinesModeling();
|
||||||
lengthSplines = *data.DataLengthSplines();
|
lengthSplines = *data.DataLengthSplines();
|
||||||
arcs = *data.DataArcs();
|
arcs = *data.DataArcs();
|
||||||
modelingArcs = *data.DataModelingArcs();
|
arcsModeling = *data.DataArcsModeling();
|
||||||
lengthArcs = *data.DataLengthArcs();
|
lengthArcs = *data.DataLengthArcs();
|
||||||
splinePaths = *data.DataSplinePaths();
|
splinePaths = *data.DataSplinePaths();
|
||||||
modelingSplinePaths = *data.DataModelingSplinePaths();
|
splinePathsModeling = *data.DataSplinePathsModeling();
|
||||||
details = *data.DataDetails();
|
details = *data.DataDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,9 +92,9 @@ VPointF VContainer::GetPoint(qint64 id) const
|
||||||
return GetObject(points, id);
|
return GetObject(points, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
VPointF VContainer::GetModelingPoint(qint64 id) const
|
VPointF VContainer::GetPointModeling(qint64 id) const
|
||||||
{
|
{
|
||||||
return GetObject(modelingPoints, id);
|
return GetObject(pointsModeling, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename key, typename val>
|
template <typename key, typename val>
|
||||||
|
@ -151,9 +151,9 @@ VSpline VContainer::GetSpline(qint64 id) const
|
||||||
return GetObject(splines, id);
|
return GetObject(splines, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
VSpline VContainer::GetModelingSpline(qint64 id) const
|
VSpline VContainer::GetSplineModeling(qint64 id) const
|
||||||
{
|
{
|
||||||
return GetObject(modelingSplines, id);
|
return GetObject(splinesModeling, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
VArc VContainer::GetArc(qint64 id) const
|
VArc VContainer::GetArc(qint64 id) const
|
||||||
|
@ -161,9 +161,9 @@ VArc VContainer::GetArc(qint64 id) const
|
||||||
return GetObject(arcs, id);
|
return GetObject(arcs, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
VArc VContainer::GetModelingArc(qint64 id) const
|
VArc VContainer::GetArcModeling(qint64 id) const
|
||||||
{
|
{
|
||||||
return GetObject(modelingArcs, id);
|
return GetObject(arcsModeling, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
VSplinePath VContainer::GetSplinePath(qint64 id) const
|
VSplinePath VContainer::GetSplinePath(qint64 id) const
|
||||||
|
@ -171,9 +171,9 @@ VSplinePath VContainer::GetSplinePath(qint64 id) const
|
||||||
return GetObject(splinePaths, id);
|
return GetObject(splinePaths, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
VSplinePath VContainer::GetModelingSplinePath(qint64 id) const
|
VSplinePath VContainer::GetSplinePathModeling(qint64 id) const
|
||||||
{
|
{
|
||||||
return GetObject(modelingSplinePaths, id);
|
return GetObject(splinePathsModeling, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
VDetail VContainer::GetDetail(qint64 id) const
|
VDetail VContainer::GetDetail(qint64 id) const
|
||||||
|
@ -186,9 +186,9 @@ qint64 VContainer::AddPoint(const VPointF &point)
|
||||||
return AddObject(points, point);
|
return AddObject(points, point);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 VContainer::AddModelingPoint(const VPointF &point)
|
qint64 VContainer::AddPointModeling(const VPointF &point)
|
||||||
{
|
{
|
||||||
return AddObject(modelingPoints, point);
|
return AddObject(pointsModeling, point);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 VContainer::AddDetail(const VDetail &detail)
|
qint64 VContainer::AddDetail(const VDetail &detail)
|
||||||
|
@ -221,7 +221,7 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const
|
||||||
{
|
{
|
||||||
case (Tool::NodePoint):
|
case (Tool::NodePoint):
|
||||||
{
|
{
|
||||||
VPointF point = GetModelingPoint(detail[i].getId());
|
VPointF point = GetPointModeling(detail[i].getId());
|
||||||
points.append(point.toQPointF());
|
points.append(point.toQPointF());
|
||||||
if (detail.getSupplement() == true)
|
if (detail.getSupplement() == true)
|
||||||
{
|
{
|
||||||
|
@ -234,7 +234,7 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const
|
||||||
break;
|
break;
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
{
|
{
|
||||||
VArc arc = GetModelingArc(detail[i].getId());
|
VArc arc = GetArcModeling(detail[i].getId());
|
||||||
qreal len1 = GetLengthContour(points, arc.GetPoints());
|
qreal len1 = GetLengthContour(points, arc.GetPoints());
|
||||||
qreal lenReverse = GetLengthContour(points, GetReversePoint(arc.GetPoints()));
|
qreal lenReverse = GetLengthContour(points, GetReversePoint(arc.GetPoints()));
|
||||||
if (len1 <= lenReverse)
|
if (len1 <= lenReverse)
|
||||||
|
@ -257,7 +257,7 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const
|
||||||
break;
|
break;
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
{
|
{
|
||||||
VSpline spline = GetModelingSpline(detail[i].getId());
|
VSpline spline = GetSplineModeling(detail[i].getId());
|
||||||
qreal len1 = GetLengthContour(points, spline.GetPoints());
|
qreal len1 = GetLengthContour(points, spline.GetPoints());
|
||||||
qreal lenReverse = GetLengthContour(points, GetReversePoint(spline.GetPoints()));
|
qreal lenReverse = GetLengthContour(points, GetReversePoint(spline.GetPoints()));
|
||||||
if (len1 <= lenReverse)
|
if (len1 <= lenReverse)
|
||||||
|
@ -281,7 +281,7 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const
|
||||||
break;
|
break;
|
||||||
case (Tool::NodeSplinePath):
|
case (Tool::NodeSplinePath):
|
||||||
{
|
{
|
||||||
VSplinePath splinePath = GetModelingSplinePath(detail[i].getId());
|
VSplinePath splinePath = GetSplinePathModeling(detail[i].getId());
|
||||||
qreal len1 = GetLengthContour(points, splinePath.GetPathPoints());
|
qreal len1 = GetLengthContour(points, splinePath.GetPathPoints());
|
||||||
qreal lenReverse = GetLengthContour(points, GetReversePoint(splinePath.GetPathPoints()));
|
qreal lenReverse = GetLengthContour(points, GetReversePoint(splinePath.GetPathPoints()));
|
||||||
if (len1 <= lenReverse)
|
if (len1 <= lenReverse)
|
||||||
|
@ -609,10 +609,10 @@ void VContainer::Clear()
|
||||||
lengthArcs.clear();
|
lengthArcs.clear();
|
||||||
lineAngles.clear();
|
lineAngles.clear();
|
||||||
details.clear();
|
details.clear();
|
||||||
modelingArcs.clear();
|
arcsModeling.clear();
|
||||||
modelingPoints.clear();
|
pointsModeling.clear();
|
||||||
modelingSplinePaths.clear();
|
splinePathsModeling.clear();
|
||||||
modelingSplines.clear();
|
splinesModeling.clear();
|
||||||
ClearObject();
|
ClearObject();
|
||||||
CreateManTableIGroup ();
|
CreateManTableIGroup ();
|
||||||
}
|
}
|
||||||
|
@ -679,8 +679,8 @@ void VContainer::AddLine(const qint64 &firstPointId, const qint64 &secondPointId
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
first = GetModelingPoint(firstPointId);
|
first = GetPointModeling(firstPointId);
|
||||||
second = GetModelingPoint(secondPointId);
|
second = GetPointModeling(secondPointId);
|
||||||
}
|
}
|
||||||
AddLengthLine(nameLine, toMM(QLineF(first.toQPointF(), second.toQPointF()).length()));
|
AddLengthLine(nameLine, toMM(QLineF(first.toQPointF(), second.toQPointF()).length()));
|
||||||
nameLine = GetNameLineAngle(firstPointId, secondPointId, mode);
|
nameLine = GetNameLineAngle(firstPointId, secondPointId, mode);
|
||||||
|
@ -692,9 +692,9 @@ qint64 VContainer::AddSpline(const VSpline &spl)
|
||||||
return AddObject(splines, spl);
|
return AddObject(splines, spl);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 VContainer::AddModelingSpline(const VSpline &spl)
|
qint64 VContainer::AddSplineModeling(const VSpline &spl)
|
||||||
{
|
{
|
||||||
return AddObject(modelingSplines, spl);
|
return AddObject(splinesModeling, spl);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 VContainer::AddSplinePath(const VSplinePath &splPath)
|
qint64 VContainer::AddSplinePath(const VSplinePath &splPath)
|
||||||
|
@ -702,9 +702,9 @@ qint64 VContainer::AddSplinePath(const VSplinePath &splPath)
|
||||||
return AddObject(splinePaths, splPath);
|
return AddObject(splinePaths, splPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 VContainer::AddModelingSplinePath(const VSplinePath &splPath)
|
qint64 VContainer::AddSplinePathModeling(const VSplinePath &splPath)
|
||||||
{
|
{
|
||||||
return AddObject(modelingSplinePaths, splPath);
|
return AddObject(splinePathsModeling, splPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 VContainer::AddArc(const VArc &arc)
|
qint64 VContainer::AddArc(const VArc &arc)
|
||||||
|
@ -712,9 +712,9 @@ qint64 VContainer::AddArc(const VArc &arc)
|
||||||
return AddObject(arcs, arc);
|
return AddObject(arcs, arc);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 VContainer::AddModelingArc(const VArc &arc)
|
qint64 VContainer::AddArcModeling(const VArc &arc)
|
||||||
{
|
{
|
||||||
return AddObject(modelingArcs, arc);
|
return AddObject(arcsModeling, arc);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename key, typename val>
|
template <typename key, typename val>
|
||||||
|
@ -736,8 +736,8 @@ QString VContainer::GetNameLine(const qint64 &firstPoint, const qint64 &secondPo
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
first = GetModelingPoint(firstPoint);
|
first = GetPointModeling(firstPoint);
|
||||||
second = GetModelingPoint(secondPoint);
|
second = GetPointModeling(secondPoint);
|
||||||
}
|
}
|
||||||
return QString("Line_%1_%2").arg(first.name(), second.name());
|
return QString("Line_%1_%2").arg(first.name(), second.name());
|
||||||
}
|
}
|
||||||
|
@ -753,8 +753,8 @@ QString VContainer::GetNameLineAngle(const qint64 &firstPoint, const qint64 &sec
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
first = GetModelingPoint(firstPoint);
|
first = GetPointModeling(firstPoint);
|
||||||
second = GetModelingPoint(secondPoint);
|
second = GetPointModeling(secondPoint);
|
||||||
}
|
}
|
||||||
return QString("AngleLine_%1_%2").arg(first.name(), second.name());
|
return QString("AngleLine_%1_%2").arg(first.name(), second.name());
|
||||||
}
|
}
|
||||||
|
@ -764,9 +764,9 @@ void VContainer::UpdatePoint(qint64 id, const VPointF &point)
|
||||||
UpdateObject(points, id, point);
|
UpdateObject(points, id, point);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VContainer::UpdateModelingPoint(qint64 id, const VPointF &point)
|
void VContainer::UpdatePointModeling(qint64 id, const VPointF &point)
|
||||||
{
|
{
|
||||||
UpdateObject(modelingPoints, id, point);
|
UpdateObject(pointsModeling, id, point);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VContainer::UpdateDetail(qint64 id, const VDetail &detail)
|
void VContainer::UpdateDetail(qint64 id, const VDetail &detail)
|
||||||
|
@ -779,9 +779,9 @@ void VContainer::UpdateSpline(qint64 id, const VSpline &spl)
|
||||||
UpdateObject(splines, id, spl);
|
UpdateObject(splines, id, spl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VContainer::UpdateModelingSpline(qint64 id, const VSpline &spl)
|
void VContainer::UpdateSplineModeling(qint64 id, const VSpline &spl)
|
||||||
{
|
{
|
||||||
UpdateObject(modelingSplines, id, spl);
|
UpdateObject(splinesModeling, id, spl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VContainer::UpdateSplinePath(qint64 id, const VSplinePath &splPath)
|
void VContainer::UpdateSplinePath(qint64 id, const VSplinePath &splPath)
|
||||||
|
@ -789,9 +789,9 @@ void VContainer::UpdateSplinePath(qint64 id, const VSplinePath &splPath)
|
||||||
UpdateObject(splinePaths, id, splPath);
|
UpdateObject(splinePaths, id, splPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VContainer::UpdateModelingSplinePath(qint64 id, const VSplinePath &splPath)
|
void VContainer::UpdateSplinePathModeling(qint64 id, const VSplinePath &splPath)
|
||||||
{
|
{
|
||||||
UpdateObject(modelingSplinePaths, id, splPath);
|
UpdateObject(splinePathsModeling, id, splPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VContainer::UpdateArc(qint64 id, const VArc &arc)
|
void VContainer::UpdateArc(qint64 id, const VArc &arc)
|
||||||
|
@ -799,9 +799,9 @@ void VContainer::UpdateArc(qint64 id, const VArc &arc)
|
||||||
UpdateObject(arcs, id, arc);
|
UpdateObject(arcs, id, arc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VContainer::UpdateModelingArc(qint64 id, const VArc &arc)
|
void VContainer::UpdateArcModeling(qint64 id, const VArc &arc)
|
||||||
{
|
{
|
||||||
UpdateObject(modelingArcs, id, arc);
|
UpdateObject(arcsModeling, id, arc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VContainer::AddLengthLine(const QString &name, const qreal &value)
|
void VContainer::AddLengthLine(const QString &name, const qreal &value)
|
||||||
|
|
|
@ -70,133 +70,619 @@ public:
|
||||||
*/
|
*/
|
||||||
VPointF GetPoint(qint64 id) const;
|
VPointF GetPoint(qint64 id) const;
|
||||||
/**
|
/**
|
||||||
* @brief GetModelingPoint return a modeling point by id
|
* @brief GetPointModeling return a point modeling by id
|
||||||
* @param id id of modeling point
|
* @param id id of point modeling
|
||||||
* @return modeling point
|
* @return point modeling
|
||||||
*/
|
*/
|
||||||
VPointF GetModelingPoint(qint64 id) const;
|
VPointF GetPointModeling(qint64 id) const;
|
||||||
/**
|
/**
|
||||||
* @brief GetStandartTableCell
|
* @brief GetStandartTableCell return standart table row by name
|
||||||
* @param name
|
* @param name name of standart table row
|
||||||
* @return
|
* @return row of standart table
|
||||||
*/
|
*/
|
||||||
VStandartTableCell GetStandartTableCell(const QString& name) const;
|
VStandartTableCell GetStandartTableCell(const QString& name) const;
|
||||||
|
/**
|
||||||
|
* @brief GetIncrementTableRow return increment table row by name
|
||||||
|
* @param name name of increment table row
|
||||||
|
* @return row of increment table
|
||||||
|
*/
|
||||||
VIncrementTableRow GetIncrementTableRow(const QString& name) const;
|
VIncrementTableRow GetIncrementTableRow(const QString& name) const;
|
||||||
|
/**
|
||||||
|
* @brief GetLine return length of line by name
|
||||||
|
* @param name name of line
|
||||||
|
* @return length of line in mm
|
||||||
|
*/
|
||||||
qreal GetLine(const QString &name) const;
|
qreal GetLine(const QString &name) const;
|
||||||
|
/**
|
||||||
|
* @brief GetLengthArc return length of arc by name
|
||||||
|
* @param name name of arc
|
||||||
|
* @return length of arc in mm
|
||||||
|
*/
|
||||||
qreal GetLengthArc(const QString &name) const;
|
qreal GetLengthArc(const QString &name) const;
|
||||||
|
/**
|
||||||
|
* @brief GetLengthSpline return length of spline by name
|
||||||
|
* @param name name of spline
|
||||||
|
* @return length of spline in mm
|
||||||
|
*/
|
||||||
qreal GetLengthSpline(const QString &name) const;
|
qreal GetLengthSpline(const QString &name) const;
|
||||||
|
/**
|
||||||
|
* @brief GetLineAngle return angle of line
|
||||||
|
* @param name name of line angle
|
||||||
|
* @return angle in degree
|
||||||
|
*/
|
||||||
qreal GetLineAngle(const QString &name) const;
|
qreal GetLineAngle(const QString &name) const;
|
||||||
|
/**
|
||||||
|
* @brief GetSpline return spline by id
|
||||||
|
* @param id id of spline
|
||||||
|
* @return spline
|
||||||
|
*/
|
||||||
VSpline GetSpline(qint64 id) const;
|
VSpline GetSpline(qint64 id) const;
|
||||||
VSpline GetModelingSpline(qint64 id) const;
|
/**
|
||||||
|
* @brief GetSplineModeling return spline modeling by id
|
||||||
|
* @param id id of spline modeling
|
||||||
|
* @return spline modeling
|
||||||
|
*/
|
||||||
|
VSpline GetSplineModeling(qint64 id) const;
|
||||||
|
/**
|
||||||
|
* @brief GetArc return arc by id
|
||||||
|
* @param id id of arc
|
||||||
|
* @return arc
|
||||||
|
*/
|
||||||
VArc GetArc(qint64 id) const;
|
VArc GetArc(qint64 id) const;
|
||||||
VArc GetModelingArc(qint64 id) const;
|
/**
|
||||||
|
* @brief GetArcModeling return arc modeling by id
|
||||||
|
* @param id id of arc modeling
|
||||||
|
* @return arc modeling
|
||||||
|
*/
|
||||||
|
VArc GetArcModeling(qint64 id) const;
|
||||||
|
/**
|
||||||
|
* @brief GetSplinePath return spline path by id
|
||||||
|
* @param id id of spline path
|
||||||
|
* @return spline path
|
||||||
|
*/
|
||||||
VSplinePath GetSplinePath(qint64 id) const;
|
VSplinePath GetSplinePath(qint64 id) const;
|
||||||
VSplinePath GetModelingSplinePath(qint64 id) const;
|
/**
|
||||||
|
* @brief GetSplinePathModeling return spline path modeling by id
|
||||||
|
* @param id id of spline modeling path
|
||||||
|
* @return spline modeling path
|
||||||
|
*/
|
||||||
|
VSplinePath GetSplinePathModeling(qint64 id) const;
|
||||||
|
/**
|
||||||
|
* @brief GetDetail return detail by id
|
||||||
|
* @param id id of detail
|
||||||
|
* @return detail
|
||||||
|
*/
|
||||||
VDetail GetDetail(qint64 id) const;
|
VDetail GetDetail(qint64 id) const;
|
||||||
|
/**
|
||||||
|
* @brief getId return current id
|
||||||
|
* @return current id
|
||||||
|
*/
|
||||||
static qint64 getId() {return _id;}
|
static qint64 getId() {return _id;}
|
||||||
|
/**
|
||||||
|
* @brief AddPoint add new point to container
|
||||||
|
* @param point new point
|
||||||
|
* @return return id of new point in container
|
||||||
|
*/
|
||||||
qint64 AddPoint(const VPointF& point);
|
qint64 AddPoint(const VPointF& point);
|
||||||
qint64 AddModelingPoint(const VPointF& point);
|
/**
|
||||||
|
* @brief AddPointModeling add new point modeling to container
|
||||||
|
* @param point new point modeling
|
||||||
|
* @return return id of new point modeling in container
|
||||||
|
*/
|
||||||
|
qint64 AddPointModeling(const VPointF& point);
|
||||||
|
/**
|
||||||
|
* @brief AddDetail add new detail to container
|
||||||
|
* @param detail new detail
|
||||||
|
* @return return id of new detail in container
|
||||||
|
*/
|
||||||
qint64 AddDetail(const VDetail& detail);
|
qint64 AddDetail(const VDetail& detail);
|
||||||
|
/**
|
||||||
|
* @brief AddStandartTableCell add new row of standart table
|
||||||
|
* @param name name of row of standart table
|
||||||
|
* @param cell row of standart table
|
||||||
|
*/
|
||||||
inline void AddStandartTableCell(const QString& name, const VStandartTableCell& cell)
|
inline void AddStandartTableCell(const QString& name, const VStandartTableCell& cell)
|
||||||
{standartTable[name] = cell;}
|
{standartTable[name] = cell;}
|
||||||
inline void AddIncrementTableRow(const QString& name, const VIncrementTableRow &cell)
|
/**
|
||||||
{incrementTable[name] = cell;}
|
* @brief AddIncrementTableRow add new row of increment table
|
||||||
|
* @param name name of new row of increment table
|
||||||
|
* @param row new row of increment table
|
||||||
|
*/
|
||||||
|
inline void AddIncrementTableRow(const QString& name, const VIncrementTableRow &row)
|
||||||
|
{incrementTable[name] = row;}
|
||||||
|
/**
|
||||||
|
* @brief AddLengthLine add length of line to container
|
||||||
|
* @param name name of line
|
||||||
|
* @param value length of line
|
||||||
|
*/
|
||||||
void AddLengthLine(const QString &name, const qreal &value);
|
void AddLengthLine(const QString &name, const qreal &value);
|
||||||
|
/**
|
||||||
|
* @brief AddLengthSpline add length of spline to container
|
||||||
|
* @param name name of spline
|
||||||
|
* @param value length of spline
|
||||||
|
*/
|
||||||
void AddLengthSpline(const QString &name, const qreal &value);
|
void AddLengthSpline(const QString &name, const qreal &value);
|
||||||
|
/**
|
||||||
|
* @brief AddLengthArc add length of arc to container
|
||||||
|
* @param id id of arc
|
||||||
|
*/
|
||||||
void AddLengthArc(const qint64 &id);
|
void AddLengthArc(const qint64 &id);
|
||||||
|
/**
|
||||||
|
* @brief AddLengthArc add length of arc
|
||||||
|
* @param name name of arc
|
||||||
|
* @param value length of arc
|
||||||
|
*/
|
||||||
void AddLengthArc(const QString &name, const qreal &value);
|
void AddLengthArc(const QString &name, const qreal &value);
|
||||||
|
/**
|
||||||
|
* @brief AddLineAngle add angle of line to container
|
||||||
|
* @param name name of line angle
|
||||||
|
* @param value angle in degree
|
||||||
|
*/
|
||||||
void AddLineAngle(const QString &name, const qreal &value);
|
void AddLineAngle(const QString &name, const qreal &value);
|
||||||
|
/**
|
||||||
|
* @brief AddLine add line to container
|
||||||
|
* @param firstPointId id of first point of line
|
||||||
|
* @param secondPointId id of second point of line
|
||||||
|
* @param mode mode of line
|
||||||
|
*/
|
||||||
void AddLine(const qint64 &firstPointId, const qint64 &secondPointId,
|
void AddLine(const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
const Draw::Draws &mode = Draw::Calculation);
|
const Draw::Draws &mode = Draw::Calculation);
|
||||||
|
/**
|
||||||
|
* @brief AddSpline add spline to container
|
||||||
|
* @param spl new spline
|
||||||
|
* @return id of spline in container
|
||||||
|
*/
|
||||||
qint64 AddSpline(const VSpline& spl);
|
qint64 AddSpline(const VSpline& spl);
|
||||||
qint64 AddModelingSpline(const VSpline& spl);
|
/**
|
||||||
|
* @brief AddSplineModeling add spline modeling to container
|
||||||
|
* @param spl new spline modeling
|
||||||
|
* @return id of spline modeling in container
|
||||||
|
*/
|
||||||
|
qint64 AddSplineModeling(const VSpline& spl);
|
||||||
|
/**
|
||||||
|
* @brief AddSplinePath add spline path to container
|
||||||
|
* @param splPath new spline path
|
||||||
|
* @return id of spline path in container
|
||||||
|
*/
|
||||||
qint64 AddSplinePath(const VSplinePath& splPath);
|
qint64 AddSplinePath(const VSplinePath& splPath);
|
||||||
qint64 AddModelingSplinePath(const VSplinePath& splPath);
|
/**
|
||||||
|
* @brief AddSplinePathModeling add spline path modeling to container
|
||||||
|
* @param splPath new spline path
|
||||||
|
* @return id of spline path in container
|
||||||
|
*/
|
||||||
|
qint64 AddSplinePathModeling(const VSplinePath& splPath);
|
||||||
|
/**
|
||||||
|
* @brief AddArc add arc to container
|
||||||
|
* @param arc new arc
|
||||||
|
* @return id of arc in container in container
|
||||||
|
*/
|
||||||
qint64 AddArc(const VArc& arc);
|
qint64 AddArc(const VArc& arc);
|
||||||
qint64 AddModelingArc(const VArc& arc);
|
/**
|
||||||
|
* @brief AddArcModeling add arc modeling to container
|
||||||
|
* @param arc new arc modeling
|
||||||
|
* @return id of new arc modeling in container
|
||||||
|
*/
|
||||||
|
qint64 AddArcModeling(const VArc& arc);
|
||||||
|
/**
|
||||||
|
* @brief GetNameLine return name of line
|
||||||
|
* @param firstPoint id of first point of line
|
||||||
|
* @param secondPoint id of second point of line
|
||||||
|
* @param mode mode of line
|
||||||
|
* @return name of line
|
||||||
|
*/
|
||||||
QString GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint,
|
QString GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint,
|
||||||
const Draw::Draws &mode = Draw::Calculation) const;
|
const Draw::Draws &mode = Draw::Calculation) const;
|
||||||
|
/**
|
||||||
|
* @brief GetNameLineAngle return name of line angle
|
||||||
|
* @param firstPoint id of first point of line
|
||||||
|
* @param secondPoint id of second point of line
|
||||||
|
* @param mode mode of line
|
||||||
|
* @return name of angle of line
|
||||||
|
*/
|
||||||
QString GetNameLineAngle(const qint64 &firstPoint, const qint64 &secondPoint,
|
QString GetNameLineAngle(const qint64 &firstPoint, const qint64 &secondPoint,
|
||||||
const Draw::Draws &mode = Draw::Calculation) const;
|
const Draw::Draws &mode = Draw::Calculation) const;
|
||||||
|
/**
|
||||||
|
* @brief UpdatePoint update point by id
|
||||||
|
* @param id id of existing point
|
||||||
|
* @param point point
|
||||||
|
*/
|
||||||
void UpdatePoint(qint64 id, const VPointF& point);
|
void UpdatePoint(qint64 id, const VPointF& point);
|
||||||
void UpdateModelingPoint(qint64 id, const VPointF& point);
|
/**
|
||||||
|
* @brief UpdatePointModeling update point modeling by id
|
||||||
|
* @param id id of existing point modeling
|
||||||
|
* @param point point modeling
|
||||||
|
*/
|
||||||
|
void UpdatePointModeling(qint64 id, const VPointF& point);
|
||||||
|
/**
|
||||||
|
* @brief UpdateDetail update detail by id
|
||||||
|
* @param id id of existing detail
|
||||||
|
* @param detail detail
|
||||||
|
*/
|
||||||
void UpdateDetail(qint64 id, const VDetail& detail);
|
void UpdateDetail(qint64 id, const VDetail& detail);
|
||||||
|
/**
|
||||||
|
* @brief UpdateSpline update spline by id
|
||||||
|
* @param id if of existing spline
|
||||||
|
* @param spl spline
|
||||||
|
*/
|
||||||
void UpdateSpline(qint64 id, const VSpline& spl);
|
void UpdateSpline(qint64 id, const VSpline& spl);
|
||||||
void UpdateModelingSpline(qint64 id, const VSpline& spl);
|
/**
|
||||||
|
* @brief UpdateSplineModeling update spline modeling by id
|
||||||
|
* @param id id of existing spline modeling
|
||||||
|
* @param spl spline modeling
|
||||||
|
*/
|
||||||
|
void UpdateSplineModeling(qint64 id, const VSpline& spl);
|
||||||
|
/**
|
||||||
|
* @brief UpdateSplinePath update spline path by id
|
||||||
|
* @param id id of existing spline path
|
||||||
|
* @param splPath spline path
|
||||||
|
*/
|
||||||
void UpdateSplinePath(qint64 id, const VSplinePath& splPath);
|
void UpdateSplinePath(qint64 id, const VSplinePath& splPath);
|
||||||
void UpdateModelingSplinePath(qint64 id, const VSplinePath& splPath);
|
/**
|
||||||
|
* @brief UpdateSplinePathModeling update spline path modeling by id
|
||||||
|
* @param id id of existing spline path modeling
|
||||||
|
* @param splPath spline path modeling
|
||||||
|
*/
|
||||||
|
void UpdateSplinePathModeling(qint64 id, const VSplinePath& splPath);
|
||||||
|
/**
|
||||||
|
* @brief UpdateArc update arc by id
|
||||||
|
* @param id id of existing arc
|
||||||
|
* @param arc arc
|
||||||
|
*/
|
||||||
void UpdateArc(qint64 id, const VArc& arc);
|
void UpdateArc(qint64 id, const VArc& arc);
|
||||||
void UpdateModelingArc(qint64 id, const VArc& arc);
|
/**
|
||||||
|
* @brief UpdateArcModeling update arc modeling by id
|
||||||
|
* @param id id of existing arc modeling
|
||||||
|
* @param arc arc modeling
|
||||||
|
*/
|
||||||
|
void UpdateArcModeling(qint64 id, const VArc& arc);
|
||||||
|
/**
|
||||||
|
* @brief UpdateStandartTableCell update standart table row by name
|
||||||
|
* @param name name of row
|
||||||
|
* @param cell row of standart table
|
||||||
|
*/
|
||||||
inline void UpdateStandartTableCell(const QString& name, const VStandartTableCell& cell)
|
inline void UpdateStandartTableCell(const QString& name, const VStandartTableCell& cell)
|
||||||
{standartTable[name] = cell;}
|
{standartTable[name] = cell;}
|
||||||
inline void UpdateIncrementTableRow(const QString& name, const VIncrementTableRow& cell)
|
/**
|
||||||
{incrementTable[name] = cell;}
|
* @brief UpdateIncrementTableRow update increment table row by name
|
||||||
|
* @param name name of row
|
||||||
|
* @param row row
|
||||||
|
*/
|
||||||
|
inline void UpdateIncrementTableRow(const QString& name, const VIncrementTableRow& row)
|
||||||
|
{incrementTable[name] = row;}
|
||||||
|
/**
|
||||||
|
* @brief GetValueStandartTableCell return value of standart table row by name
|
||||||
|
* @param name name of row
|
||||||
|
* @return value in mm
|
||||||
|
*/
|
||||||
qreal GetValueStandartTableCell(const QString& name) const;
|
qreal GetValueStandartTableCell(const QString& name) const;
|
||||||
|
/**
|
||||||
|
* @brief GetValueIncrementTableRow return value of increment table row by name
|
||||||
|
* @param name name of row
|
||||||
|
* @return value of row in mm
|
||||||
|
*/
|
||||||
qreal GetValueIncrementTableRow(const QString& name) const;
|
qreal GetValueIncrementTableRow(const QString& name) const;
|
||||||
|
/**
|
||||||
|
* @brief Clear clear data in container. Id will be 0.
|
||||||
|
*/
|
||||||
void Clear();
|
void Clear();
|
||||||
|
/**
|
||||||
|
* @brief ClearObject points, splines, arcs, spline paths will be cleared.
|
||||||
|
*/
|
||||||
void ClearObject();
|
void ClearObject();
|
||||||
|
/**
|
||||||
|
* @brief ClearIncrementTable clear increment table
|
||||||
|
*/
|
||||||
inline void ClearIncrementTable() {incrementTable.clear();}
|
inline void ClearIncrementTable() {incrementTable.clear();}
|
||||||
|
/**
|
||||||
|
* @brief ClearLengthLines clear length lines
|
||||||
|
*/
|
||||||
inline void ClearLengthLines() {lengthLines.clear();}
|
inline void ClearLengthLines() {lengthLines.clear();}
|
||||||
|
/**
|
||||||
|
* @brief ClearLengthSplines clear length splines
|
||||||
|
*/
|
||||||
inline void ClearLengthSplines() {lengthSplines.clear();}
|
inline void ClearLengthSplines() {lengthSplines.clear();}
|
||||||
|
/**
|
||||||
|
* @brief ClearLengthArcs clear length arcs
|
||||||
|
*/
|
||||||
inline void ClearLengthArcs() {lengthArcs.clear();}
|
inline void ClearLengthArcs() {lengthArcs.clear();}
|
||||||
|
/**
|
||||||
|
* @brief ClearLineAngles clear angles of lines
|
||||||
|
*/
|
||||||
inline void ClearLineAngles() {lineAngles.clear();}
|
inline void ClearLineAngles() {lineAngles.clear();}
|
||||||
|
/**
|
||||||
|
* @brief SetSize set value of size
|
||||||
|
* @param size value of size in mm
|
||||||
|
*/
|
||||||
inline void SetSize(qint32 size) {base["Сг"] = size;}
|
inline void SetSize(qint32 size) {base["Сг"] = size;}
|
||||||
|
/**
|
||||||
|
* @brief SetGrowth set value of growth
|
||||||
|
* @param growth value of growth in mm
|
||||||
|
*/
|
||||||
inline void SetGrowth(qint32 growth) {base["Р"] = growth;}
|
inline void SetGrowth(qint32 growth) {base["Р"] = growth;}
|
||||||
|
/**
|
||||||
|
* @brief size return size
|
||||||
|
* @return size in mm
|
||||||
|
*/
|
||||||
inline qint32 size() const {return base.value("Сг");}
|
inline qint32 size() const {return base.value("Сг");}
|
||||||
|
/**
|
||||||
|
* @brief growth return growth
|
||||||
|
* @return growth in mm
|
||||||
|
*/
|
||||||
inline qint32 growth() const {return base.value("Р");}
|
inline qint32 growth() const {return base.value("Р");}
|
||||||
|
/**
|
||||||
|
* @brief FindVar return value of variable by name
|
||||||
|
* @param name name of variable
|
||||||
|
* @param ok false if can't find variable
|
||||||
|
* @return value of variable
|
||||||
|
*/
|
||||||
qreal FindVar(const QString& name, bool *ok)const;
|
qreal FindVar(const QString& name, bool *ok)const;
|
||||||
|
/**
|
||||||
|
* @brief IncrementTableContains check if increment table contains name
|
||||||
|
* @param name name of row
|
||||||
|
* @return true if contains
|
||||||
|
*/
|
||||||
inline bool IncrementTableContains(const QString& name) {return incrementTable.contains(name);}
|
inline bool IncrementTableContains(const QString& name) {return incrementTable.contains(name);}
|
||||||
|
/**
|
||||||
|
* @brief getNextId generate next unique id
|
||||||
|
* @return next unique id
|
||||||
|
*/
|
||||||
static qint64 getNextId();
|
static qint64 getNextId();
|
||||||
|
/**
|
||||||
|
* @brief RemoveIncrementTableRow remove row by name from increment table
|
||||||
|
* @param name name of existing row
|
||||||
|
*/
|
||||||
inline void RemoveIncrementTableRow(const QString& name) {incrementTable.remove(name);}
|
inline void RemoveIncrementTableRow(const QString& name) {incrementTable.remove(name);}
|
||||||
|
/**
|
||||||
|
* @brief DataPoints return container of points
|
||||||
|
* @return pointer on container of points
|
||||||
|
*/
|
||||||
inline const QHash<qint64, VPointF> *DataPoints() const {return &points;}
|
inline const QHash<qint64, VPointF> *DataPoints() const {return &points;}
|
||||||
inline const QHash<qint64, VPointF> *DataModelingPoints() const {return &modelingPoints;}
|
/**
|
||||||
|
* @brief DataPointsModeling return container of points modeling
|
||||||
|
* @return pointer on container of points modeling
|
||||||
|
*/
|
||||||
|
inline const QHash<qint64, VPointF> *DataPointsModeling() const {return &pointsModeling;}
|
||||||
|
/**
|
||||||
|
* @brief DataSplines return container of splines
|
||||||
|
* @return pointer on container of splines
|
||||||
|
*/
|
||||||
inline const QHash<qint64, VSpline> *DataSplines() const {return &splines;}
|
inline const QHash<qint64, VSpline> *DataSplines() const {return &splines;}
|
||||||
inline const QHash<qint64, VSpline> *DataModelingSplines() const {return &modelingSplines;}
|
/**
|
||||||
|
* @brief DataSplinesModeling return container of splines modeling
|
||||||
|
* @return pointer on container of splines modeling
|
||||||
|
*/
|
||||||
|
inline const QHash<qint64, VSpline> *DataSplinesModeling() const {return &splinesModeling;}
|
||||||
|
/**
|
||||||
|
* @brief DataArcs return container of arcs
|
||||||
|
* @return pointer on container of arcs
|
||||||
|
*/
|
||||||
inline const QHash<qint64, VArc> *DataArcs() const {return &arcs;}
|
inline const QHash<qint64, VArc> *DataArcs() const {return &arcs;}
|
||||||
inline const QHash<qint64, VArc> *DataModelingArcs() const {return &modelingArcs;}
|
/**
|
||||||
|
* @brief DataArcsModeling return container of arcs modeling
|
||||||
|
* @return pointer on container of arcs modeling
|
||||||
|
*/
|
||||||
|
inline const QHash<qint64, VArc> *DataArcsModeling() const {return &arcsModeling;}
|
||||||
|
/**
|
||||||
|
* @brief DataBase return container of data
|
||||||
|
* @return pointer on container of base data
|
||||||
|
*/
|
||||||
inline const QHash<QString, qint32> *DataBase() const {return &base;}
|
inline const QHash<QString, qint32> *DataBase() const {return &base;}
|
||||||
|
/**
|
||||||
|
* @brief DataStandartTable return container of standart table
|
||||||
|
* @return pointer on container of standart table
|
||||||
|
*/
|
||||||
inline const QHash<QString, VStandartTableCell> *DataStandartTable() const {return &standartTable;}
|
inline const QHash<QString, VStandartTableCell> *DataStandartTable() const {return &standartTable;}
|
||||||
|
/**
|
||||||
|
* @brief DataIncrementTable return container of increment table
|
||||||
|
* @return pointer on container of increment table
|
||||||
|
*/
|
||||||
inline const QHash<QString, VIncrementTableRow> *DataIncrementTable() const {return &incrementTable;}
|
inline const QHash<QString, VIncrementTableRow> *DataIncrementTable() const {return &incrementTable;}
|
||||||
|
/**
|
||||||
|
* @brief DataLengthLines return container of lines lengths
|
||||||
|
* @return pointer on container of lines lengths
|
||||||
|
*/
|
||||||
inline const QHash<QString, qreal> *DataLengthLines() const {return &lengthLines;}
|
inline const QHash<QString, qreal> *DataLengthLines() const {return &lengthLines;}
|
||||||
|
/**
|
||||||
|
* @brief DataLengthSplines return container of splines lengths
|
||||||
|
* @return pointer on container of splines lengths
|
||||||
|
*/
|
||||||
inline const QHash<QString, qreal> *DataLengthSplines() const {return &lengthSplines;}
|
inline const QHash<QString, qreal> *DataLengthSplines() const {return &lengthSplines;}
|
||||||
|
/**
|
||||||
|
* @brief DataLengthArcs return container of arcs length
|
||||||
|
* @return pointer on container of arcs length
|
||||||
|
*/
|
||||||
inline const QHash<QString, qreal> *DataLengthArcs() const {return &lengthArcs;}
|
inline const QHash<QString, qreal> *DataLengthArcs() const {return &lengthArcs;}
|
||||||
|
/**
|
||||||
|
* @brief DataLineAngles return container of angles of line
|
||||||
|
* @return pointer on container of angles of line
|
||||||
|
*/
|
||||||
inline const QHash<QString, qreal> *DataLineAngles() const {return &lineAngles;}
|
inline const QHash<QString, qreal> *DataLineAngles() const {return &lineAngles;}
|
||||||
|
/**
|
||||||
|
* @brief DataSplinePaths return container of spline paths
|
||||||
|
* @return pointer on container of spline paths
|
||||||
|
*/
|
||||||
inline const QHash<qint64, VSplinePath> *DataSplinePaths() const {return &splinePaths;}
|
inline const QHash<qint64, VSplinePath> *DataSplinePaths() const {return &splinePaths;}
|
||||||
inline const QHash<qint64, VSplinePath> *DataModelingSplinePaths() const {return &modelingSplinePaths;}
|
/**
|
||||||
|
* @brief DataSplinePathsModeling return container of spline paths modeling
|
||||||
|
* @return pointer on container of spline paths modeling
|
||||||
|
*/
|
||||||
|
inline const QHash<qint64, VSplinePath> *DataSplinePathsModeling() const {return &splinePathsModeling;}
|
||||||
|
/**
|
||||||
|
* @brief DataDetails return container of details
|
||||||
|
* @return pointer on container of details
|
||||||
|
*/
|
||||||
inline const QHash<qint64, VDetail> *DataDetails() const {return &details;}
|
inline const QHash<qint64, VDetail> *DataDetails() const {return &details;}
|
||||||
|
/**
|
||||||
|
* @brief UpdateId update id. If new id bigger when current save new like current.
|
||||||
|
* @param newId id
|
||||||
|
*/
|
||||||
static void UpdateId(qint64 newId);
|
static void UpdateId(qint64 newId);
|
||||||
|
/**
|
||||||
|
* @brief ContourPath create painter path for detail
|
||||||
|
* @param idDetail id of detail
|
||||||
|
* @return return painter path of contour detail
|
||||||
|
*/
|
||||||
QPainterPath ContourPath(qint64 idDetail) const;
|
QPainterPath ContourPath(qint64 idDetail) const;
|
||||||
|
/**
|
||||||
|
* @brief biasPoints bias point
|
||||||
|
* @param points vector of points
|
||||||
|
* @param mx offset respect to x
|
||||||
|
* @param my offset respect to y
|
||||||
|
* @return new vector biased points
|
||||||
|
*/
|
||||||
QVector<QPointF> biasPoints(const QVector<QPointF> &points, const qreal &mx, const qreal &my) const;
|
QVector<QPointF> biasPoints(const QVector<QPointF> &points, const qreal &mx, const qreal &my) const;
|
||||||
|
/**
|
||||||
|
* @brief Equidistant create equidistant painter path for detail
|
||||||
|
* @param points vector of points
|
||||||
|
* @param eqv type of equidistant
|
||||||
|
* @param width width of equidistant
|
||||||
|
* @return return painter path of equidistant
|
||||||
|
*/
|
||||||
QPainterPath Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv, const qreal &width)const;
|
QPainterPath Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv, const qreal &width)const;
|
||||||
|
/**
|
||||||
|
* @brief ParallelLine create parallel line
|
||||||
|
* @param line starting line
|
||||||
|
* @param width width to parallel line
|
||||||
|
* @return parallel line
|
||||||
|
*/
|
||||||
static QLineF ParallelLine(const QLineF &line, qreal width );
|
static QLineF ParallelLine(const QLineF &line, qreal width );
|
||||||
|
/**
|
||||||
|
* @brief SingleParallelPoint return point of parallel line
|
||||||
|
* @param line starting line
|
||||||
|
* @param angle angle in degree
|
||||||
|
* @param width width to parallel line
|
||||||
|
* @return point of parallel line
|
||||||
|
*/
|
||||||
static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width);
|
static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width);
|
||||||
|
/**
|
||||||
|
* @brief EkvPoint return vector of points of equidistant two lines. Last point of two lines must be equal.
|
||||||
|
* @param line1 first line
|
||||||
|
* @param line2 second line
|
||||||
|
* @param width width of equidistant
|
||||||
|
* @return vector of points
|
||||||
|
*/
|
||||||
QVector<QPointF> EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width)const;
|
QVector<QPointF> EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width)const;
|
||||||
|
/**
|
||||||
|
* @brief CheckLoops seek and delete loops in equidistant
|
||||||
|
* @param points vector of points of equidistant
|
||||||
|
* @return vector of points of equidistant
|
||||||
|
*/
|
||||||
QVector<QPointF> CheckLoops(const QVector<QPointF> &points) const;
|
QVector<QPointF> CheckLoops(const QVector<QPointF> &points) const;
|
||||||
|
/**
|
||||||
|
* @brief PrepareDetails prepare detail for creation layout
|
||||||
|
* @param list list of details
|
||||||
|
*/
|
||||||
void PrepareDetails(QVector<VItem *> & list) const;
|
void PrepareDetails(QVector<VItem *> & list) const;
|
||||||
private:
|
private:
|
||||||
|
/**
|
||||||
|
* @brief _id current id. New object will have value +1. For full class equal 0.
|
||||||
|
*/
|
||||||
static qint64 _id;
|
static qint64 _id;
|
||||||
|
/**
|
||||||
|
* @brief base container of base data (size and growth)
|
||||||
|
*/
|
||||||
QHash<QString, qint32> base;
|
QHash<QString, qint32> base;
|
||||||
|
/**
|
||||||
|
* @brief points container of points
|
||||||
|
*/
|
||||||
QHash<qint64, VPointF> points;
|
QHash<qint64, VPointF> points;
|
||||||
QHash<qint64, VPointF> modelingPoints;
|
/**
|
||||||
|
* @brief pointsModeling container of points modeling
|
||||||
|
*/
|
||||||
|
QHash<qint64, VPointF> pointsModeling;
|
||||||
|
/**
|
||||||
|
* @brief standartTable container of standart table rows
|
||||||
|
*/
|
||||||
QHash<QString, VStandartTableCell> standartTable;
|
QHash<QString, VStandartTableCell> standartTable;
|
||||||
|
/**
|
||||||
|
* @brief incrementTable
|
||||||
|
*/
|
||||||
QHash<QString, VIncrementTableRow> incrementTable;
|
QHash<QString, VIncrementTableRow> incrementTable;
|
||||||
|
/**
|
||||||
|
* @brief lengthLines container of lines lengths
|
||||||
|
*/
|
||||||
QHash<QString, qreal> lengthLines;
|
QHash<QString, qreal> lengthLines;
|
||||||
|
/**
|
||||||
|
* @brief lineAngles container of angles of lines
|
||||||
|
*/
|
||||||
QHash<QString, qreal> lineAngles;
|
QHash<QString, qreal> lineAngles;
|
||||||
|
/**
|
||||||
|
* @brief splines container of splines
|
||||||
|
*/
|
||||||
QHash<qint64, VSpline> splines;
|
QHash<qint64, VSpline> splines;
|
||||||
QHash<qint64, VSpline> modelingSplines;
|
/**
|
||||||
|
* @brief splinesModeling container of splines modeling
|
||||||
|
*/
|
||||||
|
QHash<qint64, VSpline> splinesModeling;
|
||||||
|
/**
|
||||||
|
* @brief lengthSplines container of splines length
|
||||||
|
*/
|
||||||
QHash<QString, qreal> lengthSplines;
|
QHash<QString, qreal> lengthSplines;
|
||||||
|
/**
|
||||||
|
* @brief arcs container of arcs
|
||||||
|
*/
|
||||||
QHash<qint64, VArc> arcs;
|
QHash<qint64, VArc> arcs;
|
||||||
QHash<qint64, VArc> modelingArcs;
|
/**
|
||||||
|
* @brief arcsModeling container of arcs modeling
|
||||||
|
*/
|
||||||
|
QHash<qint64, VArc> arcsModeling;
|
||||||
|
/**
|
||||||
|
* @brief lengthArcs container of arcs length
|
||||||
|
*/
|
||||||
QHash<QString, qreal> lengthArcs;
|
QHash<QString, qreal> lengthArcs;
|
||||||
|
/**
|
||||||
|
* @brief splinePaths container of spline paths
|
||||||
|
*/
|
||||||
QHash<qint64, VSplinePath> splinePaths;
|
QHash<qint64, VSplinePath> splinePaths;
|
||||||
QHash<qint64, VSplinePath> modelingSplinePaths;
|
/**
|
||||||
|
* @brief splinePathsModeling container of spline paths modeling
|
||||||
|
*/
|
||||||
|
QHash<qint64, VSplinePath> splinePathsModeling;
|
||||||
|
/**
|
||||||
|
* @brief details container of details
|
||||||
|
*/
|
||||||
QHash<qint64, VDetail> details;
|
QHash<qint64, VDetail> details;
|
||||||
|
/**
|
||||||
|
* @brief CreateManTableIGroup generate man standart table of measurements
|
||||||
|
*/
|
||||||
void CreateManTableIGroup ();
|
void CreateManTableIGroup ();
|
||||||
|
/**
|
||||||
|
* @brief GetReversePoint return revers container of points
|
||||||
|
* @param points container with points
|
||||||
|
* @return reverced points
|
||||||
|
*/
|
||||||
QVector<QPointF> GetReversePoint(const QVector<QPointF> &points)const;
|
QVector<QPointF> GetReversePoint(const QVector<QPointF> &points)const;
|
||||||
|
/**
|
||||||
|
* @brief GetLengthContour return length of contour
|
||||||
|
* @param contour container with points of contour
|
||||||
|
* @param newPoints point whos we try to add to contour
|
||||||
|
* @return length length of contour
|
||||||
|
*/
|
||||||
qreal GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints)const;
|
qreal GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints)const;
|
||||||
template <typename key, typename val> static val GetObject(const QHash<key, val> &obj, key id);
|
template <typename key, typename val>
|
||||||
template <typename val> static void UpdateObject(QHash<qint64, val> &obj, const qint64 &id, const val& point);
|
/**
|
||||||
template <typename key, typename val> static qint64 AddObject(QHash<key, val> &obj, const val& value);
|
* @brief GetObject return object from container
|
||||||
|
* @param obj container
|
||||||
|
* @param id id of object
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
static val GetObject(const QHash<key, val> &obj, key id);
|
||||||
|
template <typename val>
|
||||||
|
/**
|
||||||
|
* @brief UpdateObject update object in container
|
||||||
|
* @param obj container
|
||||||
|
* @param id id of existing object
|
||||||
|
* @param point object
|
||||||
|
*/
|
||||||
|
static void UpdateObject(QHash<qint64, val> &obj, const qint64 &id, const val& point);
|
||||||
|
template <typename key, typename val>
|
||||||
|
/**
|
||||||
|
* @brief AddObject add object to container
|
||||||
|
* @param obj container
|
||||||
|
* @param value object
|
||||||
|
* @return id of object in container
|
||||||
|
*/
|
||||||
|
static qint64 AddObject(QHash<key, val> &obj, const val& value);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VCONTAINER_H
|
#endif // VCONTAINER_H
|
||||||
|
|
|
@ -105,7 +105,7 @@ void DialogAlongLine::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -140,7 +140,7 @@ void DialogArc::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
ChangeCurrentText(ui->comboBoxBasePoint, point.name());
|
ChangeCurrentText(ui->comboBoxBasePoint, point.name());
|
||||||
emit ToolTip("");
|
emit ToolTip("");
|
||||||
|
|
|
@ -105,7 +105,7 @@ void DialogBisector::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -122,7 +122,7 @@ void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const Draw::D
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
name = point.name();
|
name = point.name();
|
||||||
break;
|
break;
|
||||||
|
@ -136,7 +136,7 @@ void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const Draw::D
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
arc = data->GetModelingArc(id);
|
arc = data->GetArcModeling(id);
|
||||||
}
|
}
|
||||||
name = arc.name();
|
name = arc.name();
|
||||||
break;
|
break;
|
||||||
|
@ -150,7 +150,7 @@ void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const Draw::D
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spl = data->GetModelingSpline(id);
|
spl = data->GetSplineModeling(id);
|
||||||
}
|
}
|
||||||
name = spl.GetName();
|
name = spl.GetName();
|
||||||
break;
|
break;
|
||||||
|
@ -164,7 +164,7 @@ void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const Draw::D
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
splPath = data->GetModelingSplinePath(id);
|
splPath = data->GetSplinePathModeling(id);
|
||||||
}
|
}
|
||||||
name = splPath.name();
|
name = splPath.name();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -115,7 +115,7 @@ void DialogEndLine::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
ChangeCurrentText(ui->comboBoxBasePoint, point.name());
|
ChangeCurrentText(ui->comboBoxBasePoint, point.name());
|
||||||
emit ToolTip("");
|
emit ToolTip("");
|
||||||
|
|
|
@ -109,7 +109,7 @@ void DialogHeight::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
switch (number)
|
switch (number)
|
||||||
{
|
{
|
||||||
|
|
|
@ -105,7 +105,7 @@ void DialogLine::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,7 +80,7 @@ void DialogLineIntersect::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -121,7 +121,7 @@ void DialogNormal::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,7 +98,7 @@ void DialogPointOfContact::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -83,7 +83,7 @@ void DialogPointOfIntersection::ChoosedObject(qint64 id, const Scene::Scenes &ty
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,7 +106,7 @@ void DialogShoulderPoint::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -79,7 +79,7 @@ void DialogSpline::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
@ -111,8 +111,8 @@ void DialogSpline::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p1 = data->GetModelingPoint(p1Id).toQPointF();
|
p1 = data->GetPointModeling(p1Id).toQPointF();
|
||||||
p4 = data->GetModelingPoint(id).toQPointF();
|
p4 = data->GetPointModeling(id).toQPointF();
|
||||||
}
|
}
|
||||||
ui->spinBoxAngle1->setValue(static_cast<qint32>(QLineF(p1, p4).angle()));
|
ui->spinBoxAngle1->setValue(static_cast<qint32>(QLineF(p1, p4).angle()));
|
||||||
ui->spinBoxAngle2->setValue(static_cast<qint32>(QLineF(p4, p1).angle()));
|
ui->spinBoxAngle2->setValue(static_cast<qint32>(QLineF(p4, p1).angle()));
|
||||||
|
|
|
@ -173,7 +173,7 @@ void DialogSplinePath::NewItem(qint64 id, qreal kAsm1, qreal angle, qreal kAsm2)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
QListWidgetItem *item = new QListWidgetItem(point.name());
|
QListWidgetItem *item = new QListWidgetItem(point.name());
|
||||||
item->setFont(QFont("Times", 12, QFont::Bold));
|
item->setFont(QFont("Times", 12, QFont::Bold));
|
||||||
|
|
|
@ -99,7 +99,7 @@ void DialogTool::FillComboBoxPoints(QComboBox *box, const qint64 &id) const
|
||||||
{
|
{
|
||||||
if (det[i].getId() != id)
|
if (det[i].getId() != id)
|
||||||
{
|
{
|
||||||
VPointF point = data->GetModelingPoint(det[i].getId());
|
VPointF point = data->GetPointModeling(det[i].getId());
|
||||||
box->addItem(point.name(), det[i].getId());
|
box->addItem(point.name(), det[i].getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ void DialogTriangle::ChoosedObject(qint64 id, const Scene::Scenes &type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetPointModeling(id);
|
||||||
}
|
}
|
||||||
switch (number)
|
switch (number)
|
||||||
{
|
{
|
||||||
|
|
|
@ -83,7 +83,7 @@ void VModelingAlongLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
|
|
||||||
void VModelingAlongLine::AddToFile()
|
void VModelingAlongLine::AddToFile()
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
@ -109,7 +109,7 @@ void VModelingAlongLine::RemoveReferens()
|
||||||
void VModelingAlongLine::setDialog()
|
void VModelingAlongLine::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogAlongLine.isNull() == false);
|
Q_ASSERT(dialogAlongLine.isNull() == false);
|
||||||
VPointF p = VAbstractTool::data.GetModelingPoint(id);
|
VPointF p = VAbstractTool::data.GetPointModeling(id);
|
||||||
dialogAlongLine->setTypeLine(typeLine);
|
dialogAlongLine->setTypeLine(typeLine);
|
||||||
dialogAlongLine->setFormula(formula);
|
dialogAlongLine->setFormula(formula);
|
||||||
dialogAlongLine->setFirstPointId(basePointId, id);
|
dialogAlongLine->setFirstPointId(basePointId, id);
|
||||||
|
@ -136,8 +136,8 @@ VModelingAlongLine *VModelingAlongLine::Create(const qint64 _id, const QString &
|
||||||
const Tool::Sources &typeCreation)
|
const Tool::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
VModelingAlongLine *point = 0;
|
VModelingAlongLine *point = 0;
|
||||||
VPointF firstPoint = data->GetModelingPoint(firstPointId);
|
VPointF firstPoint = data->GetPointModeling(firstPointId);
|
||||||
VPointF secondPoint = data->GetModelingPoint(secondPointId);
|
VPointF secondPoint = data->GetPointModeling(secondPointId);
|
||||||
QLineF line = QLineF(firstPoint.toQPointF(), secondPoint.toQPointF());
|
QLineF line = QLineF(firstPoint.toQPointF(), secondPoint.toQPointF());
|
||||||
Calculator cal(data);
|
Calculator cal(data);
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
|
@ -148,11 +148,11 @@ VModelingAlongLine *VModelingAlongLine::Create(const qint64 _id, const QString &
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingPoint(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
id = data->AddPointModeling(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingPoint(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
data->UpdatePointModeling(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
|
|
@ -50,7 +50,7 @@ VModelingArc::VModelingArc(VDomDocument *doc, VContainer *data, qint64 id, const
|
||||||
void VModelingArc::setDialog()
|
void VModelingArc::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogArc.isNull() == false);
|
Q_ASSERT(dialogArc.isNull() == false);
|
||||||
VArc arc = VAbstractTool::data.GetModelingArc(id);
|
VArc arc = VAbstractTool::data.GetArcModeling(id);
|
||||||
dialogArc->SetCenter(arc.GetCenter());
|
dialogArc->SetCenter(arc.GetCenter());
|
||||||
dialogArc->SetRadius(arc.GetFormulaRadius());
|
dialogArc->SetRadius(arc.GetFormulaRadius());
|
||||||
dialogArc->SetF1(arc.GetFormulaF1());
|
dialogArc->SetF1(arc.GetFormulaF1());
|
||||||
|
@ -95,15 +95,15 @@ VModelingArc* VModelingArc::Create(const qint64 _id, const qint64 ¢er, const
|
||||||
calcF2 = result;
|
calcF2 = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
VArc arc = VArc(data->DataModelingPoints(), center, calcRadius, radius, calcF1, f1, calcF2, f2 );
|
VArc arc = VArc(data->DataPointsModeling(), center, calcRadius, radius, calcF1, f1, calcF2, f2 );
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingArc(arc);
|
id = data->AddArcModeling(arc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingArc(id, arc);
|
data->UpdateArcModeling(id, arc);
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
@ -148,7 +148,7 @@ void VModelingArc::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
|
|
||||||
void VModelingArc::AddToFile()
|
void VModelingArc::AddToFile()
|
||||||
{
|
{
|
||||||
VArc arc = VAbstractTool::data.GetModelingArc(id);
|
VArc arc = VAbstractTool::data.GetArcModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
@ -184,13 +184,13 @@ void VModelingArc::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
||||||
void VModelingArc::RemoveReferens()
|
void VModelingArc::RemoveReferens()
|
||||||
{
|
{
|
||||||
VArc arc = VAbstractTool::data.GetModelingArc(id);
|
VArc arc = VAbstractTool::data.GetArcModeling(id);
|
||||||
doc->DecrementReferens(arc.GetCenter());
|
doc->DecrementReferens(arc.GetCenter());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VModelingArc::RefreshGeometry()
|
void VModelingArc::RefreshGeometry()
|
||||||
{
|
{
|
||||||
VArc arc = VAbstractTool::data.GetModelingArc(id);
|
VArc arc = VAbstractTool::data.GetArcModeling(id);
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addPath(arc.GetPath());
|
path.addPath(arc.GetPath());
|
||||||
path.setFillRule( Qt::WindingFill );
|
path.setFillRule( Qt::WindingFill );
|
||||||
|
|
|
@ -51,7 +51,7 @@ VModelingBisector::VModelingBisector(VDomDocument *doc, VContainer *data, const
|
||||||
void VModelingBisector::setDialog()
|
void VModelingBisector::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogBisector.isNull() == false);
|
Q_ASSERT(dialogBisector.isNull() == false);
|
||||||
VPointF p = VAbstractTool::data.GetModelingPoint(id);
|
VPointF p = VAbstractTool::data.GetPointModeling(id);
|
||||||
dialogBisector->setTypeLine(typeLine);
|
dialogBisector->setTypeLine(typeLine);
|
||||||
dialogBisector->setFormula(formula);
|
dialogBisector->setFormula(formula);
|
||||||
dialogBisector->setFirstPointId(firstPointId, id);
|
dialogBisector->setFirstPointId(firstPointId, id);
|
||||||
|
@ -81,9 +81,9 @@ VModelingBisector *VModelingBisector::Create(const qint64 _id, const QString &fo
|
||||||
const Tool::Sources &typeCreation)
|
const Tool::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
VModelingBisector *point = 0;
|
VModelingBisector *point = 0;
|
||||||
VPointF firstPoint = data->GetModelingPoint(firstPointId);
|
VPointF firstPoint = data->GetPointModeling(firstPointId);
|
||||||
VPointF secondPoint = data->GetModelingPoint(secondPointId);
|
VPointF secondPoint = data->GetPointModeling(secondPointId);
|
||||||
VPointF thirdPoint = data->GetModelingPoint(thirdPointId);
|
VPointF thirdPoint = data->GetPointModeling(thirdPointId);
|
||||||
|
|
||||||
Calculator cal(data);
|
Calculator cal(data);
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
|
@ -95,11 +95,11 @@ VModelingBisector *VModelingBisector::Create(const qint64 _id, const QString &fo
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
id = data->AddPointModeling(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingPoint(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
data->UpdatePointModeling(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
@ -159,7 +159,7 @@ void VModelingBisector::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
|
|
||||||
void VModelingBisector::AddToFile()
|
void VModelingBisector::AddToFile()
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
|
|
@ -46,7 +46,7 @@ VModelingEndLine::VModelingEndLine(VDomDocument *doc, VContainer *data, const qi
|
||||||
void VModelingEndLine::setDialog()
|
void VModelingEndLine::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogEndLine.isNull() == false);
|
Q_ASSERT(dialogEndLine.isNull() == false);
|
||||||
VPointF p = VAbstractTool::data.GetModelingPoint(id);
|
VPointF p = VAbstractTool::data.GetPointModeling(id);
|
||||||
dialogEndLine->setTypeLine(typeLine);
|
dialogEndLine->setTypeLine(typeLine);
|
||||||
dialogEndLine->setFormula(formula);
|
dialogEndLine->setFormula(formula);
|
||||||
dialogEndLine->setAngle(angle);
|
dialogEndLine->setAngle(angle);
|
||||||
|
@ -72,7 +72,7 @@ VModelingEndLine *VModelingEndLine::Create(const qint64 _id, const QString &poin
|
||||||
const Document::Documents &parse, const Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Tool::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
VModelingEndLine *point = 0;
|
VModelingEndLine *point = 0;
|
||||||
VPointF basePoint = data->GetModelingPoint(basePointId);
|
VPointF basePoint = data->GetPointModeling(basePointId);
|
||||||
QLineF line = QLineF(basePoint.toQPointF(), QPointF(basePoint.x()+100, basePoint.y()));
|
QLineF line = QLineF(basePoint.toQPointF(), QPointF(basePoint.x()+100, basePoint.y()));
|
||||||
Calculator cal(data);
|
Calculator cal(data);
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
|
@ -84,11 +84,11 @@ VModelingEndLine *VModelingEndLine::Create(const qint64 _id, const QString &poin
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingPoint(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
id = data->AddPointModeling(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingPoint(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
data->UpdatePointModeling(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
@ -143,7 +143,7 @@ void VModelingEndLine::FullUpdateFromGui(int result)
|
||||||
|
|
||||||
void VModelingEndLine::AddToFile()
|
void VModelingEndLine::AddToFile()
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
|
|
@ -48,7 +48,7 @@ VModelingHeight::VModelingHeight(VDomDocument *doc, VContainer *data, const qint
|
||||||
void VModelingHeight::setDialog()
|
void VModelingHeight::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogHeight.isNull() == false);
|
Q_ASSERT(dialogHeight.isNull() == false);
|
||||||
VPointF p = VAbstractTool::data.GetModelingPoint(id);
|
VPointF p = VAbstractTool::data.GetPointModeling(id);
|
||||||
dialogHeight->setTypeLine(typeLine);
|
dialogHeight->setTypeLine(typeLine);
|
||||||
dialogHeight->setBasePointId(basePointId, id);
|
dialogHeight->setBasePointId(basePointId, id);
|
||||||
dialogHeight->setP1LineId(p1LineId, id);
|
dialogHeight->setP1LineId(p1LineId, id);
|
||||||
|
@ -75,9 +75,9 @@ VModelingHeight *VModelingHeight::Create(const qint64 _id, const QString &pointN
|
||||||
const Document::Documents &parse, const Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Tool::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
VModelingHeight *point = 0;
|
VModelingHeight *point = 0;
|
||||||
VPointF basePoint = data->GetModelingPoint(basePointId);
|
VPointF basePoint = data->GetPointModeling(basePointId);
|
||||||
VPointF p1Line = data->GetModelingPoint(p1LineId);
|
VPointF p1Line = data->GetPointModeling(p1LineId);
|
||||||
VPointF p2Line = data->GetModelingPoint(p2LineId);
|
VPointF p2Line = data->GetPointModeling(p2LineId);
|
||||||
|
|
||||||
QPointF pHeight = VToolHeight::FindPoint(QLineF(p1Line.toQPointF(), p2Line.toQPointF()),
|
QPointF pHeight = VToolHeight::FindPoint(QLineF(p1Line.toQPointF(), p2Line.toQPointF()),
|
||||||
basePoint.toQPointF());
|
basePoint.toQPointF());
|
||||||
|
@ -85,11 +85,11 @@ VModelingHeight *VModelingHeight::Create(const qint64 _id, const QString &pointN
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingPoint(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
id = data->AddPointModeling(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingPoint(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
data->UpdatePointModeling(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
@ -145,7 +145,7 @@ void VModelingHeight::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
|
|
||||||
void VModelingHeight::AddToFile()
|
void VModelingHeight::AddToFile()
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
|
|
@ -37,8 +37,8 @@ VModelingLine::VModelingLine(VDomDocument *doc, VContainer *data, qint64 id, qin
|
||||||
{
|
{
|
||||||
ignoreFullUpdate = true;
|
ignoreFullUpdate = true;
|
||||||
//Лінія
|
//Лінія
|
||||||
VPointF first = data->GetModelingPoint(firstPoint);
|
VPointF first = data->GetPointModeling(firstPoint);
|
||||||
VPointF second = data->GetModelingPoint(secondPoint);
|
VPointF second = data->GetPointModeling(secondPoint);
|
||||||
this->setLine(QLineF(first.toQPointF(), second.toQPointF()));
|
this->setLine(QLineF(first.toQPointF(), second.toQPointF()));
|
||||||
this->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
this->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
||||||
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
|
@ -102,8 +102,8 @@ void VModelingLine::FullUpdateFromFile()
|
||||||
firstPoint = domElement.attribute(AttrFirstPoint, "").toLongLong();
|
firstPoint = domElement.attribute(AttrFirstPoint, "").toLongLong();
|
||||||
secondPoint = domElement.attribute(AttrSecondPoint, "").toLongLong();
|
secondPoint = domElement.attribute(AttrSecondPoint, "").toLongLong();
|
||||||
}
|
}
|
||||||
VPointF first = VAbstractTool::data.GetModelingPoint(firstPoint);
|
VPointF first = VAbstractTool::data.GetPointModeling(firstPoint);
|
||||||
VPointF second = VAbstractTool::data.GetModelingPoint(secondPoint);
|
VPointF second = VAbstractTool::data.GetPointModeling(secondPoint);
|
||||||
this->setLine(QLineF(first.toQPointF(), second.toQPointF()));
|
this->setLine(QLineF(first.toQPointF(), second.toQPointF()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ VModelingLineIntersect::VModelingLineIntersect(VDomDocument *doc, VContainer *da
|
||||||
void VModelingLineIntersect::setDialog()
|
void VModelingLineIntersect::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogLineIntersect.isNull() == false);
|
Q_ASSERT(dialogLineIntersect.isNull() == false);
|
||||||
VPointF p = VAbstractTool::data.GetModelingPoint(id);
|
VPointF p = VAbstractTool::data.GetPointModeling(id);
|
||||||
dialogLineIntersect->setP1Line1(p1Line1);
|
dialogLineIntersect->setP1Line1(p1Line1);
|
||||||
dialogLineIntersect->setP2Line1(p2Line1);
|
dialogLineIntersect->setP2Line1(p2Line1);
|
||||||
dialogLineIntersect->setP1Line2(p1Line2);
|
dialogLineIntersect->setP1Line2(p1Line2);
|
||||||
|
@ -74,10 +74,10 @@ VModelingLineIntersect *VModelingLineIntersect::Create(const qint64 _id, const q
|
||||||
const Tool::Sources &typeCreation)
|
const Tool::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
VModelingLineIntersect *point = 0;
|
VModelingLineIntersect *point = 0;
|
||||||
VPointF p1Line1 = data->GetModelingPoint(p1Line1Id);
|
VPointF p1Line1 = data->GetPointModeling(p1Line1Id);
|
||||||
VPointF p2Line1 = data->GetModelingPoint(p2Line1Id);
|
VPointF p2Line1 = data->GetPointModeling(p2Line1Id);
|
||||||
VPointF p1Line2 = data->GetModelingPoint(p1Line2Id);
|
VPointF p1Line2 = data->GetPointModeling(p1Line2Id);
|
||||||
VPointF p2Line2 = data->GetModelingPoint(p2Line2Id);
|
VPointF p2Line2 = data->GetPointModeling(p2Line2Id);
|
||||||
|
|
||||||
QLineF line1(p1Line1.toQPointF(), p2Line1.toQPointF());
|
QLineF line1(p1Line1.toQPointF(), p2Line1.toQPointF());
|
||||||
QLineF line2(p1Line2.toQPointF(), p2Line2.toQPointF());
|
QLineF line2(p1Line2.toQPointF(), p2Line2.toQPointF());
|
||||||
|
@ -88,11 +88,11 @@ VModelingLineIntersect *VModelingLineIntersect::Create(const qint64 _id, const q
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
id = data->AddPointModeling(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingPoint(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
data->UpdatePointModeling(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
@ -126,7 +126,7 @@ void VModelingLineIntersect::FullUpdateFromFile()
|
||||||
p1Line2 = domElement.attribute(AttrP1Line2, "").toLongLong();
|
p1Line2 = domElement.attribute(AttrP1Line2, "").toLongLong();
|
||||||
p2Line2 = domElement.attribute(AttrP2Line2, "").toLongLong();
|
p2Line2 = domElement.attribute(AttrP2Line2, "").toLongLong();
|
||||||
}
|
}
|
||||||
RefreshPointGeometry(VAbstractTool::data.GetModelingPoint(id));
|
RefreshPointGeometry(VAbstractTool::data.GetPointModeling(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VModelingLineIntersect::FullUpdateFromGui(int result)
|
void VModelingLineIntersect::FullUpdateFromGui(int result)
|
||||||
|
@ -154,7 +154,7 @@ void VModelingLineIntersect::contextMenuEvent(QGraphicsSceneContextMenuEvent *ev
|
||||||
|
|
||||||
void VModelingLineIntersect::AddToFile()
|
void VModelingLineIntersect::AddToFile()
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
|
|
@ -35,8 +35,8 @@ VModelingLinePoint::VModelingLinePoint(VDomDocument *doc, VContainer *data, cons
|
||||||
basePointId(basePointId), mainLine(0)
|
basePointId(basePointId), mainLine(0)
|
||||||
{
|
{
|
||||||
//Лінія, що з'єднує дві точки
|
//Лінія, що з'єднує дві точки
|
||||||
QPointF point1 = data->GetModelingPoint(basePointId).toQPointF();
|
QPointF point1 = data->GetPointModeling(basePointId).toQPointF();
|
||||||
QPointF point2 = data->GetModelingPoint(id).toQPointF();
|
QPointF point2 = data->GetPointModeling(id).toQPointF();
|
||||||
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this);
|
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this);
|
||||||
mainLine->setPen(QPen(Qt::black, widthHairLine));
|
mainLine->setPen(QPen(Qt::black, widthHairLine));
|
||||||
mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
||||||
|
@ -52,9 +52,9 @@ VModelingLinePoint::VModelingLinePoint(VDomDocument *doc, VContainer *data, cons
|
||||||
|
|
||||||
void VModelingLinePoint::RefreshGeometry()
|
void VModelingLinePoint::RefreshGeometry()
|
||||||
{
|
{
|
||||||
VModelingPoint::RefreshPointGeometry(VModelingTool::data.GetModelingPoint(id));
|
VModelingPoint::RefreshPointGeometry(VModelingTool::data.GetPointModeling(id));
|
||||||
QPointF point = VModelingTool::data.GetModelingPoint(id).toQPointF();
|
QPointF point = VModelingTool::data.GetPointModeling(id).toQPointF();
|
||||||
QPointF basePoint = VModelingTool::data.GetModelingPoint(basePointId).toQPointF();
|
QPointF basePoint = VModelingTool::data.GetPointModeling(basePointId).toQPointF();
|
||||||
mainLine->setLine(QLineF(basePoint - point, QPointF()));
|
mainLine->setLine(QLineF(basePoint - point, QPointF()));
|
||||||
if (typeLine == TypeLineNone)
|
if (typeLine == TypeLineNone)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,7 @@ VModelingNormal::VModelingNormal(VDomDocument *doc, VContainer *data, const qint
|
||||||
void VModelingNormal::setDialog()
|
void VModelingNormal::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogNormal.isNull() == false);
|
Q_ASSERT(dialogNormal.isNull() == false);
|
||||||
VPointF p = VAbstractTool::data.GetModelingPoint(id);
|
VPointF p = VAbstractTool::data.GetPointModeling(id);
|
||||||
dialogNormal->setTypeLine(typeLine);
|
dialogNormal->setTypeLine(typeLine);
|
||||||
dialogNormal->setFormula(formula);
|
dialogNormal->setFormula(formula);
|
||||||
dialogNormal->setAngle(angle);
|
dialogNormal->setAngle(angle);
|
||||||
|
@ -75,8 +75,8 @@ VModelingNormal *VModelingNormal::Create(const qint64 _id, const QString &formul
|
||||||
const Tool::Sources &typeCreation)
|
const Tool::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
VModelingNormal *point = 0;
|
VModelingNormal *point = 0;
|
||||||
VPointF firstPoint = data->GetModelingPoint(firstPointId);
|
VPointF firstPoint = data->GetPointModeling(firstPointId);
|
||||||
VPointF secondPoint = data->GetModelingPoint(secondPointId);
|
VPointF secondPoint = data->GetPointModeling(secondPointId);
|
||||||
Calculator cal(data);
|
Calculator cal(data);
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
qreal result = cal.eval(formula, &errorMsg);
|
qreal result = cal.eval(formula, &errorMsg);
|
||||||
|
@ -87,11 +87,11 @@ VModelingNormal *VModelingNormal::Create(const qint64 _id, const QString &formul
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
id = data->AddPointModeling(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingPoint(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
data->UpdatePointModeling(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
@ -150,7 +150,7 @@ void VModelingNormal::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
|
|
||||||
void VModelingNormal::AddToFile()
|
void VModelingNormal::AddToFile()
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
|
|
@ -42,12 +42,12 @@ VModelingPoint::VModelingPoint(VDomDocument *doc, VContainer *data, qint64 id, Q
|
||||||
this->setBrush(QBrush(Qt::NoBrush));
|
this->setBrush(QBrush(Qt::NoBrush));
|
||||||
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
this->setAcceptHoverEvents(true);
|
this->setAcceptHoverEvents(true);
|
||||||
RefreshPointGeometry(VAbstractTool::data.GetModelingPoint(id));
|
RefreshPointGeometry(VAbstractTool::data.GetPointModeling(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VModelingPoint::NameChangePosition(const QPointF &pos)
|
void VModelingPoint::NameChangePosition(const QPointF &pos)
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QPointF p = pos - this->pos();
|
QPointF p = pos - this->pos();
|
||||||
point.setMx(p.x());
|
point.setMx(p.x());
|
||||||
point.setMy(p.y());
|
point.setMy(p.y());
|
||||||
|
|
|
@ -48,7 +48,7 @@ VModelingPointOfContact::VModelingPointOfContact(VDomDocument *doc, VContainer *
|
||||||
void VModelingPointOfContact::setDialog()
|
void VModelingPointOfContact::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogPointOfContact.isNull() == false);
|
Q_ASSERT(dialogPointOfContact.isNull() == false);
|
||||||
VPointF p = VAbstractTool::data.GetModelingPoint(id);
|
VPointF p = VAbstractTool::data.GetPointModeling(id);
|
||||||
dialogPointOfContact->setRadius(radius);
|
dialogPointOfContact->setRadius(radius);
|
||||||
dialogPointOfContact->setCenter(center, id);
|
dialogPointOfContact->setCenter(center, id);
|
||||||
dialogPointOfContact->setFirstPoint(firstPointId, id);
|
dialogPointOfContact->setFirstPoint(firstPointId, id);
|
||||||
|
@ -77,9 +77,9 @@ VModelingPointOfContact *VModelingPointOfContact::Create(const qint64 _id, const
|
||||||
const Tool::Sources &typeCreation)
|
const Tool::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
VModelingPointOfContact *point = 0;
|
VModelingPointOfContact *point = 0;
|
||||||
VPointF centerP = data->GetModelingPoint(center);
|
VPointF centerP = data->GetPointModeling(center);
|
||||||
VPointF firstP = data->GetModelingPoint(firstPointId);
|
VPointF firstP = data->GetPointModeling(firstPointId);
|
||||||
VPointF secondP = data->GetModelingPoint(secondPointId);
|
VPointF secondP = data->GetPointModeling(secondPointId);
|
||||||
|
|
||||||
Calculator cal(data);
|
Calculator cal(data);
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
|
@ -91,11 +91,11 @@ VModelingPointOfContact *VModelingPointOfContact::Create(const qint64 _id, const
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
id = data->AddPointModeling(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingPoint(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
data->UpdatePointModeling(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
@ -124,7 +124,7 @@ void VModelingPointOfContact::FullUpdateFromFile()
|
||||||
firstPointId = domElement.attribute(AttrFirstPoint, "").toLongLong();
|
firstPointId = domElement.attribute(AttrFirstPoint, "").toLongLong();
|
||||||
secondPointId = domElement.attribute(AttrSecondPoint, "").toLongLong();
|
secondPointId = domElement.attribute(AttrSecondPoint, "").toLongLong();
|
||||||
}
|
}
|
||||||
RefreshPointGeometry(VAbstractTool::data.GetModelingPoint(id));
|
RefreshPointGeometry(VAbstractTool::data.GetPointModeling(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VModelingPointOfContact::FullUpdateFromGui(int result)
|
void VModelingPointOfContact::FullUpdateFromGui(int result)
|
||||||
|
@ -152,7 +152,7 @@ void VModelingPointOfContact::contextMenuEvent(QGraphicsSceneContextMenuEvent *e
|
||||||
|
|
||||||
void VModelingPointOfContact::AddToFile()
|
void VModelingPointOfContact::AddToFile()
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
|
|
@ -48,7 +48,7 @@ VModelingShoulderPoint::VModelingShoulderPoint(VDomDocument *doc, VContainer *da
|
||||||
void VModelingShoulderPoint::setDialog()
|
void VModelingShoulderPoint::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogShoulderPoint.isNull() == false);
|
Q_ASSERT(dialogShoulderPoint.isNull() == false);
|
||||||
VPointF p = VAbstractTool::data.GetModelingPoint(id);
|
VPointF p = VAbstractTool::data.GetPointModeling(id);
|
||||||
dialogShoulderPoint->setTypeLine(typeLine);
|
dialogShoulderPoint->setTypeLine(typeLine);
|
||||||
dialogShoulderPoint->setFormula(formula);
|
dialogShoulderPoint->setFormula(formula);
|
||||||
dialogShoulderPoint->setP1Line(basePointId, id);
|
dialogShoulderPoint->setP1Line(basePointId, id);
|
||||||
|
@ -79,9 +79,9 @@ VModelingShoulderPoint *VModelingShoulderPoint::Create(const qint64 _id, const Q
|
||||||
const Tool::Sources &typeCreation)
|
const Tool::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
VModelingShoulderPoint *point = 0;
|
VModelingShoulderPoint *point = 0;
|
||||||
VPointF firstPoint = data->GetModelingPoint(p1Line);
|
VPointF firstPoint = data->GetPointModeling(p1Line);
|
||||||
VPointF secondPoint = data->GetModelingPoint(p2Line);
|
VPointF secondPoint = data->GetPointModeling(p2Line);
|
||||||
VPointF shoulderPoint = data->GetModelingPoint(pShoulder);
|
VPointF shoulderPoint = data->GetPointModeling(pShoulder);
|
||||||
|
|
||||||
Calculator cal(data);
|
Calculator cal(data);
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
|
@ -93,11 +93,11 @@ VModelingShoulderPoint *VModelingShoulderPoint::Create(const qint64 _id, const Q
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
id = data->AddPointModeling(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingPoint(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
data->UpdatePointModeling(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
@ -158,7 +158,7 @@ void VModelingShoulderPoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *ev
|
||||||
|
|
||||||
void VModelingShoulderPoint::AddToFile()
|
void VModelingShoulderPoint::AddToFile()
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
|
|
@ -38,7 +38,7 @@ VModelingSpline::VModelingSpline(VDomDocument *doc, VContainer *data, qint64 id,
|
||||||
dialogSpline(QSharedPointer<DialogSpline>()), controlPoints(QVector<VControlPointSpline *>())
|
dialogSpline(QSharedPointer<DialogSpline>()), controlPoints(QVector<VControlPointSpline *>())
|
||||||
{
|
{
|
||||||
ignoreFullUpdate = true;
|
ignoreFullUpdate = true;
|
||||||
VSpline spl = data->GetModelingSpline(id);
|
VSpline spl = data->GetSplineModeling(id);
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addPath(spl.GetPath());
|
path.addPath(spl.GetPath());
|
||||||
path.setFillRule( Qt::WindingFill );
|
path.setFillRule( Qt::WindingFill );
|
||||||
|
@ -72,7 +72,7 @@ VModelingSpline::VModelingSpline(VDomDocument *doc, VContainer *data, qint64 id,
|
||||||
void VModelingSpline::setDialog()
|
void VModelingSpline::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogSpline.isNull() == false);
|
Q_ASSERT(dialogSpline.isNull() == false);
|
||||||
VSpline spl = VAbstractTool::data.GetModelingSpline(id);
|
VSpline spl = VAbstractTool::data.GetSplineModeling(id);
|
||||||
dialogSpline->setP1(spl.GetP1());
|
dialogSpline->setP1(spl.GetP1());
|
||||||
dialogSpline->setP4(spl.GetP4());
|
dialogSpline->setP4(spl.GetP4());
|
||||||
dialogSpline->setAngle1(spl.GetAngle1());
|
dialogSpline->setAngle1(spl.GetAngle1());
|
||||||
|
@ -102,15 +102,15 @@ VModelingSpline *VModelingSpline::Create(const qint64 _id, const qint64 &p1, con
|
||||||
const Tool::Sources &typeCreation)
|
const Tool::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
VModelingSpline *spl = 0;
|
VModelingSpline *spl = 0;
|
||||||
VSpline spline = VSpline(data->DataModelingPoints(), p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve);
|
VSpline spline = VSpline(data->DataPointsModeling(), p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve);
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingSpline(spline);
|
id = data->AddSplineModeling(spline);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingSpline(id, spline);
|
data->UpdateSplineModeling(id, spline);
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
@ -136,7 +136,7 @@ void VModelingSpline::FullUpdateFromGui(int result)
|
||||||
{
|
{
|
||||||
if (result == QDialog::Accepted)
|
if (result == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
VSpline spl = VSpline (VAbstractTool::data.DataModelingPoints(), dialogSpline->getP1(),
|
VSpline spl = VSpline (VAbstractTool::data.DataPointsModeling(), dialogSpline->getP1(),
|
||||||
dialogSpline->getP4(), dialogSpline->getAngle1(), dialogSpline->getAngle2(),
|
dialogSpline->getP4(), dialogSpline->getAngle1(), dialogSpline->getAngle2(),
|
||||||
dialogSpline->getKAsm1(), dialogSpline->getKAsm2(), dialogSpline->getKCurve());
|
dialogSpline->getKAsm1(), dialogSpline->getKAsm2(), dialogSpline->getKCurve());
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ void VModelingSpline::FullUpdateFromGui(int result)
|
||||||
connect(controlPoints[1], &VControlPointSpline::ControlPointChangePosition, this,
|
connect(controlPoints[1], &VControlPointSpline::ControlPointChangePosition, this,
|
||||||
&VModelingSpline::ControlPointChangePosition);
|
&VModelingSpline::ControlPointChangePosition);
|
||||||
|
|
||||||
spl = VSpline (VAbstractTool::data.DataModelingPoints(), dialogSpline->getP1(),
|
spl = VSpline (VAbstractTool::data.DataPointsModeling(), dialogSpline->getP1(),
|
||||||
controlPoints[0]->pos(), controlPoints[1]->pos(), dialogSpline->getP4(),
|
controlPoints[0]->pos(), controlPoints[1]->pos(), dialogSpline->getP4(),
|
||||||
dialogSpline->getKCurve());
|
dialogSpline->getKCurve());
|
||||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||||
|
@ -174,7 +174,7 @@ void VModelingSpline::ControlPointChangePosition(const qint32 &indexSpline, Spli
|
||||||
const QPointF &pos)
|
const QPointF &pos)
|
||||||
{
|
{
|
||||||
Q_UNUSED(indexSpline);
|
Q_UNUSED(indexSpline);
|
||||||
VSpline spl = VAbstractTool::data.GetModelingSpline(id);
|
VSpline spl = VAbstractTool::data.GetSplineModeling(id);
|
||||||
if (position == SplinePoint::FirstPoint)
|
if (position == SplinePoint::FirstPoint)
|
||||||
{
|
{
|
||||||
spl.ModifiSpl (spl.GetP1(), pos, spl.GetP3(), spl.GetP4(), spl.GetKcurve());
|
spl.ModifiSpl (spl.GetP1(), pos, spl.GetP3(), spl.GetP4(), spl.GetKcurve());
|
||||||
|
@ -202,7 +202,7 @@ void VModelingSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
|
|
||||||
void VModelingSpline::AddToFile()
|
void VModelingSpline::AddToFile()
|
||||||
{
|
{
|
||||||
VSpline spl = VAbstractTool::data.GetModelingSpline(id);
|
VSpline spl = VAbstractTool::data.GetSplineModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
@ -241,22 +241,22 @@ void VModelingSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
||||||
void VModelingSpline::RemoveReferens()
|
void VModelingSpline::RemoveReferens()
|
||||||
{
|
{
|
||||||
VSpline spl = VAbstractTool::data.GetModelingSpline(id);
|
VSpline spl = VAbstractTool::data.GetSplineModeling(id);
|
||||||
doc->DecrementReferens(spl.GetP1());
|
doc->DecrementReferens(spl.GetP1());
|
||||||
doc->DecrementReferens(spl.GetP4());
|
doc->DecrementReferens(spl.GetP4());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VModelingSpline::RefreshGeometry()
|
void VModelingSpline::RefreshGeometry()
|
||||||
{
|
{
|
||||||
VSpline spl = VAbstractTool::data.GetModelingSpline(id);
|
VSpline spl = VAbstractTool::data.GetSplineModeling(id);
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addPath(spl.GetPath());
|
path.addPath(spl.GetPath());
|
||||||
path.setFillRule( Qt::WindingFill );
|
path.setFillRule( Qt::WindingFill );
|
||||||
this->setPath(path);
|
this->setPath(path);
|
||||||
QPointF splinePoint = VAbstractTool::data.GetModelingPoint(spl.GetP1()).toQPointF();
|
QPointF splinePoint = VAbstractTool::data.GetPointModeling(spl.GetP1()).toQPointF();
|
||||||
QPointF controlPoint = spl.GetP2();
|
QPointF controlPoint = spl.GetP2();
|
||||||
emit RefreshLine(1, SplinePoint::FirstPoint, controlPoint, splinePoint);
|
emit RefreshLine(1, SplinePoint::FirstPoint, controlPoint, splinePoint);
|
||||||
splinePoint = VAbstractTool::data.GetModelingPoint(spl.GetP4()).toQPointF();
|
splinePoint = VAbstractTool::data.GetPointModeling(spl.GetP4()).toQPointF();
|
||||||
controlPoint = spl.GetP3();
|
controlPoint = spl.GetP3();
|
||||||
emit RefreshLine(1, SplinePoint::LastPoint, controlPoint, splinePoint);
|
emit RefreshLine(1, SplinePoint::LastPoint, controlPoint, splinePoint);
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ VModelingSplinePath::VModelingSplinePath(VDomDocument *doc, VContainer *data, qi
|
||||||
controlPoints(QVector<VControlPointSpline *>())
|
controlPoints(QVector<VControlPointSpline *>())
|
||||||
{
|
{
|
||||||
ignoreFullUpdate = true;
|
ignoreFullUpdate = true;
|
||||||
VSplinePath splPath = data->GetModelingSplinePath(id);
|
VSplinePath splPath = data->GetSplinePathModeling(id);
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addPath(splPath.GetPath());
|
path.addPath(splPath.GetPath());
|
||||||
path.setFillRule( Qt::WindingFill );
|
path.setFillRule( Qt::WindingFill );
|
||||||
|
@ -74,7 +74,7 @@ VModelingSplinePath::VModelingSplinePath(VDomDocument *doc, VContainer *data, qi
|
||||||
void VModelingSplinePath::setDialog()
|
void VModelingSplinePath::setDialog()
|
||||||
{
|
{
|
||||||
Q_ASSERT(dialogSplinePath.isNull() == false);
|
Q_ASSERT(dialogSplinePath.isNull() == false);
|
||||||
VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id);
|
VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id);
|
||||||
dialogSplinePath->SetPath(splPath);
|
dialogSplinePath->SetPath(splPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,11 +97,11 @@ VModelingSplinePath * VModelingSplinePath::Create(const qint64 _id, const VSplin
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddModelingSplinePath(path);
|
id = data->AddSplinePathModeling(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data->UpdateModelingSplinePath(id, path);
|
data->UpdateSplinePathModeling(id, path);
|
||||||
if (parse != Document::FullParse)
|
if (parse != Document::FullParse)
|
||||||
{
|
{
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
|
@ -141,7 +141,7 @@ void VModelingSplinePath::FullUpdateFromGui(int result)
|
||||||
connect(controlPoints[j-1], &VControlPointSpline::ControlPointChangePosition, this,
|
connect(controlPoints[j-1], &VControlPointSpline::ControlPointChangePosition, this,
|
||||||
&VModelingSplinePath::ControlPointChangePosition);
|
&VModelingSplinePath::ControlPointChangePosition);
|
||||||
|
|
||||||
spl = VSpline (VAbstractTool::data.DataModelingPoints(), spl.GetP1(), controlPoints[j-2]->pos(),
|
spl = VSpline (VAbstractTool::data.DataPointsModeling(), spl.GetP1(), controlPoints[j-2]->pos(),
|
||||||
controlPoints[j-1]->pos(), spl.GetP4(), splPath.getKCurve());
|
controlPoints[j-1]->pos(), spl.GetP4(), splPath.getKCurve());
|
||||||
CorectControlPoints(spl, splPath, i);
|
CorectControlPoints(spl, splPath, i);
|
||||||
CorectControlPoints(spl, splPath, i);
|
CorectControlPoints(spl, splPath, i);
|
||||||
|
@ -162,7 +162,7 @@ void VModelingSplinePath::FullUpdateFromGui(int result)
|
||||||
void VModelingSplinePath::ControlPointChangePosition(const qint32 &indexSpline, SplinePoint::Position position,
|
void VModelingSplinePath::ControlPointChangePosition(const qint32 &indexSpline, SplinePoint::Position position,
|
||||||
const QPointF &pos)
|
const QPointF &pos)
|
||||||
{
|
{
|
||||||
VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id);
|
VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id);
|
||||||
VSpline spl = splPath.GetSpline(indexSpline);
|
VSpline spl = splPath.GetSpline(indexSpline);
|
||||||
if (position == SplinePoint::FirstPoint)
|
if (position == SplinePoint::FirstPoint)
|
||||||
{
|
{
|
||||||
|
@ -221,7 +221,7 @@ void VModelingSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event
|
||||||
|
|
||||||
void VModelingSplinePath::AddToFile()
|
void VModelingSplinePath::AddToFile()
|
||||||
{
|
{
|
||||||
VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id);
|
VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
@ -271,7 +271,7 @@ void VModelingSplinePath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
||||||
void VModelingSplinePath::RemoveReferens()
|
void VModelingSplinePath::RemoveReferens()
|
||||||
{
|
{
|
||||||
VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id);
|
VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id);
|
||||||
for (qint32 i = 0; i < splPath.Count(); ++i)
|
for (qint32 i = 0; i < splPath.Count(); ++i)
|
||||||
{
|
{
|
||||||
doc->DecrementReferens(splPath[i].P());
|
doc->DecrementReferens(splPath[i].P());
|
||||||
|
@ -280,7 +280,7 @@ void VModelingSplinePath::RemoveReferens()
|
||||||
|
|
||||||
void VModelingSplinePath::RefreshGeometry()
|
void VModelingSplinePath::RefreshGeometry()
|
||||||
{
|
{
|
||||||
VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id);
|
VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id);
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addPath(splPath.GetPath());
|
path.addPath(splPath.GetPath());
|
||||||
path.setFillRule( Qt::WindingFill );
|
path.setFillRule( Qt::WindingFill );
|
||||||
|
|
|
@ -109,7 +109,7 @@ void VNodeArc::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
||||||
void VNodeArc::RefreshGeometry()
|
void VNodeArc::RefreshGeometry()
|
||||||
{
|
{
|
||||||
VArc arc = VAbstractTool::data.GetModelingArc(id);
|
VArc arc = VAbstractTool::data.GetArcModeling(id);
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addPath(arc.GetPath());
|
path.addPath(arc.GetPath());
|
||||||
path.setFillRule( Qt::WindingFill );
|
path.setFillRule( Qt::WindingFill );
|
||||||
|
|
|
@ -44,7 +44,7 @@ VNodePoint::VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 id
|
||||||
this->setBrush(QBrush(Qt::NoBrush));
|
this->setBrush(QBrush(Qt::NoBrush));
|
||||||
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
this->setAcceptHoverEvents(true);
|
this->setAcceptHoverEvents(true);
|
||||||
RefreshPointGeometry(VAbstractTool::data.GetModelingPoint(id));
|
RefreshPointGeometry(VAbstractTool::data.GetPointModeling(id));
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Tool::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
|
@ -69,12 +69,12 @@ void VNodePoint::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 i
|
||||||
|
|
||||||
void VNodePoint::FullUpdateFromFile()
|
void VNodePoint::FullUpdateFromFile()
|
||||||
{
|
{
|
||||||
RefreshPointGeometry(VAbstractTool::data.GetModelingPoint(id));
|
RefreshPointGeometry(VAbstractTool::data.GetPointModeling(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VNodePoint::AddToFile()
|
void VNodePoint::AddToFile()
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QDomElement domElement = doc->createElement(TagName);
|
QDomElement domElement = doc->createElement(TagName);
|
||||||
|
|
||||||
AddAttribute(domElement, AttrId, id);
|
AddAttribute(domElement, AttrId, id);
|
||||||
|
@ -118,7 +118,7 @@ void VNodePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
||||||
void VNodePoint::NameChangePosition(const QPointF &pos)
|
void VNodePoint::NameChangePosition(const QPointF &pos)
|
||||||
{
|
{
|
||||||
VPointF point = VAbstractTool::data.GetModelingPoint(id);
|
VPointF point = VAbstractTool::data.GetPointModeling(id);
|
||||||
QPointF p = pos - this->pos();
|
QPointF p = pos - this->pos();
|
||||||
point.setMx(p.x());
|
point.setMx(p.x());
|
||||||
point.setMy(p.y());
|
point.setMy(p.y());
|
||||||
|
|
|
@ -111,7 +111,7 @@ void VNodeSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
||||||
void VNodeSpline::RefreshGeometry()
|
void VNodeSpline::RefreshGeometry()
|
||||||
{
|
{
|
||||||
VSpline spl = VAbstractTool::data.GetModelingSpline(id);
|
VSpline spl = VAbstractTool::data.GetSplineModeling(id);
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addPath(spl.GetPath());
|
path.addPath(spl.GetPath());
|
||||||
path.setFillRule( Qt::WindingFill );
|
path.setFillRule( Qt::WindingFill );
|
||||||
|
|
|
@ -55,7 +55,7 @@ void VNodeSplinePath::Create(VDomDocument *doc, VContainer *data, qint64 id, qin
|
||||||
VNodeSplinePath *splPath = new VNodeSplinePath(doc, data, id, idSpline, typeobject, typeCreation);
|
VNodeSplinePath *splPath = new VNodeSplinePath(doc, data, id, idSpline, typeobject, typeCreation);
|
||||||
Q_ASSERT(splPath != 0);
|
Q_ASSERT(splPath != 0);
|
||||||
doc->AddTool(id, splPath);
|
doc->AddTool(id, splPath);
|
||||||
VSplinePath path = data->GetModelingSplinePath(id);
|
VSplinePath path = data->GetSplinePathModeling(id);
|
||||||
const QVector<VSplinePoint> *points = path.GetPoint();
|
const QVector<VSplinePoint> *points = path.GetPoint();
|
||||||
for (qint32 i = 0; i<points->size(); ++i)
|
for (qint32 i = 0; i<points->size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -115,7 +115,7 @@ void VNodeSplinePath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
||||||
void VNodeSplinePath::RefreshGeometry()
|
void VNodeSplinePath::RefreshGeometry()
|
||||||
{
|
{
|
||||||
VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id);
|
VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id);
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addPath(splPath.GetPath());
|
path.addPath(splPath.GetPath());
|
||||||
path.setFillRule( Qt::WindingFill );
|
path.setFillRule( Qt::WindingFill );
|
||||||
|
|
|
@ -148,9 +148,9 @@ void VToolDetail::Create(QSharedPointer<DialogDetail> &dialog, VMainGraphicsScen
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = data->GetModelingPoint(detail[i].getId());
|
point = data->GetPointModeling(detail[i].getId());
|
||||||
}
|
}
|
||||||
id = data->AddModelingPoint(point);
|
id = data->AddPointModeling(point);
|
||||||
VNodePoint::Create(doc, data, id, detail[i].getId(), detail[i].getMode(),
|
VNodePoint::Create(doc, data, id, detail[i].getId(), detail[i].getMode(),
|
||||||
Document::FullParse, Tool::FromGui);
|
Document::FullParse, Tool::FromGui);
|
||||||
}
|
}
|
||||||
|
@ -164,9 +164,9 @@ void VToolDetail::Create(QSharedPointer<DialogDetail> &dialog, VMainGraphicsScen
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
arc = data->GetModelingArc(detail[i].getId());
|
arc = data->GetArcModeling(detail[i].getId());
|
||||||
}
|
}
|
||||||
id = data->AddModelingArc(arc);
|
id = data->AddArcModeling(arc);
|
||||||
VNodeArc::Create(doc, data, id, detail[i].getId(), detail[i].getMode(),
|
VNodeArc::Create(doc, data, id, detail[i].getId(), detail[i].getMode(),
|
||||||
Document::FullParse, Tool::FromGui);
|
Document::FullParse, Tool::FromGui);
|
||||||
}
|
}
|
||||||
|
@ -180,9 +180,9 @@ void VToolDetail::Create(QSharedPointer<DialogDetail> &dialog, VMainGraphicsScen
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spline = data->GetModelingSpline(detail[i].getId());
|
spline = data->GetSplineModeling(detail[i].getId());
|
||||||
}
|
}
|
||||||
id = data->AddModelingSpline(spline);
|
id = data->AddSplineModeling(spline);
|
||||||
VNodeSpline::Create(doc, data, id, detail[i].getId(), detail[i].getMode(),
|
VNodeSpline::Create(doc, data, id, detail[i].getId(), detail[i].getMode(),
|
||||||
Document::FullParse, Tool::FromGui);
|
Document::FullParse, Tool::FromGui);
|
||||||
}
|
}
|
||||||
|
@ -196,9 +196,9 @@ void VToolDetail::Create(QSharedPointer<DialogDetail> &dialog, VMainGraphicsScen
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
splinePath = data->GetModelingSplinePath(detail[i].getId());
|
splinePath = data->GetSplinePathModeling(detail[i].getId());
|
||||||
}
|
}
|
||||||
id = data->AddModelingSplinePath(splinePath);
|
id = data->AddSplinePathModeling(splinePath);
|
||||||
VNodeSplinePath::Create(doc, data, id, detail[i].getId(), detail[i].getMode(),
|
VNodeSplinePath::Create(doc, data, id, detail[i].getId(), detail[i].getMode(),
|
||||||
Document::FullParse, Tool::FromGui);
|
Document::FullParse, Tool::FromGui);
|
||||||
}
|
}
|
||||||
|
|
|
@ -591,28 +591,28 @@ void VDomDocument::ParseDetailElement(VMainGraphicsScene *sceneDetail, const QDo
|
||||||
if (t == "NodePoint")
|
if (t == "NodePoint")
|
||||||
{
|
{
|
||||||
tool = Tool::NodePoint;
|
tool = Tool::NodePoint;
|
||||||
VPointF point = data->GetModelingPoint(id);
|
VPointF point = data->GetPointModeling(id);
|
||||||
mode = point.getMode();
|
mode = point.getMode();
|
||||||
oldDetail.append(VNodeDetail(point.getIdObject(), tool, mode, NodeDetail::Contour));
|
oldDetail.append(VNodeDetail(point.getIdObject(), tool, mode, NodeDetail::Contour));
|
||||||
}
|
}
|
||||||
else if (t == "NodeArc")
|
else if (t == "NodeArc")
|
||||||
{
|
{
|
||||||
tool = Tool::NodeArc;
|
tool = Tool::NodeArc;
|
||||||
VArc arc = data->GetModelingArc(id);
|
VArc arc = data->GetArcModeling(id);
|
||||||
mode = arc.getMode();
|
mode = arc.getMode();
|
||||||
oldDetail.append(VNodeDetail(arc.getIdObject(), tool, mode, NodeDetail::Contour));
|
oldDetail.append(VNodeDetail(arc.getIdObject(), tool, mode, NodeDetail::Contour));
|
||||||
}
|
}
|
||||||
else if (t == "NodeSpline")
|
else if (t == "NodeSpline")
|
||||||
{
|
{
|
||||||
tool = Tool::NodeSpline;
|
tool = Tool::NodeSpline;
|
||||||
VSpline spl = data->GetModelingSpline(id);
|
VSpline spl = data->GetSplineModeling(id);
|
||||||
mode = spl.getMode();
|
mode = spl.getMode();
|
||||||
oldDetail.append(VNodeDetail(spl.getIdObject(), tool, mode, NodeDetail::Contour));
|
oldDetail.append(VNodeDetail(spl.getIdObject(), tool, mode, NodeDetail::Contour));
|
||||||
}
|
}
|
||||||
else if (t == "NodeSplinePath")
|
else if (t == "NodeSplinePath")
|
||||||
{
|
{
|
||||||
tool = Tool::NodeSplinePath;
|
tool = Tool::NodeSplinePath;
|
||||||
VSplinePath splPath = data->GetModelingSplinePath(id);
|
VSplinePath splPath = data->GetSplinePathModeling(id);
|
||||||
mode = splPath.getMode();
|
mode = splPath.getMode();
|
||||||
oldDetail.append(VNodeDetail(splPath.getIdObject(), tool, mode, NodeDetail::Contour));
|
oldDetail.append(VNodeDetail(splPath.getIdObject(), tool, mode, NodeDetail::Contour));
|
||||||
}
|
}
|
||||||
|
@ -993,11 +993,11 @@ void VDomDocument::ParsePointElement(VMainGraphicsScene *scene, const QDomElemen
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
typeObject = Draw::Modeling;
|
typeObject = Draw::Modeling;
|
||||||
point = data->GetModelingPoint(idObject);
|
point = data->GetPointModeling(idObject);
|
||||||
}
|
}
|
||||||
qreal mx = toPixel(GetParametrDouble(domElement, "mx"));
|
qreal mx = toPixel(GetParametrDouble(domElement, "mx"));
|
||||||
qreal my = toPixel(GetParametrDouble(domElement, "my"));
|
qreal my = toPixel(GetParametrDouble(domElement, "my"));
|
||||||
data->UpdateModelingPoint(id, VPointF(point.x(), point.y(), point.name(), mx, my, typeObject,
|
data->UpdatePointModeling(id, VPointF(point.x(), point.y(), point.name(), mx, my, typeObject,
|
||||||
idObject ));
|
idObject ));
|
||||||
VNodePoint::Create(this, data, id, idObject, mode, parse, Tool::FromFile);
|
VNodePoint::Create(this, data, id, idObject, mode, parse, Tool::FromFile);
|
||||||
return;
|
return;
|
||||||
|
@ -1236,11 +1236,11 @@ void VDomDocument::ParseSplineElement(VMainGraphicsScene *scene, const QDomEleme
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
typeObject = Draw::Modeling;
|
typeObject = Draw::Modeling;
|
||||||
spl = data->GetModelingSpline(idObject);
|
spl = data->GetSplineModeling(idObject);
|
||||||
}
|
}
|
||||||
spl.setMode(typeObject);
|
spl.setMode(typeObject);
|
||||||
spl.setIdObject(idObject);
|
spl.setIdObject(idObject);
|
||||||
data->UpdateModelingSpline(id, spl);
|
data->UpdateSplineModeling(id, spl);
|
||||||
VNodeSpline::Create(this, data, id, idObject, mode, parse, Tool::FromFile);
|
VNodeSpline::Create(this, data, id, idObject, mode, parse, Tool::FromFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1268,11 +1268,11 @@ void VDomDocument::ParseSplineElement(VMainGraphicsScene *scene, const QDomEleme
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
typeObject = Draw::Modeling;
|
typeObject = Draw::Modeling;
|
||||||
path = data->GetModelingSplinePath(idObject);
|
path = data->GetSplinePathModeling(idObject);
|
||||||
}
|
}
|
||||||
path.setMode(typeObject);
|
path.setMode(typeObject);
|
||||||
path.setIdObject(idObject);
|
path.setIdObject(idObject);
|
||||||
data->UpdateModelingSplinePath(id, path);
|
data->UpdateSplinePathModeling(id, path);
|
||||||
VNodeSplinePath::Create(this, data, id, idObject, mode, parse, Tool::FromFile);
|
VNodeSplinePath::Create(this, data, id, idObject, mode, parse, Tool::FromFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1336,11 +1336,11 @@ void VDomDocument::ParseArcElement(VMainGraphicsScene *scene, const QDomElement
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
typeObject = Draw::Modeling;
|
typeObject = Draw::Modeling;
|
||||||
arc = data->GetModelingArc(idObject);
|
arc = data->GetArcModeling(idObject);
|
||||||
}
|
}
|
||||||
arc.setMode(typeObject);
|
arc.setMode(typeObject);
|
||||||
arc.setIdObject(idObject);
|
arc.setIdObject(idObject);
|
||||||
data->UpdateModelingArc(id, arc);
|
data->UpdateArcModeling(id, arc);
|
||||||
VNodeArc::Create(this, data, id, idObject, mode, parse, Tool::FromFile);
|
VNodeArc::Create(this, data, id, idObject, mode, parse, Tool::FromFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user