Class LitePattern for getting a list of measurements from a pattern file.
--HG-- branch : feature
This commit is contained in:
parent
aec99643b3
commit
90455b8910
|
@ -11,7 +11,8 @@ SOURCES += \
|
||||||
$$PWD/dialogs/dialogmdatabase.cpp \
|
$$PWD/dialogs/dialogmdatabase.cpp \
|
||||||
$$PWD/dialogs/tapeconfigdialog.cpp \
|
$$PWD/dialogs/tapeconfigdialog.cpp \
|
||||||
$$PWD/dialogs/configpages/tapeconfigurationpage.cpp \
|
$$PWD/dialogs/configpages/tapeconfigurationpage.cpp \
|
||||||
$$PWD/dialogs/configpages/tapepathpage.cpp
|
$$PWD/dialogs/configpages/tapepathpage.cpp \
|
||||||
|
$$PWD/vlitepattern.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/tmainwindow.h \
|
$$PWD/tmainwindow.h \
|
||||||
|
@ -23,7 +24,8 @@ HEADERS += \
|
||||||
$$PWD/version.h \
|
$$PWD/version.h \
|
||||||
$$PWD/dialogs/tapeconfigdialog.h \
|
$$PWD/dialogs/tapeconfigdialog.h \
|
||||||
$$PWD/dialogs/configpages/tapeconfigurationpage.h \
|
$$PWD/dialogs/configpages/tapeconfigurationpage.h \
|
||||||
$$PWD/dialogs/configpages/tapepathpage.h
|
$$PWD/dialogs/configpages/tapepathpage.h \
|
||||||
|
$$PWD/vlitepattern.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
$$PWD/tmainwindow.ui \
|
$$PWD/tmainwindow.ui \
|
||||||
|
|
|
@ -145,7 +145,7 @@ CONFIG(debug, debug|release){
|
||||||
win32:RC_FILE = share/resources/tape.rc
|
win32:RC_FILE = share/resources/tape.rc
|
||||||
|
|
||||||
# When the GNU linker sees a library, it discards all symbols that it doesn't need.
|
# When the GNU linker sees a library, it discards all symbols that it doesn't need.
|
||||||
# Add dependent library the first.
|
# Dependent library go first.
|
||||||
|
|
||||||
#VTools static library (depend on VWidgets, VMisc, VPatternDB)
|
#VTools static library (depend on VWidgets, VMisc, VPatternDB)
|
||||||
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vtools/$${DESTDIR}/ -lvtools
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vtools/$${DESTDIR}/ -lvtools
|
||||||
|
@ -202,7 +202,7 @@ DEPENDPATH += $$PWD/../../libs/vgeometry
|
||||||
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/vgeometry.lib
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/vgeometry.lib
|
||||||
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/libvgeometry.a
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/libvgeometry.a
|
||||||
|
|
||||||
# IFC static library
|
# IFC static library (depend on QMuParser)
|
||||||
unix|win32: LIBS += -L$$OUT_PWD/../../libs/ifc/$${DESTDIR}/ -lifc
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/ifc/$${DESTDIR}/ -lifc
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../../libs/ifc
|
INCLUDEPATH += $$PWD/../../libs/ifc
|
||||||
|
|
74
src/app/tape/vlitepattern.cpp
Normal file
74
src/app/tape/vlitepattern.cpp
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file vlitepattern.cpp
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 9 8, 2015
|
||||||
|
**
|
||||||
|
** @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) 2015 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 "vlitepattern.h"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VLitePattern::VLitePattern(QObject *parent)
|
||||||
|
: VAbstractPattern(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VLitePattern::CreateEmptyFile(const QString &tablePath)
|
||||||
|
{
|
||||||
|
Q_UNUSED(tablePath)
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VLitePattern::IncrementReferens(quint32 id) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VLitePattern::DecrementReferens(quint32 id) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QString VLitePattern::GenerateLabel(const LabelType &type, const QString &reservedName) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(type)
|
||||||
|
Q_UNUSED(reservedName)
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VLitePattern::UpdateToolData(const quint32 &id, VContainer *data)
|
||||||
|
{
|
||||||
|
Q_UNUSED(id)
|
||||||
|
Q_UNUSED(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VLitePattern::LiteParseTree(const Document &parse)
|
||||||
|
{
|
||||||
|
Q_UNUSED(parse)
|
||||||
|
}
|
|
@ -1,14 +1,14 @@
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
**
|
**
|
||||||
** @file vgeometrydef.cpp
|
** @file vlitepattern.h
|
||||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
** @date 7 5, 2015
|
** @date 9 8, 2015
|
||||||
**
|
**
|
||||||
** @brief
|
** @brief
|
||||||
** @copyright
|
** @copyright
|
||||||
** This source code is part of the Valentine project, a pattern making
|
** This source code is part of the Valentine project, a pattern making
|
||||||
** program, whose allow create and modeling patterns of clothing.
|
** program, whose allow create and modeling patterns of clothing.
|
||||||
** Copyright (C) 2013-2015 Valentina project
|
** Copyright (C) 2015 Valentina project
|
||||||
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||||
**
|
**
|
||||||
** Valentina is free software: you can redistribute it and/or modify
|
** Valentina is free software: you can redistribute it and/or modify
|
||||||
|
@ -26,19 +26,31 @@
|
||||||
**
|
**
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "vgeometrydef.h"
|
#ifndef VLITEPATTERN_H
|
||||||
|
#define VLITEPATTERN_H
|
||||||
|
|
||||||
//variables
|
#include "../ifc/xml/vabstractpattern.h"
|
||||||
const QString spl_ = QStringLiteral("Spl_");
|
|
||||||
const QString arc_ = QStringLiteral("Arc_");
|
class VLitePattern : public VAbstractPattern
|
||||||
const QString splPath = QStringLiteral("SplPath");
|
{
|
||||||
const QString radius_V = QStringLiteral("Radius");
|
Q_OBJECT
|
||||||
const QString radiusArc_ = radius_V + arc_;
|
public:
|
||||||
const QString angle1_V = QStringLiteral("Angle1");
|
VLitePattern(QObject *parent = nullptr);
|
||||||
const QString angle2_V = QStringLiteral("Angle2");
|
|
||||||
const QString angle1Arc_ = angle1_V + arc_;
|
virtual void CreateEmptyFile(const QString &tablePath) Q_DECL_OVERRIDE;
|
||||||
const QString angle2Arc_ = angle2_V + arc_;
|
|
||||||
const QString angle1Spl_ = angle1_V + spl_;
|
virtual void IncrementReferens(quint32 id) const Q_DECL_OVERRIDE;
|
||||||
const QString angle2Spl_ = angle2_V + spl_;
|
virtual void DecrementReferens(quint32 id) const Q_DECL_OVERRIDE;
|
||||||
const QString angle1SplPath = angle1_V + splPath;
|
|
||||||
const QString angle2SplPath = angle2_V + splPath;
|
virtual QString GenerateLabel(const LabelType &type, const QString &reservedName = QString())const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
virtual void UpdateToolData(const quint32 &id, VContainer *data) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
virtual void LiteParseTree(const Document &parse) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(VLitePattern)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // VLITEPATTERN_H
|
File diff suppressed because it is too large
Load Diff
|
@ -220,20 +220,20 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
case Tool::EndLine:
|
case Tool::EndLine:
|
||||||
{
|
{
|
||||||
return QString(tr("%1_%2 - Line from point %1 to point %2"))
|
return QString(tr("%1_%2 - Line from point %1 to point %2"))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrBasePoint)))
|
.arg(PointName(AttrUInt(domElem, AttrBasePoint)))
|
||||||
.arg(PointName(tool.getId()));
|
.arg(PointName(tool.getId()));
|
||||||
}
|
}
|
||||||
case Tool::Line:
|
case Tool::Line:
|
||||||
{
|
{
|
||||||
return QString(tr("%1_%2 - Line from point %1 to point %2"))
|
return QString(tr("%1_%2 - Line from point %1 to point %2"))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrFirstPoint)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint)));
|
.arg(PointName(AttrUInt(domElem, AttrSecondPoint)));
|
||||||
}
|
}
|
||||||
case Tool::AlongLine:
|
case Tool::AlongLine:
|
||||||
{
|
{
|
||||||
return QString(tr("%3 - Point along line %1_%2"))
|
return QString(tr("%3 - Point along line %1_%2"))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrFirstPoint)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrSecondPoint)))
|
||||||
.arg(PointName(tool.getId()));
|
.arg(PointName(tool.getId()));
|
||||||
}
|
}
|
||||||
case Tool::ShoulderPoint:
|
case Tool::ShoulderPoint:
|
||||||
|
@ -243,25 +243,25 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
case Tool::Normal:
|
case Tool::Normal:
|
||||||
{
|
{
|
||||||
return QString(tr("%3 - normal to line %1_%2"))
|
return QString(tr("%3 - normal to line %1_%2"))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrFirstPoint)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrSecondPoint)))
|
||||||
.arg(PointName(tool.getId()));
|
.arg(PointName(tool.getId()));
|
||||||
}
|
}
|
||||||
case Tool::Bisector:
|
case Tool::Bisector:
|
||||||
{
|
{
|
||||||
return QString(tr("%4 - bisector of angle %1_%2_%3"))
|
return QString(tr("%4 - bisector of angle %1_%2_%3"))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrFirstPoint)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrSecondPoint)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrThirdPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrThirdPoint)))
|
||||||
.arg(PointName(tool.getId()));
|
.arg(PointName(tool.getId()));
|
||||||
}
|
}
|
||||||
case Tool::LineIntersect:
|
case Tool::LineIntersect:
|
||||||
{
|
{
|
||||||
return QString(tr("%5 - intersection of lines %1_%2 and %3_%4"))
|
return QString(tr("%5 - intersection of lines %1_%2 and %3_%4"))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP1Line1)))
|
.arg(PointName(AttrUInt(domElem, AttrP1Line1)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP2Line1)))
|
.arg(PointName(AttrUInt(domElem, AttrP2Line1)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP1Line2)))
|
.arg(PointName(AttrUInt(domElem, AttrP1Line2)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP2Line2)))
|
.arg(PointName(AttrUInt(domElem, AttrP2Line2)))
|
||||||
.arg(PointName(tool.getId()));
|
.arg(PointName(tool.getId()));
|
||||||
}
|
}
|
||||||
case Tool::Spline:
|
case Tool::Spline:
|
||||||
|
@ -308,36 +308,36 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
case Tool::PointOfContact:
|
case Tool::PointOfContact:
|
||||||
{
|
{
|
||||||
return QString(tr("%4 - point of contact of arc with the center in point %1 and line %2_%3"))
|
return QString(tr("%4 - point of contact of arc with the center in point %1 and line %2_%3"))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrCenter)))
|
.arg(PointName(AttrUInt(domElem, AttrCenter)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrFirstPoint)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrSecondPoint)))
|
||||||
.arg(PointName(tool.getId()));
|
.arg(PointName(tool.getId()));
|
||||||
}
|
}
|
||||||
case Tool::Height:
|
case Tool::Height:
|
||||||
{
|
{
|
||||||
return QString(tr("Point of perpendicular from point %1 to line %2_%3"))
|
return QString(tr("Point of perpendicular from point %1 to line %2_%3"))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrBasePoint)))
|
.arg(PointName(AttrUInt(domElem, AttrBasePoint)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP1Line)))
|
.arg(PointName(AttrUInt(domElem, AttrP1Line)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP2Line)));
|
.arg(PointName(AttrUInt(domElem, AttrP2Line)));
|
||||||
}
|
}
|
||||||
case Tool::Triangle:
|
case Tool::Triangle:
|
||||||
{
|
{
|
||||||
return QString(tr("Triangle: axis %1_%2, points %3 and %4"))
|
return QString(tr("Triangle: axis %1_%2, points %3 and %4"))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrAxisP1)))
|
.arg(PointName(AttrUInt(domElem, AttrAxisP1)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrAxisP2)))
|
.arg(PointName(AttrUInt(domElem, AttrAxisP2)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrFirstPoint)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint)));
|
.arg(PointName(AttrUInt(domElem, AttrSecondPoint)));
|
||||||
}
|
}
|
||||||
case Tool::PointOfIntersection:
|
case Tool::PointOfIntersection:
|
||||||
{
|
{
|
||||||
return QString(tr("%1 - point of intersection %2 and %3"))
|
return QString(tr("%1 - point of intersection %2 and %3"))
|
||||||
.arg(PointName(tool.getId()))
|
.arg(PointName(tool.getId()))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrFirstPoint)))
|
.arg(PointName(AttrUInt(domElem, AttrFirstPoint)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrSecondPoint)));
|
.arg(PointName(AttrUInt(domElem, AttrSecondPoint)));
|
||||||
}
|
}
|
||||||
case Tool::CutArc:
|
case Tool::CutArc:
|
||||||
{
|
{
|
||||||
const QSharedPointer<VArc> arc = data->GeometricObject<VArc>(AttrUInt(domElem, VToolCutArc::AttrArc));
|
const QSharedPointer<VArc> arc = data->GeometricObject<VArc>(AttrUInt(domElem, AttrArc));
|
||||||
SCASSERT(arc != nullptr);
|
SCASSERT(arc != nullptr);
|
||||||
return QString(tr("%1 - cut arc with center %2"))
|
return QString(tr("%1 - cut arc with center %2"))
|
||||||
.arg(PointName(tool.getId()))
|
.arg(PointName(tool.getId()))
|
||||||
|
@ -381,15 +381,15 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
{
|
{
|
||||||
return QString(tr("%1 - point of intersection line %2_%3 and axis through point %4"))
|
return QString(tr("%1 - point of intersection line %2_%3 and axis through point %4"))
|
||||||
.arg(PointName(tool.getId()))
|
.arg(PointName(tool.getId()))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP1Line)))
|
.arg(PointName(AttrUInt(domElem, AttrP1Line)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrP2Line)))
|
.arg(PointName(AttrUInt(domElem, AttrP2Line)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrBasePoint)));
|
.arg(PointName(AttrUInt(domElem, AttrBasePoint)));
|
||||||
}
|
}
|
||||||
case Tool::CurveIntersectAxis:
|
case Tool::CurveIntersectAxis:
|
||||||
{
|
{
|
||||||
return QString(tr("%1 - point of intersection curve and axis through point %2"))
|
return QString(tr("%1 - point of intersection curve and axis through point %2"))
|
||||||
.arg(PointName(tool.getId()))
|
.arg(PointName(tool.getId()))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrBasePoint)));
|
.arg(PointName(AttrUInt(domElem, AttrBasePoint)));
|
||||||
}
|
}
|
||||||
case Tool::PointOfIntersectionArcs:
|
case Tool::PointOfIntersectionArcs:
|
||||||
{
|
{
|
||||||
|
@ -410,9 +410,9 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
case Tool::TrueDarts:
|
case Tool::TrueDarts:
|
||||||
{
|
{
|
||||||
return QString(tr("Correction the dart %1_%2_%3"))
|
return QString(tr("Correction the dart %1_%2_%3"))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrDartP1)))
|
.arg(PointName(AttrUInt(domElem, AttrDartP1)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrDartP2)))
|
.arg(PointName(AttrUInt(domElem, AttrDartP2)))
|
||||||
.arg(PointName(AttrUInt(domElem, VAbstractTool::AttrDartP2)));
|
.arg(PointName(AttrUInt(domElem, AttrDartP2)));
|
||||||
}
|
}
|
||||||
//Because "history" not only show history of pattern, but help restore current data for each pattern's
|
//Because "history" not only show history of pattern, but help restore current data for each pattern's
|
||||||
//piece, we need add record about details and nodes, but don't show them.
|
//piece, we need add record about details and nodes, but don't show them.
|
||||||
|
|
|
@ -1991,7 +1991,7 @@ for(DIR, INSTALL_STANDARD_MEASHUREMENTS) {
|
||||||
copyToDestdir($$st_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tables/standard))
|
copyToDestdir($$st_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tables/standard))
|
||||||
|
|
||||||
# When the GNU linker sees a library, it discards all symbols that it doesn't need.
|
# When the GNU linker sees a library, it discards all symbols that it doesn't need.
|
||||||
# Add dependent library the first.
|
# Dependent library go first.
|
||||||
|
|
||||||
#VTools static library (depend on VWidgets, VMisc, VPatternDB)
|
#VTools static library (depend on VWidgets, VMisc, VPatternDB)
|
||||||
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vtools/$${DESTDIR}/ -lvtools
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vtools/$${DESTDIR}/ -lvtools
|
||||||
|
@ -2021,15 +2021,6 @@ DEPENDPATH += $$PWD/../../libs/vpatterndb
|
||||||
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib
|
||||||
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a
|
||||||
|
|
||||||
#VMisc static library
|
|
||||||
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vmisc/$${DESTDIR}/ -lvmisc
|
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../../libs/vmisc
|
|
||||||
DEPENDPATH += $$PWD/../../libs/vmisc
|
|
||||||
|
|
||||||
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/vmisc.lib
|
|
||||||
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/libvmisc.a
|
|
||||||
|
|
||||||
# VGeometry static library (depend on ifc)
|
# VGeometry static library (depend on ifc)
|
||||||
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/ -lvgeometry
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/ -lvgeometry
|
||||||
|
|
||||||
|
@ -2039,7 +2030,7 @@ DEPENDPATH += $$PWD/../../libs/vgeometry
|
||||||
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/vgeometry.lib
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/vgeometry.lib
|
||||||
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/libvgeometry.a
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/libvgeometry.a
|
||||||
|
|
||||||
# IFC static library
|
# IFC static library (depend on QMuParser, VMisc)
|
||||||
unix|win32: LIBS += -L$$OUT_PWD/../../libs/ifc/$${DESTDIR}/ -lifc
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/ifc/$${DESTDIR}/ -lifc
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../../libs/ifc
|
INCLUDEPATH += $$PWD/../../libs/ifc
|
||||||
|
@ -2048,6 +2039,15 @@ DEPENDPATH += $$PWD/../../libs/ifc
|
||||||
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/ifc.lib
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/ifc.lib
|
||||||
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/libifc.a
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/libifc.a
|
||||||
|
|
||||||
|
#VMisc static library
|
||||||
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vmisc/$${DESTDIR}/ -lvmisc
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/../../libs/vmisc
|
||||||
|
DEPENDPATH += $$PWD/../../libs/vmisc
|
||||||
|
|
||||||
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/vmisc.lib
|
||||||
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/libvmisc.a
|
||||||
|
|
||||||
# VObj static library
|
# VObj static library
|
||||||
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vobj/$${DESTDIR}/ -lvobj
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vobj/$${DESTDIR}/ -lvobj
|
||||||
|
|
||||||
|
|
|
@ -532,9 +532,9 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document
|
||||||
{
|
{
|
||||||
VDetail detail;
|
VDetail detail;
|
||||||
const quint32 id = GetParametrId(domElement);
|
const quint32 id = GetParametrId(domElement);
|
||||||
detail.setName(GetParametrString(domElement, VAbstractTool::AttrName, ""));
|
detail.setName(GetParametrString(domElement, AttrName, ""));
|
||||||
detail.setMx(qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0")));
|
detail.setMx(qApp->toPixel(GetParametrDouble(domElement, AttrMx, "0.0")));
|
||||||
detail.setMy(qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "0.0")));
|
detail.setMy(qApp->toPixel(GetParametrDouble(domElement, AttrMy, "0.0")));
|
||||||
detail.setSeamAllowance(GetParametrUInt(domElement, VToolDetail::AttrSupplement, "1"));
|
detail.setSeamAllowance(GetParametrUInt(domElement, VToolDetail::AttrSupplement, "1"));
|
||||||
detail.setWidth(GetParametrDouble(domElement, VToolDetail::AttrWidth, "10.0"));
|
detail.setWidth(GetParametrDouble(domElement, VToolDetail::AttrWidth, "10.0"));
|
||||||
detail.setClosed(GetParametrUInt(domElement, VToolDetail::AttrClosed, "1"));
|
detail.setClosed(GetParametrUInt(domElement, VToolDetail::AttrClosed, "1"));
|
||||||
|
@ -551,8 +551,8 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document
|
||||||
if (element.tagName() == VToolDetail::TagNode)
|
if (element.tagName() == VToolDetail::TagNode)
|
||||||
{
|
{
|
||||||
const quint32 id = GetParametrUInt(element, VToolDetail::AttrIdObject, NULL_ID_STR);
|
const quint32 id = GetParametrUInt(element, VToolDetail::AttrIdObject, NULL_ID_STR);
|
||||||
const qreal mx = qApp->toPixel(GetParametrDouble(element, VAbstractTool::AttrMx, "0.0"));
|
const qreal mx = qApp->toPixel(GetParametrDouble(element, AttrMx, "0.0"));
|
||||||
const qreal my = qApp->toPixel(GetParametrDouble(element, VAbstractTool::AttrMy, "0.0"));
|
const qreal my = qApp->toPixel(GetParametrDouble(element, AttrMy, "0.0"));
|
||||||
const bool reverse = GetParametrUInt(element, VToolDetail::AttrReverse, "0");
|
const bool reverse = GetParametrUInt(element, VToolDetail::AttrReverse, "0");
|
||||||
const NodeDetail nodeType = NodeDetail::Contour;
|
const NodeDetail nodeType = NodeDetail::Contour;
|
||||||
|
|
||||||
|
@ -624,23 +624,23 @@ void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id
|
||||||
QString &typeLine, QString &lineColor)
|
QString &typeLine, QString &lineColor)
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, VAbstractTool::TypeLineLine);
|
typeLine = GetParametrString(domElement, AttrTypeLine, TypeLineLine);
|
||||||
lineColor = GetParametrString(domElement, VAbstractTool::AttrLineColor, VAbstractTool::ColorBlack);
|
lineColor = GetParametrString(domElement, AttrLineColor, ColorBlack);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, qreal &my)
|
void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, qreal &my)
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, mx, my);
|
PointsCommonAttributes(domElement, id, mx, my);
|
||||||
name = GetParametrString(domElement, VAbstractTool::AttrName, "A");
|
name = GetParametrString(domElement, AttrName, "A");
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id, qreal &mx, qreal &my)
|
void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id, qreal &mx, qreal &my)
|
||||||
{
|
{
|
||||||
ToolsCommonAttributes(domElement, id);
|
ToolsCommonAttributes(domElement, id);
|
||||||
mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0"));
|
mx = qApp->toPixel(GetParametrDouble(domElement, AttrMx, "10.0"));
|
||||||
my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0"));
|
my = qApp->toPixel(GetParametrDouble(domElement, AttrMy, "15.0"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -770,12 +770,12 @@ void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &do
|
||||||
{
|
{
|
||||||
quint32 id = 0;
|
quint32 id = 0;
|
||||||
ToolsCommonAttributes(domElement, id);
|
ToolsCommonAttributes(domElement, id);
|
||||||
const quint32 firstPoint = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR);
|
const quint32 firstPoint = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR);
|
||||||
const quint32 secondPoint = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR);
|
const quint32 secondPoint = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR);
|
||||||
const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine,
|
const QString typeLine = GetParametrString(domElement, AttrTypeLine,
|
||||||
VAbstractTool::TypeLineLine);
|
TypeLineLine);
|
||||||
const QString lineColor = GetParametrString(domElement, VAbstractTool::AttrLineColor,
|
const QString lineColor = GetParametrString(domElement, AttrLineColor,
|
||||||
VAbstractTool::ColorBlack);
|
ColorBlack);
|
||||||
|
|
||||||
VToolLine::Create(id, firstPoint, secondPoint, typeLine, lineColor, scene, this, data, parse, Source::FromFile);
|
VToolLine::Create(id, firstPoint, secondPoint, typeLine, lineColor, scene, this, data, parse, Source::FromFile);
|
||||||
}
|
}
|
||||||
|
@ -896,8 +896,8 @@ void VPattern::ParseToolBasePoint(VMainGraphicsScene *scene, const QDomElement &
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const qreal x = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrX, "10.0"));
|
const qreal x = qApp->toPixel(GetParametrDouble(domElement, AttrX, "10.0"));
|
||||||
const qreal y = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrY, "10.0"));
|
const qreal y = qApp->toPixel(GetParametrDouble(domElement, AttrY, "10.0"));
|
||||||
|
|
||||||
data->UpdateGObject(id, new VPointF(x, y, name, mx, my));
|
data->UpdateGObject(id, new VPointF(x, y, name, mx, my));
|
||||||
VDrawTool::AddRecord(id, Tool::BasePoint, this);
|
VDrawTool::AddRecord(id, Tool::BasePoint, this);
|
||||||
|
@ -943,12 +943,12 @@ void VPattern::ParseToolEndLine(VMainGraphicsScene *scene, QDomElement &domEleme
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
||||||
|
|
||||||
const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0");
|
const QString formula = GetParametrString(domElement, AttrLength, "100.0");
|
||||||
QString f = formula;//need for saving fixed formula;
|
QString f = formula;//need for saving fixed formula;
|
||||||
|
|
||||||
const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR);
|
const quint32 basePointId = GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR);
|
||||||
|
|
||||||
const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0");
|
const QString angle = GetParametrString(domElement, AttrAngle, "0.0");
|
||||||
QString angleFix = angle;
|
QString angleFix = angle;
|
||||||
|
|
||||||
VToolEndLine::Create(id, name, typeLine, lineColor, f, angleFix, basePointId, mx, my, scene, this, data,
|
VToolEndLine::Create(id, name, typeLine, lineColor, f, angleFix, basePointId, mx, my, scene, this, data,
|
||||||
|
@ -956,8 +956,8 @@ void VPattern::ParseToolEndLine(VMainGraphicsScene *scene, QDomElement &domEleme
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (f != formula || angleFix != angle)
|
if (f != formula || angleFix != angle)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrLength, f);
|
SetAttribute(domElement, AttrLength, f);
|
||||||
SetAttribute(domElement, VAbstractTool::AttrAngle, angleFix);
|
SetAttribute(domElement, AttrAngle, angleFix);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -991,17 +991,17 @@ void VPattern::ParseToolAlongLine(VMainGraphicsScene *scene, QDomElement &domEle
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
||||||
const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0");
|
const QString formula = GetParametrString(domElement, AttrLength, "100.0");
|
||||||
QString f = formula;//need for saving fixed formula;
|
QString f = formula;//need for saving fixed formula;
|
||||||
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR);
|
const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR);
|
||||||
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR);
|
const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR);
|
||||||
|
|
||||||
VToolAlongLine::Create(id, name, typeLine, lineColor, f, firstPointId, secondPointId, mx, my, scene,
|
VToolAlongLine::Create(id, name, typeLine, lineColor, f, firstPointId, secondPointId, mx, my, scene,
|
||||||
this, data, parse, Source::FromFile);
|
this, data, parse, Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (f != formula)
|
if (f != formula)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrLength, f);
|
SetAttribute(domElement, AttrLength, f);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1035,18 +1035,18 @@ void VPattern::ParseToolShoulderPoint(VMainGraphicsScene *scene, QDomElement &do
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
||||||
const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0");
|
const QString formula = GetParametrString(domElement, AttrLength, "100.0");
|
||||||
QString f = formula;//need for saving fixed formula;
|
QString f = formula;//need for saving fixed formula;
|
||||||
const quint32 p1Line = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, NULL_ID_STR);
|
const quint32 p1Line = GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR);
|
||||||
const quint32 p2Line = GetParametrUInt(domElement, VAbstractTool::AttrP2Line, NULL_ID_STR);
|
const quint32 p2Line = GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR);
|
||||||
const quint32 pShoulder = GetParametrUInt(domElement, VAbstractTool::AttrPShoulder, NULL_ID_STR);
|
const quint32 pShoulder = GetParametrUInt(domElement, AttrPShoulder, NULL_ID_STR);
|
||||||
|
|
||||||
VToolShoulderPoint::Create(id, f, p1Line, p2Line, pShoulder, typeLine, lineColor, name, mx, my, scene,
|
VToolShoulderPoint::Create(id, f, p1Line, p2Line, pShoulder, typeLine, lineColor, name, mx, my, scene,
|
||||||
this, data, parse, Source::FromFile);
|
this, data, parse, Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (f != formula)
|
if (f != formula)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrLength, f);
|
SetAttribute(domElement, AttrLength, f);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1080,18 +1080,18 @@ void VPattern::ParseToolNormal(VMainGraphicsScene *scene, QDomElement &domElemen
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
||||||
const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0");
|
const QString formula = GetParametrString(domElement, AttrLength, "100.0");
|
||||||
QString f = formula;//need for saving fixed formula;
|
QString f = formula;//need for saving fixed formula;
|
||||||
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR);
|
const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR);
|
||||||
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR);
|
const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR);
|
||||||
const qreal angle = GetParametrDouble(domElement, VAbstractTool::AttrAngle, "0.0");
|
const qreal angle = GetParametrDouble(domElement, AttrAngle, "0.0");
|
||||||
|
|
||||||
VToolNormal::Create(id, f, firstPointId, secondPointId, typeLine, lineColor, name, angle, mx, my, scene,
|
VToolNormal::Create(id, f, firstPointId, secondPointId, typeLine, lineColor, name, angle, mx, my, scene,
|
||||||
this, data, parse, Source::FromFile);
|
this, data, parse, Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (f != formula)
|
if (f != formula)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrLength, f);
|
SetAttribute(domElement, AttrLength, f);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1125,18 +1125,18 @@ void VPattern::ParseToolBisector(VMainGraphicsScene *scene, QDomElement &domElem
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
||||||
const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0");
|
const QString formula = GetParametrString(domElement, AttrLength, "100.0");
|
||||||
QString f = formula;//need for saving fixed formula;
|
QString f = formula;//need for saving fixed formula;
|
||||||
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR);
|
const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR);
|
||||||
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR);
|
const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR);
|
||||||
const quint32 thirdPointId = GetParametrUInt(domElement, VAbstractTool::AttrThirdPoint, NULL_ID_STR);
|
const quint32 thirdPointId = GetParametrUInt(domElement, AttrThirdPoint, NULL_ID_STR);
|
||||||
|
|
||||||
VToolBisector::Create(id, f, firstPointId, secondPointId, thirdPointId,
|
VToolBisector::Create(id, f, firstPointId, secondPointId, thirdPointId,
|
||||||
typeLine, lineColor, name, mx, my, scene, this, data, parse, Source::FromFile);
|
typeLine, lineColor, name, mx, my, scene, this, data, parse, Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (f != formula)
|
if (f != formula)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrLength, f);
|
SetAttribute(domElement, AttrLength, f);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1168,10 +1168,10 @@ void VPattern::ParseToolLineIntersect(VMainGraphicsScene *scene, const QDomEleme
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const quint32 p1Line1Id = GetParametrUInt(domElement, VAbstractTool::AttrP1Line1, NULL_ID_STR);
|
const quint32 p1Line1Id = GetParametrUInt(domElement, AttrP1Line1, NULL_ID_STR);
|
||||||
const quint32 p2Line1Id = GetParametrUInt(domElement, VAbstractTool::AttrP2Line1, NULL_ID_STR);
|
const quint32 p2Line1Id = GetParametrUInt(domElement, AttrP2Line1, NULL_ID_STR);
|
||||||
const quint32 p1Line2Id = GetParametrUInt(domElement, VAbstractTool::AttrP1Line2, NULL_ID_STR);
|
const quint32 p1Line2Id = GetParametrUInt(domElement, AttrP1Line2, NULL_ID_STR);
|
||||||
const quint32 p2Line2Id = GetParametrUInt(domElement, VAbstractTool::AttrP2Line2, NULL_ID_STR);
|
const quint32 p2Line2Id = GetParametrUInt(domElement, AttrP2Line2, NULL_ID_STR);
|
||||||
|
|
||||||
VToolLineIntersect::Create(id, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, name,
|
VToolLineIntersect::Create(id, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, name,
|
||||||
mx, my, scene, this, data, parse, Source::FromFile);
|
mx, my, scene, this, data, parse, Source::FromFile);
|
||||||
|
@ -1198,18 +1198,18 @@ void VPattern::ParseToolPointOfContact(VMainGraphicsScene *scene, QDomElement &d
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const QString radius = GetParametrString(domElement, VAbstractTool::AttrRadius, "0");
|
const QString radius = GetParametrString(domElement, AttrRadius, "0");
|
||||||
QString f = radius;//need for saving fixed formula;
|
QString f = radius;//need for saving fixed formula;
|
||||||
const quint32 center = GetParametrUInt(domElement, VAbstractTool::AttrCenter, NULL_ID_STR);
|
const quint32 center = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR);
|
||||||
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR);
|
const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR);
|
||||||
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR);
|
const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR);
|
||||||
|
|
||||||
VToolPointOfContact::Create(id, f, center, firstPointId, secondPointId, name, mx, my, scene, this,
|
VToolPointOfContact::Create(id, f, center, firstPointId, secondPointId, name, mx, my, scene, this,
|
||||||
data, parse, Source::FromFile);
|
data, parse, Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (f != radius)
|
if (f != radius)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrRadius, f);
|
SetAttribute(domElement, AttrRadius, f);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1270,9 +1270,9 @@ void VPattern::ParseToolHeight(VMainGraphicsScene *scene, const QDomElement &dom
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
||||||
const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR);
|
const quint32 basePointId = GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR);
|
||||||
const quint32 p1LineId = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, NULL_ID_STR);
|
const quint32 p1LineId = GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR);
|
||||||
const quint32 p2LineId = GetParametrUInt(domElement, VAbstractTool::AttrP2Line, NULL_ID_STR);
|
const quint32 p2LineId = GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR);
|
||||||
|
|
||||||
VToolHeight::Create(id, name, typeLine, lineColor, basePointId, p1LineId, p2LineId,
|
VToolHeight::Create(id, name, typeLine, lineColor, basePointId, p1LineId, p2LineId,
|
||||||
mx, my, scene, this, data, parse, Source::FromFile);
|
mx, my, scene, this, data, parse, Source::FromFile);
|
||||||
|
@ -1299,10 +1299,10 @@ void VPattern::ParseToolTriangle(VMainGraphicsScene *scene, const QDomElement &d
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const quint32 axisP1Id = GetParametrUInt(domElement, VAbstractTool::AttrAxisP1, NULL_ID_STR);
|
const quint32 axisP1Id = GetParametrUInt(domElement, AttrAxisP1, NULL_ID_STR);
|
||||||
const quint32 axisP2Id = GetParametrUInt(domElement, VAbstractTool::AttrAxisP2, NULL_ID_STR);
|
const quint32 axisP2Id = GetParametrUInt(domElement, AttrAxisP2, NULL_ID_STR);
|
||||||
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR);
|
const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR);
|
||||||
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR);
|
const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR);
|
||||||
|
|
||||||
VToolTriangle::Create(id, name, axisP1Id, axisP2Id, firstPointId, secondPointId, mx, my, scene, this,
|
VToolTriangle::Create(id, name, axisP1Id, axisP2Id, firstPointId, secondPointId, mx, my, scene, this,
|
||||||
data, parse, Source::FromFile);
|
data, parse, Source::FromFile);
|
||||||
|
@ -1330,8 +1330,8 @@ void VPattern::ParseToolPointOfIntersection(VMainGraphicsScene *scene, const QDo
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR);
|
const quint32 firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR);
|
||||||
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR);
|
const quint32 secondPointId = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR);
|
||||||
|
|
||||||
VToolPointOfIntersection::Create(id, name, firstPointId, secondPointId, mx, my, scene, this, data,
|
VToolPointOfIntersection::Create(id, name, firstPointId, secondPointId, mx, my, scene, this, data,
|
||||||
parse, Source::FromFile);
|
parse, Source::FromFile);
|
||||||
|
@ -1358,18 +1358,18 @@ void VPattern::ParseToolCutSpline(VMainGraphicsScene *scene, QDomElement &domEle
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0");
|
const QString formula = GetParametrString(domElement, AttrLength, "0");
|
||||||
QString f = formula;//need for saving fixed formula;
|
QString f = formula;//need for saving fixed formula;
|
||||||
const quint32 splineId = GetParametrUInt(domElement, VToolCutSpline::AttrSpline, NULL_ID_STR);
|
const quint32 splineId = GetParametrUInt(domElement, VToolCutSpline::AttrSpline, NULL_ID_STR);
|
||||||
const QString color = GetParametrString(domElement, VAbstractTool::AttrColor,
|
const QString color = GetParametrString(domElement, AttrColor,
|
||||||
VAbstractTool::ColorBlack);
|
ColorBlack);
|
||||||
|
|
||||||
VToolCutSpline::Create(id, name, f, splineId, mx, my, color, scene, this, data, parse,
|
VToolCutSpline::Create(id, name, f, splineId, mx, my, color, scene, this, data, parse,
|
||||||
Source::FromFile);
|
Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (f != formula)
|
if (f != formula)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrLength, f);
|
SetAttribute(domElement, AttrLength, f);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1401,19 +1401,19 @@ void VPattern::ParseToolCutSplinePath(VMainGraphicsScene *scene, QDomElement &do
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0");
|
const QString formula = GetParametrString(domElement, AttrLength, "0");
|
||||||
QString f = formula;//need for saving fixed formula;
|
QString f = formula;//need for saving fixed formula;
|
||||||
const quint32 splinePathId = GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath,
|
const quint32 splinePathId = GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath,
|
||||||
NULL_ID_STR);
|
NULL_ID_STR);
|
||||||
const QString color = GetParametrString(domElement, VAbstractTool::AttrColor,
|
const QString color = GetParametrString(domElement, AttrColor,
|
||||||
VAbstractTool::ColorBlack);
|
ColorBlack);
|
||||||
|
|
||||||
VToolCutSplinePath::Create(id, name, f, splinePathId, mx, my, color, scene, this, data, parse,
|
VToolCutSplinePath::Create(id, name, f, splinePathId, mx, my, color, scene, this, data, parse,
|
||||||
Source::FromFile);
|
Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (f != formula)
|
if (f != formula)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrLength, f);
|
SetAttribute(domElement, AttrLength, f);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1445,17 +1445,16 @@ void VPattern::ParseToolCutArc(VMainGraphicsScene *scene, QDomElement &domElemen
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0");
|
const QString formula = GetParametrString(domElement, AttrLength, "0");
|
||||||
QString f = formula;//need for saving fixed formula;
|
QString f = formula;//need for saving fixed formula;
|
||||||
const quint32 arcId = GetParametrUInt(domElement, VToolCutArc::AttrArc, NULL_ID_STR);
|
const quint32 arcId = GetParametrUInt(domElement, AttrArc, NULL_ID_STR);
|
||||||
const QString color = GetParametrString(domElement, VAbstractTool::AttrColor,
|
const QString color = GetParametrString(domElement, AttrColor, ColorBlack);
|
||||||
VAbstractTool::ColorBlack);
|
|
||||||
|
|
||||||
VToolCutArc::Create(id, name, f, arcId, mx, my, color, scene, this, data, parse, Source::FromFile);
|
VToolCutArc::Create(id, name, f, arcId, mx, my, color, scene, this, data, parse, Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (f != formula)
|
if (f != formula)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrLength, f);
|
SetAttribute(domElement, AttrLength, f);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1491,11 +1490,11 @@ void VPattern::ParseToolLineIntersectAxis(VMainGraphicsScene *scene, QDomElement
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
||||||
|
|
||||||
const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR);
|
const quint32 basePointId = GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR);
|
||||||
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, NULL_ID_STR);
|
const quint32 firstPointId = GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR);
|
||||||
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrP2Line, NULL_ID_STR);
|
const quint32 secondPointId = GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR);
|
||||||
|
|
||||||
const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0");
|
const QString angle = GetParametrString(domElement, AttrAngle, "0.0");
|
||||||
QString angleFix = angle;
|
QString angleFix = angle;
|
||||||
|
|
||||||
VToolLineIntersectAxis::Create(id, name, typeLine, lineColor, angleFix, basePointId, firstPointId,
|
VToolLineIntersectAxis::Create(id, name, typeLine, lineColor, angleFix, basePointId, firstPointId,
|
||||||
|
@ -1503,7 +1502,7 @@ void VPattern::ParseToolLineIntersectAxis(VMainGraphicsScene *scene, QDomElement
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (angleFix != angle)
|
if (angleFix != angle)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrAngle, angleFix);
|
SetAttribute(domElement, AttrAngle, angleFix);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1541,9 +1540,9 @@ void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElemen
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor);
|
||||||
|
|
||||||
const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR);
|
const quint32 basePointId = GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR);
|
||||||
const quint32 curveId = GetParametrUInt(domElement, VAbstractTool::AttrCurve, NULL_ID_STR);
|
const quint32 curveId = GetParametrUInt(domElement, AttrCurve, NULL_ID_STR);
|
||||||
const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0");
|
const QString angle = GetParametrString(domElement, AttrAngle, "0.0");
|
||||||
QString angleFix = angle;
|
QString angleFix = angle;
|
||||||
|
|
||||||
VToolCurveIntersectAxis::Create(id, name, typeLine, lineColor, angleFix, basePointId, curveId, mx, my,
|
VToolCurveIntersectAxis::Create(id, name, typeLine, lineColor, angleFix, basePointId, curveId, mx, my,
|
||||||
|
@ -1551,7 +1550,7 @@ void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElemen
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (angleFix != angle)
|
if (angleFix != angle)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrAngle, angleFix);
|
SetAttribute(domElement, AttrAngle, angleFix);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1586,10 +1585,10 @@ void VPattern::ParseToolPointOfIntersectionArcs(VMainGraphicsScene *scene, const
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const quint32 firstArcId = GetParametrUInt(domElement, VAbstractTool::AttrFirstArc, NULL_ID_STR);
|
const quint32 firstArcId = GetParametrUInt(domElement, AttrFirstArc, NULL_ID_STR);
|
||||||
const quint32 secondArcId = GetParametrUInt(domElement, VAbstractTool::AttrSecondArc, NULL_ID_STR);
|
const quint32 secondArcId = GetParametrUInt(domElement, AttrSecondArc, NULL_ID_STR);
|
||||||
const CrossCirclesPoint crossPoint = static_cast<CrossCirclesPoint>(GetParametrUInt(domElement,
|
const CrossCirclesPoint crossPoint = static_cast<CrossCirclesPoint>(GetParametrUInt(domElement,
|
||||||
VAbstractTool::AttrCrossPoint,
|
AttrCrossPoint,
|
||||||
"1"));
|
"1"));
|
||||||
|
|
||||||
VToolPointOfIntersectionArcs::Create(id, name, firstArcId, secondArcId, crossPoint, mx, my, scene, this,
|
VToolPointOfIntersectionArcs::Create(id, name, firstArcId, secondArcId, crossPoint, mx, my, scene, this,
|
||||||
|
@ -1618,23 +1617,22 @@ void VPattern::ParseToolPointOfIntersectionCircles(VMainGraphicsScene *scene, QD
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const quint32 c1CenterId = GetParametrUInt(domElement, VAbstractTool::AttrC1Center, NULL_ID_STR);
|
const quint32 c1CenterId = GetParametrUInt(domElement, AttrC1Center, NULL_ID_STR);
|
||||||
const quint32 c2CenterId = GetParametrUInt(domElement, VAbstractTool::AttrC2Center, NULL_ID_STR);
|
const quint32 c2CenterId = GetParametrUInt(domElement, AttrC2Center, NULL_ID_STR);
|
||||||
const QString c1Radius = GetParametrString(domElement, VAbstractTool::AttrC1Radius);
|
const QString c1Radius = GetParametrString(domElement, AttrC1Radius);
|
||||||
QString c1R = c1Radius;
|
QString c1R = c1Radius;
|
||||||
const QString c2Radius = GetParametrString(domElement, VAbstractTool::AttrC2Radius);
|
const QString c2Radius = GetParametrString(domElement, AttrC2Radius);
|
||||||
QString c2R = c2Radius;
|
QString c2R = c2Radius;
|
||||||
const CrossCirclesPoint crossPoint = static_cast<CrossCirclesPoint>(GetParametrUInt(domElement,
|
const CrossCirclesPoint crossPoint = static_cast<CrossCirclesPoint>(GetParametrUInt(domElement,
|
||||||
VAbstractTool::AttrCrossPoint,
|
AttrCrossPoint, "1"));
|
||||||
"1"));
|
|
||||||
|
|
||||||
VToolPointOfIntersectionCircles::Create(id, name, c1CenterId, c2CenterId, c1R, c2R, crossPoint, mx, my,
|
VToolPointOfIntersectionCircles::Create(id, name, c1CenterId, c2CenterId, c1R, c2R, crossPoint, mx, my,
|
||||||
scene, this, data, parse, Source::FromFile);
|
scene, this, data, parse, Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (c1R != c1Radius || c2R != c2Radius)
|
if (c1R != c1Radius || c2R != c2Radius)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrC1Center, c1R);
|
SetAttribute(domElement, AttrC1Center, c1R);
|
||||||
SetAttribute(domElement, VAbstractTool::AttrC2Center, c2R);
|
SetAttribute(domElement, AttrC2Center, c2R);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1661,12 +1659,12 @@ void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDo
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const quint32 cCenterId = GetParametrUInt(domElement, VAbstractTool::AttrCCenter, NULL_ID_STR);
|
const quint32 cCenterId = GetParametrUInt(domElement, AttrCCenter, NULL_ID_STR);
|
||||||
const quint32 tangentId = GetParametrUInt(domElement, VAbstractTool::AttrTangent, NULL_ID_STR);
|
const quint32 tangentId = GetParametrUInt(domElement, AttrTangent, NULL_ID_STR);
|
||||||
const QString cRadius = GetParametrString(domElement, VAbstractTool::AttrCRadius);
|
const QString cRadius = GetParametrString(domElement, AttrCRadius);
|
||||||
QString cR = cRadius;
|
QString cR = cRadius;
|
||||||
const CrossCirclesPoint crossPoint = static_cast<CrossCirclesPoint>(GetParametrUInt(domElement,
|
const CrossCirclesPoint crossPoint = static_cast<CrossCirclesPoint>(GetParametrUInt(domElement,
|
||||||
VAbstractTool::AttrCrossPoint,
|
AttrCrossPoint,
|
||||||
"1"));
|
"1"));
|
||||||
|
|
||||||
VToolPointFromCircleAndTangent::Create(id, name, cCenterId, cR, tangentId, crossPoint, mx, my,
|
VToolPointFromCircleAndTangent::Create(id, name, cCenterId, cR, tangentId, crossPoint, mx, my,
|
||||||
|
@ -1674,7 +1672,7 @@ void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDo
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (cR != cRadius)
|
if (cR != cRadius)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrCCenter, cR);
|
SetAttribute(domElement, AttrCCenter, cR);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1701,10 +1699,10 @@ void VPattern::ParseToolPointFromArcAndTangent(VMainGraphicsScene *scene, const
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PointsCommonAttributes(domElement, id, name, mx, my);
|
PointsCommonAttributes(domElement, id, name, mx, my);
|
||||||
const quint32 arcId = GetParametrUInt(domElement, VAbstractTool::AttrArc, NULL_ID_STR);
|
const quint32 arcId = GetParametrUInt(domElement, AttrArc, NULL_ID_STR);
|
||||||
const quint32 tangentId = GetParametrUInt(domElement, VAbstractTool::AttrTangent, NULL_ID_STR);
|
const quint32 tangentId = GetParametrUInt(domElement, AttrTangent, NULL_ID_STR);
|
||||||
const CrossCirclesPoint crossPoint = static_cast<CrossCirclesPoint>(GetParametrUInt(domElement,
|
const CrossCirclesPoint crossPoint = static_cast<CrossCirclesPoint>(GetParametrUInt(domElement,
|
||||||
VAbstractTool::AttrCrossPoint,
|
AttrCrossPoint,
|
||||||
"1"));
|
"1"));
|
||||||
|
|
||||||
VToolPointFromArcAndTangent::Create(id, name, arcId, tangentId, crossPoint, mx, my,
|
VToolPointFromArcAndTangent::Create(id, name, arcId, tangentId, crossPoint, mx, my,
|
||||||
|
@ -1730,22 +1728,22 @@ void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement &
|
||||||
{
|
{
|
||||||
ToolsCommonAttributes(domElement, id);
|
ToolsCommonAttributes(domElement, id);
|
||||||
|
|
||||||
const quint32 p1Id = GetParametrUInt(domElement, VAbstractTool::AttrPoint1, NULL_ID_STR);
|
const quint32 p1Id = GetParametrUInt(domElement, AttrPoint1, NULL_ID_STR);
|
||||||
const quint32 p2Id = GetParametrUInt(domElement, VAbstractTool::AttrPoint2, NULL_ID_STR);
|
const quint32 p2Id = GetParametrUInt(domElement, AttrPoint2, NULL_ID_STR);
|
||||||
|
|
||||||
const quint32 baseLineP1Id = GetParametrUInt(domElement, VAbstractTool::AttrBaseLineP1, NULL_ID_STR);
|
const quint32 baseLineP1Id = GetParametrUInt(domElement, AttrBaseLineP1, NULL_ID_STR);
|
||||||
const quint32 baseLineP2Id = GetParametrUInt(domElement, VAbstractTool::AttrBaseLineP2, NULL_ID_STR);
|
const quint32 baseLineP2Id = GetParametrUInt(domElement, AttrBaseLineP2, NULL_ID_STR);
|
||||||
const quint32 dartP1Id = GetParametrUInt(domElement, VAbstractTool::AttrDartP1, NULL_ID_STR);
|
const quint32 dartP1Id = GetParametrUInt(domElement, AttrDartP1, NULL_ID_STR);
|
||||||
const quint32 dartP2Id = GetParametrUInt(domElement, VAbstractTool::AttrDartP2, NULL_ID_STR);
|
const quint32 dartP2Id = GetParametrUInt(domElement, AttrDartP2, NULL_ID_STR);
|
||||||
const quint32 dartP3Id = GetParametrUInt(domElement, VAbstractTool::AttrDartP3, NULL_ID_STR);
|
const quint32 dartP3Id = GetParametrUInt(domElement, AttrDartP3, NULL_ID_STR);
|
||||||
|
|
||||||
const QString name1 = GetParametrString(domElement, VAbstractTool::AttrName1, "A");
|
const QString name1 = GetParametrString(domElement, AttrName1, "A");
|
||||||
const qreal mx1 = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx1, "10.0"));
|
const qreal mx1 = qApp->toPixel(GetParametrDouble(domElement, AttrMx1, "10.0"));
|
||||||
const qreal my1 = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy1, "15.0"));
|
const qreal my1 = qApp->toPixel(GetParametrDouble(domElement, AttrMy1, "15.0"));
|
||||||
|
|
||||||
const QString name2 = GetParametrString(domElement, VAbstractTool::AttrName2, "A");
|
const QString name2 = GetParametrString(domElement, AttrName2, "A");
|
||||||
const qreal mx2 = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx2, "10.0"));
|
const qreal mx2 = qApp->toPixel(GetParametrDouble(domElement, AttrMx2, "10.0"));
|
||||||
const qreal my2 = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy2, "15.0"));
|
const qreal my2 = qApp->toPixel(GetParametrDouble(domElement, AttrMy2, "15.0"));
|
||||||
|
|
||||||
VToolTrueDarts::Create(id, p1Id, p2Id,
|
VToolTrueDarts::Create(id, p1Id, p2Id,
|
||||||
baseLineP1Id, baseLineP2Id, dartP1Id, dartP2Id, dartP3Id,
|
baseLineP1Id, baseLineP2Id, dartP1Id, dartP2Id, dartP3Id,
|
||||||
|
@ -1771,15 +1769,14 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, const QDomElement &dom
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ToolsCommonAttributes(domElement, id);
|
ToolsCommonAttributes(domElement, id);
|
||||||
const quint32 point1 = GetParametrUInt(domElement, VAbstractTool::AttrPoint1, NULL_ID_STR);
|
const quint32 point1 = GetParametrUInt(domElement, AttrPoint1, NULL_ID_STR);
|
||||||
const quint32 point4 = GetParametrUInt(domElement, VAbstractTool::AttrPoint4, NULL_ID_STR);
|
const quint32 point4 = GetParametrUInt(domElement, AttrPoint4, NULL_ID_STR);
|
||||||
const qreal angle1 = GetParametrDouble(domElement, VAbstractTool::AttrAngle1, "270.0");
|
const qreal angle1 = GetParametrDouble(domElement, AttrAngle1, "270.0");
|
||||||
const qreal angle2 = GetParametrDouble(domElement, VAbstractTool::AttrAngle2, "90.0");
|
const qreal angle2 = GetParametrDouble(domElement, AttrAngle2, "90.0");
|
||||||
const qreal kAsm1 = GetParametrDouble(domElement, VAbstractTool::AttrKAsm1, "1.0");
|
const qreal kAsm1 = GetParametrDouble(domElement, AttrKAsm1, "1.0");
|
||||||
const qreal kAsm2 = GetParametrDouble(domElement, VAbstractTool::AttrKAsm2, "1.0");
|
const qreal kAsm2 = GetParametrDouble(domElement, AttrKAsm2, "1.0");
|
||||||
const qreal kCurve = GetParametrDouble(domElement, VAbstractTool::AttrKCurve, "1.0");
|
const qreal kCurve = GetParametrDouble(domElement, AttrKCurve, "1.0");
|
||||||
const QString color = GetParametrString(domElement, VAbstractTool::AttrColor,
|
const QString color = GetParametrString(domElement, AttrColor, ColorBlack);
|
||||||
VAbstractTool::ColorBlack);
|
|
||||||
|
|
||||||
VToolSpline::Create(id, point1, point4, kAsm1, kAsm2, angle1, angle2, kCurve, color, scene, this, data,
|
VToolSpline::Create(id, point1, point4, kAsm1, kAsm2, angle1, angle2, kCurve, color, scene, this, data,
|
||||||
parse, Source::FromFile);
|
parse, Source::FromFile);
|
||||||
|
@ -1803,9 +1800,8 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ToolsCommonAttributes(domElement, id);
|
ToolsCommonAttributes(domElement, id);
|
||||||
const qreal kCurve = GetParametrDouble(domElement, VAbstractTool::AttrKCurve, "1.0");
|
const qreal kCurve = GetParametrDouble(domElement, AttrKCurve, "1.0");
|
||||||
const QString color = GetParametrString(domElement, VAbstractTool::AttrColor,
|
const QString color = GetParametrString(domElement, AttrColor, ColorBlack);
|
||||||
VAbstractTool::ColorBlack);
|
|
||||||
VSplinePath *path = new VSplinePath(kCurve);
|
VSplinePath *path = new VSplinePath(kCurve);
|
||||||
|
|
||||||
const QDomNodeList nodeList = domElement.childNodes();
|
const QDomNodeList nodeList = domElement.childNodes();
|
||||||
|
@ -1815,12 +1811,12 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement
|
||||||
const QDomElement element = nodeList.at(i).toElement();
|
const QDomElement element = nodeList.at(i).toElement();
|
||||||
if (element.isNull() == false)
|
if (element.isNull() == false)
|
||||||
{
|
{
|
||||||
if (element.tagName() == VAbstractTool::AttrPathPoint)
|
if (element.tagName() == AttrPathPoint)
|
||||||
{
|
{
|
||||||
const qreal kAsm1 = GetParametrDouble(element, VAbstractTool::AttrKAsm1, "1.0");
|
const qreal kAsm1 = GetParametrDouble(element, AttrKAsm1, "1.0");
|
||||||
const qreal angle = GetParametrDouble(element, VAbstractTool::AttrAngle, "0");
|
const qreal angle = GetParametrDouble(element, AttrAngle, "0");
|
||||||
const qreal kAsm2 = GetParametrDouble(element, VAbstractTool::AttrKAsm2, "1.0");
|
const qreal kAsm2 = GetParametrDouble(element, AttrKAsm2, "1.0");
|
||||||
const quint32 pSpline = GetParametrUInt(element, VAbstractTool::AttrPSpline, NULL_ID_STR);
|
const quint32 pSpline = GetParametrUInt(element, AttrPSpline, NULL_ID_STR);
|
||||||
const VPointF p = *data->GeometricObject<VPointF>(pSpline);
|
const VPointF p = *data->GeometricObject<VPointF>(pSpline);
|
||||||
|
|
||||||
QLineF line(0, 0, 100, 0);
|
QLineF line(0, 0, 100, 0);
|
||||||
|
@ -1909,23 +1905,22 @@ void VPattern::ParseToolArc(VMainGraphicsScene *scene, QDomElement &domElement,
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ToolsCommonAttributes(domElement, id);
|
ToolsCommonAttributes(domElement, id);
|
||||||
const quint32 center = GetParametrUInt(domElement, VAbstractTool::AttrCenter, NULL_ID_STR);
|
const quint32 center = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR);
|
||||||
const QString radius = GetParametrString(domElement, VAbstractTool::AttrRadius, "10");
|
const QString radius = GetParametrString(domElement, AttrRadius, "10");
|
||||||
QString r = radius;//need for saving fixed formula;
|
QString r = radius;//need for saving fixed formula;
|
||||||
const QString f1 = GetParametrString(domElement, VAbstractTool::AttrAngle1, "180");
|
const QString f1 = GetParametrString(domElement, AttrAngle1, "180");
|
||||||
QString f1Fix = f1;//need for saving fixed formula;
|
QString f1Fix = f1;//need for saving fixed formula;
|
||||||
const QString f2 = GetParametrString(domElement, VAbstractTool::AttrAngle2, "270");
|
const QString f2 = GetParametrString(domElement, AttrAngle2, "270");
|
||||||
QString f2Fix = f2;//need for saving fixed formula;
|
QString f2Fix = f2;//need for saving fixed formula;
|
||||||
const QString color = GetParametrString(domElement, VAbstractTool::AttrColor,
|
const QString color = GetParametrString(domElement, AttrColor, ColorBlack);
|
||||||
VAbstractTool::ColorBlack);
|
|
||||||
|
|
||||||
VToolArc::Create(id, center, r, f1Fix, f2Fix, color, scene, this, data, parse, Source::FromFile);
|
VToolArc::Create(id, center, r, f1Fix, f2Fix, color, scene, this, data, parse, Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (r != radius || f1Fix != f1 || f2Fix != f2)
|
if (r != radius || f1Fix != f1 || f2Fix != f2)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrRadius, r);
|
SetAttribute(domElement, AttrRadius, r);
|
||||||
SetAttribute(domElement, VAbstractTool::AttrAngle1, f1Fix);
|
SetAttribute(domElement, AttrAngle1, f1Fix);
|
||||||
SetAttribute(domElement, VAbstractTool::AttrAngle2, f2Fix);
|
SetAttribute(domElement, AttrAngle2, f2Fix);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1980,24 +1975,23 @@ void VPattern::ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &do
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ToolsCommonAttributes(domElement, id);
|
ToolsCommonAttributes(domElement, id);
|
||||||
const quint32 center = GetParametrUInt(domElement, VAbstractTool::AttrCenter, NULL_ID_STR);
|
const quint32 center = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR);
|
||||||
const QString radius = GetParametrString(domElement, VAbstractTool::AttrRadius, "10");
|
const QString radius = GetParametrString(domElement, AttrRadius, "10");
|
||||||
QString r = radius;//need for saving fixed formula;
|
QString r = radius;//need for saving fixed formula;
|
||||||
const QString f1 = GetParametrString(domElement, VAbstractTool::AttrAngle1, "180");
|
const QString f1 = GetParametrString(domElement, AttrAngle1, "180");
|
||||||
QString f1Fix = f1;//need for saving fixed formula;
|
QString f1Fix = f1;//need for saving fixed formula;
|
||||||
const QString length = GetParametrString(domElement, VAbstractTool::AttrLength, "10");
|
const QString length = GetParametrString(domElement, AttrLength, "10");
|
||||||
QString lengthFix = length;//need for saving fixed length;
|
QString lengthFix = length;//need for saving fixed length;
|
||||||
const QString color = GetParametrString(domElement, VAbstractTool::AttrColor,
|
const QString color = GetParametrString(domElement, AttrColor, ColorBlack);
|
||||||
VAbstractTool::ColorBlack);
|
|
||||||
|
|
||||||
VToolArcWithLength::Create(id, center, r, f1Fix, lengthFix, color, scene, this, data, parse,
|
VToolArcWithLength::Create(id, center, r, f1Fix, lengthFix, color, scene, this, data, parse,
|
||||||
Source::FromFile);
|
Source::FromFile);
|
||||||
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
//Rewrite attribute formula. Need for situation when we have wrong formula.
|
||||||
if (r != radius || f1Fix != f1 || lengthFix != length)
|
if (r != radius || f1Fix != f1 || lengthFix != length)
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, VAbstractTool::AttrRadius, r);
|
SetAttribute(domElement, AttrRadius, r);
|
||||||
SetAttribute(domElement, VAbstractTool::AttrAngle1, f1Fix);
|
SetAttribute(domElement, AttrAngle1, f1Fix);
|
||||||
SetAttribute(domElement, VAbstractTool::AttrLength, lengthFix);
|
SetAttribute(domElement, AttrLength, lengthFix);
|
||||||
haveLiteChange();
|
haveLiteChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,3 +59,111 @@ qreal WidthHairLine(Unit patternUnit)
|
||||||
{
|
{
|
||||||
return WidthMainLine(patternUnit)/3.0;
|
return WidthMainLine(patternUnit)/3.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString AttrType = QStringLiteral("type");
|
||||||
|
const QString AttrMx = QStringLiteral("mx");
|
||||||
|
const QString AttrMy = QStringLiteral("my");
|
||||||
|
const QString AttrName = QStringLiteral("name");
|
||||||
|
const QString AttrMx1 = QStringLiteral("mx1");
|
||||||
|
const QString AttrMy1 = QStringLiteral("my1");
|
||||||
|
const QString AttrName1 = QStringLiteral("name1");
|
||||||
|
const QString AttrMx2 = QStringLiteral("mx2");
|
||||||
|
const QString AttrMy2 = QStringLiteral("my2");
|
||||||
|
const QString AttrName2 = QStringLiteral("name2");
|
||||||
|
const QString AttrBaseLineP1 = QStringLiteral("baseLineP1");
|
||||||
|
const QString AttrBaseLineP2 = QStringLiteral("baseLineP2");
|
||||||
|
const QString AttrDartP1 = QStringLiteral("dartP1");
|
||||||
|
const QString AttrDartP2 = QStringLiteral("dartP2");
|
||||||
|
const QString AttrDartP3 = QStringLiteral("dartP3");
|
||||||
|
const QString AttrX = QStringLiteral("x");
|
||||||
|
const QString AttrY = QStringLiteral("y");
|
||||||
|
const QString AttrTypeLine = QStringLiteral("typeLine");
|
||||||
|
const QString AttrLength = QStringLiteral("length");
|
||||||
|
const QString AttrBasePoint = QStringLiteral("basePoint");
|
||||||
|
const QString AttrFirstPoint = QStringLiteral("firstPoint");
|
||||||
|
const QString AttrSecondPoint = QStringLiteral("secondPoint");
|
||||||
|
const QString AttrThirdPoint = QStringLiteral("thirdPoint");
|
||||||
|
const QString AttrCenter = QStringLiteral("center");
|
||||||
|
const QString AttrRadius = QStringLiteral("radius");
|
||||||
|
const QString AttrAngle = QStringLiteral("angle");
|
||||||
|
const QString AttrAngle1 = QStringLiteral("angle1");
|
||||||
|
const QString AttrAngle2 = QStringLiteral("angle2");
|
||||||
|
const QString AttrP1Line = QStringLiteral("p1Line");
|
||||||
|
const QString AttrP2Line = QStringLiteral("p2Line");
|
||||||
|
const QString AttrP1Line1 = QStringLiteral("p1Line1");
|
||||||
|
const QString AttrP2Line1 = QStringLiteral("p2Line1");
|
||||||
|
const QString AttrP1Line2 = QStringLiteral("p1Line2");
|
||||||
|
const QString AttrP2Line2 = QStringLiteral("p2Line2");
|
||||||
|
const QString AttrPShoulder = QStringLiteral("pShoulder");
|
||||||
|
const QString AttrPoint1 = QStringLiteral("point1");
|
||||||
|
const QString AttrPoint2 = QStringLiteral("point2");
|
||||||
|
const QString AttrPoint4 = QStringLiteral("point4");
|
||||||
|
const QString AttrKAsm1 = QStringLiteral("kAsm1");
|
||||||
|
const QString AttrKAsm2 = QStringLiteral("kAsm2");
|
||||||
|
const QString AttrKCurve = QStringLiteral("kCurve");
|
||||||
|
const QString AttrPathPoint = QStringLiteral("pathPoint");
|
||||||
|
const QString AttrPSpline = QStringLiteral("pSpline");
|
||||||
|
const QString AttrAxisP1 = QStringLiteral("axisP1");
|
||||||
|
const QString AttrAxisP2 = QStringLiteral("axisP2");
|
||||||
|
const QString AttrCurve = QStringLiteral("curve");
|
||||||
|
const QString AttrLineColor = QStringLiteral("lineColor");
|
||||||
|
const QString AttrColor = QStringLiteral("color");
|
||||||
|
const QString AttrFirstArc = QStringLiteral("firstArc");
|
||||||
|
const QString AttrSecondArc = QStringLiteral("secondArc");
|
||||||
|
const QString AttrCrossPoint = QStringLiteral("crossPoint");
|
||||||
|
const QString AttrC1Center = QStringLiteral("c1Center");
|
||||||
|
const QString AttrC2Center = QStringLiteral("c2Center");
|
||||||
|
const QString AttrC1Radius = QStringLiteral("c1Radius");
|
||||||
|
const QString AttrC2Radius = QStringLiteral("c2Radius");
|
||||||
|
const QString AttrCCenter = QStringLiteral("cCenter");
|
||||||
|
const QString AttrTangent = QStringLiteral("tangent");
|
||||||
|
const QString AttrCRadius = QStringLiteral("cRadius");
|
||||||
|
const QString AttrArc = QStringLiteral("arc");
|
||||||
|
|
||||||
|
const QString TypeLineNone = QStringLiteral("none");
|
||||||
|
const QString TypeLineLine = QStringLiteral("hair");
|
||||||
|
const QString TypeLineDashLine = QStringLiteral("dashLine");
|
||||||
|
const QString TypeLineDotLine = QStringLiteral("dotLine");
|
||||||
|
const QString TypeLineDashDotLine = QStringLiteral("dashDotLine");
|
||||||
|
const QString TypeLineDashDotDotLine = QStringLiteral("dashDotDotLine");
|
||||||
|
|
||||||
|
const QString ColorBlack = QStringLiteral("black");
|
||||||
|
const QString ColorGreen = QStringLiteral("green");
|
||||||
|
const QString ColorBlue = QStringLiteral("blue");
|
||||||
|
const QString ColorDarkRed = QStringLiteral("darkRed");
|
||||||
|
const QString ColorDarkGreen = QStringLiteral("darkGreen");
|
||||||
|
const QString ColorDarkBlue = QStringLiteral("darkBlue");
|
||||||
|
const QString ColorYellow = QStringLiteral("yellow");
|
||||||
|
|
||||||
|
//variables
|
||||||
|
const QString line_ = QStringLiteral("Line_");
|
||||||
|
const QString angleLine_ = QStringLiteral("AngleLine_");
|
||||||
|
const QString spl_ = QStringLiteral(SPL_);
|
||||||
|
const QString arc_ = QStringLiteral(ARC_);
|
||||||
|
const QString splPath = QStringLiteral("SplPath");
|
||||||
|
const QString radius_V = QStringLiteral("Radius");
|
||||||
|
const QString radiusArc_ = radius_V + arc_;
|
||||||
|
const QString angle1_V = QStringLiteral("Angle1");
|
||||||
|
const QString angle2_V = QStringLiteral("Angle2");
|
||||||
|
const QString angle1Arc_ = angle1_V + arc_;
|
||||||
|
const QString angle2Arc_ = angle2_V + arc_;
|
||||||
|
const QString angle1Spl_ = angle1_V + spl_;
|
||||||
|
const QString angle2Spl_ = angle2_V + spl_;
|
||||||
|
const QString angle1SplPath = angle1_V + splPath;
|
||||||
|
const QString angle2SplPath = angle2_V + splPath;
|
||||||
|
|
||||||
|
const QStringList builInVariables = QStringList() << line_
|
||||||
|
<< angleLine_
|
||||||
|
<< arc_
|
||||||
|
<< spl_
|
||||||
|
<< splPath
|
||||||
|
<< radius_V
|
||||||
|
<< radiusArc_
|
||||||
|
<< angle1_V
|
||||||
|
<< angle2_V
|
||||||
|
<< angle1Arc_
|
||||||
|
<< angle2Arc_
|
||||||
|
<< angle1Spl_
|
||||||
|
<< angle2Spl_
|
||||||
|
<< angle1SplPath
|
||||||
|
<< angle2SplPath;
|
||||||
|
|
|
@ -62,4 +62,102 @@ static const quint32 null_id = 0;
|
||||||
qreal WidthMainLine(Unit patternUnit);
|
qreal WidthMainLine(Unit patternUnit);
|
||||||
qreal WidthHairLine(Unit patternUnit);
|
qreal WidthHairLine(Unit patternUnit);
|
||||||
|
|
||||||
|
extern const QString AttrType;
|
||||||
|
extern const QString AttrMx;
|
||||||
|
extern const QString AttrMy;
|
||||||
|
extern const QString AttrName;
|
||||||
|
extern const QString AttrMx1;
|
||||||
|
extern const QString AttrMy1;
|
||||||
|
extern const QString AttrName1;
|
||||||
|
extern const QString AttrMx2;
|
||||||
|
extern const QString AttrMy2;
|
||||||
|
extern const QString AttrName2;
|
||||||
|
extern const QString AttrBaseLineP1;
|
||||||
|
extern const QString AttrBaseLineP2;
|
||||||
|
extern const QString AttrDartP1;
|
||||||
|
extern const QString AttrDartP2;
|
||||||
|
extern const QString AttrDartP3;
|
||||||
|
extern const QString AttrX;
|
||||||
|
extern const QString AttrY;
|
||||||
|
extern const QString AttrTypeLine;
|
||||||
|
extern const QString AttrLength;
|
||||||
|
extern const QString AttrBasePoint;
|
||||||
|
extern const QString AttrFirstPoint;
|
||||||
|
extern const QString AttrSecondPoint;
|
||||||
|
extern const QString AttrThirdPoint;
|
||||||
|
extern const QString AttrCenter;
|
||||||
|
extern const QString AttrRadius;
|
||||||
|
extern const QString AttrAngle;
|
||||||
|
extern const QString AttrAngle1;
|
||||||
|
extern const QString AttrAngle2;
|
||||||
|
extern const QString AttrP1Line;
|
||||||
|
extern const QString AttrP2Line;
|
||||||
|
extern const QString AttrP1Line1;
|
||||||
|
extern const QString AttrP2Line1;
|
||||||
|
extern const QString AttrP1Line2;
|
||||||
|
extern const QString AttrP2Line2;
|
||||||
|
extern const QString AttrPShoulder;
|
||||||
|
extern const QString AttrPoint1;
|
||||||
|
extern const QString AttrPoint2;
|
||||||
|
extern const QString AttrPoint4;
|
||||||
|
extern const QString AttrKAsm1;
|
||||||
|
extern const QString AttrKAsm2;
|
||||||
|
extern const QString AttrKCurve;
|
||||||
|
extern const QString AttrPathPoint;
|
||||||
|
extern const QString AttrPSpline;
|
||||||
|
extern const QString AttrAxisP1;
|
||||||
|
extern const QString AttrAxisP2;
|
||||||
|
extern const QString AttrCurve;
|
||||||
|
extern const QString AttrLineColor;
|
||||||
|
extern const QString AttrColor;
|
||||||
|
extern const QString AttrFirstArc;
|
||||||
|
extern const QString AttrSecondArc;
|
||||||
|
extern const QString AttrCrossPoint;
|
||||||
|
extern const QString AttrC1Center;
|
||||||
|
extern const QString AttrC2Center;
|
||||||
|
extern const QString AttrC1Radius;
|
||||||
|
extern const QString AttrC2Radius;
|
||||||
|
extern const QString AttrCCenter;
|
||||||
|
extern const QString AttrTangent;
|
||||||
|
extern const QString AttrCRadius;
|
||||||
|
extern const QString AttrArc;
|
||||||
|
|
||||||
|
extern const QString TypeLineNone;
|
||||||
|
extern const QString TypeLineLine;
|
||||||
|
extern const QString TypeLineDashLine;
|
||||||
|
extern const QString TypeLineDotLine;
|
||||||
|
extern const QString TypeLineDashDotLine;
|
||||||
|
extern const QString TypeLineDashDotDotLine;
|
||||||
|
|
||||||
|
extern const QString ColorBlack;
|
||||||
|
extern const QString ColorGreen;
|
||||||
|
extern const QString ColorBlue;
|
||||||
|
extern const QString ColorDarkRed;
|
||||||
|
extern const QString ColorDarkGreen;
|
||||||
|
extern const QString ColorDarkBlue;
|
||||||
|
extern const QString ColorYellow;
|
||||||
|
|
||||||
|
// variables name
|
||||||
|
// Hacks for avoiding the linker error "undefined reference to"
|
||||||
|
#define SPL_ "Spl_"
|
||||||
|
#define ARC_ "Arc_"
|
||||||
|
|
||||||
|
extern const QString line_;
|
||||||
|
extern const QString angleLine_;
|
||||||
|
extern const QString arc_;
|
||||||
|
extern const QString spl_;
|
||||||
|
extern const QString splPath;
|
||||||
|
extern const QString radius_V;
|
||||||
|
extern const QString radiusArc_;
|
||||||
|
extern const QString angle1_V;
|
||||||
|
extern const QString angle2_V;
|
||||||
|
extern const QString angle1Arc_;
|
||||||
|
extern const QString angle2Arc_;
|
||||||
|
extern const QString angle1Spl_;
|
||||||
|
extern const QString angle2Spl_;
|
||||||
|
extern const QString angle1SplPath;
|
||||||
|
extern const QString angle2SplPath;
|
||||||
|
|
||||||
|
extern const QStringList builInVariables;
|
||||||
|
|
||||||
#endif // IFCDEF_H
|
#endif // IFCDEF_H
|
||||||
|
|
|
@ -27,9 +27,10 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "vabstractpattern.h"
|
#include "vabstractpattern.h"
|
||||||
#include "../vmisc/def.h"
|
|
||||||
#include "exception/vexceptionbadid.h"
|
#include "exception/vexceptionbadid.h"
|
||||||
|
#include "exception/vexceptionemptyparameter.h"
|
||||||
#include "vpatternconverter.h"
|
#include "vpatternconverter.h"
|
||||||
|
#include "../qmuparser/qmutokenparser.h"
|
||||||
|
|
||||||
const QString VAbstractPattern::TagPattern = QStringLiteral("pattern");
|
const QString VAbstractPattern::TagPattern = QStringLiteral("pattern");
|
||||||
const QString VAbstractPattern::TagCalculation = QStringLiteral("calculation");
|
const QString VAbstractPattern::TagCalculation = QStringLiteral("calculation");
|
||||||
|
@ -111,6 +112,53 @@ VAbstractPattern::VAbstractPattern(QObject *parent)
|
||||||
VAbstractPattern::~VAbstractPattern()
|
VAbstractPattern::~VAbstractPattern()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QStringList VAbstractPattern::ListMeasurements() const
|
||||||
|
{
|
||||||
|
QSet<QString> measurements;
|
||||||
|
QSet<QString> others;
|
||||||
|
|
||||||
|
const QStringList increments = ListIncrements();
|
||||||
|
for (int i=0; i < increments.size(); ++i)
|
||||||
|
{
|
||||||
|
others.insert(increments.at(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
const QStringList expressions = ListExpressions();
|
||||||
|
for (int i=0; i < expressions.size(); ++i)
|
||||||
|
{
|
||||||
|
qmu::QmuTokenParser *cal = new qmu::QmuTokenParser(expressions.at(i), false, false);// Eval formula
|
||||||
|
const QMap<int, QString> tokens = cal->GetTokens();// Tokens (variables, measurements)
|
||||||
|
delete cal;
|
||||||
|
|
||||||
|
const QList<QString> tValues = tokens.values();
|
||||||
|
for (int j = 0; j < tValues.size(); ++j)
|
||||||
|
{
|
||||||
|
if (measurements.contains(tValues.at(j)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (others.contains(tValues.at(j)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsVariable(tValues.at(j)) || IsPostfixOperator(tValues.at(j)) || IsFunction(tValues.at(j)))
|
||||||
|
{
|
||||||
|
others.insert(tValues.at(j));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
measurements.insert(tValues.at(j));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QStringList(measurements.toList());
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief ChangeActivPP set new active pattern piece name.
|
* @brief ChangeActivPP set new active pattern piece name.
|
||||||
|
@ -989,3 +1037,233 @@ void VAbstractPattern::CheckTagExists(const QString &tag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QStringList VAbstractPattern::ListIncrements() const
|
||||||
|
{
|
||||||
|
QStringList increments;
|
||||||
|
const QDomNodeList list = elementsByTagName(TagIncrement);
|
||||||
|
for (int i=0; i < list.size(); ++i)
|
||||||
|
{
|
||||||
|
const QDomElement dom = list.at(i).toElement();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
increments.append(GetParametrString(dom, IncrementName));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return increments;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QStringList VAbstractPattern::ListExpressions() const
|
||||||
|
{
|
||||||
|
QStringList list;
|
||||||
|
|
||||||
|
list << ListPointExpressions();
|
||||||
|
list << ListArcExpressions();
|
||||||
|
list << ListSplineExpressions();
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QStringList VAbstractPattern::ListPointExpressions() const
|
||||||
|
{
|
||||||
|
QStringList expressions;
|
||||||
|
const QDomNodeList list = elementsByTagName(TagPoint);
|
||||||
|
for (int i=0; i < list.size(); ++i)
|
||||||
|
{
|
||||||
|
const QDomElement dom = list.at(i).toElement();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrLength));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrAngle));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrC1Radius));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrC2Radius));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrCRadius));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return expressions;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QStringList VAbstractPattern::ListArcExpressions() const
|
||||||
|
{
|
||||||
|
QStringList expressions;
|
||||||
|
const QDomNodeList list = elementsByTagName(TagPoint);
|
||||||
|
for (int i=0; i < list.size(); ++i)
|
||||||
|
{
|
||||||
|
const QDomElement dom = list.at(i).toElement();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrAngle1));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrAngle2));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrRadius));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrLength));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return expressions;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QStringList VAbstractPattern::ListSplineExpressions() const
|
||||||
|
{
|
||||||
|
QStringList expressions;
|
||||||
|
expressions << ListPathPointExpressions();
|
||||||
|
return expressions;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QStringList VAbstractPattern::ListPathPointExpressions() const
|
||||||
|
{
|
||||||
|
QStringList expressions;
|
||||||
|
const QDomNodeList list = elementsByTagName(TagPoint);
|
||||||
|
for (int i=0; i < list.size(); ++i)
|
||||||
|
{
|
||||||
|
const QDomElement dom = list.at(i).toElement();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrKAsm1));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrKAsm2));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expressions.append(GetParametrString(dom, AttrAngle));
|
||||||
|
}
|
||||||
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
Q_UNUSED(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return expressions;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool VAbstractPattern::IsVariable(const QString &token) const
|
||||||
|
{
|
||||||
|
for (int i = 0; i < builInVariables.size(); ++i)
|
||||||
|
{
|
||||||
|
if (token.indexOf( builInVariables.at(i) ) == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool VAbstractPattern::IsPostfixOperator(const QString &token) const
|
||||||
|
{
|
||||||
|
for (int i = 0; i < builInPostfixOperators.size(); ++i)
|
||||||
|
{
|
||||||
|
if (token.indexOf( builInPostfixOperators.at(i) ) == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool VAbstractPattern::IsFunction(const QString &token) const
|
||||||
|
{
|
||||||
|
for (int i = 0; i < builInFunctions.size(); ++i)
|
||||||
|
{
|
||||||
|
if (token.indexOf( builInFunctions.at(i) ) == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -48,6 +48,8 @@ public:
|
||||||
VAbstractPattern(QObject *parent = nullptr);
|
VAbstractPattern(QObject *parent = nullptr);
|
||||||
virtual ~VAbstractPattern() Q_DECL_OVERRIDE;
|
virtual ~VAbstractPattern() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
QStringList ListMeasurements() const;
|
||||||
|
|
||||||
virtual void CreateEmptyFile(const QString &tablePath)=0;
|
virtual void CreateEmptyFile(const QString &tablePath)=0;
|
||||||
|
|
||||||
void ChangeActivPP(const QString& name, const Document &parse = Document::FullParse);
|
void ChangeActivPP(const QString& name, const Document &parse = Document::FullParse);
|
||||||
|
@ -242,6 +244,17 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VAbstractPattern)
|
Q_DISABLE_COPY(VAbstractPattern)
|
||||||
|
|
||||||
|
QStringList ListIncrements() const;
|
||||||
|
QStringList ListExpressions() const;
|
||||||
|
QStringList ListPointExpressions() const;
|
||||||
|
QStringList ListArcExpressions() const;
|
||||||
|
QStringList ListSplineExpressions() const;
|
||||||
|
QStringList ListPathPointExpressions() const;
|
||||||
|
|
||||||
|
bool IsVariable(const QString& token) const;
|
||||||
|
bool IsPostfixOperator(const QString& token) const;
|
||||||
|
bool IsFunction(const QString& token) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#include "varc.h"
|
#include "varc.h"
|
||||||
#include "varc_p.h"
|
#include "varc_p.h"
|
||||||
|
#include "../ifc/ifcdef.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
|
@ -273,13 +275,13 @@ QPointF VArc::CutArc(const qreal &length) const
|
||||||
void VArc::setId(const quint32 &id)
|
void VArc::setId(const quint32 &id)
|
||||||
{
|
{
|
||||||
VAbstractCurve::setId(id);
|
VAbstractCurve::setId(id);
|
||||||
setName(QString (arc_+"%1_%2").arg(d->center.name()).arg(id));
|
setName(ARC_ + QString("%1_%2").arg(d->center.name()).arg(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VArc::ArcName()
|
void VArc::ArcName()
|
||||||
{
|
{
|
||||||
setName(QString (arc_+"%1").arg(this->GetCenter().name()));
|
setName(ARC_ + QString("%1").arg(this->GetCenter().name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -9,8 +9,7 @@ SOURCES += \
|
||||||
$$PWD/vpointf.cpp \
|
$$PWD/vpointf.cpp \
|
||||||
$$PWD/vspline.cpp \
|
$$PWD/vspline.cpp \
|
||||||
$$PWD/vsplinepath.cpp \
|
$$PWD/vsplinepath.cpp \
|
||||||
$$PWD/vsplinepoint.cpp \
|
$$PWD/vsplinepoint.cpp
|
||||||
$$PWD/vgeometrydef.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/stable.h \
|
$$PWD/stable.h \
|
||||||
|
|
|
@ -35,20 +35,4 @@ enum class Draw : char { Calculation, Modeling, Layout };
|
||||||
enum class GOType : char { Point, Arc, Spline, SplinePath, Unknown };
|
enum class GOType : char { Point, Arc, Spline, SplinePath, Unknown };
|
||||||
enum class SplinePointPosition : char { FirstPoint, LastPoint };
|
enum class SplinePointPosition : char { FirstPoint, LastPoint };
|
||||||
|
|
||||||
// variables name
|
|
||||||
extern const QString arc_;
|
|
||||||
extern const QString spl_;
|
|
||||||
extern const QString splPath;
|
|
||||||
extern const QString radius_V;
|
|
||||||
extern const QString radiusArc_;
|
|
||||||
extern const QString angle1_V;
|
|
||||||
extern const QString angle2_V;
|
|
||||||
extern const QString angle1Arc_;
|
|
||||||
extern const QString angle2Arc_;
|
|
||||||
extern const QString angle1Spl_;
|
|
||||||
extern const QString angle2Spl_;
|
|
||||||
extern const QString angle1SplPath;
|
|
||||||
extern const QString angle2SplPath;
|
|
||||||
|
|
||||||
|
|
||||||
#endif // VGEOMETRYDEF_H
|
#endif // VGEOMETRYDEF_H
|
||||||
|
|
|
@ -601,7 +601,7 @@ qreal VSpline::CalcSqDistance (qreal x1, qreal y1, qreal x2, qreal y2)
|
||||||
*/
|
*/
|
||||||
void VSpline::CreateName()
|
void VSpline::CreateName()
|
||||||
{
|
{
|
||||||
setName(QString(spl_+"%1_%2").arg(this->GetP1().name(), this->GetP4().name()));
|
setName(SPL_ + QString("%1_%2").arg(this->GetP1().name(), this->GetP4().name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -343,10 +343,6 @@ const QString p52_S = QStringLiteral("p52");
|
||||||
const QString p53_S = QStringLiteral("p53");
|
const QString p53_S = QStringLiteral("p53");
|
||||||
const QString p54_S = QStringLiteral("p54");
|
const QString p54_S = QStringLiteral("p54");
|
||||||
|
|
||||||
//variables
|
|
||||||
const QString line_ = QStringLiteral("Line_");
|
|
||||||
const QString angleLine_ = QStringLiteral("AngleLine_");
|
|
||||||
|
|
||||||
//functions
|
//functions
|
||||||
const QString sin_F = QStringLiteral("sin");
|
const QString sin_F = QStringLiteral("sin");
|
||||||
const QString cos_F = QStringLiteral("cos");
|
const QString cos_F = QStringLiteral("cos");
|
||||||
|
@ -386,6 +382,10 @@ const QString cm_Oprt = QStringLiteral("cm");
|
||||||
const QString mm_Oprt = QStringLiteral("mm");
|
const QString mm_Oprt = QStringLiteral("mm");
|
||||||
const QString in_Oprt = QStringLiteral("in");
|
const QString in_Oprt = QStringLiteral("in");
|
||||||
|
|
||||||
|
const QStringList builInPostfixOperators = QStringList() << cm_Oprt
|
||||||
|
<< mm_Oprt
|
||||||
|
<< in_Oprt;
|
||||||
|
|
||||||
const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png");
|
const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png");
|
||||||
const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png");
|
const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png");
|
||||||
|
|
||||||
|
|
|
@ -529,13 +529,6 @@ extern const QString p52_S;
|
||||||
extern const QString p53_S;
|
extern const QString p53_S;
|
||||||
extern const QString p54_S;
|
extern const QString p54_S;
|
||||||
|
|
||||||
extern const QString line_;
|
|
||||||
extern const QString angleLine_;
|
|
||||||
|
|
||||||
// variables name
|
|
||||||
extern const QString line_;
|
|
||||||
extern const QString angleLine_;
|
|
||||||
|
|
||||||
// functions
|
// functions
|
||||||
extern const QString sin_F;
|
extern const QString sin_F;
|
||||||
extern const QString cos_F;
|
extern const QString cos_F;
|
||||||
|
@ -571,6 +564,8 @@ extern const QString cm_Oprt;
|
||||||
extern const QString mm_Oprt;
|
extern const QString mm_Oprt;
|
||||||
extern const QString in_Oprt;
|
extern const QString in_Oprt;
|
||||||
|
|
||||||
|
extern const QStringList builInPostfixOperators;
|
||||||
|
|
||||||
extern const QString cursorArrowOpenHand;
|
extern const QString cursorArrowOpenHand;
|
||||||
extern const QString cursorArrowCloseHand;
|
extern const QString cursorArrowCloseHand;
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
#include "../vgeometry/vgeometrydef.h"
|
#include "../vgeometry/vgeometrydef.h"
|
||||||
#include "../qmuparser/qmutokenparser.h"
|
#include "../qmuparser/qmutokenparser.h"
|
||||||
|
#include "../ifc/ifcdef.h"
|
||||||
|
|
||||||
using namespace qmu;
|
using namespace qmu;
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId,
|
||||||
vis = new VisToolAlongLine(data);
|
vis = new VisToolAlongLine(data);
|
||||||
|
|
||||||
// Call after initialization vis!!!!
|
// Call after initialization vis!!!!
|
||||||
SetTypeLine(VAbstractTool::TypeLineNone);//By default don't show line
|
SetTypeLine(TypeLineNone);//By default don't show line
|
||||||
|
|
||||||
FixateSize();
|
FixateSize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *p
|
||||||
FillComboBoxLineColors(ui->comboBoxLineColor);
|
FillComboBoxLineColors(ui->comboBoxLineColor);
|
||||||
|
|
||||||
QMap<QString, QIcon> stylesPics = VAbstractTool::LineStylesPics();
|
QMap<QString, QIcon> stylesPics = VAbstractTool::LineStylesPics();
|
||||||
stylesPics.remove(VAbstractTool::TypeLineNone);// Prevent hiding line
|
stylesPics.remove(TypeLineNone);// Prevent hiding line
|
||||||
FillComboBoxTypeLine(ui->comboBoxLineType, stylesPics);
|
FillComboBoxTypeLine(ui->comboBoxLineType, stylesPics);
|
||||||
|
|
||||||
number = 0;
|
number = 0;
|
||||||
|
|
|
@ -227,7 +227,7 @@ QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const
|
||||||
#endif
|
#endif
|
||||||
if (value.isEmpty())
|
if (value.isEmpty())
|
||||||
{
|
{
|
||||||
value = VAbstractTool::TypeLineLine;
|
value = TypeLineLine;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,81 +40,6 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QtCore/qmath.h>
|
#include <QtCore/qmath.h>
|
||||||
|
|
||||||
const QString VAbstractTool::AttrType = QStringLiteral("type");
|
|
||||||
const QString VAbstractTool::AttrMx = QStringLiteral("mx");
|
|
||||||
const QString VAbstractTool::AttrMy = QStringLiteral("my");
|
|
||||||
const QString VAbstractTool::AttrName = QStringLiteral("name");
|
|
||||||
const QString VAbstractTool::AttrMx1 = QStringLiteral("mx1");
|
|
||||||
const QString VAbstractTool::AttrMy1 = QStringLiteral("my1");
|
|
||||||
const QString VAbstractTool::AttrName1 = QStringLiteral("name1");
|
|
||||||
const QString VAbstractTool::AttrMx2 = QStringLiteral("mx2");
|
|
||||||
const QString VAbstractTool::AttrMy2 = QStringLiteral("my2");
|
|
||||||
const QString VAbstractTool::AttrName2 = QStringLiteral("name2");
|
|
||||||
const QString VAbstractTool::AttrBaseLineP1 = QStringLiteral("baseLineP1");
|
|
||||||
const QString VAbstractTool::AttrBaseLineP2 = QStringLiteral("baseLineP2");
|
|
||||||
const QString VAbstractTool::AttrDartP1 = QStringLiteral("dartP1");
|
|
||||||
const QString VAbstractTool::AttrDartP2 = QStringLiteral("dartP2");
|
|
||||||
const QString VAbstractTool::AttrDartP3 = QStringLiteral("dartP3");
|
|
||||||
const QString VAbstractTool::AttrX = QStringLiteral("x");
|
|
||||||
const QString VAbstractTool::AttrY = QStringLiteral("y");
|
|
||||||
const QString VAbstractTool::AttrTypeLine = QStringLiteral("typeLine");
|
|
||||||
const QString VAbstractTool::AttrLength = QStringLiteral("length");
|
|
||||||
const QString VAbstractTool::AttrBasePoint = QStringLiteral("basePoint");
|
|
||||||
const QString VAbstractTool::AttrFirstPoint = QStringLiteral("firstPoint");
|
|
||||||
const QString VAbstractTool::AttrSecondPoint = QStringLiteral("secondPoint");
|
|
||||||
const QString VAbstractTool::AttrThirdPoint = QStringLiteral("thirdPoint");
|
|
||||||
const QString VAbstractTool::AttrCenter = QStringLiteral("center");
|
|
||||||
const QString VAbstractTool::AttrRadius = QStringLiteral("radius");
|
|
||||||
const QString VAbstractTool::AttrAngle = QStringLiteral("angle");
|
|
||||||
const QString VAbstractTool::AttrAngle1 = QStringLiteral("angle1");
|
|
||||||
const QString VAbstractTool::AttrAngle2 = QStringLiteral("angle2");
|
|
||||||
const QString VAbstractTool::AttrP1Line = QStringLiteral("p1Line");
|
|
||||||
const QString VAbstractTool::AttrP2Line = QStringLiteral("p2Line");
|
|
||||||
const QString VAbstractTool::AttrP1Line1 = QStringLiteral("p1Line1");
|
|
||||||
const QString VAbstractTool::AttrP2Line1 = QStringLiteral("p2Line1");
|
|
||||||
const QString VAbstractTool::AttrP1Line2 = QStringLiteral("p1Line2");
|
|
||||||
const QString VAbstractTool::AttrP2Line2 = QStringLiteral("p2Line2");
|
|
||||||
const QString VAbstractTool::AttrPShoulder = QStringLiteral("pShoulder");
|
|
||||||
const QString VAbstractTool::AttrPoint1 = QStringLiteral("point1");
|
|
||||||
const QString VAbstractTool::AttrPoint2 = QStringLiteral("point2");
|
|
||||||
const QString VAbstractTool::AttrPoint4 = QStringLiteral("point4");
|
|
||||||
const QString VAbstractTool::AttrKAsm1 = QStringLiteral("kAsm1");
|
|
||||||
const QString VAbstractTool::AttrKAsm2 = QStringLiteral("kAsm2");
|
|
||||||
const QString VAbstractTool::AttrKCurve = QStringLiteral("kCurve");
|
|
||||||
const QString VAbstractTool::AttrPathPoint = QStringLiteral("pathPoint");
|
|
||||||
const QString VAbstractTool::AttrPSpline = QStringLiteral("pSpline");
|
|
||||||
const QString VAbstractTool::AttrAxisP1 = QStringLiteral("axisP1");
|
|
||||||
const QString VAbstractTool::AttrAxisP2 = QStringLiteral("axisP2");
|
|
||||||
const QString VAbstractTool::AttrCurve = QStringLiteral("curve");
|
|
||||||
const QString VAbstractTool::AttrLineColor = QStringLiteral("lineColor");
|
|
||||||
const QString VAbstractTool::AttrColor = QStringLiteral("color");
|
|
||||||
const QString VAbstractTool::AttrFirstArc = QStringLiteral("firstArc");
|
|
||||||
const QString VAbstractTool::AttrSecondArc = QStringLiteral("secondArc");
|
|
||||||
const QString VAbstractTool::AttrCrossPoint = QStringLiteral("crossPoint");
|
|
||||||
const QString VAbstractTool::AttrC1Center = QStringLiteral("c1Center");
|
|
||||||
const QString VAbstractTool::AttrC2Center = QStringLiteral("c2Center");
|
|
||||||
const QString VAbstractTool::AttrC1Radius = QStringLiteral("c1Radius");
|
|
||||||
const QString VAbstractTool::AttrC2Radius = QStringLiteral("c2Radius");
|
|
||||||
const QString VAbstractTool::AttrCCenter = QStringLiteral("cCenter");
|
|
||||||
const QString VAbstractTool::AttrTangent = QStringLiteral("tangent");
|
|
||||||
const QString VAbstractTool::AttrCRadius = QStringLiteral("cRadius");
|
|
||||||
const QString VAbstractTool::AttrArc = QStringLiteral("arc");
|
|
||||||
|
|
||||||
const QString VAbstractTool::TypeLineNone = QStringLiteral("none");
|
|
||||||
const QString VAbstractTool::TypeLineLine = QStringLiteral("hair");
|
|
||||||
const QString VAbstractTool::TypeLineDashLine = QStringLiteral("dashLine");
|
|
||||||
const QString VAbstractTool::TypeLineDotLine = QStringLiteral("dotLine");
|
|
||||||
const QString VAbstractTool::TypeLineDashDotLine = QStringLiteral("dashDotLine");
|
|
||||||
const QString VAbstractTool::TypeLineDashDotDotLine = QStringLiteral("dashDotDotLine");
|
|
||||||
|
|
||||||
const QString VAbstractTool::ColorBlack = QStringLiteral("black");
|
|
||||||
const QString VAbstractTool::ColorGreen = QStringLiteral("green");
|
|
||||||
const QString VAbstractTool::ColorBlue = QStringLiteral("blue");
|
|
||||||
const QString VAbstractTool::ColorDarkRed = QStringLiteral("darkRed");
|
|
||||||
const QString VAbstractTool::ColorDarkGreen = QStringLiteral("darkGreen");
|
|
||||||
const QString VAbstractTool::ColorDarkBlue = QStringLiteral("darkBlue");
|
|
||||||
const QString VAbstractTool::ColorYellow = QStringLiteral("yellow");
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief VAbstractTool container.
|
* @brief VAbstractTool container.
|
||||||
|
@ -244,7 +169,8 @@ QMap<QString, QIcon> VAbstractTool::LineStylesPics()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
const QStringList VAbstractTool::Colors()
|
const QStringList VAbstractTool::Colors()
|
||||||
{
|
{
|
||||||
const QStringList colors = QStringList() << ColorBlack << ColorGreen << ColorBlue << ColorDarkRed << ColorDarkGreen
|
const QStringList colors = QStringList() << ColorBlack << ColorGreen << ColorBlue
|
||||||
|
<< ColorDarkRed << ColorDarkGreen
|
||||||
<< ColorDarkBlue << ColorYellow;
|
<< ColorDarkBlue << ColorYellow;
|
||||||
return colors;
|
return colors;
|
||||||
}
|
}
|
||||||
|
@ -333,8 +259,9 @@ void VAbstractTool::ToolCreation(const Source &typeCreation)
|
||||||
*/
|
*/
|
||||||
const QStringList VAbstractTool::StylesList()
|
const QStringList VAbstractTool::StylesList()
|
||||||
{
|
{
|
||||||
const QStringList styles = QStringList() << TypeLineNone << TypeLineLine << TypeLineDashLine << TypeLineDotLine
|
const QStringList styles = QStringList() << TypeLineNone << TypeLineLine << TypeLineDashLine
|
||||||
<< TypeLineDashDotLine << TypeLineDashDotDotLine;
|
<< TypeLineDotLine << TypeLineDashDotLine
|
||||||
|
<< TypeLineDashDotDotLine;
|
||||||
return styles;
|
return styles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,80 +54,6 @@ public:
|
||||||
VAbstractTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr);
|
VAbstractTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr);
|
||||||
virtual ~VAbstractTool() Q_DECL_OVERRIDE;
|
virtual ~VAbstractTool() Q_DECL_OVERRIDE;
|
||||||
quint32 getId() const;
|
quint32 getId() const;
|
||||||
static const QString AttrType;
|
|
||||||
static const QString AttrMx;
|
|
||||||
static const QString AttrMy;
|
|
||||||
static const QString AttrName;
|
|
||||||
static const QString AttrMx1;
|
|
||||||
static const QString AttrMy1;
|
|
||||||
static const QString AttrName1;
|
|
||||||
static const QString AttrMx2;
|
|
||||||
static const QString AttrMy2;
|
|
||||||
static const QString AttrName2;
|
|
||||||
static const QString AttrBaseLineP1;
|
|
||||||
static const QString AttrBaseLineP2;
|
|
||||||
static const QString AttrDartP1;
|
|
||||||
static const QString AttrDartP2;
|
|
||||||
static const QString AttrDartP3;
|
|
||||||
static const QString AttrX;
|
|
||||||
static const QString AttrY;
|
|
||||||
static const QString AttrTypeLine;
|
|
||||||
static const QString AttrLength;
|
|
||||||
static const QString AttrBasePoint;
|
|
||||||
static const QString AttrFirstPoint;
|
|
||||||
static const QString AttrSecondPoint;
|
|
||||||
static const QString AttrThirdPoint;
|
|
||||||
static const QString AttrCenter;
|
|
||||||
static const QString AttrRadius;
|
|
||||||
static const QString AttrAngle;
|
|
||||||
static const QString AttrAngle1;
|
|
||||||
static const QString AttrAngle2;
|
|
||||||
static const QString AttrP1Line;
|
|
||||||
static const QString AttrP2Line;
|
|
||||||
static const QString AttrP1Line1;
|
|
||||||
static const QString AttrP2Line1;
|
|
||||||
static const QString AttrP1Line2;
|
|
||||||
static const QString AttrP2Line2;
|
|
||||||
static const QString AttrPShoulder;
|
|
||||||
static const QString AttrPoint1;
|
|
||||||
static const QString AttrPoint2;
|
|
||||||
static const QString AttrPoint4;
|
|
||||||
static const QString AttrKAsm1;
|
|
||||||
static const QString AttrKAsm2;
|
|
||||||
static const QString AttrKCurve;
|
|
||||||
static const QString AttrPathPoint;
|
|
||||||
static const QString AttrPSpline;
|
|
||||||
static const QString AttrAxisP1;
|
|
||||||
static const QString AttrAxisP2;
|
|
||||||
static const QString AttrCurve;
|
|
||||||
static const QString AttrLineColor;
|
|
||||||
static const QString AttrColor;
|
|
||||||
static const QString AttrFirstArc;
|
|
||||||
static const QString AttrSecondArc;
|
|
||||||
static const QString AttrCrossPoint;
|
|
||||||
static const QString AttrC1Center;
|
|
||||||
static const QString AttrC2Center;
|
|
||||||
static const QString AttrC1Radius;
|
|
||||||
static const QString AttrC2Radius;
|
|
||||||
static const QString AttrCCenter;
|
|
||||||
static const QString AttrTangent;
|
|
||||||
static const QString AttrCRadius;
|
|
||||||
static const QString AttrArc;
|
|
||||||
|
|
||||||
static const QString TypeLineNone;
|
|
||||||
static const QString TypeLineLine;
|
|
||||||
static const QString TypeLineDashLine;
|
|
||||||
static const QString TypeLineDotLine;
|
|
||||||
static const QString TypeLineDashDotLine;
|
|
||||||
static const QString TypeLineDashDotDotLine;
|
|
||||||
|
|
||||||
static const QString ColorBlack;
|
|
||||||
static const QString ColorGreen;
|
|
||||||
static const QString ColorBlue;
|
|
||||||
static const QString ColorDarkRed;
|
|
||||||
static const QString ColorDarkGreen;
|
|
||||||
static const QString ColorDarkBlue;
|
|
||||||
static const QString ColorYellow;
|
|
||||||
|
|
||||||
static const QStringList StylesList();
|
static const QStringList StylesList();
|
||||||
static Qt::PenStyle LineStyleToPenStyle(const QString &typeLine);
|
static Qt::PenStyle LineStyleToPenStyle(const QString &typeLine);
|
||||||
|
|
|
@ -671,8 +671,8 @@ QVector<VDetail> VToolUnionDetails::GetDetailFromFile(VAbstractPattern *doc, con
|
||||||
if (element.tagName() == VToolUnionDetails::TagNode)
|
if (element.tagName() == VToolUnionDetails::TagNode)
|
||||||
{
|
{
|
||||||
quint32 id = doc->GetParametrUInt(element, VToolDetail::AttrIdObject, NULL_ID_STR);
|
quint32 id = doc->GetParametrUInt(element, VToolDetail::AttrIdObject, NULL_ID_STR);
|
||||||
qreal mx = qApp->toPixel(doc->GetParametrDouble(element, VAbstractTool::AttrMx, "0.0"));
|
qreal mx = qApp->toPixel(doc->GetParametrDouble(element, AttrMx, "0.0"));
|
||||||
qreal my = qApp->toPixel(doc->GetParametrDouble(element, VAbstractTool::AttrMy, "0.0"));
|
qreal my = qApp->toPixel(doc->GetParametrDouble(element, AttrMy, "0.0"));
|
||||||
const bool reversed = doc->GetParametrUInt(element, VToolDetail::AttrReverse, "0");
|
const bool reversed = doc->GetParametrUInt(element, VToolDetail::AttrReverse, "0");
|
||||||
Tool tool = Tool::NodePoint;
|
Tool tool = Tool::NodePoint;
|
||||||
NodeDetail nodeType = NodeDetail::Contour;
|
NodeDetail nodeType = NodeDetail::Contour;
|
||||||
|
|
|
@ -45,8 +45,8 @@ MoveDetail::MoveDetail(VAbstractPattern *doc, const double &x, const double &y,
|
||||||
QDomElement domElement = doc->elementById(id);
|
QDomElement domElement = doc->elementById(id);
|
||||||
if (domElement.isElement())
|
if (domElement.isElement())
|
||||||
{
|
{
|
||||||
oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0"));
|
oldX = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMx, "0.0"));
|
||||||
oldY = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy, "0.0"));
|
oldY = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMy, "0.0"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -134,6 +134,6 @@ int MoveDetail::id() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MoveDetail::SaveCoordinates(QDomElement &domElement, double x, double y)
|
void MoveDetail::SaveCoordinates(QDomElement &domElement, double x, double y)
|
||||||
{
|
{
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrMx, QString().setNum(qApp->fromPixel(x)));
|
doc->SetAttribute(domElement, AttrMx, QString().setNum(qApp->fromPixel(x)));
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrMy, QString().setNum(qApp->fromPixel(y)));
|
doc->SetAttribute(domElement, AttrMy, QString().setNum(qApp->fromPixel(y)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,13 +69,13 @@ MoveDoubleLabel::MoveDoubleLabel(VAbstractPattern *doc, const double &x, const d
|
||||||
{
|
{
|
||||||
if (type == DoublePoint::FirstPoint)
|
if (type == DoublePoint::FirstPoint)
|
||||||
{
|
{
|
||||||
oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx1, "0.0"));
|
oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMx1, "0.0"));
|
||||||
oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy1, "0.0"));
|
oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMy1, "0.0"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx2, "0.0"));
|
oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMx2, "0.0"));
|
||||||
oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy2, "0.0"));
|
oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMy2, "0.0"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == DoublePoint::FirstPoint)
|
if (type == DoublePoint::FirstPoint)
|
||||||
|
@ -168,13 +168,13 @@ void MoveDoubleLabel::Do(double mx, double my)
|
||||||
{
|
{
|
||||||
if (type == DoublePoint::FirstPoint)
|
if (type == DoublePoint::FirstPoint)
|
||||||
{
|
{
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrMx1, QString().setNum(qApp->fromPixel(mx)));
|
doc->SetAttribute(domElement, AttrMx1, QString().setNum(qApp->fromPixel(mx)));
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrMy1, QString().setNum(qApp->fromPixel(my)));
|
doc->SetAttribute(domElement, AttrMy1, QString().setNum(qApp->fromPixel(my)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrMx2, QString().setNum(qApp->fromPixel(mx)));
|
doc->SetAttribute(domElement, AttrMx2, QString().setNum(qApp->fromPixel(mx)));
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrMy2, QString().setNum(qApp->fromPixel(my)));
|
doc->SetAttribute(domElement, AttrMy2, QString().setNum(qApp->fromPixel(my)));
|
||||||
}
|
}
|
||||||
|
|
||||||
emit NeedLiteParsing(Document::LitePPParse);
|
emit NeedLiteParsing(Document::LitePPParse);
|
||||||
|
|
|
@ -49,8 +49,8 @@ MoveLabel::MoveLabel(VAbstractPattern *doc, const double &x, const double &y, co
|
||||||
QDomElement domElement = doc->elementById(id);
|
QDomElement domElement = doc->elementById(id);
|
||||||
if (domElement.isElement())
|
if (domElement.isElement())
|
||||||
{
|
{
|
||||||
oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0"));
|
oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMx, "0.0"));
|
||||||
oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy, "0.0"));
|
oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, AttrMy, "0.0"));
|
||||||
|
|
||||||
qCDebug(vUndo, "Label old Mx %f", oldMx);
|
qCDebug(vUndo, "Label old Mx %f", oldMx);
|
||||||
qCDebug(vUndo, "Label old My %f", oldMy);
|
qCDebug(vUndo, "Label old My %f", oldMy);
|
||||||
|
@ -117,8 +117,8 @@ void MoveLabel::Do(double mx, double my)
|
||||||
QDomElement domElement = doc->elementById(nodeId);
|
QDomElement domElement = doc->elementById(nodeId);
|
||||||
if (domElement.isElement())
|
if (domElement.isElement())
|
||||||
{
|
{
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrMx, QString().setNum(qApp->fromPixel(mx)));
|
doc->SetAttribute(domElement, AttrMx, QString().setNum(qApp->fromPixel(mx)));
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrMy, QString().setNum(qApp->fromPixel(my)));
|
doc->SetAttribute(domElement, AttrMy, QString().setNum(qApp->fromPixel(my)));
|
||||||
|
|
||||||
emit NeedLiteParsing(Document::LitePPParse);
|
emit NeedLiteParsing(Document::LitePPParse);
|
||||||
|
|
||||||
|
|
|
@ -92,11 +92,11 @@ void MoveSpline::Do(const VSpline &spl)
|
||||||
QDomElement domElement = doc->elementById(nodeId);
|
QDomElement domElement = doc->elementById(nodeId);
|
||||||
if (domElement.isElement())
|
if (domElement.isElement())
|
||||||
{
|
{
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrAngle1, QString().setNum(spl.GetStartAngle()));
|
doc->SetAttribute(domElement, AttrAngle1, QString().setNum(spl.GetStartAngle()));
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrAngle2, QString().setNum(spl.GetEndAngle()));
|
doc->SetAttribute(domElement, AttrAngle2, QString().setNum(spl.GetEndAngle()));
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrKAsm1, QString().setNum(spl.GetKasm1()));
|
doc->SetAttribute(domElement, AttrKAsm1, QString().setNum(spl.GetKasm1()));
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrKAsm2, QString().setNum(spl.GetKasm2()));
|
doc->SetAttribute(domElement, AttrKAsm2, QString().setNum(spl.GetKasm2()));
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrKCurve, QString().setNum(spl.GetKcurve()));
|
doc->SetAttribute(domElement, AttrKCurve, QString().setNum(spl.GetKcurve()));
|
||||||
|
|
||||||
emit NeedLiteParsing(Document::LiteParse);
|
emit NeedLiteParsing(Document::LiteParse);
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ void MoveSplinePath::Do(const VSplinePath &splPath)
|
||||||
QDomElement domElement = doc->elementById(nodeId);
|
QDomElement domElement = doc->elementById(nodeId);
|
||||||
if (domElement.isElement())
|
if (domElement.isElement())
|
||||||
{
|
{
|
||||||
doc->SetAttribute(domElement, VToolSplinePath::AttrKCurve, QString().setNum(splPath.GetKCurve()));
|
doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.GetKCurve()));
|
||||||
VToolSplinePath::UpdatePathPoint(doc, domElement, splPath);
|
VToolSplinePath::UpdatePathPoint(doc, domElement, splPath);
|
||||||
|
|
||||||
emit NeedLiteParsing(Document::LiteParse);
|
emit NeedLiteParsing(Document::LiteParse);
|
||||||
|
|
|
@ -49,8 +49,8 @@ MoveSPoint::MoveSPoint(VAbstractPattern *doc, const double &x, const double &y,
|
||||||
QDomElement domElement = doc->elementById(id);
|
QDomElement domElement = doc->elementById(id);
|
||||||
if (domElement.isElement())
|
if (domElement.isElement())
|
||||||
{
|
{
|
||||||
oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrX, "0.0"));
|
oldX = qApp->toPixel(doc->GetParametrDouble(domElement, AttrX, "0.0"));
|
||||||
oldY = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrY, "0.0"));
|
oldY = qApp->toPixel(doc->GetParametrDouble(domElement, AttrY, "0.0"));
|
||||||
|
|
||||||
qCDebug(vUndo, "SPoint oldX %f", oldX);
|
qCDebug(vUndo, "SPoint oldX %f", oldX);
|
||||||
qCDebug(vUndo, "SPoint oldY %f", oldY);
|
qCDebug(vUndo, "SPoint oldY %f", oldY);
|
||||||
|
@ -119,8 +119,8 @@ void MoveSPoint::Do(double x, double y)
|
||||||
QDomElement domElement = doc->elementById(nodeId);
|
QDomElement domElement = doc->elementById(nodeId);
|
||||||
if (domElement.isElement())
|
if (domElement.isElement())
|
||||||
{
|
{
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrX, QString().setNum(qApp->fromPixel(x)));
|
doc->SetAttribute(domElement, AttrX, QString().setNum(qApp->fromPixel(x)));
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrY, QString().setNum(qApp->fromPixel(y)));
|
doc->SetAttribute(domElement, AttrY, QString().setNum(qApp->fromPixel(y)));
|
||||||
|
|
||||||
emit NeedLiteParsing(Document::LitePPParse);
|
emit NeedLiteParsing(Document::LitePPParse);
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,7 @@ int SaveDetailOptions::id() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void SaveDetailOptions::SaveDet(QDomElement &domElement, const VDetail &det)
|
void SaveDetailOptions::SaveDet(QDomElement &domElement, const VDetail &det)
|
||||||
{
|
{
|
||||||
doc->SetAttribute(domElement, VAbstractTool::AttrName, det.getName());
|
doc->SetAttribute(domElement, AttrName, det.getName());
|
||||||
doc->SetAttribute(domElement, VToolDetail::AttrSupplement, QString().setNum(det.getSeamAllowance()));
|
doc->SetAttribute(domElement, VToolDetail::AttrSupplement, QString().setNum(det.getSeamAllowance()));
|
||||||
doc->SetAttribute(domElement, VToolDetail::AttrClosed, QString().setNum(det.getClosed()));
|
doc->SetAttribute(domElement, VToolDetail::AttrClosed, QString().setNum(det.getClosed()));
|
||||||
doc->SetAttribute(domElement, VToolDetail::AttrWidth, QString().setNum(det.getWidth()));
|
doc->SetAttribute(domElement, VToolDetail::AttrWidth, QString().setNum(det.getWidth()));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user