Moving class VContainer in a static library complited.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-06-12 11:55:44 +03:00
parent 0322457ece
commit f8c6a65962
144 changed files with 1097 additions and 869 deletions

View File

@ -14,7 +14,8 @@ DEPENDPATH += \
../src/libs/ifc \
../src/libs/vobj \
../src/libs/vlayout \
../src/libs/vgeometry
../src/libs/vgeometry \
../src/libs/vpatterndb
include(../src/app/app.pri)
include(../src/libs/qmuparser/qmuparser.pri)
@ -23,6 +24,7 @@ include(../src/libs/ifc/ifc.pri)
include(../src/libs/vobj/vobj.pri)
include(../src/libs/vlayout/vlayout.pri)
include(../src/libs/vgeometry/vgeometry.pri)
include(../src/libs/vpatterndb/vpatterndb.pri)
# Add here path to new translation file with name "valentina_*_*.ts" if you want to add new language.
# Same paths in variable INSTALL_TRANSLATIONS (app.pro).

View File

@ -1,7 +1,6 @@
# Suport subdirectories. Just better project code tree.
include(container/container.pri)
include(dialogs/dialogs.pri)
include(geometry/geometry.pri)
include(tools/tools.pri)
include(widgets/widgets.pri)
include(xml/xml.pri)

View File

@ -600,6 +600,15 @@ DEPENDPATH += $$PWD/../libs/vgeometry
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
#VPatternDB staic library
unix|win32: LIBS += -L$$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/ -lvpatterndb
INCLUDEPATH += $$PWD/../libs/vpatterndb
DEPENDPATH += $$PWD/../libs/vpatterndb
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
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -2,49 +2,7 @@
# This need for corect working file translations.pro
SOURCES += \
$$PWD/vcontainer.cpp \
$$PWD/calculator.cpp \
$$PWD/variables/vmeasurement.cpp \
$$PWD/variables/vincrement.cpp \
$$PWD/variables/vvariable.cpp \
$$PWD/variables/vinternalvariable.cpp \
$$PWD/variables/vlineangle.cpp \
$$PWD/variables/varclength.cpp \
$$PWD/variables/vcurvelength.cpp \
$$PWD/variables/vlinelength.cpp \
$$PWD/variables/vsplinelength.cpp \
$$PWD/vformula.cpp \
$$PWD/variables/varcradius.cpp \
$$PWD/variables/vcurvevariable.cpp \
container/variables/vcurveangle.cpp \
container/variables/varcangle.cpp \
container/variables/vsplineangle.cpp \
container/vtranslatevars.cpp
$$PWD/vformula.cpp
HEADERS += \
$$PWD/vcontainer.h \
$$PWD/calculator.h \
$$PWD/variables/vmeasurement.h \
$$PWD/variables/vincrement.h \
$$PWD/variables/vvariable.h \
$$PWD/variables/vinternalvariable.h \
$$PWD/variables/vlineangle.h \
$$PWD/variables.h \
$$PWD/variables/vcurvelength.h \
$$PWD/variables/varclength.h \
$$PWD/variables/vlinelength.h \
$$PWD/variables/vsplinelength.h \
$$PWD/variables/vinternalvariable_p.h \
$$PWD/variables/vvariable_p.h \
$$PWD/variables/vincrement_p.h \
$$PWD/variables/vlineangle_p.h \
$$PWD/variables/vlinelength_p.h \
$$PWD/variables/vmeasurement_p.h \
$$PWD/vformula.h \
$$PWD/variables/varcradius.h \
$$PWD/variables/vcurvevariable.h \
$$PWD/variables/vcurvevariable_p.h \
container/variables/vcurveangle.h \
container/variables/varcangle.h \
container/variables/vsplineangle.h \
container/vtranslatevars.h
$$PWD/vformula.h

View File

@ -27,8 +27,8 @@
*************************************************************************/
#include "vformula.h"
#include "../container/calculator.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/calculator.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../core/vapplication.h"
#include "../core/vsettings.h"
#include <QDebug>
@ -102,7 +102,7 @@ QString VFormula::GetFormula(FormulaType type) const
}
else
{
return qApp->TrVars()->FormulaFromUser(formula);
return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
}
}
@ -225,8 +225,8 @@ void VFormula::Eval()
{
try
{
Calculator *cal = new Calculator(data);
QString expression = qApp->TrVars()->FormulaFromUser(formula);
Calculator *cal = new Calculator(data, qApp->patternType());
QString expression = qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
const qreal result = cal->EvalFormula(expression);
delete cal;

View File

@ -32,7 +32,7 @@
#include <QApplication>
#include "../options.h"
#include "../widgets/vmaingraphicsview.h"
#include "../container/vtranslatevars.h"
#include "../libs/vpatterndb/vtranslatevars.h"
#include "vsettings.h"
class VApplication;// used in define

View File

@ -492,7 +492,7 @@ void VSettings::SetUserPassword(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
int VSettings::GetLayoutPaperHeight() const
{
const int def = qFloor(VAbstractMeasurements::UnitConvertor(1189/*A0*/, Unit::Mm, Unit::Px));
const int def = qFloor(UnitConvertor(1189/*A0*/, Unit::Mm, Unit::Px));
bool ok = false;
const int height = value(SettingLayoutPaperHeight, def).toInt(&ok);
if (ok)
@ -514,7 +514,7 @@ void VSettings::SetLayoutPaperHeight(int value)
//---------------------------------------------------------------------------------------------------------------------
int VSettings::GetLayoutPaperWidth() const
{
const int def = qFloor(VAbstractMeasurements::UnitConvertor(841/*A0*/, Unit::Mm, Unit::Px));
const int def = qFloor(UnitConvertor(841/*A0*/, Unit::Mm, Unit::Px));
bool ok = false;
const int width = value(SettingLayoutPaperWidth, def).toInt(&ok);
if (ok)
@ -552,7 +552,7 @@ unsigned int VSettings::GetLayoutShift() const
//---------------------------------------------------------------------------------------------------------------------
unsigned int VSettings::GetDefLayoutShift()
{
return static_cast<unsigned int>(VAbstractMeasurements::UnitConvertor(50, Unit::Mm, Unit::Px));
return static_cast<unsigned int>(UnitConvertor(50, Unit::Mm, Unit::Px));
}
//---------------------------------------------------------------------------------------------------------------------
@ -580,7 +580,7 @@ unsigned int VSettings::GetLayoutWidth() const
//---------------------------------------------------------------------------------------------------------------------
unsigned int VSettings::GetDefLayoutWidth()
{
return static_cast<unsigned int>(VAbstractMeasurements::UnitConvertor(2.5, Unit::Mm, Unit::Px));
return static_cast<unsigned int>(UnitConvertor(2.5, Unit::Mm, Unit::Px));
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -942,7 +942,7 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column)
qCDebug(vDialog, "Changed value to %f", base);
// Convert value to measurements table unit
base = VAbstractMeasurements::UnitConvertor(base, qApp->patternUnit(), m->MUnit());
base = UnitConvertor(base, qApp->patternUnit(), m->MUnit());
m->SetAttribute(domElement, VIndividualMeasurements::AttrValue, QString("%1").arg(base));
QString error;

View File

@ -31,7 +31,7 @@
#include "../../xml/vindividualmeasurements.h"
#include "../../core/vapplication.h"
#include "../../core/vsettings.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include <QFileDialog>
#include <QMessageBox>

View File

@ -31,7 +31,6 @@
#include "../../core/vapplication.h"
#include "../../libs/ifc/xml/vdomdocument.h"
#include "../../core/vsettings.h"
#include "../../xml/vabstractmeasurements.h"
#include "../../libs/vlayout/vlayoutgenerator.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
@ -86,51 +85,51 @@ DialogLayoutSettings::~DialogLayoutSettings()
//---------------------------------------------------------------------------------------------------------------------
int DialogLayoutSettings::GetPaperHeight() const
{
return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), oldPaperUnit, Unit::Px));
return qFloor(UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), oldPaperUnit, Unit::Px));
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::SetPaperHeight(int value)
{
ui->doubleSpinBoxPaperHeight->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, PaperUnit()));
ui->doubleSpinBoxPaperHeight->setValue(UnitConvertor(value, Unit::Px, PaperUnit()));
}
//---------------------------------------------------------------------------------------------------------------------
int DialogLayoutSettings::GetPaperWidth() const
{
return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), oldPaperUnit, Unit::Px));
return qFloor(UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), oldPaperUnit, Unit::Px));
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::SetPaperWidth(int value)
{
ui->doubleSpinBoxPaperWidth->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, PaperUnit()));
ui->doubleSpinBoxPaperWidth->setValue(UnitConvertor(value, Unit::Px, PaperUnit()));
}
//---------------------------------------------------------------------------------------------------------------------
unsigned int DialogLayoutSettings::GetShift() const
{
return static_cast<quint32>(qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxShift->value(),
return static_cast<quint32>(qFloor(UnitConvertor(ui->doubleSpinBoxShift->value(),
oldLayoutUnit, Unit::Px)));
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::SetShift(unsigned int value)
{
ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, LayoutUnit()));
ui->doubleSpinBoxShift->setValue(UnitConvertor(value, Unit::Px, LayoutUnit()));
}
//---------------------------------------------------------------------------------------------------------------------
unsigned int DialogLayoutSettings::GetLayoutWidth() const
{
return static_cast<quint32>(qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxLayoutWidth->value(),
return static_cast<quint32>(qFloor(UnitConvertor(ui->doubleSpinBoxLayoutWidth->value(),
oldLayoutUnit, Unit::Px)));
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::SetLayoutWidth(unsigned int value)
{
ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, LayoutUnit()));
ui->doubleSpinBoxLayoutWidth->setValue(UnitConvertor(value, Unit::Px, LayoutUnit()));
}
//---------------------------------------------------------------------------------------------------------------------
@ -257,8 +256,8 @@ void DialogLayoutSettings::ConvertPaperSize()
ui->doubleSpinBoxPaperWidth->setMaximum(FromPixel(QIMAGE_MAX, paperUnit));
ui->doubleSpinBoxPaperHeight->setMaximum(FromPixel(QIMAGE_MAX, paperUnit));
ui->doubleSpinBoxPaperWidth->setValue(VAbstractMeasurements::UnitConvertor(width, oldPaperUnit, paperUnit));
ui->doubleSpinBoxPaperHeight->setValue(VAbstractMeasurements::UnitConvertor(height, oldPaperUnit, paperUnit));
ui->doubleSpinBoxPaperWidth->setValue(UnitConvertor(width, oldPaperUnit, paperUnit));
ui->doubleSpinBoxPaperHeight->setValue(UnitConvertor(height, oldPaperUnit, paperUnit));
oldPaperUnit = paperUnit;
CorrectPaperDecimals();
MinimumPaperSize();
@ -274,8 +273,8 @@ void DialogLayoutSettings::ConvertLayoutSize()
ui->doubleSpinBoxLayoutWidth->setMaximum(FromPixel(QIMAGE_MAX, unit));
ui->doubleSpinBoxShift->setMaximum(FromPixel(QIMAGE_MAX, unit));
ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(layoutWidth, oldLayoutUnit, unit));
ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(shift, oldLayoutUnit, unit));
ui->doubleSpinBoxLayoutWidth->setValue(UnitConvertor(layoutWidth, oldLayoutUnit, unit));
ui->doubleSpinBoxShift->setValue(UnitConvertor(shift, oldLayoutUnit, unit));
oldLayoutUnit = unit;
CorrectLayoutDecimals();
MinimumLayoutSize();
@ -432,74 +431,74 @@ QSizeF DialogLayoutSettings::Template()
case PaperSizeTemplate::A0:
SetAdditionalOptions(false);
width = VAbstractMeasurements::UnitConvertor(841, Unit::Mm, paperUnit);
height = VAbstractMeasurements::UnitConvertor(1189, Unit::Mm, paperUnit);
width = UnitConvertor(841, Unit::Mm, paperUnit);
height = UnitConvertor(1189, Unit::Mm, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::A1:
SetAdditionalOptions(false);
width = VAbstractMeasurements::UnitConvertor(594, Unit::Mm, paperUnit);
height = VAbstractMeasurements::UnitConvertor(841, Unit::Mm, paperUnit);
width = UnitConvertor(594, Unit::Mm, paperUnit);
height = UnitConvertor(841, Unit::Mm, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::A2:
SetAdditionalOptions(false);
width = VAbstractMeasurements::UnitConvertor(420, Unit::Mm, paperUnit);
height = VAbstractMeasurements::UnitConvertor(594, Unit::Mm, paperUnit);
width = UnitConvertor(420, Unit::Mm, paperUnit);
height = UnitConvertor(594, Unit::Mm, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::A3:
SetAdditionalOptions(false);
width = VAbstractMeasurements::UnitConvertor(297, Unit::Mm, paperUnit);
height = VAbstractMeasurements::UnitConvertor(420, Unit::Mm, paperUnit);
width = UnitConvertor(297, Unit::Mm, paperUnit);
height = UnitConvertor(420, Unit::Mm, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::A4:
SetAdditionalOptions(false);
width = VAbstractMeasurements::UnitConvertor(210, Unit::Mm, paperUnit);
height = VAbstractMeasurements::UnitConvertor(297, Unit::Mm, paperUnit);
width = UnitConvertor(210, Unit::Mm, paperUnit);
height = UnitConvertor(297, Unit::Mm, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::Letter:
SetAdditionalOptions(false);
width = VAbstractMeasurements::UnitConvertor(8.5, Unit::Inch, paperUnit);
height = VAbstractMeasurements::UnitConvertor(11, Unit::Inch, paperUnit);
width = UnitConvertor(8.5, Unit::Inch, paperUnit);
height = UnitConvertor(11, Unit::Inch, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::Legal:
SetAdditionalOptions(true);
width = VAbstractMeasurements::UnitConvertor(11, Unit::Inch, paperUnit);
height = VAbstractMeasurements::UnitConvertor(17, Unit::Inch, paperUnit);
width = UnitConvertor(11, Unit::Inch, paperUnit);
height = UnitConvertor(17, Unit::Inch, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::Roll24in:
SetAdditionalOptions(true);
width = VAbstractMeasurements::UnitConvertor(24, Unit::Inch, paperUnit);
height = VAbstractMeasurements::UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit);
width = UnitConvertor(24, Unit::Inch, paperUnit);
height = UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::Roll30in:
SetAdditionalOptions(true);
width = VAbstractMeasurements::UnitConvertor(30, Unit::Inch, paperUnit);
height = VAbstractMeasurements::UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit);
width = UnitConvertor(30, Unit::Inch, paperUnit);
height = UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::Roll36in:
SetAdditionalOptions(true);
width = VAbstractMeasurements::UnitConvertor(36, Unit::Inch, paperUnit);
height = VAbstractMeasurements::UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit);
width = UnitConvertor(36, Unit::Inch, paperUnit);
height = UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::Roll42in:
SetAdditionalOptions(true);
width = VAbstractMeasurements::UnitConvertor(42, Unit::Inch, paperUnit);
height = VAbstractMeasurements::UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit);
width = UnitConvertor(42, Unit::Inch, paperUnit);
height = UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::Roll44in:
SetAdditionalOptions(true);
width = VAbstractMeasurements::UnitConvertor(44, Unit::Inch, paperUnit);
height = VAbstractMeasurements::UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit);
width = UnitConvertor(44, Unit::Inch, paperUnit);
height = UnitConvertor(QIMAGE_MAX, Unit::Px, paperUnit);
return QSizeF(width, height);
default:
break;
@ -578,10 +577,8 @@ void DialogLayoutSettings::CorrectLayoutDecimals()
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::Label()
{
const int width = qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), PaperUnit(),
Unit::Px));
const int height = qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperHeight->value(),
PaperUnit(), Unit::Px));
const int width = qFloor(UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), PaperUnit(), Unit::Px));
const int height = qFloor(UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), PaperUnit(), Unit::Px));
QString text = QString("%1 x %2 px, \n%3 ppi").arg(width).arg(height).arg(PrintDPI);
ui->labelSizeDescription->setText(text);
}
@ -589,7 +586,7 @@ void DialogLayoutSettings::Label()
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::MinimumPaperSize()
{
const qreal value = VAbstractMeasurements::UnitConvertor(1, Unit::Px, oldPaperUnit);
const qreal value = UnitConvertor(1, Unit::Px, oldPaperUnit);
ui->doubleSpinBoxPaperWidth->setMinimum(value);
ui->doubleSpinBoxPaperHeight->setMinimum(value);
}
@ -597,7 +594,7 @@ void DialogLayoutSettings::MinimumPaperSize()
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::MinimumLayoutSize()
{
const qreal value = VAbstractMeasurements::UnitConvertor(1, Unit::Px, oldLayoutUnit);
const qreal value = UnitConvertor(1, Unit::Px, oldLayoutUnit);
ui->doubleSpinBoxLayoutWidth->setMinimum(value);
}
@ -613,10 +610,8 @@ void DialogLayoutSettings::ReadSettings()
SetLayoutWidth(qApp->getSettings()->GetLayoutWidth());
SetShift(qApp->getSettings()->GetLayoutShift());
const qreal width = VAbstractMeasurements::UnitConvertor(qApp->getSettings()->GetLayoutPaperWidth(), Unit::Px,
LayoutUnit());
const qreal height = VAbstractMeasurements::UnitConvertor(qApp->getSettings()->GetLayoutPaperHeight(), Unit::Px,
LayoutUnit());
const qreal width = UnitConvertor(qApp->getSettings()->GetLayoutPaperWidth(), Unit::Px, LayoutUnit());
const qreal height = UnitConvertor(qApp->getSettings()->GetLayoutPaperHeight(), Unit::Px, LayoutUnit());
SheetSize(QSizeF(width, height));
SetGroup(qApp->getSettings()->GetLayoutGroup());
SetRotate(qApp->getSettings()->GetLayoutRotate());

View File

@ -31,7 +31,7 @@
#include "../../xml/vstandardmeasurements.h"
#include "../../core/vapplication.h"
#include "../../core/vsettings.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../utils/logging.h"
#include <QDir>

View File

@ -306,7 +306,7 @@ QString DialogAlongLine::GetTypeLine() const
*/
QString DialogAlongLine::GetFormula() const
{
return qApp->TrVars()->FormulaFromUser(formula);
return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -33,7 +33,7 @@
#include <QTimer>
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../libs/ifc/xml/vdomdocument.h"
#include "../../visualization/vistoolarc.h"
#include "dialogeditwrongformula.h"
@ -424,7 +424,7 @@ quint32 DialogArc::GetCenter() const
*/
QString DialogArc::GetRadius() const
{
return qApp->TrVars()->FormulaFromUser(radius);
return qApp->TrVars()->FormulaFromUser(radius, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------
@ -434,7 +434,7 @@ QString DialogArc::GetRadius() const
*/
QString DialogArc::GetF1() const
{
return qApp->TrVars()->FormulaFromUser(f1);
return qApp->TrVars()->FormulaFromUser(f1, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------
@ -444,5 +444,5 @@ QString DialogArc::GetF1() const
*/
QString DialogArc::GetF2() const
{
return qApp->TrVars()->FormulaFromUser(f2);
return qApp->TrVars()->FormulaFromUser(f2, qApp->getSettings()->GetOsSeparator());
}

View File

@ -33,7 +33,7 @@
#include <QTimer>
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../libs/ifc/xml/vdomdocument.h"
#include "../../visualization/vistoolarcwithlength.h"
#include "dialogeditwrongformula.h"
@ -109,7 +109,7 @@ void DialogArcWithLength::SetCenter(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogArcWithLength::GetRadius() const
{
return qApp->TrVars()->FormulaFromUser(radius);
return qApp->TrVars()->FormulaFromUser(radius, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------
@ -133,7 +133,7 @@ void DialogArcWithLength::SetRadius(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogArcWithLength::GetF1() const
{
return qApp->TrVars()->FormulaFromUser(f1);
return qApp->TrVars()->FormulaFromUser(f1, qApp->getSettings()->GetOsSeparator());
}
void DialogArcWithLength::SetF1(const QString &value)
@ -156,7 +156,7 @@ void DialogArcWithLength::SetF1(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogArcWithLength::GetLength() const
{
return qApp->TrVars()->FormulaFromUser(length);
return qApp->TrVars()->FormulaFromUser(length, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogbisector.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolbisector.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
@ -342,7 +342,7 @@ QString DialogBisector::GetTypeLine() const
*/
QString DialogBisector::GetFormula() const
{
return qApp->TrVars()->FormulaFromUser(formula);
return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogcurveintersectaxis.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolcurveintersectaxis.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
@ -99,7 +99,7 @@ void DialogCurveIntersectAxis::SetTypeLine(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCurveIntersectAxis::GetAngle() const
{
return qApp->TrVars()->FormulaFromUser(formulaAngle);
return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogcutarc.h"
#include "../../libs/vgeometry/varc.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolcutarc.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../xml/vpattern.h"
@ -216,7 +216,7 @@ void DialogCutArc::SetPointName(const QString &value)
*/
QString DialogCutArc::GetFormula() const
{
return qApp->TrVars()->FormulaFromUser(formula);
return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogcutspline.h"
#include "../../libs/vgeometry/vspline.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../xml/vpattern.h"
#include "../../visualization/vistoolcutspline.h"
#include "dialogeditwrongformula.h"
@ -210,7 +210,7 @@ void DialogCutSpline::ShowVisualization()
*/
QString DialogCutSpline::GetFormula() const
{
return qApp->TrVars()->FormulaFromUser(formula);
return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogcutsplinepath.h"
#include "../../libs/vgeometry/vsplinepath.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../xml/vpattern.h"
#include "../../visualization/vistoolcutsplinepath.h"
#include "dialogeditwrongformula.h"
@ -210,7 +210,7 @@ void DialogCutSplinePath::ShowVisualization()
*/
QString DialogCutSplinePath::GetFormula() const
{
return qApp->TrVars()->FormulaFromUser(formula);
return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -33,7 +33,7 @@
#include "../../libs/vgeometry/varc.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../libs/vgeometry/vsplinepath.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../libs/ifc/xml/vdomdocument.h"
#include "../../xml/vabstractmeasurements.h"
@ -53,7 +53,7 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge
ui.labelUnitY->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true));
// Default value for seam allowence is 1 cm. But pattern have different units, so just set 1 in dialog not enough.
ui.doubleSpinBoxSeams->setValue(VAbstractMeasurements::UnitConvertor(1, Unit::Cm, qApp->patternUnit()));
ui.doubleSpinBoxSeams->setValue(UnitConvertor(1, Unit::Cm, qApp->patternUnit()));
bOk = ui.buttonBox->button(QDialogButtonBox::Ok);
SCASSERT(bOk != nullptr);

View File

@ -31,7 +31,7 @@
#include "ui_dialogdetail.h"
#include "dialogtool.h"
#include "../../geometry/vdetail.h"
#include "../../libs/vpatterndb/vdetail.h"
/**
* @brief The DialogDetail class dialog for ToolDetai. Help create detail and edit option.

View File

@ -28,7 +28,7 @@
#include "dialogeditwrongformula.h"
#include "ui_dialogeditwrongformula.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
//---------------------------------------------------------------------------------------------------------------------
DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, const quint32 &toolId, QWidget *parent)
@ -385,7 +385,7 @@ void DialogEditWrongFormula::setPostfix(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogEditWrongFormula::GetFormula() const
{
return qApp->TrVars()->FormulaFromUser(formula);
return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogendline.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolendline.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
@ -355,7 +355,7 @@ QString DialogEndLine::GetTypeLine() const
*/
QString DialogEndLine::GetFormula() const
{
return qApp->TrVars()->FormulaFromUser(formulaLength);
return qApp->TrVars()->FormulaFromUser(formulaLength, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------
@ -365,7 +365,7 @@ QString DialogEndLine::GetFormula() const
*/
QString DialogEndLine::GetAngle() const
{
return qApp->TrVars()->FormulaFromUser(formulaAngle);
return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogheight.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../tools/vabstracttool.h"
#include "../visualization/vistoolheight.h"
#include "../widgets/vmaingraphicsscene.h"

View File

@ -30,7 +30,7 @@
#include "ui_dialogline.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolline.h"
#include "../../core/vapplication.h"
#include "../../widgets/vmaingraphicsscene.h"

View File

@ -30,7 +30,7 @@
#include "ui_dialoglineintersect.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoollineintersect.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../xml/vpattern.h"

View File

@ -30,7 +30,7 @@
#include "ui_dialoglineintersectaxis.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoollineintersectaxis.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
@ -107,7 +107,7 @@ void DialogLineIntersectAxis::SetTypeLine(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogLineIntersectAxis::GetAngle() const
{
return qApp->TrVars()->FormulaFromUser(formulaAngle);
return qApp->TrVars()->FormulaFromUser(formulaAngle, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -315,7 +315,7 @@ QString DialogNormal::GetTypeLine() const
*/
QString DialogNormal::GetFormula() const
{
return qApp->TrVars()->FormulaFromUser(formula);
return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogpointfromarcandtangent.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolpointfromarcandtangent.h"
#include "../../widgets/vmaingraphicsscene.h"

View File

@ -30,7 +30,7 @@
#include "ui_dialogpointfromcircleandtangent.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolpointfromcircleandtangent.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "dialogeditwrongformula.h"
@ -111,7 +111,8 @@ void DialogPointFromCircleAndTangent::SetCircleCenterId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogPointFromCircleAndTangent::GetCircleRadius() const
{
return qApp->TrVars()->FormulaFromUser(ui->plainTextEditRadius->toPlainText());
return qApp->TrVars()->FormulaFromUser(ui->plainTextEditRadius->toPlainText(),
qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -29,7 +29,7 @@
#include "dialogpointofcontact.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolpointofcontact.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../xml/vpattern.h"
@ -304,7 +304,7 @@ void DialogPointOfContact::SetPointName(const QString &value)
*/
QString DialogPointOfContact::getRadius() const
{
return qApp->TrVars()->FormulaFromUser(radius);
return qApp->TrVars()->FormulaFromUser(radius, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogpointofintersection.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolpointofintersection.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../xml/vpattern.h"

View File

@ -30,7 +30,7 @@
#include "ui_dialogpointofintersectionarcs.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolpointofintersectionarcs.h"
#include "../../widgets/vmaingraphicsscene.h"

View File

@ -30,7 +30,7 @@
#include "ui_dialogpointofintersectioncircles.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolpointofintersectioncircles.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "dialogeditwrongformula.h"
@ -143,7 +143,8 @@ void DialogPointOfIntersectionCircles::SetSecondCircleCenterId(const quint32 &va
//---------------------------------------------------------------------------------------------------------------------
QString DialogPointOfIntersectionCircles::GetFirstCircleRadius() const
{
return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle1Radius->toPlainText());
return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle1Radius->toPlainText(),
qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------
@ -167,7 +168,8 @@ void DialogPointOfIntersectionCircles::SetFirstCircleRadius(const QString &value
//---------------------------------------------------------------------------------------------------------------------
QString DialogPointOfIntersectionCircles::GetSecondCircleRadius() const
{
return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle2Radius->toPlainText());
return qApp->TrVars()->FormulaFromUser(ui->plainTextEditCircle2Radius->toPlainText(),
qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogshoulderpoint.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolshoulderpoint.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
@ -341,7 +341,7 @@ QString DialogShoulderPoint::GetTypeLine() const
*/
QString DialogShoulderPoint::GetFormula() const
{
return qApp->TrVars()->FormulaFromUser(formula);
return qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,7 @@
#include "ui_dialogspline.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolspline.h"
#include <QDebug>

View File

@ -29,7 +29,7 @@
#include "dialogsplinepath.h"
#include "ui_dialogsplinepath.h"
#include "../../libs/vgeometry/vsplinepoint.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistoolsplinepath.h"
//---------------------------------------------------------------------------------------------------------------------

View File

@ -27,8 +27,8 @@
*************************************************************************/
#include "dialogtool.h"
#include "../../container/calculator.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../libs/vgeometry/varc.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../libs/vgeometry/vsplinepath.h"
@ -460,8 +460,9 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt
// Replace line return character with spaces for calc if exist
QString formula = text;
formula.replace("\n", " ");
formula = qApp->TrVars()->FormulaFromUser(formula);// Translate to internal look.
Calculator *cal = new Calculator(data);
// Translate to internal look.
formula = qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
Calculator *cal = new Calculator(data, qApp->patternType());
result = cal->EvalFormula(formula);
delete cal;

View File

@ -29,7 +29,7 @@
#include "dialogtriangle.h"
#include "ui_dialogtriangle.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../visualization/vistooltriangle.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../xml/vpattern.h"

View File

@ -28,8 +28,8 @@
#include "dialoguniondetails.h"
#include "ui_dialoguniondetails.h"
#include "../../geometry/vdetail.h"
#include "../../container/vcontainer.h"
#include "../../libs/vpatterndb/vdetail.h"
#include "../../libs/vpatterndb/vcontainer.h"
//---------------------------------------------------------------------------------------------------------------------
/**

View File

@ -1,12 +0,0 @@
# ADD TO EACH PATH $$PWD VARIABLE!!!!!!
# This need for corect working file translations.pro
HEADERS += \
$$PWD/vnodedetail.h \
$$PWD/vdetail.h \
$$PWD/vnodedetail_p.h \
$$PWD/vdetail_p.h
SOURCES += \
$$PWD/vnodedetail.cpp \
$$PWD/vdetail.cpp

View File

@ -895,8 +895,8 @@ void MainWindow::ToolBarOption()
{
if (qApp->patternType() == MeasurementsType::Standard)
{
const QStringList listHeights = VMeasurement::ListHeights(doc->GetGradationHeights());
const QStringList listSizes = VMeasurement::ListSizes(doc->GetGradationSizes());
const QStringList listHeights = VMeasurement::ListHeights(doc->GetGradationHeights(), qApp->patternUnit());
const QStringList listSizes = VMeasurement::ListSizes(doc->GetGradationSizes(), qApp->patternUnit());
gradationHeights = SetGradationList(tr("Height: "), listHeights);
SetDefaultHeight(static_cast<int>(pattern->height()));
@ -1904,8 +1904,8 @@ void MainWindow::Layout()
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::UpdateGradation()
{
UpdateHeightsList(VMeasurement::ListHeights(doc->GetGradationHeights()));
UpdateSizesList(VMeasurement::ListSizes(doc->GetGradationSizes()));
UpdateHeightsList(VMeasurement::ListHeights(doc->GetGradationHeights(), qApp->patternUnit()));
UpdateSizesList(VMeasurement::ListSizes(doc->GetGradationSizes(), qApp->patternUnit()));
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -28,13 +28,13 @@
#include "mainwindowsnogui.h"
#include "../core/vapplication.h"
#include "../container/vcontainer.h"
#include "../../libs/vobj/vobjpaintdevice.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../libs/vobj/vobjpaintdevice.h"
#include "../dialogs/app/dialoglayoutsettings.h"
#include "../../libs/vlayout/vlayoutgenerator.h"
#include "../libs/vlayout/vlayoutgenerator.h"
#include "../dialogs/app/dialoglayoutprogress.h"
#include "../dialogs/app/dialogsavelayout.h"
#include "../../libs/vlayout/vposter.h"
#include "../libs/vlayout/vposter.h"
#include <QFileDialog>
#include <QFileInfo>

View File

@ -31,7 +31,7 @@
#include <QMainWindow>
#include "../geometry/vdetail.h"
#include "../libs/vpatterndb/vdetail.h"
#include "../libs/vlayout/vlayoutdetail.h"
#include "xml/vpattern.h"

View File

@ -28,7 +28,6 @@
#include "options.h"
#include <QString>
#include <QStringList>
// From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This
// furthermore blows up the binary sizes.
@ -36,192 +35,3 @@ const QString degreeSymbol = QStringLiteral("°");
const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png");
const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png");
// Keep synchronize all names with initialization in VApllication class!!!!!
//measurements
//head and neck
const QString headGirth_M = QStringLiteral("head_girth");
const QString midNeckGirth_M = QStringLiteral("mid_neck_girth");
const QString neckBaseGirth_M = QStringLiteral("neck_base_girth");
const QString headAndNeckLength_M = QStringLiteral("head_and_neck_length");
//torso
const QString centerFrontWaistLength_M = QStringLiteral("center_front_waist_length");
const QString centerBackWaistLength_M = QStringLiteral("center_back_waist_length");
const QString shoulderLength_M = QStringLiteral("shoulder_length");
const QString sideWaistLength_M = QStringLiteral("side_waist_length");
const QString trunkLength_M = QStringLiteral("trunk_length");
const QString shoulderGirth_M = QStringLiteral("shoulder_girth");
const QString upperChestGirth_M = QStringLiteral("upper_chest_girth");
const QString bustGirth_M = QStringLiteral("bust_girth");
const QString underBustGirth_M = QStringLiteral("under_bust_girth");
const QString waistGirth_M = QStringLiteral("waist_girth");
const QString highHipGirth_M = QStringLiteral("high_hip_girth");
const QString hipGirth_M = QStringLiteral("hip_girth");
const QString upperFrontChestWidth_M = QStringLiteral("upper_front_chest_width");
const QString frontChestWidth_M = QStringLiteral("front_chest_width");
const QString acrossFrontShoulderWidth_M = QStringLiteral("across_front_shoulder_width");
const QString acrossBackShoulderWidth_M = QStringLiteral("across_back_shoulder_width");
const QString upperBackWidth_M = QStringLiteral("upper_back_width");
const QString backWidth_M = QStringLiteral("back_width");
const QString bustpointToBustpoint_M = QStringLiteral("bustpoint_to_bustpoint");
const QString halterBustpointToBustpoint_M = QStringLiteral("halter_bustpoint_to_bustpoint");
const QString neckToBustpoint_M = QStringLiteral("neck_to_bustpoint");
const QString crotchLength_M = QStringLiteral("crotch_length");
const QString riseHeight_M = QStringLiteral("rise_height");
const QString shoulderDrop_M = QStringLiteral("shoulder_drop");
const QString shoulderSlopeDegrees_M = QStringLiteral("shoulder_slope_degrees");
const QString frontShoulderSlopeLength_M = QStringLiteral("front_shoulder_slope_length");
const QString backShoulderSlopeLength_M = QStringLiteral("back_shoulder_slope_length");
const QString frontShoulderToWaistLength_M = QStringLiteral("front_shoulder_to_waist_length");
const QString backShoulderToWaistLength_M = QStringLiteral("back_shoulder_to_waist_length");
const QString frontNeckArc_M = QStringLiteral("front_neck_arc");
const QString backNeckArc_M = QStringLiteral("back_neck_arc");
const QString frontUpperChestArc_M = QStringLiteral("front_upper_chest_arc");
const QString backUpperChestArc_M = QStringLiteral("back_upper_chest_arc");
const QString frontWaistArc_M = QStringLiteral("front_waist_arc");
const QString backWaistArc_M = QStringLiteral("back_waist_arc");
const QString frontUpperHipArc_M = QStringLiteral("front_upper_hip_arc");
const QString backUpperHipArc_M = QStringLiteral("back_upper_hip_arc");
const QString frontHipArc_M = QStringLiteral("front_hip_arc");
const QString backHipArc_M = QStringLiteral("back_hip_arc");
const QString chestSlope_M = QStringLiteral("chest_slope");
const QString backSlope_M = QStringLiteral("back_slope");
const QString frontWaistSlope_M = QStringLiteral("front_waist_slope");
const QString backWaistSlope_M = QStringLiteral("back_waist_slope");
const QString frontNeckToUpperChestHeight_M = QStringLiteral("front_neck_to_upper_chest_height");
const QString frontNeckToBustHeight_M = QStringLiteral("front_neck_to_bust_height");
const QString frontWaistToUpperChest_M = QStringLiteral("front_waist_to_upper_chest");
const QString frontWaistToLowerBreast_M = QStringLiteral("front_waist_to_lower_breast");
const QString backWaistToUpperChest_M = QStringLiteral("back_waist_to_upper_chest");
const QString strapLength_M = QStringLiteral("strap_length");
//arm
const QString armscyeGirth_M = QStringLiteral("armscye_girth");
const QString elbowGirth_M = QStringLiteral("elbow_girth");
const QString upperArmGirth_M = QStringLiteral("upper_arm_girth");
const QString wristGirth_M = QStringLiteral("wrist_girth");
const QString scyeDepth_M = QStringLiteral("scye_depth");
const QString shoulderAndArmLength_M = QStringLiteral("shoulder_and_arm_length");
const QString underarmLength_M = QStringLiteral("underarm_length");
const QString cervicaleToWristLength_M = QStringLiteral("cervicale_to_wrist_length");
const QString shoulderToElbowLength_M = QStringLiteral("shoulder_to_elbow_length");
const QString armLength_M = QStringLiteral("arm_length");
//hand
const QString handWidth_M = QStringLiteral("hand_width");
const QString handLength_M = QStringLiteral("hand_length");
const QString handGirth_M = QStringLiteral("hand_girth");
//leg
const QString thighGirth_M = QStringLiteral("thigh_girth");
const QString midThighGirth_M = QStringLiteral("mid_thigh_girth");
const QString kneeGirth_M = QStringLiteral("knee_girth");
const QString calfGirth_M = QStringLiteral("calf_girth");
const QString ankleGirth_M = QStringLiteral("ankle_girth");
const QString kneeHeight_M = QStringLiteral("knee_height");
const QString ankleHeight_M = QStringLiteral("ankle_height");
//foot
const QString footWidth_M = QStringLiteral("foot_width");
const QString footLength_M = QStringLiteral("foot_length");
//heights
const QString height_M = QStringLiteral("height");
const QString cervicaleHeight_M = QStringLiteral("cervicale_height");
const QString cervicaleToKneeHeight_M = QStringLiteral("cervicale_to_knee_height");
const QString waistHeight_M = QStringLiteral("waist_height");
const QString highHipHeight_M = QStringLiteral("high_hip_height");
const QString hipHeight_M = QStringLiteral("hip_height");
const QString waistToHipHeight_M = QStringLiteral("waist_to_hip_height");
const QString waistToKneeHeight_M = QStringLiteral("waist_to_knee_height");
const QString crotchHeight_M = QStringLiteral("crotch_height");
//extended measurements
const QString size_M = QStringLiteral("size");
const QString heightFrontNeckBasePoint_M = QStringLiteral("height_front_neck_base_point");
const QString heightBaseNeckSidePoint_M = QStringLiteral("height_base_neck_side_point");
const QString heightShoulderPoint_M = QStringLiteral("height_shoulder_point");
const QString heightNipplePoint_M = QStringLiteral("height_nipple_point");
const QString heightBackAngleAxilla_M = QStringLiteral("height_back_angle_axilla");
const QString heightScapularPoint_M = QStringLiteral("height_scapular_point");
const QString heightUnderButtockFolds_M = QStringLiteral("height_under_buttock_folds");
const QString hipsExcludingProtrudingAbdomen_M = QStringLiteral("hips_excluding_protruding_abdomen");
const QString girthFootInstep_M = QStringLiteral("girth_foot_instep");
const QString sideWaistToFloor_M = QStringLiteral("side_waist_to_floor");
const QString frontWaistToFloor_M = QStringLiteral("front_waist_to_floor");
const QString arcThroughGroinArea_M = QStringLiteral("arc_through_groin_area");
const QString waistToPlaneSeat_M = QStringLiteral("waist_to_plane_seat");
const QString neckToRadialPoint_M = QStringLiteral("neck_to_radial_point");
const QString neckToThirdFinger_M = QStringLiteral("neck_to_third_finger");
const QString neckToFirstLineChestCircumference_M = QStringLiteral("neck_to_first_line_chest_circumference");
const QString frontWaistLength_M = QStringLiteral("front_waist_length");
const QString arcThroughShoulderJoint_M = QStringLiteral("arc_through_shoulder_joint");
const QString neckToBackLineChestCircumference_M = QStringLiteral("neck_to_back_line_chest_circumference");
const QString waistToNeckSide_M = QStringLiteral("waist_to_neck_side");
const QString arcLengthUpperBody_M = QStringLiteral("arc_length_upper_body");
const QString chestWidth_M = QStringLiteral("chest_width");
const QString anteroposteriorDiameterHands_M = QStringLiteral("anteroposterior_diameter_hands");
const QString heightClavicularPoint_M = QStringLiteral("height_clavicular_point");
const QString heightArmholeSlash_M = QStringLiteral("height_armhole_slash");
const QString slashShoulderHeight_M = QStringLiteral("slash_shoulder_height");
const QString halfGirthNeck_M = QStringLiteral("half_girth_neck");
const QString halfGirthNeckForShirts_M = QStringLiteral("half_girth_neck_for_shirts");
const QString halfGirthChestFirst_M = QStringLiteral("half_girth_chest_first");
const QString halfGirthChestSecond_M = QStringLiteral("half_girth_chest_second");
const QString halfGirthChestThird_M = QStringLiteral("half_girth_chest_third");
const QString halfGirthWaist_M = QStringLiteral("half_girth_waist");
const QString halfGirthHipsConsideringProtrudingAbdomen_M
= QStringLiteral("half_girth_hips_considering_protruding_abdomen");
const QString halfGirthHipsExcludingProtrudingAbdomen_M
= QStringLiteral("half_girth_hips_excluding_protruding_abdomen");
const QString girthKneeFlexedFeet_M = QStringLiteral("girth_knee_flexed_feet");
const QString neckTransverseDiameter_M = QStringLiteral("neck_transverse_diameter");
const QString frontSlashShoulderHeight_M = QStringLiteral("front_slash_shoulder_height");
const QString neckToFrontWaistLine_M = QStringLiteral("neck_to_front_waist_line");
const QString handVerticalDiameter_M = QStringLiteral("hand_vertical_diameter");
const QString neckToKneePoint_M = QStringLiteral("neck_to_knee_point");
const QString waistToKnee_M = QStringLiteral("waist_to_knee");
const QString shoulderHeight_M = QStringLiteral("shoulder_height");
const QString headHeight_M = QStringLiteral("head_height");
const QString bodyPosition_M = QStringLiteral("body_position");
const QString arcBehindShoulderGirdle_M = QStringLiteral("arc_behind_shoulder_girdle");
const QString neckToNeckBase_M = QStringLiteral("neck_to_neck_base");
const QString depthWaistFirst_M = QStringLiteral("depth_waist_first");
const QString depthWaistSecond_M = QStringLiteral("depth_waist_second");
//variables
const QString line_ = QStringLiteral("Line_");
const QString angleLine_ = QStringLiteral("AngleLine_");
//functions
const QString sin_F = QStringLiteral("sin");
const QString cos_F = QStringLiteral("cos");
const QString tan_F = QStringLiteral("tan");
const QString asin_F = QStringLiteral("asin");
const QString acos_F = QStringLiteral("acos");
const QString atan_F = QStringLiteral("atan");
const QString sinh_F = QStringLiteral("sinh");
const QString cosh_F = QStringLiteral("cosh");
const QString tanh_F = QStringLiteral("tanh");
const QString asinh_F = QStringLiteral("asinh");
const QString acosh_F = QStringLiteral("acosh");
const QString atanh_F = QStringLiteral("atanh");
const QString log2_F = QStringLiteral("log2");
const QString log10_F = QStringLiteral("log10");
const QString log_F = QStringLiteral("log");
const QString ln_F = QStringLiteral("ln");
const QString exp_F = QStringLiteral("exp");
const QString sqrt_F = QStringLiteral("sqrt");
const QString sign_F = QStringLiteral("sign");
const QString rint_F = QStringLiteral("rint");
const QString abs_F = QStringLiteral("abs");
const QString min_F = QStringLiteral("min");
const QString max_F = QStringLiteral("max");
const QString sum_F = QStringLiteral("sum");
const QString avg_F = QStringLiteral("avg");
const QString fmod_F = QStringLiteral("fmod");
const QStringList builInFunctions = QStringList() << sin_F << cos_F << tan_F << asin_F << acos_F << atan_F
<< sinh_F << cosh_F << tanh_F << asinh_F << acosh_F << atanh_F
<< log2_F << log10_F << log_F << ln_F << exp_F << sqrt_F
<< sign_F << rint_F << abs_F << min_F << max_F << sum_F
<< avg_F << fmod_F;
// Postfix operators
const QString cm_Oprt = QStringLiteral("cm");
const QString mm_Oprt = QStringLiteral("mm");
const QString in_Oprt = QStringLiteral("in");

View File

@ -56,274 +56,9 @@ extern const QString cursorArrowOpenHand;
extern const QString cursorArrowCloseHand;
enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown };
enum class Tool : unsigned char
{
Arrow,
Point,
LinePoint,
AbstractSpline,
Cut,
SinglePoint,
EndLine,
Line,
AlongLine,
ShoulderPoint,
Normal,
Bisector,
LineIntersect,
Spline,
CutSpline,
CutArc,
Arc,
ArcWithLength,
SplinePath,
CutSplinePath,
PointOfContact,
Detail,
NodePoint,
NodeArc,
NodeSpline,
NodeSplinePath,
Height,
Triangle,
LineIntersectAxis,
PointOfIntersectionArcs,
PointOfIntersectionCircles,
CurveIntersectAxis,
PointOfIntersection,
PointFromCircleAndTangent,
PointFromArcAndTangent,
UnionDetails // 35
};
enum class Vis : unsigned char
{
ControlPointSpline = 36, // increase this value if need more positions in Tool enum
GraphicsSimpleTextItem,
SimpleSplinePath,
Line,
Path,
ToolAlongLine,
ToolArc,
ToolArcWithLength,
ToolBisector,
ToolCutArc,
ToolEndLine,
ToolHeight,
ToolLine,
ToolLineIntersect,
ToolNormal,
ToolPointOfContact,
ToolPointOfIntersection,
ToolPointOfIntersectionArcs,
ToolPointOfIntersectionCircles,
ToolPointFromCircleAndTangent,
ToolPointFromArcAndTangent,
ToolShoulderPoint,
ToolSpline,
ToolTriangle,
ToolCutSpline,
ToolSplinePath,
ToolCutSplinePath,
ToolLineIntersectAxis,
ToolCurveIntersectAxis
};
enum class Source : char { FromGui, FromFile, FromTool };
enum class NodeDetail : char { Contour, Modeling };
enum class Contour : char { OpenContour, CloseContour };
enum class VarType : char { Measurement, Increment, LineLength, SplineLength, ArcLength, ArcRadius, LineAngle, ArcAngle,
SplineAngle, Unknown };
enum class GHeights : unsigned char { ALL,
H92=92, H98=98, H104=104, H110=110, H116=116, H122=122, H128=128, H134=134,
H140=140, H146=146, H152=152, H158=158, H164=164, H170=170, H176=176, H182=182,
H188=188, H194=194};
enum class GSizes : unsigned char { ALL,
S22=22, S24=24, S26=26, S28=28, S30=30, S32=32, S34=34, S36=36, S38=38, S40=40,
S42=42, S44=44, S46=46, S48=48, S50=50, S52=52, S54=54, S56=56 };
// measurements
//head and neck
extern const QString headGirth_M;
extern const QString midNeckGirth_M;
extern const QString neckBaseGirth_M;
extern const QString headAndNeckLength_M;
//torso
extern const QString centerFrontWaistLength_M;
extern const QString centerBackWaistLength_M;
extern const QString shoulderLength_M;
extern const QString sideWaistLength_M;
extern const QString trunkLength_M;
extern const QString shoulderGirth_M;
extern const QString upperChestGirth_M;
extern const QString bustGirth_M;
extern const QString underBustGirth_M;
extern const QString waistGirth_M;
extern const QString highHipGirth_M;
extern const QString hipGirth_M;
extern const QString upperFrontChestWidth_M;
extern const QString frontChestWidth_M;
extern const QString acrossFrontShoulderWidth_M;
extern const QString acrossBackShoulderWidth_M;
extern const QString upperBackWidth_M;
extern const QString backWidth_M;
extern const QString bustpointToBustpoint_M;
extern const QString halterBustpointToBustpoint_M;
extern const QString neckToBustpoint_M;
extern const QString crotchLength_M;
extern const QString riseHeight_M;
extern const QString shoulderDrop_M;
extern const QString shoulderSlopeDegrees_M;
extern const QString frontShoulderSlopeLength_M;
extern const QString backShoulderSlopeLength_M;
extern const QString frontShoulderToWaistLength_M;
extern const QString backShoulderToWaistLength_M;
extern const QString frontNeckArc_M;
extern const QString backNeckArc_M;
extern const QString frontUpperChestArc_M;
extern const QString backUpperChestArc_M;
extern const QString frontWaistArc_M;
extern const QString backWaistArc_M;
extern const QString frontUpperHipArc_M;
extern const QString backUpperHipArc_M;
extern const QString frontHipArc_M;
extern const QString backHipArc_M;
extern const QString chestSlope_M;
extern const QString backSlope_M;
extern const QString frontWaistSlope_M;
extern const QString backWaistSlope_M;
extern const QString frontNeckToUpperChestHeight_M;
extern const QString frontNeckToBustHeight_M;
extern const QString frontWaistToUpperChest_M;
extern const QString frontWaistToLowerBreast_M;
extern const QString backWaistToUpperChest_M;
extern const QString strapLength_M;
//arm
extern const QString armscyeGirth_M;
extern const QString elbowGirth_M;
extern const QString upperArmGirth_M;
extern const QString wristGirth_M;
extern const QString scyeDepth_M;
extern const QString shoulderAndArmLength_M;
extern const QString underarmLength_M;
extern const QString cervicaleToWristLength_M;
extern const QString shoulderToElbowLength_M;
extern const QString armLength_M;
//hand
extern const QString handWidth_M;
extern const QString handLength_M;
extern const QString handGirth_M;
//leg
extern const QString thighGirth_M;
extern const QString midThighGirth_M;
extern const QString kneeGirth_M;
extern const QString calfGirth_M;
extern const QString ankleGirth_M;
extern const QString kneeHeight_M;
extern const QString ankleHeight_M;
//foot
extern const QString footWidth_M;
extern const QString footLength_M;
//heights
extern const QString height_M;
extern const QString cervicaleHeight_M;
extern const QString cervicaleToKneeHeight_M;
extern const QString waistHeight_M;
extern const QString highHipHeight_M;
extern const QString hipHeight_M;
extern const QString waistToHipHeight_M;
extern const QString waistToKneeHeight_M;
extern const QString crotchHeight_M;
//extended measurements
extern const QString size_M;
extern const QString heightFrontNeckBasePoint_M;
extern const QString heightBaseNeckSidePoint_M;
extern const QString heightShoulderPoint_M;
extern const QString heightNipplePoint_M;
extern const QString heightBackAngleAxilla_M;
extern const QString heightScapularPoint_M;
extern const QString heightUnderButtockFolds_M;
extern const QString hipsExcludingProtrudingAbdomen_M;
extern const QString girthFootInstep_M;
extern const QString sideWaistToFloor_M;
extern const QString frontWaistToFloor_M;
extern const QString arcThroughGroinArea_M;
extern const QString waistToPlaneSeat_M;
extern const QString neckToRadialPoint_M;
extern const QString neckToThirdFinger_M;
extern const QString neckToFirstLineChestCircumference_M;
extern const QString frontWaistLength_M;
extern const QString arcThroughShoulderJoint_M;
extern const QString neckToBackLineChestCircumference_M;
extern const QString waistToNeckSide_M;
extern const QString arcLengthUpperBody_M;
extern const QString chestWidth_M;
extern const QString anteroposteriorDiameterHands_M;
extern const QString heightClavicularPoint_M;
extern const QString heightArmholeSlash_M;
extern const QString slashShoulderHeight_M;
extern const QString halfGirthNeck_M;
extern const QString halfGirthNeckForShirts_M;
extern const QString halfGirthChestFirst_M;
extern const QString halfGirthChestSecond_M;
extern const QString halfGirthChestThird_M;
extern const QString halfGirthWaist_M;
extern const QString halfGirthHipsConsideringProtrudingAbdomen_M;
extern const QString halfGirthHipsExcludingProtrudingAbdomen_M;
extern const QString girthKneeFlexedFeet_M;
extern const QString neckTransverseDiameter_M;
extern const QString frontSlashShoulderHeight_M;
extern const QString neckToFrontWaistLine_M;
extern const QString handVerticalDiameter_M;
extern const QString neckToKneePoint_M;
extern const QString waistToKnee_M;
extern const QString shoulderHeight_M;
extern const QString headHeight_M;
extern const QString bodyPosition_M;
extern const QString arcBehindShoulderGirdle_M;
extern const QString neckToNeckBase_M;
extern const QString depthWaistFirst_M;
extern const QString depthWaistSecond_M;
// variables name
extern const QString line_;
extern const QString angleLine_;
// functions
extern const QString sin_F;
extern const QString cos_F;
extern const QString tan_F;
extern const QString asin_F;
extern const QString acos_F;
extern const QString atan_F;
extern const QString sinh_F;
extern const QString cosh_F;
extern const QString tanh_F;
extern const QString asinh_F;
extern const QString acosh_F;
extern const QString atanh_F;
extern const QString log2_F;
extern const QString log10_F;
extern const QString log_F;
extern const QString ln_F;
extern const QString exp_F;
extern const QString sqrt_F;
extern const QString sign_F;
extern const QString rint_F;
extern const QString abs_F;
extern const QString min_F;
extern const QString max_F;
extern const QString sum_F;
extern const QString avg_F;
extern const QString fmod_F;
extern const QStringList builInFunctions;
// Postfix operators
extern const QString cm_Oprt;
extern const QString mm_Oprt;
extern const QString in_Oprt;
#endif // OPTIONS_H

View File

@ -31,7 +31,7 @@
#include <qmuparsererror.h>
#include "../dialogs/tools/dialogeditwrongformula.h"
#include "../dialogs/app/dialogundo.h"
#include "../container/calculator.h"
#include "../libs/vpatterndb/calculator.h"
#include "../../undocommands/addtocalc.h"
#include "../../undocommands/savetooloptions.h"
#include "../../libs/ifc/exception/vexceptionundo.h"
@ -285,7 +285,7 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine
Calculator *cal = nullptr;
try
{
cal = new Calculator(data);
cal = new Calculator(data, qApp->patternType());
result = cal->EvalFormula(formula);
delete cal;
}
@ -316,7 +316,7 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine
/* Need delete dialog here because parser in dialog don't allow use correct separator for
* parsing here. */
delete dialog;
Calculator *cal1 = new Calculator(data);
Calculator *cal1 = new Calculator(data, qApp->patternType());
result = cal1->EvalFormula(formula);
delete cal1; /* Here can be memory leak, but dialog already check this formula and probability
* very low. */

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolalongline.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogalongline.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../libs/ifc/exception/vexceptionobjecterror.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolarc.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogarc.h"
#include "../../libs/vgeometry/varc.h"
#include "../container/vformula.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolarcwithlength.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogarcwithlength.h"
#include "../../libs/vgeometry/varc.h"
#include "../container/vformula.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolbisector.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogbisector.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../visualization/vistoolbisector.h"

View File

@ -28,7 +28,7 @@
#include "vtoolcurveintersectaxis.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogcurveintersectaxis.h"
#include "../../dialogs/tools/dialogeditwrongformula.h"
#include "../../libs/vgeometry/vpointf.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolcutarc.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogcutarc.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../libs/vgeometry/varc.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolcutspline.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogcutspline.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../visualization/vistoolcutspline.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolcutsplinepath.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogcutsplinepath.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../visualization/vistoolcutsplinepath.h"

View File

@ -28,7 +28,7 @@
#include "vtoolendline.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogendline.h"
#include "../../dialogs/tools/dialogeditwrongformula.h"
#include "../../libs/vgeometry/vpointf.h"

View File

@ -28,7 +28,7 @@
#include "vtoollineintersectaxis.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialoglineintersectaxis.h"
#include "../../dialogs/tools/dialogeditwrongformula.h"
#include "../../libs/vgeometry/vpointf.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolnormal.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialognormal.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../visualization/vistoolnormal.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolpointofcontact.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogpointofcontact.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../container/vformula.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolshoulderpoint.h"
#include "../../container/calculator.h"
#include "../../libs/vpatterndb/calculator.h"
#include "../../dialogs/tools/dialogshoulderpoint.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../visualization/vistoolshoulderpoint.h"

View File

@ -29,7 +29,7 @@
#ifndef VDATATOOL_H
#define VDATATOOL_H
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../../utils/logging.h"
Q_DECLARE_LOGGING_CATEGORY(vTool)

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vistoolalongline.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../libs/vgeometry/vpointf.h"
//---------------------------------------------------------------------------------------------------------------------

View File

@ -29,7 +29,7 @@
#include "vistoolarc.h"
#include "../libs/vgeometry/vpointf.h"
#include "../libs/vgeometry/varc.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
//---------------------------------------------------------------------------------------------------------------------
VisToolArc::VisToolArc(const VContainer *data, QGraphicsItem *parent)

View File

@ -29,7 +29,7 @@
#include "vistoolarcwithlength.h"
#include "../libs/vgeometry/vpointf.h"
#include "../libs/vgeometry/varc.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
//---------------------------------------------------------------------------------------------------------------------
VisToolArcWithLength::VisToolArcWithLength(const VContainer *data, QGraphicsItem *parent)

View File

@ -28,7 +28,7 @@
#include "vistoolbisector.h"
#include "../libs/vgeometry/vpointf.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../tools/drawTools/vtoolbisector.h"
//---------------------------------------------------------------------------------------------------------------------

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vistoolcurveintersectaxis.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../libs/vgeometry/vpointf.h"
#include "../tools/drawTools/vtoolcurveintersectaxis.h"

View File

@ -28,7 +28,7 @@
#include "vistoolcutarc.h"
#include "../libs/vgeometry/varc.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
//---------------------------------------------------------------------------------------------------------------------
VisToolCutArc::VisToolCutArc(const VContainer *data, QGraphicsItem *parent)

View File

@ -28,7 +28,7 @@
#include "vistoolcutspline.h"
#include "../libs/vgeometry/vspline.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
//---------------------------------------------------------------------------------------------------------------------
VisToolCutSpline::VisToolCutSpline(const VContainer *data, QGraphicsItem *parent)

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vistoolcutsplinepath.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../libs/vgeometry/vsplinepath.h"
//---------------------------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,7 @@
#include "vistoolendline.h"
#include "../libs/vgeometry/vpointf.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../tools/vabstracttool.h"
#include <QGraphicsScene>

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vistoolline.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../libs/vgeometry/vpointf.h"
#include "../tools/drawTools/vdrawtool.h"

View File

@ -28,7 +28,7 @@
#include "vistoollineintersect.h"
#include "../libs/vgeometry/vpointf.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
//---------------------------------------------------------------------------------------------------------------------
VisToolLineIntersect::VisToolLineIntersect(const VContainer *data, QGraphicsItem *parent)

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vistoollineintersectaxis.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../libs/vgeometry/vpointf.h"
#include "../tools/drawTools/vtoollineintersectaxis.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vistoolpointfromarcandtangent.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../tools/drawTools/vtoolpointfromarcandtangent.h"
#include "../libs/vgeometry/vpointf.h"
#include "../libs/vgeometry/varc.h"

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vistoolpointfromcircleandtangent.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../tools/drawTools/vtoolpointfromcircleandtangent.h"
#include "../libs/vgeometry/vpointf.h"

View File

@ -28,7 +28,7 @@
#include "vistoolpointofintersection.h"
#include "../libs/vgeometry/vpointf.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
//---------------------------------------------------------------------------------------------------------------------
VisToolPointOfIntersection::VisToolPointOfIntersection(const VContainer *data, QGraphicsItem *parent)

View File

@ -28,7 +28,7 @@
#include "vistoolpointofintersectionarcs.h"
#include "../libs/vgeometry/varc.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../tools/drawTools/vtoolpointofintersectionarcs.h"
//---------------------------------------------------------------------------------------------------------------------

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "vistoolpointofintersectioncircles.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../tools/drawTools/vtoolpointofintersectioncircles.h"
#include "../libs/vgeometry/vpointf.h"

View File

@ -29,7 +29,7 @@
#include "vistoolspline.h"
#include "../libs/vgeometry/vpointf.h"
#include "../libs/vgeometry/vspline.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
const int EMPTY_ANGLE = -1;

View File

@ -28,7 +28,7 @@
#include "vistooltriangle.h"
#include "../libs/vgeometry/vpointf.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../tools/drawTools/vtooltriangle.h"
#include <QtCore/qmath.h>

View File

@ -28,7 +28,7 @@
#include "visualization.h"
#include "../tools/drawTools/vdrawtool.h"
#include "../container/calculator.h"
#include "../libs/vpatterndb/calculator.h"
#include <QGraphicsEllipseItem>
@ -145,8 +145,8 @@ qreal Visualization::FindVal(const QString &expression)
// Replace line return with spaces for calc if exist
QString formula = expression;
formula.replace("\n", " ");
formula = qApp->TrVars()->FormulaFromUser(formula);
Calculator *cal = new Calculator(Visualization::data);
formula = qApp->TrVars()->FormulaFromUser(formula, qApp->getSettings()->GetOsSeparator());
Calculator *cal = new Calculator(Visualization::data, qApp->patternType());
val = cal->EvalFormula(formula);
delete cal;
}

View File

@ -29,7 +29,7 @@
#include "textdelegate.h"
#include <QLineEdit>
#include "../options.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
//---------------------------------------------------------------------------------------------------------------------
/**

View File

@ -201,77 +201,6 @@ Unit VAbstractMeasurements::MUnit() const
return VDomDocument::StrToUnits(unit);
}
//---------------------------------------------------------------------------------------------------------------------
qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const Unit &to)
{
switch (from)
{
case Unit::Mm:
switch (to)
{
case Unit::Mm:
return value;
case Unit::Cm:
return value / 10.0;
case Unit::Inch:
return value / 25.4;
case Unit::Px:
return (value / 25.4) * PrintDPI;
default:
break;
}
break;
case Unit::Cm:
switch (to)
{
case Unit::Mm:
return value * 10.0;
case Unit::Cm:
return value;
case Unit::Inch:
return value / 2.54;
case Unit::Px:
return ((value * 10.0) / 25.4) * PrintDPI;
default:
break;
}
break;
case Unit::Inch:
switch (to)
{
case Unit::Mm:
return value * 25.4;
case Unit::Cm:
return value * 2.54;
case Unit::Inch:
return value;
case Unit::Px:
return value * PrintDPI;
default:
break;
}
break;
case Unit::Px:
switch (to)
{
case Unit::Mm:
return (value / PrintDPI) * 25.4;
case Unit::Cm:
return ((value / PrintDPI) * 25.4) / 10.0;
case Unit::Inch:
return value / PrintDPI;
case Unit::Px:
return value;
default:
break;
}
break;
default:
break;
}
return 0;
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractMeasurements::Measurement(const QString &tag)
{

View File

@ -30,7 +30,7 @@
#define VABSTRACTMEASUREMENTS_H
#include "../libs/ifc/xml/vdomdocument.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
class VAbstractMeasurements : public VDomDocument
{
@ -41,7 +41,6 @@ public:
Unit MUnit() const;
static const QString TagUnit;
static const QString AttrValue;
static qreal UnitConvertor(qreal value, const Unit &from, const Unit &to);
protected:
/** @brief data container with data. */
VContainer *data;

View File

@ -31,7 +31,7 @@
#include "../libs/ifc/xml/vdomdocument.h"
#include "vtoolrecord.h"
#include "../container/vcontainer.h"
#include "../libs/vpatterndb/vcontainer.h"
class VDataTool;
class VMainGraphicsScene;

View File

@ -32,7 +32,7 @@
#include <QException>
#include <QString>
#include <QCoreApplication>
#include "ifcdef.h"
#include "../ifcdef.h"
class QWidget;

View File

@ -99,4 +99,75 @@ inline double FromPixel(double pix, const Unit &unit)
return 0;
}
//---------------------------------------------------------------------------------------------------------------------
inline qreal UnitConvertor(qreal value, const Unit &from, const Unit &to)
{
switch (from)
{
case Unit::Mm:
switch (to)
{
case Unit::Mm:
return value;
case Unit::Cm:
return value / 10.0;
case Unit::Inch:
return value / 25.4;
case Unit::Px:
return (value / 25.4) * PrintDPI;
default:
break;
}
break;
case Unit::Cm:
switch (to)
{
case Unit::Mm:
return value * 10.0;
case Unit::Cm:
return value;
case Unit::Inch:
return value / 2.54;
case Unit::Px:
return ((value * 10.0) / 25.4) * PrintDPI;
default:
break;
}
break;
case Unit::Inch:
switch (to)
{
case Unit::Mm:
return value * 25.4;
case Unit::Cm:
return value * 2.54;
case Unit::Inch:
return value;
case Unit::Px:
return value * PrintDPI;
default:
break;
}
break;
case Unit::Px:
switch (to)
{
case Unit::Mm:
return (value / PrintDPI) * 25.4;
case Unit::Cm:
return ((value / PrintDPI) * 25.4) / 10.0;
case Unit::Inch:
return value / PrintDPI;
case Unit::Px:
return value;
default:
break;
}
break;
default:
break;
}
return 0;
}
#endif // IFCDEF_H

View File

@ -1,8 +1,10 @@
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = qmuparser \
SUBDIRS = \
qmuparser \
vpropertyexplorer \
ifc \
vobj \
vlayout \
vgeometry
vgeometry \
vpatterndb

View File

@ -29,9 +29,7 @@
#include "calculator.h"
#include <QDebug>
#include <QSettings>
#include "../core/vapplication.h"
#include "vcontainer.h"
#include "../core/vsettings.h"
using namespace qmu;
@ -44,14 +42,14 @@ using namespace qmu;
* Example:
*
* const QString formula = qApp->FormulaFromUser(edit->text());
* Calculator *cal = new Calculator(data);
* Calculator *cal = new Calculator(data, patternType);
* const qreal result = cal->EvalFormula(formula);
* delete cal;
*
* @param data pointer to a variable container.
*/
Calculator::Calculator(const VContainer *data)
:QmuParser(), vVarVal(nullptr), data(data)
Calculator::Calculator(const VContainer *data, MeasurementsType patternType)
:QmuParser(), vVarVal(nullptr), data(data), patternType(patternType)
{
SCASSERT(data != nullptr)
InitCharacterSets();
@ -68,7 +66,7 @@ Calculator::Calculator(const VContainer *data)
* Use this constuctor to get tokens from formula. All formulas must be converted to external look.
* Example:
*
* Calculator *cal = new Calculator(formula, false);
* Calculator *cal = new Calculator(formula, osSeparator, false);
* tokens = cal->GetTokens();
* numbers = cal->GetNumbers();
* delete cal;
@ -76,14 +74,14 @@ Calculator::Calculator(const VContainer *data)
* @param formula string with formula.
* @param fromUser true if we parse formula from user
*/
Calculator::Calculator(const QString &formula, bool fromUser)
:QmuParser(), vVarVal(nullptr), data(nullptr)
Calculator::Calculator(const QString &formula, bool osSeparator, bool fromUser)
:QmuParser(), vVarVal(nullptr), data(nullptr), patternType(MeasurementsType::Standard)
{
InitCharacterSets();
setAllowSubexpressions(false);//Only one expression per time
SetVarFactory(AddVariable, this);
SetSepForTr(fromUser);
SetSepForTr(osSeparator, fromUser);
SetExpr(formula);
//Need run for making tokens. Don't catch exception here, because we want know if formula has error.
@ -154,7 +152,7 @@ qreal Calculator::EvalFormula(const QString &formula)
*/
void Calculator::InitVariables(const VContainer *data, const QMap<int, QString> &tokens, const QString &formula)
{
if (qApp->patternType() == MeasurementsType::Standard)
if (patternType == MeasurementsType::Standard)
{
vVarVal = new qreal[2]; //stabdard measurements table have two additional variables
}
@ -169,17 +167,17 @@ void Calculator::InitVariables(const VContainer *data, const QMap<int, QString>
if (vars->contains(i.value()))
{
QSharedPointer<VInternalVariable> var = vars->value(i.value());
if ((qApp->patternType() == MeasurementsType::Standard) &&
if ((patternType == MeasurementsType::Standard) &&
(var->GetType() == VarType::Measurement || var->GetType() == VarType::Increment))
{
QSharedPointer<VVariable> m = data->GetVariable<VVariable>(i.value());
m->SetValue(data->size(), data->height());
m->SetValue(data->size(), data->height(), *data->GetPatternUnit());
}
DefineVar(i.value(), var->GetValue());
found = true;
}
if (qApp->patternType() == MeasurementsType::Standard)
if (patternType == MeasurementsType::Standard)
{
if (i.value() == data->SizeName())
{
@ -259,13 +257,11 @@ void Calculator::SetSepForEval()
* @brief Calculator::SetSepForTr set separators for translation expression.
* @param fromUser true if expression come from user (from dialog).
*/
void Calculator::SetSepForTr(bool fromUser)
void Calculator::SetSepForTr(bool osSeparator, bool fromUser)
{
if (fromUser)
{
const bool osSeparatorValue = qApp->getSettings()->GetOsSeparator();
if (osSeparatorValue)
if (osSeparator)
{
const QLocale loc = QLocale::system();
SetDecSep(loc.decimalPoint().toLatin1());

View File

@ -29,7 +29,8 @@
#ifndef CALCULATOR_H
#define CALCULATOR_H
#include "../../libs/qmuparser/qmuparser.h"
#include "../qmuparser/qmuparser.h"
#include "../ifc/ifcdef.h"
class VContainer;
@ -55,19 +56,20 @@ class VContainer;
class Calculator:public qmu::QmuParser
{
public:
Calculator(const VContainer *data);
Calculator(const QString &formula, bool fromUser = true);
Calculator(const VContainer *data, MeasurementsType patternType);
Calculator(const QString &formula, bool osSeparator, bool fromUser = true);
~Calculator();
qreal EvalFormula(const QString &formula);
private:
Q_DISABLE_COPY(Calculator)
qreal *vVarVal;
const VContainer *data;
MeasurementsType patternType;
void InitVariables(const VContainer *data, const QMap<int, QString> &tokens, const QString &formula);
void InitCharacterSets();
static qreal* AddVariable(const QString &a_szName, void *a_pUserData);
void SetSepForEval();
void SetSepForTr(bool fromUser);
void SetSepForTr(bool osSeparator, bool fromUser);
static void RemoveAll(QMap<int, QString> &map, const QString &val);
};

View File

@ -0,0 +1,30 @@
/************************************************************************
**
** @file stable.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 10 12, 2014
**
** @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) 2013-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/>.
**
*************************************************************************/
// Build the precompiled headers.
#include "stable.h"

View File

@ -0,0 +1,52 @@
/************************************************************************
**
** @file stable.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 10 12, 2014
**
** @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) 2013-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/>.
**
*************************************************************************/
#ifndef STABLE_H
#define STABLE_H
/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */
#ifndef __clang__
#pragma message("Compiling precompiled headers for VPatternDB library.\n")
#endif
/* Add C includes here */
#if defined __cplusplus
/* Add C++ includes here */
#ifdef QT_CORE_LIB
#include <QtCore>
#endif
#ifdef QT_GUI_LIB
# include <QtGui>
#endif
#endif/*__cplusplus*/
#endif // STABLE_H

View File

@ -27,7 +27,7 @@
*************************************************************************/
#include "varcangle.h"
#include "../libs/vgeometry/vabstractcurve.h"
#include "../vgeometry/vabstractcurve.h"
//---------------------------------------------------------------------------------------------------------------------
VArcAngle::VArcAngle()

View File

@ -27,8 +27,7 @@
*************************************************************************/
#include "varclength.h"
#include "../libs/vgeometry/vabstractcurve.h"
#include "../core/vapplication.h"
#include "../vgeometry/vabstractcurve.h"
//---------------------------------------------------------------------------------------------------------------------
VArcLength::VArcLength()
@ -38,8 +37,8 @@ VArcLength::VArcLength()
}
//---------------------------------------------------------------------------------------------------------------------
VArcLength::VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc)
:VCurveLength(id, parentId, arc)
VArcLength::VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc, Unit patternUnit)
:VCurveLength(id, parentId, arc, patternUnit)
{
SetType(VarType::ArcLength);
}

View File

@ -37,7 +37,7 @@ class VArcLength :public VCurveLength
{
public:
VArcLength();
VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc);
VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc, Unit patternUnit);
VArcLength(const VArcLength &var);
VArcLength &operator=(const VArcLength &var);
virtual ~VArcLength();

View File

@ -27,8 +27,7 @@
*************************************************************************/
#include "varcradius.h"
#include "../libs/vgeometry/varc.h"
#include "../core/vapplication.h"
#include "../vgeometry/varc.h"
//---------------------------------------------------------------------------------------------------------------------
VArcRadius::VArcRadius()
@ -38,14 +37,14 @@ VArcRadius::VArcRadius()
}
//---------------------------------------------------------------------------------------------------------------------
VArcRadius::VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc)
VArcRadius::VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc, Unit patternUnit)
:VCurveVariable(id, parentId)
{
SCASSERT(arc != nullptr);
SetType(VarType::ArcRadius);
SetName(QString(radius_V+"%1").arg(arc->name()));
SetValue(qApp->fromPixel(arc->GetRadius()));
SetValue(FromPixel(arc->GetRadius(), patternUnit));
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -30,6 +30,7 @@
#define VARCRADIUS_H
#include "vcurvevariable.h"
#include "../ifc/ifcdef.h"
class VArc;
@ -37,7 +38,7 @@ class VArcRadius :public VCurveVariable
{
public:
VArcRadius();
VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc);
VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc, Unit patternUnit);
VArcRadius(const VArcRadius &var);
VArcRadius &operator=(const VArcRadius &var);
virtual ~VArcRadius();

Some files were not shown because too many files have changed in this diff Show More