Added VNodeEllipticalArc.
--HG-- branch : develop
This commit is contained in:
parent
f0b35ddc11
commit
1fb0ab4d75
|
@ -77,7 +77,7 @@ void VToolOptionsPropertyBrowser::ClearPropertyBrowser()
|
||||||
void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item)
|
void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item)
|
||||||
{
|
{
|
||||||
// This check helps to find missed tools in the switch
|
// This check helps to find missed tools in the switch
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was used in switch.");
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50, "Not all tools were used in switch.");
|
||||||
|
|
||||||
switch (item->type())
|
switch (item->type())
|
||||||
{
|
{
|
||||||
|
@ -213,7 +213,7 @@ void VToolOptionsPropertyBrowser::UpdateOptions()
|
||||||
}
|
}
|
||||||
|
|
||||||
// This check helps to find missed tools in the switch
|
// This check helps to find missed tools in the switch
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was used in switch.");
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50, "Not all tools were used in switch.");
|
||||||
|
|
||||||
switch (currentItem->type())
|
switch (currentItem->type())
|
||||||
{
|
{
|
||||||
|
@ -360,7 +360,7 @@ void VToolOptionsPropertyBrowser::userChangedData(VProperty *property)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This check helps to find missed tools in the switch
|
// This check helps to find missed tools in the switch
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was used in switch.");
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50, "Not all tools were used in switch.");
|
||||||
|
|
||||||
switch (currentItem->type())
|
switch (currentItem->type())
|
||||||
{
|
{
|
||||||
|
|
|
@ -209,7 +209,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default")
|
||||||
QString DialogHistory::Record(const VToolRecord &tool)
|
QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
{
|
{
|
||||||
// This check helps to find missed tools in the switch
|
// This check helps to find missed tools in the switch
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was used in history.");
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50, "Not all tools were used in history.");
|
||||||
|
|
||||||
const QDomElement domElem = doc->elementById(tool.getId());
|
const QDomElement domElem = doc->elementById(tool.getId());
|
||||||
if (domElem.isElement() == false)
|
if (domElem.isElement() == false)
|
||||||
|
@ -392,6 +392,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
case Tool::Detail:
|
case Tool::Detail:
|
||||||
case Tool::UnionDetails:
|
case Tool::UnionDetails:
|
||||||
case Tool::NodeArc:
|
case Tool::NodeArc:
|
||||||
|
case Tool::NodeElArc:
|
||||||
case Tool::NodePoint:
|
case Tool::NodePoint:
|
||||||
case Tool::NodeSpline:
|
case Tool::NodeSpline:
|
||||||
case Tool::NodeSplinePath:
|
case Tool::NodeSplinePath:
|
||||||
|
|
|
@ -1791,7 +1791,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default")
|
||||||
void MainWindow::CancelTool()
|
void MainWindow::CancelTool()
|
||||||
{
|
{
|
||||||
// This check helps to find missed tools in the switch
|
// This check helps to find missed tools in the switch
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was handled.");
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50, "Not all tools were handled.");
|
||||||
|
|
||||||
qCDebug(vMainWindow, "Canceling tool.");
|
qCDebug(vMainWindow, "Canceling tool.");
|
||||||
delete dialogTool;
|
delete dialogTool;
|
||||||
|
@ -1824,6 +1824,7 @@ void MainWindow::CancelTool()
|
||||||
case Tool::LAST_ONE_DO_NOT_USE:
|
case Tool::LAST_ONE_DO_NOT_USE:
|
||||||
case Tool::NodePoint:
|
case Tool::NodePoint:
|
||||||
case Tool::NodeArc:
|
case Tool::NodeArc:
|
||||||
|
case Tool::NodeElArc:
|
||||||
case Tool::NodeSpline:
|
case Tool::NodeSpline:
|
||||||
case Tool::NodeSplinePath:
|
case Tool::NodeSplinePath:
|
||||||
Q_UNREACHABLE(); //-V501
|
Q_UNREACHABLE(); //-V501
|
||||||
|
@ -2995,7 +2996,7 @@ void MainWindow::SetEnableTool(bool enable)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This check helps to find missed tools
|
// This check helps to find missed tools
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools were handled.");
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50, "Not all tools were handled.");
|
||||||
|
|
||||||
//Drawing Tools
|
//Drawing Tools
|
||||||
ui->toolButtonEndLine->setEnabled(drawTools);
|
ui->toolButtonEndLine->setEnabled(drawTools);
|
||||||
|
@ -3316,7 +3317,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default")
|
||||||
void MainWindow::LastUsedTool()
|
void MainWindow::LastUsedTool()
|
||||||
{
|
{
|
||||||
// This check helps to find missed tools in the switch
|
// This check helps to find missed tools in the switch
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was handled.");
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50, "Not all tools were handled.");
|
||||||
|
|
||||||
if (currentTool == lastUsedTool)
|
if (currentTool == lastUsedTool)
|
||||||
{
|
{
|
||||||
|
@ -3341,6 +3342,7 @@ void MainWindow::LastUsedTool()
|
||||||
case Tool::LAST_ONE_DO_NOT_USE:
|
case Tool::LAST_ONE_DO_NOT_USE:
|
||||||
case Tool::NodePoint:
|
case Tool::NodePoint:
|
||||||
case Tool::NodeArc:
|
case Tool::NodeArc:
|
||||||
|
case Tool::NodeElArc:
|
||||||
case Tool::NodeSpline:
|
case Tool::NodeSpline:
|
||||||
case Tool::NodeSplinePath:
|
case Tool::NodeSplinePath:
|
||||||
Q_UNREACHABLE(); //-V501
|
Q_UNREACHABLE(); //-V501
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "../vmisc/vmath.h"
|
#include "../vmisc/vmath.h"
|
||||||
#include "../qmuparser/qmuparsererror.h"
|
#include "../qmuparser/qmuparsererror.h"
|
||||||
#include "../vgeometry/varc.h"
|
#include "../vgeometry/varc.h"
|
||||||
|
#include "../vgeometry/vellipticalarc.h"
|
||||||
#include "../vgeometry/vsplinepath.h"
|
#include "../vgeometry/vsplinepath.h"
|
||||||
#include "../vgeometry/vcubicbezier.h"
|
#include "../vgeometry/vcubicbezier.h"
|
||||||
#include "../vgeometry/vcubicbezierpath.h"
|
#include "../vgeometry/vcubicbezierpath.h"
|
||||||
|
@ -628,8 +629,11 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document
|
||||||
QString().setNum(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping())));
|
QString().setNum(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping())));
|
||||||
detail.SetInLayout(GetParametrBool(domElement, AttrInLayout, trueStr));
|
detail.SetInLayout(GetParametrBool(domElement, AttrInLayout, trueStr));
|
||||||
|
|
||||||
QStringList types = QStringList() << VToolDetail::NodePoint << VToolDetail::NodeArc << VToolDetail::NodeSpline
|
QStringList types = QStringList() << VToolDetail::NodePoint
|
||||||
<< VToolDetail::NodeSplinePath;
|
<< VToolDetail::NodeArc
|
||||||
|
<< VToolDetail::NodeSpline
|
||||||
|
<< VToolDetail::NodeSplinePath
|
||||||
|
<< VToolDetail::NodeElArc;
|
||||||
const QDomNodeList nodeList = domElement.childNodes();
|
const QDomNodeList nodeList = domElement.childNodes();
|
||||||
const qint32 num = nodeList.size();
|
const qint32 num = nodeList.size();
|
||||||
for (qint32 i = 0; i < num; ++i)
|
for (qint32 i = 0; i < num; ++i)
|
||||||
|
@ -662,6 +666,9 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document
|
||||||
case 3: // VToolDetail::NodeSplinePath
|
case 3: // VToolDetail::NodeSplinePath
|
||||||
tool = Tool::NodeSplinePath;
|
tool = Tool::NodeSplinePath;
|
||||||
break;
|
break;
|
||||||
|
case 4: // VToolDetail::NodeElArc
|
||||||
|
tool = Tool::NodeElArc;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
VException e(tr("Wrong tag name '%1'.").arg(t));
|
VException e(tr("Wrong tag name '%1'.").arg(t));
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -2495,6 +2502,41 @@ void VPattern::ParseToolEllipticalArc(VMainGraphicsScene *scene, QDomElement &do
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VPattern::ParseNodeEllipticalArc(const QDomElement &domElement, const Document &parse)
|
||||||
|
{
|
||||||
|
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
quint32 id = 0;
|
||||||
|
|
||||||
|
ToolsCommonAttributes(domElement, id);
|
||||||
|
const quint32 idObject = GetParametrUInt(domElement, AttrIdObject, NULL_ID_STR);
|
||||||
|
const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, NULL_ID_STR);
|
||||||
|
VEllipticalArc *arc = nullptr;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
arc = new VEllipticalArc(*data->GeometricObject<VEllipticalArc>(idObject));
|
||||||
|
}
|
||||||
|
catch (const VExceptionBadId &e)
|
||||||
|
{ // Possible case. Parent was deleted, but the node object is still here.
|
||||||
|
Q_UNUSED(e);
|
||||||
|
return;// Just ignore
|
||||||
|
}
|
||||||
|
arc->setIdObject(idObject);
|
||||||
|
arc->setMode(Draw::Modeling);
|
||||||
|
data->UpdateGObject(id, arc);
|
||||||
|
VNodeEllipticalArc::Create(this, data, id, idObject, parse, Source::FromFile, "", idTool);
|
||||||
|
}
|
||||||
|
catch (const VExceptionBadId &e)
|
||||||
|
{
|
||||||
|
VExceptionObjectError excep(tr("Error creating or updating modeling elliptical arc"), domElement);
|
||||||
|
excep.AddMoreInformation(e.ErrorMessage());
|
||||||
|
throw excep;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPattern::ParseNodeArc(const QDomElement &domElement, const Document &parse)
|
void VPattern::ParseNodeArc(const QDomElement &domElement, const Document &parse)
|
||||||
{
|
{
|
||||||
|
@ -2937,13 +2979,17 @@ void VPattern::ParseEllipticalArcElement(VMainGraphicsScene *scene, QDomElement
|
||||||
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
|
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
|
||||||
Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of elliptical arc is empty");
|
Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of elliptical arc is empty");
|
||||||
|
|
||||||
QStringList arcs = QStringList() << VToolEllipticalArc::ToolType; /*0*/
|
const QStringList arcs = QStringList() << VToolEllipticalArc::ToolType /*0*/
|
||||||
|
<< VNodeEllipticalArc::ToolType; /*1*/
|
||||||
|
|
||||||
switch (arcs.indexOf(type))
|
switch (arcs.indexOf(type))
|
||||||
{
|
{
|
||||||
case 0: //VToolArc::ToolType
|
case 0: //VToolArc::ToolType
|
||||||
ParseToolEllipticalArc(scene, domElement, parse);
|
ParseToolEllipticalArc(scene, domElement, parse);
|
||||||
break;
|
break;
|
||||||
|
case 1: //VNodeEllipticalArc::ToolType
|
||||||
|
ParseNodeEllipticalArc(domElement, parse);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
VException e(tr("Unknown elliptical arc type '%1'.").arg(type));
|
VException e(tr("Unknown elliptical arc type '%1'.").arg(type));
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -3527,7 +3573,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default")
|
||||||
QRectF VPattern::ActiveDrawBoundingRect() const
|
QRectF VPattern::ActiveDrawBoundingRect() const
|
||||||
{
|
{
|
||||||
// This check helps to find missed tools in the switch
|
// This check helps to find missed tools in the switch
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was used.");
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50, "Not all tools were used.");
|
||||||
|
|
||||||
QRectF rec;
|
QRectF rec;
|
||||||
|
|
||||||
|
@ -3655,6 +3701,7 @@ QRectF VPattern::ActiveDrawBoundingRect() const
|
||||||
case Tool::Detail:
|
case Tool::Detail:
|
||||||
case Tool::UnionDetails:
|
case Tool::UnionDetails:
|
||||||
case Tool::NodeArc:
|
case Tool::NodeArc:
|
||||||
|
case Tool::NodeElArc:
|
||||||
case Tool::NodePoint:
|
case Tool::NodePoint:
|
||||||
case Tool::NodeSpline:
|
case Tool::NodeSpline:
|
||||||
case Tool::NodeSplinePath:
|
case Tool::NodeSplinePath:
|
||||||
|
|
|
@ -126,7 +126,7 @@ private:
|
||||||
void ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElement,
|
void ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElement,
|
||||||
const Document &parse, const QString& type);
|
const Document &parse, const QString& type);
|
||||||
void ParseEllipticalArcElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse,
|
void ParseEllipticalArcElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse,
|
||||||
const QString &type);
|
const QString &type);
|
||||||
void ParseToolsElement(VMainGraphicsScene *scene, const QDomElement& domElement,
|
void ParseToolsElement(VMainGraphicsScene *scene, const QDomElement& domElement,
|
||||||
const Document &parse, const QString& type);
|
const Document &parse, const QString& type);
|
||||||
void ParseOperationElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse,
|
void ParseOperationElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse,
|
||||||
|
@ -196,6 +196,7 @@ private:
|
||||||
void ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse);
|
void ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse);
|
||||||
|
|
||||||
void ParseToolEllipticalArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse);
|
void ParseToolEllipticalArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse);
|
||||||
|
void ParseNodeEllipticalArc(const QDomElement &domElement, const Document &parse);
|
||||||
|
|
||||||
void ParseToolRotation(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse);
|
void ParseToolRotation(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse);
|
||||||
void ParseToolFlippingByLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse);
|
void ParseToolFlippingByLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse);
|
||||||
|
|
|
@ -638,6 +638,7 @@ quint32 VAbstractPattern::SiblingNodeId(const quint32 &nodeId) const
|
||||||
case Tool::Detail:
|
case Tool::Detail:
|
||||||
case Tool::UnionDetails:
|
case Tool::UnionDetails:
|
||||||
case Tool::NodeArc:
|
case Tool::NodeArc:
|
||||||
|
case Tool::NodeElArc:
|
||||||
case Tool::NodePoint:
|
case Tool::NodePoint:
|
||||||
case Tool::NodeSpline:
|
case Tool::NodeSpline:
|
||||||
case Tool::NodeSplinePath:
|
case Tool::NodeSplinePath:
|
||||||
|
@ -1426,7 +1427,7 @@ QStringList VAbstractPattern::ListPointExpressions() const
|
||||||
// Check if new tool doesn't bring new attribute with a formula.
|
// Check if new tool doesn't bring new attribute with a formula.
|
||||||
// If no just increment a number.
|
// If no just increment a number.
|
||||||
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
|
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
|
||||||
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49);
|
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50);
|
||||||
|
|
||||||
QStringList expressions;
|
QStringList expressions;
|
||||||
const QDomNodeList list = elementsByTagName(TagPoint);
|
const QDomNodeList list = elementsByTagName(TagPoint);
|
||||||
|
@ -1498,7 +1499,7 @@ QStringList VAbstractPattern::ListArcExpressions() const
|
||||||
// Check if new tool doesn't bring new attribute with a formula.
|
// Check if new tool doesn't bring new attribute with a formula.
|
||||||
// If no just increment number.
|
// If no just increment number.
|
||||||
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
|
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
|
||||||
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49);
|
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50);
|
||||||
|
|
||||||
QStringList expressions;
|
QStringList expressions;
|
||||||
const QDomNodeList list = elementsByTagName(TagArc);
|
const QDomNodeList list = elementsByTagName(TagArc);
|
||||||
|
@ -1552,7 +1553,7 @@ QStringList VAbstractPattern::ListElArcExpressions() const
|
||||||
// Check if new tool doesn't bring new attribute with a formula.
|
// Check if new tool doesn't bring new attribute with a formula.
|
||||||
// If no just increment number.
|
// If no just increment number.
|
||||||
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
|
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
|
||||||
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49);
|
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50);
|
||||||
|
|
||||||
QStringList expressions;
|
QStringList expressions;
|
||||||
const QDomNodeList list = elementsByTagName(TagElArc);
|
const QDomNodeList list = elementsByTagName(TagElArc);
|
||||||
|
@ -1623,7 +1624,7 @@ QStringList VAbstractPattern::ListPathPointExpressions() const
|
||||||
// Check if new tool doesn't bring new attribute with a formula.
|
// Check if new tool doesn't bring new attribute with a formula.
|
||||||
// If no just increment number.
|
// If no just increment number.
|
||||||
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
|
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
|
||||||
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49);
|
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50);
|
||||||
|
|
||||||
QStringList expressions;
|
QStringList expressions;
|
||||||
const QDomNodeList list = elementsByTagName(AttrPathPoint);
|
const QDomNodeList list = elementsByTagName(AttrPathPoint);
|
||||||
|
@ -1690,7 +1691,7 @@ QStringList VAbstractPattern::ListOperationExpressions() const
|
||||||
// Check if new tool doesn't bring new attribute with a formula.
|
// Check if new tool doesn't bring new attribute with a formula.
|
||||||
// If no just increment number.
|
// If no just increment number.
|
||||||
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
|
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
|
||||||
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49);
|
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 50);
|
||||||
|
|
||||||
QStringList expressions;
|
QStringList expressions;
|
||||||
const QDomNodeList list = elementsByTagName(TagOperation);
|
const QDomNodeList list = elementsByTagName(TagOperation);
|
||||||
|
|
|
@ -57,7 +57,8 @@ public:
|
||||||
VEllipticalArc (const VPointF ¢er, qreal radius1, qreal radius2, qreal f1, qreal f2, qreal rotationAngle);
|
VEllipticalArc (const VPointF ¢er, qreal radius1, qreal radius2, qreal f1, qreal f2, qreal rotationAngle);
|
||||||
VEllipticalArc (qreal length, const QString &formulaLength, const VPointF ¢er, qreal radius1, qreal radius2,
|
VEllipticalArc (qreal length, const QString &formulaLength, const VPointF ¢er, qreal radius1, qreal radius2,
|
||||||
const QString &formulaRadius1, const QString &formulaRadius2, qreal f1, const QString &formulaF1,
|
const QString &formulaRadius1, const QString &formulaRadius2, qreal f1, const QString &formulaF1,
|
||||||
qreal rotationAngle, const QString &formulaRotationAngle, quint32 idObject = 0, Draw mode = Draw::Calculation);
|
qreal rotationAngle, const QString &formulaRotationAngle, quint32 idObject = 0,
|
||||||
|
Draw mode = Draw::Calculation);
|
||||||
VEllipticalArc (qreal length, const VPointF ¢er, qreal radius1, qreal radius2, qreal f1, qreal rotationAngle);
|
VEllipticalArc (qreal length, const VPointF ¢er, qreal radius1, qreal radius2, qreal f1, qreal rotationAngle);
|
||||||
|
|
||||||
VEllipticalArc(const VEllipticalArc &arc);
|
VEllipticalArc(const VEllipticalArc &arc);
|
||||||
|
|
|
@ -57,7 +57,7 @@ class VTranslateMeasurements;
|
||||||
#define DefPointRadius 1.5//mm
|
#define DefPointRadius 1.5//mm
|
||||||
|
|
||||||
enum class NodeDetail : char { Contour, Modeling };
|
enum class NodeDetail : char { Contour, Modeling };
|
||||||
enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown };
|
enum class SceneObject : char { Point, Line, Spline, Arc, ElArc, SplinePath, Detail, Unknown };
|
||||||
enum class MeasurementsType : char { Standard, Individual , Unknown};
|
enum class MeasurementsType : char { Standard, Individual , Unknown};
|
||||||
enum class Unit : char { Mm = 0, Cm, Inch, Px, LAST_UNIT_DO_NOT_USE};
|
enum class Unit : char { Mm = 0, Cm, Inch, Px, LAST_UNIT_DO_NOT_USE};
|
||||||
enum class Source : char { FromGui, FromFile, FromTool };
|
enum class Source : char { FromGui, FromFile, FromTool };
|
||||||
|
@ -94,6 +94,7 @@ enum class Tool : ToolVisHolderType
|
||||||
Detail,
|
Detail,
|
||||||
NodePoint,
|
NodePoint,
|
||||||
NodeArc,
|
NodeArc,
|
||||||
|
NodeElArc,
|
||||||
NodeSpline,
|
NodeSpline,
|
||||||
NodeSplinePath,
|
NodeSplinePath,
|
||||||
Height,
|
Height,
|
||||||
|
|
|
@ -404,6 +404,7 @@ QVector<QPointF> VDetail::ContourPoints(const VContainer *data) const
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
|
case (Tool::NodeElArc):
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
case (Tool::NodeSplinePath):
|
case (Tool::NodeSplinePath):
|
||||||
{
|
{
|
||||||
|
@ -448,6 +449,7 @@ QVector<QPointF> VDetail::SeamAllowancePoints(const VContainer *data) const
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
|
case (Tool::NodeElArc):
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
case (Tool::NodeSplinePath):
|
case (Tool::NodeSplinePath):
|
||||||
{
|
{
|
||||||
|
|
|
@ -193,6 +193,9 @@ void DialogDetail::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
case (SceneObject::Arc):
|
case (SceneObject::Arc):
|
||||||
NewItem(id, Tool::NodeArc, NodeDetail::Contour);
|
NewItem(id, Tool::NodeArc, NodeDetail::Contour);
|
||||||
break;
|
break;
|
||||||
|
case (SceneObject::ElArc):
|
||||||
|
NewItem(id, Tool::NodeElArc, NodeDetail::Contour);
|
||||||
|
break;
|
||||||
case (SceneObject::Point):
|
case (SceneObject::Point):
|
||||||
NewItem(id, Tool::NodePoint, NodeDetail::Contour);
|
NewItem(id, Tool::NodePoint, NodeDetail::Contour);
|
||||||
break;
|
break;
|
||||||
|
@ -394,6 +397,7 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t
|
||||||
{
|
{
|
||||||
case (Tool::NodePoint):
|
case (Tool::NodePoint):
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
|
case (Tool::NodeElArc):
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
case (Tool::NodeSplinePath):
|
case (Tool::NodeSplinePath):
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#define NODEDETAILS_H
|
#define NODEDETAILS_H
|
||||||
|
|
||||||
#include "vnodearc.h"
|
#include "vnodearc.h"
|
||||||
|
#include "vnodeellipticalarc.h"
|
||||||
#include "vnodepoint.h"
|
#include "vnodepoint.h"
|
||||||
#include "vnodespline.h"
|
#include "vnodespline.h"
|
||||||
#include "vnodesplinepath.h"
|
#include "vnodesplinepath.h"
|
||||||
|
|
|
@ -39,8 +39,6 @@
|
||||||
#include "../vdatatool.h"
|
#include "../vdatatool.h"
|
||||||
#include "vabstractnode.h"
|
#include "vabstractnode.h"
|
||||||
|
|
||||||
class VContainer;
|
|
||||||
|
|
||||||
const QString VNodeArc::ToolType = QStringLiteral("modeling");
|
const QString VNodeArc::ToolType = QStringLiteral("modeling");
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
131
src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.cpp
Normal file
131
src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.cpp
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 20 12, 2016
|
||||||
|
**
|
||||||
|
** @brief
|
||||||
|
** @copyright
|
||||||
|
** This source code is part of the Valentine project, a pattern making
|
||||||
|
** program, whose allow create and modeling patterns of clothing.
|
||||||
|
** Copyright (C) 2016 Valentina project
|
||||||
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||||
|
**
|
||||||
|
** Valentina is free software: you can redistribute it and/or modify
|
||||||
|
** it under the terms of the GNU General Public License as published by
|
||||||
|
** the Free Software Foundation, either version 3 of the License, or
|
||||||
|
** (at your option) any later version.
|
||||||
|
**
|
||||||
|
** Valentina is distributed in the hope that it will be useful,
|
||||||
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
** GNU General Public License for more details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU General Public License
|
||||||
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
**
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#include "vnodeellipticalarc.h"
|
||||||
|
|
||||||
|
#include <QDomElement>
|
||||||
|
#include <QStaticStringData>
|
||||||
|
#include <QStringData>
|
||||||
|
#include <QStringDataPtr>
|
||||||
|
|
||||||
|
#include "../ifc/xml/vdomdocument.h"
|
||||||
|
#include "../ifc/ifcdef.h"
|
||||||
|
#include "../vabstracttool.h"
|
||||||
|
#include "../vdatatool.h"
|
||||||
|
#include "vabstractnode.h"
|
||||||
|
|
||||||
|
const QString VNodeEllipticalArc::ToolType = QStringLiteral("modeling");
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VNodeEllipticalArc::Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc,
|
||||||
|
const Document &parse, const Source &typeCreation, const QString &drawName,
|
||||||
|
const quint32 &idTool)
|
||||||
|
{
|
||||||
|
VAbstractTool::AddRecord(id, Tool::NodeElArc, doc);
|
||||||
|
if (parse == Document::FullParse)
|
||||||
|
{
|
||||||
|
VNodeEllipticalArc *arc = new VNodeEllipticalArc(doc, data, id, idArc, typeCreation, drawName, idTool, doc);
|
||||||
|
|
||||||
|
doc->AddTool(id, arc);
|
||||||
|
if (idTool != NULL_ID)
|
||||||
|
{
|
||||||
|
//Some nodes we don't show on scene. Tool that create this nodes must free memory.
|
||||||
|
VDataTool *tool = doc->getTool(idTool);
|
||||||
|
SCASSERT(tool != nullptr);
|
||||||
|
arc->setParent(tool);// Adopted by a tool
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Help to delete the node before each FullParse
|
||||||
|
doc->AddToolOnRemove(arc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
doc->UpdateToolData(id, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QString VNodeEllipticalArc::getTagName() const
|
||||||
|
{
|
||||||
|
return VAbstractPattern::TagElArc;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VNodeEllipticalArc::AllowHover(bool enabled)
|
||||||
|
{
|
||||||
|
Q_UNUSED(enabled)
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VNodeEllipticalArc::AllowSelecting(bool enabled)
|
||||||
|
{
|
||||||
|
Q_UNUSED(enabled)
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VNodeEllipticalArc::AddToFile()
|
||||||
|
{
|
||||||
|
QDomElement domElement = doc->createElement(getTagName());
|
||||||
|
|
||||||
|
doc->SetAttribute(domElement, VDomDocument::AttrId, id);
|
||||||
|
doc->SetAttribute(domElement, AttrType, ToolType);
|
||||||
|
doc->SetAttribute(domElement, AttrIdObject, idNode);
|
||||||
|
if (idTool != NULL_ID)
|
||||||
|
{
|
||||||
|
doc->SetAttribute(domElement, AttrIdTool, idTool);
|
||||||
|
}
|
||||||
|
|
||||||
|
AddToModeling(domElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VNodeEllipticalArc::RefreshDataInFile()
|
||||||
|
{
|
||||||
|
QDomElement domElement = doc->elementById(id);
|
||||||
|
if (domElement.isElement())
|
||||||
|
{
|
||||||
|
doc->SetAttribute(domElement, AttrIdObject, idNode);
|
||||||
|
if (idTool != NULL_ID)
|
||||||
|
{
|
||||||
|
doc->SetAttribute(domElement, AttrIdTool, idTool);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VNodeEllipticalArc::VNodeEllipticalArc(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc,
|
||||||
|
const Source &typeCreation, const QString &drawName, const quint32 &idTool,
|
||||||
|
QObject *qoParent)
|
||||||
|
:VAbstractNode(doc, data, id, idArc, drawName, idTool, qoParent)
|
||||||
|
{
|
||||||
|
ToolCreation(typeCreation);
|
||||||
|
}
|
71
src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.h
Normal file
71
src/libs/vtools/tools/nodeDetails/vnodeellipticalarc.h
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 20 12, 2016
|
||||||
|
**
|
||||||
|
** @brief
|
||||||
|
** @copyright
|
||||||
|
** This source code is part of the Valentine project, a pattern making
|
||||||
|
** program, whose allow create and modeling patterns of clothing.
|
||||||
|
** Copyright (C) 2016 Valentina project
|
||||||
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||||
|
**
|
||||||
|
** Valentina is free software: you can redistribute it and/or modify
|
||||||
|
** it under the terms of the GNU General Public License as published by
|
||||||
|
** the Free Software Foundation, either version 3 of the License, or
|
||||||
|
** (at your option) any later version.
|
||||||
|
**
|
||||||
|
** Valentina is distributed in the hope that it will be useful,
|
||||||
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
** GNU General Public License for more details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU General Public License
|
||||||
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
**
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#ifndef VNODEELLIPTICALARC_H
|
||||||
|
#define VNODEELLIPTICALARC_H
|
||||||
|
|
||||||
|
#include <qcompilerdetection.h>
|
||||||
|
#include <QGraphicsPathItem>
|
||||||
|
#include <QMetaObject>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QString>
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
|
#include "../ifc/xml/vabstractpattern.h"
|
||||||
|
#include "../vmisc/def.h"
|
||||||
|
#include "vabstractnode.h"
|
||||||
|
|
||||||
|
class VContainer;
|
||||||
|
|
||||||
|
class VNodeEllipticalArc :public VAbstractNode
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static void Create(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document &parse,
|
||||||
|
const Source &typeCreation, const QString &drawName = QString(),
|
||||||
|
const quint32 &idTool = NULL_ID);
|
||||||
|
|
||||||
|
static const QString ToolType;
|
||||||
|
virtual QString getTagName() const Q_DECL_OVERRIDE;
|
||||||
|
public slots:
|
||||||
|
virtual void FullUpdateFromFile() Q_DECL_OVERRIDE {}
|
||||||
|
virtual void AllowHover(bool enabled) Q_DECL_OVERRIDE;
|
||||||
|
virtual void AllowSelecting(bool enabled) Q_DECL_OVERRIDE;
|
||||||
|
protected:
|
||||||
|
virtual void AddToFile() Q_DECL_OVERRIDE;
|
||||||
|
virtual void RefreshDataInFile() Q_DECL_OVERRIDE;
|
||||||
|
virtual void ShowNode() Q_DECL_OVERRIDE {}
|
||||||
|
virtual void HideNode() Q_DECL_OVERRIDE {}
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(VNodeEllipticalArc)
|
||||||
|
|
||||||
|
VNodeEllipticalArc(VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Source &typeCreation,
|
||||||
|
const QString &drawName = QString(), const quint32 &idTool = 0, QObject *qoParent = nullptr);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // VNODEELLIPTICALARC_H
|
|
@ -1,117 +1,119 @@
|
||||||
# ADD TO EACH PATH $$PWD VARIABLE!!!!!!
|
# ADD TO EACH PATH $$PWD VARIABLE!!!!!!
|
||||||
# This need for corect working file translations.pro
|
# This need for corect working file translations.pro
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/vtooldetail.h \
|
$$PWD/vtooldetail.h \
|
||||||
$$PWD/vdatatool.h \
|
$$PWD/vdatatool.h \
|
||||||
$$PWD/vabstracttool.h \
|
$$PWD/vabstracttool.h \
|
||||||
$$PWD/tools.h \
|
$$PWD/tools.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h \
|
||||||
$$PWD/drawTools/toolcurve/vtoolsplinepath.h \
|
$$PWD/drawTools/toolcurve/vtoolsplinepath.h \
|
||||||
$$PWD/drawTools/toolcurve/vtoolspline.h \
|
$$PWD/drawTools/toolcurve/vtoolspline.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h \
|
||||||
$$PWD/drawTools/vtoolline.h \
|
$$PWD/drawTools/vtoolline.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h \
|
||||||
$$PWD/drawTools/toolcurve/vtoolarc.h \
|
$$PWD/drawTools/toolcurve/vtoolarc.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h \
|
||||||
$$PWD/drawTools/vdrawtool.h \
|
$$PWD/drawTools/vdrawtool.h \
|
||||||
$$PWD/drawTools/drawtools.h \
|
$$PWD/drawTools/drawtools.h \
|
||||||
$$PWD/nodeDetails/vnodesplinepath.h \
|
$$PWD/nodeDetails/vnodesplinepath.h \
|
||||||
$$PWD/nodeDetails/vnodespline.h \
|
$$PWD/nodeDetails/vnodespline.h \
|
||||||
$$PWD/nodeDetails/vnodepoint.h \
|
$$PWD/nodeDetails/vnodepoint.h \
|
||||||
$$PWD/nodeDetails/vnodearc.h \
|
$$PWD/nodeDetails/vnodearc.h \
|
||||||
$$PWD/nodeDetails/vabstractnode.h \
|
$$PWD/nodeDetails/vabstractnode.h \
|
||||||
$$PWD/nodeDetails/nodedetails.h \
|
$$PWD/nodeDetails/nodedetails.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h \
|
||||||
$$PWD/vtooluniondetails.h \
|
$$PWD/vtooluniondetails.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h \
|
||||||
$$PWD/drawTools/toolcurve/vabstractspline.h \
|
$$PWD/drawTools/toolcurve/vabstractspline.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h \
|
||||||
$$PWD/drawTools/toolcurve/vtoolarcwithlength.h \
|
$$PWD/drawTools/toolcurve/vtoolarcwithlength.h \
|
||||||
$$PWD/drawTools/toolpoint/vabstractpoint.h \
|
$$PWD/drawTools/toolpoint/vabstractpoint.h \
|
||||||
$$PWD/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h \
|
$$PWD/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h \
|
||||||
$$PWD/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h \
|
$$PWD/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h \
|
||||||
$$PWD/drawTools/toolcurve/vtoolcubicbezier.h \
|
$$PWD/drawTools/toolcurve/vtoolcubicbezier.h \
|
||||||
$$PWD/drawTools/toolcurve/vtoolcubicbezierpath.h \
|
$$PWD/drawTools/toolcurve/vtoolcubicbezierpath.h \
|
||||||
$$PWD/drawTools/operation/vtoolrotation.h \
|
$$PWD/drawTools/operation/vtoolrotation.h \
|
||||||
$$PWD/vtextgraphicsitem.h \
|
$$PWD/vtextgraphicsitem.h \
|
||||||
$$PWD/vgrainlineitem.h \
|
$$PWD/vgrainlineitem.h \
|
||||||
$$PWD/drawTools/operation/flipping/vtoolflippingbyline.h \
|
$$PWD/drawTools/operation/flipping/vtoolflippingbyline.h \
|
||||||
$$PWD/drawTools/operation/vabstractoperation.h \
|
$$PWD/drawTools/operation/vabstractoperation.h \
|
||||||
$$PWD/drawTools/operation/flipping/vtoolflippingbyaxis.h \
|
$$PWD/drawTools/operation/flipping/vtoolflippingbyaxis.h \
|
||||||
$$PWD/drawTools/operation/flipping/vabstractflipping.h \
|
$$PWD/drawTools/operation/flipping/vabstractflipping.h \
|
||||||
$$PWD/drawTools/operation/vtoolmove.h \
|
$$PWD/drawTools/operation/vtoolmove.h \
|
||||||
$$PWD/drawTools/toolcurve/vtoolellipticalarc.h
|
$$PWD/drawTools/toolcurve/vtoolellipticalarc.h \
|
||||||
|
$$PWD/nodeDetails/vnodeellipticalarc.h
|
||||||
SOURCES += \
|
|
||||||
$$PWD/vtooldetail.cpp \
|
SOURCES += \
|
||||||
$$PWD/vdatatool.cpp \
|
$$PWD/vtooldetail.cpp \
|
||||||
$$PWD/vabstracttool.cpp \
|
$$PWD/vdatatool.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp \
|
$$PWD/vabstracttool.cpp \
|
||||||
$$PWD/drawTools/toolcurve/vtoolsplinepath.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp \
|
||||||
$$PWD/drawTools/toolcurve/vtoolspline.cpp \
|
$$PWD/drawTools/toolcurve/vtoolsplinepath.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp \
|
$$PWD/drawTools/toolcurve/vtoolspline.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp \
|
||||||
$$PWD/drawTools/vtoolline.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp \
|
$$PWD/drawTools/vtoolline.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp \
|
||||||
$$PWD/drawTools/toolcurve/vtoolarc.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp \
|
$$PWD/drawTools/toolcurve/vtoolarc.cpp \
|
||||||
$$PWD/drawTools/vdrawtool.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp \
|
||||||
$$PWD/nodeDetails/vnodesplinepath.cpp \
|
$$PWD/drawTools/vdrawtool.cpp \
|
||||||
$$PWD/nodeDetails/vnodespline.cpp \
|
$$PWD/nodeDetails/vnodesplinepath.cpp \
|
||||||
$$PWD/nodeDetails/vnodepoint.cpp \
|
$$PWD/nodeDetails/vnodespline.cpp \
|
||||||
$$PWD/nodeDetails/vnodearc.cpp \
|
$$PWD/nodeDetails/vnodepoint.cpp \
|
||||||
$$PWD/nodeDetails/vabstractnode.cpp \
|
$$PWD/nodeDetails/vnodearc.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp \
|
$$PWD/nodeDetails/vabstractnode.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp \
|
||||||
$$PWD/vtooluniondetails.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp \
|
$$PWD/vtooluniondetails.cpp \
|
||||||
$$PWD/drawTools/toolcurve/vabstractspline.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp \
|
$$PWD/drawTools/toolcurve/vabstractspline.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp \
|
||||||
$$PWD/drawTools/toolcurve/vtoolarcwithlength.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp \
|
||||||
$$PWD/drawTools/toolpoint/vabstractpoint.cpp \
|
$$PWD/drawTools/toolcurve/vtoolarcwithlength.cpp \
|
||||||
$$PWD/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp \
|
$$PWD/drawTools/toolpoint/vabstractpoint.cpp \
|
||||||
$$PWD/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp \
|
$$PWD/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp \
|
||||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp \
|
$$PWD/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp \
|
||||||
$$PWD/drawTools/toolcurve/vtoolcubicbezier.cpp \
|
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp \
|
||||||
$$PWD/drawTools/toolcurve/vtoolcubicbezierpath.cpp \
|
$$PWD/drawTools/toolcurve/vtoolcubicbezier.cpp \
|
||||||
$$PWD/drawTools/operation/vtoolrotation.cpp \
|
$$PWD/drawTools/toolcurve/vtoolcubicbezierpath.cpp \
|
||||||
$$PWD/vtextgraphicsitem.cpp \
|
$$PWD/drawTools/operation/vtoolrotation.cpp \
|
||||||
$$PWD/vgrainlineitem.cpp \
|
$$PWD/vtextgraphicsitem.cpp \
|
||||||
$$PWD/drawTools/operation/flipping/vtoolflippingbyline.cpp \
|
$$PWD/vgrainlineitem.cpp \
|
||||||
$$PWD/drawTools/operation/vabstractoperation.cpp \
|
$$PWD/drawTools/operation/flipping/vtoolflippingbyline.cpp \
|
||||||
$$PWD/drawTools/operation/flipping/vtoolflippingbyaxis.cpp \
|
$$PWD/drawTools/operation/vabstractoperation.cpp \
|
||||||
$$PWD/drawTools/operation/flipping/vabstractflipping.cpp \
|
$$PWD/drawTools/operation/flipping/vtoolflippingbyaxis.cpp \
|
||||||
$$PWD/drawTools/operation/vtoolmove.cpp \
|
$$PWD/drawTools/operation/flipping/vabstractflipping.cpp \
|
||||||
$$PWD/drawTools/toolcurve/vtoolellipticalarc.cpp
|
$$PWD/drawTools/operation/vtoolmove.cpp \
|
||||||
|
$$PWD/drawTools/toolcurve/vtoolellipticalarc.cpp \
|
||||||
|
$$PWD/nodeDetails/vnodeellipticalarc.cpp
|
||||||
|
|
|
@ -78,6 +78,7 @@
|
||||||
#include "../undocommands/savedetailoptions.h"
|
#include "../undocommands/savedetailoptions.h"
|
||||||
#include "../undocommands/toggledetailinlayout.h"
|
#include "../undocommands/toggledetailinlayout.h"
|
||||||
#include "../vgeometry/varc.h"
|
#include "../vgeometry/varc.h"
|
||||||
|
#include "../vgeometry/vellipticalarc.h"
|
||||||
#include "../vgeometry/vcubicbezier.h"
|
#include "../vgeometry/vcubicbezier.h"
|
||||||
#include "../vgeometry/vcubicbezierpath.h"
|
#include "../vgeometry/vcubicbezierpath.h"
|
||||||
#include "../vgeometry/vgeometrydef.h"
|
#include "../vgeometry/vgeometrydef.h"
|
||||||
|
@ -99,6 +100,7 @@
|
||||||
#include "vabstracttool.h"
|
#include "vabstracttool.h"
|
||||||
#include "nodeDetails/vabstractnode.h"
|
#include "nodeDetails/vabstractnode.h"
|
||||||
#include "nodeDetails/vnodearc.h"
|
#include "nodeDetails/vnodearc.h"
|
||||||
|
#include "nodeDetails/vnodeellipticalarc.h"
|
||||||
#include "nodeDetails/vnodepoint.h"
|
#include "nodeDetails/vnodepoint.h"
|
||||||
#include "nodeDetails/vnodespline.h"
|
#include "nodeDetails/vnodespline.h"
|
||||||
#include "nodeDetails/vnodesplinepath.h"
|
#include "nodeDetails/vnodesplinepath.h"
|
||||||
|
@ -130,6 +132,7 @@ const QString VToolDetail::NodeTypeContour = QStringLiteral("Contour");
|
||||||
const QString VToolDetail::NodeTypeModeling = QStringLiteral("Modeling");
|
const QString VToolDetail::NodeTypeModeling = QStringLiteral("Modeling");
|
||||||
|
|
||||||
const QString VToolDetail::NodeArc = QStringLiteral("NodeArc");
|
const QString VToolDetail::NodeArc = QStringLiteral("NodeArc");
|
||||||
|
const QString VToolDetail::NodeElArc = QStringLiteral("NodeElArc");
|
||||||
const QString VToolDetail::NodePoint = QStringLiteral("NodePoint");
|
const QString VToolDetail::NodePoint = QStringLiteral("NodePoint");
|
||||||
const QString VToolDetail::NodeSpline = QStringLiteral("NodeSpline");
|
const QString VToolDetail::NodeSpline = QStringLiteral("NodeSpline");
|
||||||
const QString VToolDetail::NodeSplinePath = QStringLiteral("NodeSplinePath");
|
const QString VToolDetail::NodeSplinePath = QStringLiteral("NodeSplinePath");
|
||||||
|
@ -162,11 +165,8 @@ VToolDetail::VToolDetail(VAbstractPattern *doc, VContainer *data, const quint32
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
doc->IncrementReferens(detail.at(i).getId());
|
case (Tool::NodeElArc):
|
||||||
break;
|
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
doc->IncrementReferens(detail.at(i).getId());
|
|
||||||
break;
|
|
||||||
case (Tool::NodeSplinePath):
|
case (Tool::NodeSplinePath):
|
||||||
doc->IncrementReferens(detail.at(i).getId());
|
doc->IncrementReferens(detail.at(i).getId());
|
||||||
break;
|
break;
|
||||||
|
@ -275,6 +275,12 @@ void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstrac
|
||||||
VNodeArc::Create(doc, data, id, nodeD.getId(), Document::FullParse, Source::FromGui);
|
VNodeArc::Create(doc, data, id, nodeD.getId(), Document::FullParse, Source::FromGui);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case (Tool::NodeElArc):
|
||||||
|
{
|
||||||
|
id = CreateNode<VEllipticalArc>(data, nodeD.getId());
|
||||||
|
VNodeEllipticalArc::Create(doc, data, id, nodeD.getId(), Document::FullParse, Source::FromGui);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
{
|
{
|
||||||
const auto obj = data->GetGObject(nodeD.getId());
|
const auto obj = data->GetGObject(nodeD.getId());
|
||||||
|
@ -1155,6 +1161,9 @@ void VToolDetail::AddNode(VAbstractPattern *doc, QDomElement &domElement, const
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
doc->SetAttribute(nod, AttrType, NodeArc);
|
doc->SetAttribute(nod, AttrType, NodeArc);
|
||||||
break;
|
break;
|
||||||
|
case (Tool::NodeElArc):
|
||||||
|
doc->SetAttribute(nod, AttrType, NodeElArc);
|
||||||
|
break;
|
||||||
case (Tool::NodePoint):
|
case (Tool::NodePoint):
|
||||||
doc->SetAttribute(nod, AttrType, NodePoint);
|
doc->SetAttribute(nod, AttrType, NodePoint);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -83,6 +83,7 @@ public:
|
||||||
static const QString NodeTypeContour;
|
static const QString NodeTypeContour;
|
||||||
static const QString NodeTypeModeling;
|
static const QString NodeTypeModeling;
|
||||||
static const QString NodeArc;
|
static const QString NodeArc;
|
||||||
|
static const QString NodeElArc;
|
||||||
static const QString NodePoint;
|
static const QString NodePoint;
|
||||||
static const QString NodeSpline;
|
static const QString NodeSpline;
|
||||||
static const QString NodeSplinePath;
|
static const QString NodeSplinePath;
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include "../ifc/xml/vdomdocument.h"
|
#include "../ifc/xml/vdomdocument.h"
|
||||||
#include "../ifc/xml/vpatternconverter.h"
|
#include "../ifc/xml/vpatternconverter.h"
|
||||||
#include "../vgeometry/varc.h"
|
#include "../vgeometry/varc.h"
|
||||||
|
#include "../vgeometry/vellipticalarc.h"
|
||||||
#include "../vgeometry/vsplinepath.h"
|
#include "../vgeometry/vsplinepath.h"
|
||||||
#include "../vgeometry/vabstractcubicbezier.h"
|
#include "../vgeometry/vabstractcubicbezier.h"
|
||||||
#include "../vgeometry/vabstractcubicbezierpath.h"
|
#include "../vgeometry/vabstractcubicbezierpath.h"
|
||||||
|
@ -59,6 +60,7 @@
|
||||||
#include "../vpatterndb/vcontainer.h"
|
#include "../vpatterndb/vcontainer.h"
|
||||||
#include "../dialogs/tools/dialogtool.h"
|
#include "../dialogs/tools/dialogtool.h"
|
||||||
#include "nodeDetails/vnodearc.h"
|
#include "nodeDetails/vnodearc.h"
|
||||||
|
#include "nodeDetails/vnodeellipticalarc.h"
|
||||||
#include "nodeDetails/vnodepoint.h"
|
#include "nodeDetails/vnodepoint.h"
|
||||||
#include "nodeDetails/vnodespline.h"
|
#include "nodeDetails/vnodespline.h"
|
||||||
#include "nodeDetails/vnodesplinepath.h"
|
#include "nodeDetails/vnodesplinepath.h"
|
||||||
|
@ -188,6 +190,42 @@ void VToolUnionDetails::AddToNewDetail(VMainGraphicsScene *scene, VAbstractPatte
|
||||||
VNodeArc::Create(doc, data, id, idObject, Document::FullParse, Source::FromGui, drawName, idTool);
|
VNodeArc::Create(doc, data, id, idObject, Document::FullParse, Source::FromGui, drawName, idTool);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case (Tool::NodeElArc):
|
||||||
|
{
|
||||||
|
const QSharedPointer<VEllipticalArc> arc = data->GeometricObject<VEllipticalArc>(det.at(i).getId());
|
||||||
|
VPointF p1 = VPointF(arc->GetP1(), "A", 0, 0);
|
||||||
|
VPointF p2 = VPointF(arc->GetP2(), "A", 0, 0);
|
||||||
|
VPointF *center = new VPointF(arc->GetCenter());
|
||||||
|
|
||||||
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
|
{
|
||||||
|
const QPointF p = *data->GeometricObject<VPointF>(pRotate);
|
||||||
|
|
||||||
|
BiasRotatePoint(&p1, dx, dy, p, angle);
|
||||||
|
BiasRotatePoint(&p2, dx, dy, p, angle);
|
||||||
|
BiasRotatePoint(center, dx, dy, p, angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineF l1(*center, p1);
|
||||||
|
QLineF l2(*center, p2);
|
||||||
|
center->setMode(Draw::Modeling);
|
||||||
|
quint32 idCenter = data->AddGObject(center);
|
||||||
|
Q_UNUSED(idCenter);
|
||||||
|
VEllipticalArc *arc1 = new VEllipticalArc (*center, arc->GetRadius1(), arc->GetRadius2(),
|
||||||
|
arc->GetFormulaRadius1(), arc->GetFormulaRadius2(),
|
||||||
|
l1.angle(), QString().setNum(l1.angle()), l2.angle(),
|
||||||
|
QString().setNum(l2.angle()), 0, "0");
|
||||||
|
arc1->setMode(Draw::Modeling);
|
||||||
|
idObject = data->AddGObject(arc1);
|
||||||
|
children.append(idObject);
|
||||||
|
|
||||||
|
VEllipticalArc *arc2 = new VEllipticalArc(*arc1);
|
||||||
|
arc2->setMode(Draw::Modeling);
|
||||||
|
id = data->AddGObject(arc2);
|
||||||
|
|
||||||
|
VNodeEllipticalArc::Create(doc, data, id, idObject, Document::FullParse, Source::FromGui, drawName, idTool);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
{
|
{
|
||||||
const QSharedPointer<VAbstractCubicBezier> spline =
|
const QSharedPointer<VAbstractCubicBezier> spline =
|
||||||
|
@ -344,6 +382,34 @@ void VToolUnionDetails::UpdatePoints(VContainer *data, const VDetail &det, const
|
||||||
delete center;
|
delete center;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case (Tool::NodeElArc):
|
||||||
|
{
|
||||||
|
const QSharedPointer<VEllipticalArc> arc = data->GeometricObject<VEllipticalArc>(det.at(i).getId());
|
||||||
|
VPointF p1 = VPointF(arc->GetP1());
|
||||||
|
VPointF p2 = VPointF(arc->GetP2());
|
||||||
|
VPointF *center = new VPointF(arc->GetCenter());
|
||||||
|
|
||||||
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
|
{
|
||||||
|
const QPointF p = *data->GeometricObject<VPointF>(pRotate);
|
||||||
|
|
||||||
|
BiasRotatePoint(&p1, dx, dy, p, angle);
|
||||||
|
BiasRotatePoint(&p2, dx, dy, p, angle);
|
||||||
|
BiasRotatePoint(center, dx, dy, p, angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineF l1(*center, p1);
|
||||||
|
QLineF l2(*center, p2);
|
||||||
|
|
||||||
|
VEllipticalArc *arc1 = new VEllipticalArc (*center, arc->GetRadius1(), arc->GetRadius2(),
|
||||||
|
arc->GetFormulaRadius1(), arc->GetFormulaRadius2(),
|
||||||
|
l1.angle(), QString().setNum(l1.angle()), l2.angle(),
|
||||||
|
QString().setNum(l2.angle()), 0, "0");
|
||||||
|
arc1->setMode(Draw::Modeling);
|
||||||
|
data->UpdateGObject(TakeNextId(children), arc1);
|
||||||
|
delete center;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
{
|
{
|
||||||
const QSharedPointer<VAbstractCubicBezier> spline =
|
const QSharedPointer<VAbstractCubicBezier> spline =
|
||||||
|
@ -803,19 +869,23 @@ QVector<VDetail> VToolUnionDetails::GetDetailFromFile(VAbstractPattern *doc, con
|
||||||
Tool tool = Tool::NodePoint;
|
Tool tool = Tool::NodePoint;
|
||||||
NodeDetail nodeType = NodeDetail::Contour;
|
NodeDetail nodeType = NodeDetail::Contour;
|
||||||
QString t = doc->GetParametrString(element, "type", "NodePoint");
|
QString t = doc->GetParametrString(element, "type", "NodePoint");
|
||||||
if (t == "NodePoint")
|
if (t == QLatin1String("NodePoint"))
|
||||||
{
|
{
|
||||||
tool = Tool::NodePoint;
|
tool = Tool::NodePoint;
|
||||||
}
|
}
|
||||||
else if (t == "NodeArc")
|
else if (t == QLatin1String("NodeArc"))
|
||||||
{
|
{
|
||||||
tool = Tool::NodeArc;
|
tool = Tool::NodeArc;
|
||||||
}
|
}
|
||||||
else if (t == "NodeSpline")
|
else if (t == QLatin1String("NodeElArc"))
|
||||||
|
{
|
||||||
|
tool = Tool::NodeElArc;
|
||||||
|
}
|
||||||
|
else if (t == QLatin1String("NodeSpline"))
|
||||||
{
|
{
|
||||||
tool = Tool::NodeSpline;
|
tool = Tool::NodeSpline;
|
||||||
}
|
}
|
||||||
else if (t == "NodeSplinePath")
|
else if (t == QLatin1String("NodeSplinePath"))
|
||||||
{
|
{
|
||||||
tool = Tool::NodeSplinePath;
|
tool = Tool::NodeSplinePath;
|
||||||
}
|
}
|
||||||
|
@ -962,6 +1032,7 @@ void VToolUnionDetails::IncrementReferences(const VDetail &d) const
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
|
case (Tool::NodeElArc):
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
case (Tool::NodeSplinePath):
|
case (Tool::NodeSplinePath):
|
||||||
doc->IncrementReferens(d.at(i).getId());
|
doc->IncrementReferens(d.at(i).getId());
|
||||||
|
@ -987,6 +1058,7 @@ void VToolUnionDetails::DecrementReferences(const VDetail &d) const
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
|
case (Tool::NodeElArc):
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
case (Tool::NodeSplinePath):
|
case (Tool::NodeSplinePath):
|
||||||
doc->DecrementReferens(d.at(i).getId());
|
doc->DecrementReferens(d.at(i).getId());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user