Refactoring.
Code style.
This commit is contained in:
parent
de0ffa0148
commit
161918203a
|
@ -29,7 +29,6 @@
|
|||
#ifndef VEXCEPTION_H
|
||||
#define VEXCEPTION_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QException>
|
||||
#include <QString>
|
||||
|
@ -46,11 +45,12 @@ QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
|
|||
class VException : public QException
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(VException) // NOLINT
|
||||
|
||||
public:
|
||||
explicit VException(const QString &error) V_NOEXCEPT_EXPR (true);
|
||||
VException(const VException &e) V_NOEXCEPT_EXPR (true);
|
||||
explicit VException(const QString &error) V_NOEXCEPT_EXPR(true);
|
||||
VException(const VException &e) V_NOEXCEPT_EXPR(true);
|
||||
auto operator=(const VException &e) V_NOEXCEPT_EXPR(true) -> VException &;
|
||||
virtual ~VException() V_NOEXCEPT_EXPR (true) = default;
|
||||
virtual ~VException() V_NOEXCEPT_EXPR(true) = default;
|
||||
|
||||
Q_NORETURN virtual void raise() const override;
|
||||
|
||||
|
@ -60,15 +60,15 @@ public:
|
|||
virtual auto ErrorMessage() const -> QString;
|
||||
virtual auto DetailedInformation() const -> QString;
|
||||
auto WhatUtf8() const V_NOEXCEPT_EXPR(true) -> QString;
|
||||
void AddMoreInformation(const QString &info);
|
||||
void AddMoreInformation(const QString &info);
|
||||
auto MoreInformation() const -> QString;
|
||||
|
||||
protected:
|
||||
/** @brief error string with error */
|
||||
QString error;
|
||||
QString error;
|
||||
|
||||
/** @brief moreInfo more information about error */
|
||||
QString moreInfo {};
|
||||
QString moreInfo{};
|
||||
|
||||
auto MoreInfo(const QString &detInfo) const -> QString;
|
||||
};
|
||||
|
@ -99,11 +99,12 @@ inline auto VException::MoreInformation() const -> QString
|
|||
class VExceptionToolWasDeleted : public VException
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(VExceptionToolDeleted) // NOLINT
|
||||
|
||||
public:
|
||||
explicit VExceptionToolWasDeleted(const QString &error) V_NOEXCEPT_EXPR (true);
|
||||
VExceptionToolWasDeleted(const VExceptionToolWasDeleted &e) V_NOEXCEPT_EXPR (true);
|
||||
explicit VExceptionToolWasDeleted(const QString &error) V_NOEXCEPT_EXPR(true);
|
||||
VExceptionToolWasDeleted(const VExceptionToolWasDeleted &e) V_NOEXCEPT_EXPR(true);
|
||||
auto operator=(const VExceptionToolWasDeleted &e) V_NOEXCEPT_EXPR(true) -> VExceptionToolWasDeleted &;
|
||||
virtual ~VExceptionToolWasDeleted() V_NOEXCEPT_EXPR (true) = default;
|
||||
virtual ~VExceptionToolWasDeleted() V_NOEXCEPT_EXPR(true) = default;
|
||||
|
||||
Q_NORETURN virtual void raise() const override;
|
||||
// cppcheck-suppress unusedFunction
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VEXCEPTIONBADID_H
|
||||
#define VEXCEPTIONBADID_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
|
@ -42,11 +41,11 @@
|
|||
class VExceptionBadId final : public VException
|
||||
{
|
||||
public:
|
||||
VExceptionBadId(const QString &error, const quint32 &id) V_NOEXCEPT_EXPR (true);
|
||||
VExceptionBadId(const QString &error, const QString &key) V_NOEXCEPT_EXPR (true);
|
||||
VExceptionBadId(const VExceptionBadId &e) V_NOEXCEPT_EXPR (true);
|
||||
VExceptionBadId(const QString &error, const quint32 &id) V_NOEXCEPT_EXPR(true);
|
||||
VExceptionBadId(const QString &error, const QString &key) V_NOEXCEPT_EXPR(true);
|
||||
VExceptionBadId(const VExceptionBadId &e) V_NOEXCEPT_EXPR(true);
|
||||
auto operator=(const VExceptionBadId &e) V_NOEXCEPT_EXPR(true) -> VExceptionBadId &;
|
||||
virtual ~VExceptionBadId() V_NOEXCEPT_EXPR (true) = default;
|
||||
virtual ~VExceptionBadId() V_NOEXCEPT_EXPR(true) = default;
|
||||
|
||||
Q_NORETURN virtual void raise() const override { throw *this; }
|
||||
|
||||
|
@ -58,10 +57,10 @@ public:
|
|||
|
||||
protected:
|
||||
/** @brief id id */
|
||||
quint32 id;
|
||||
quint32 id;
|
||||
|
||||
/** @brief key key */
|
||||
QString key;
|
||||
QString key;
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VEXCEPTIONCONVERSIONERROR_H
|
||||
#define VEXCEPTIONCONVERSIONERROR_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "../ifcdef.h"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VEXCEPTIONEMPTYPARAMETER_H
|
||||
#define VEXCEPTIONEMPTYPARAMETER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VEXCEPTIONOBJECTERROR_H
|
||||
#define VEXCEPTIONOBJECTERROR_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VEXCEPTIONUNDO_H
|
||||
#define VEXCEPTIONUNDO_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "../ifcdef.h"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VEXCEPTIONWRONGID_H
|
||||
#define VEXCEPTIONWRONGID_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VABSTRACTCONVERTER_H
|
||||
#define VABSTRACTCONVERTER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QString>
|
||||
#include <QTemporaryFile>
|
||||
|
@ -41,12 +40,13 @@ QT_WARNING_PUSH
|
|||
QT_WARNING_DISABLE_GCC("-Wsuggest-final-types")
|
||||
QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
|
||||
|
||||
class VAbstractConverter :public VDomDocument
|
||||
class VAbstractConverter : public VDomDocument
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit VAbstractConverter(const QString &fileName);
|
||||
virtual ~VAbstractConverter() = default;
|
||||
~VAbstractConverter() override = default;
|
||||
|
||||
auto Convert() -> QString;
|
||||
|
||||
|
@ -69,12 +69,12 @@ protected:
|
|||
virtual auto MaxVerStr() const -> QString = 0;
|
||||
|
||||
virtual auto XSDSchema(unsigned ver) const -> QString;
|
||||
virtual void ApplyPatches() =0;
|
||||
virtual void DowngradeToCurrentMaxVersion() =0;
|
||||
virtual void ApplyPatches() = 0;
|
||||
virtual void DowngradeToCurrentMaxVersion() = 0;
|
||||
|
||||
virtual auto IsReadOnly() const -> bool = 0;
|
||||
|
||||
virtual auto Schemas() const -> QHash <unsigned, QString> =0;
|
||||
virtual auto Schemas() const -> QHash<unsigned, QString> = 0;
|
||||
|
||||
void Replace(QString &formula, const QString &newName, vsizetype position, const QString &token,
|
||||
vsizetype &bias) const;
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VABSTRACTMCONVERTER_H
|
||||
#define VABSTRACTMCONVERTER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QMap>
|
||||
#include <QMultiMap>
|
||||
#include <QString>
|
||||
|
@ -41,7 +40,7 @@ class VAbstractMConverter : public VAbstractConverter
|
|||
{
|
||||
public:
|
||||
explicit VAbstractMConverter(const QString &fileName);
|
||||
virtual ~VAbstractMConverter() = default;
|
||||
~VAbstractMConverter() override = default;
|
||||
|
||||
auto Units() const -> Unit;
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VABSTRACTPATTERN_H
|
||||
#define VABSTRACTPATTERN_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QHash>
|
||||
#include <QMap>
|
||||
#include <QMetaObject>
|
||||
|
@ -37,9 +36,9 @@
|
|||
#include <QPair>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QUuid>
|
||||
#include <QVector>
|
||||
#include <QtGlobal>
|
||||
#include <QUuid>
|
||||
|
||||
#include "../vmisc/def.h"
|
||||
#include "vdomdocument.h"
|
||||
|
@ -51,14 +50,40 @@ class VPieceNode;
|
|||
class VPatternImage;
|
||||
class VBackgroundPatternImage;
|
||||
|
||||
enum class Document : qint8 { FullLiteParse, LiteParse, LitePPParse, FullParse };
|
||||
enum class LabelType : qint8 {NewPatternPiece, NewLabel};
|
||||
enum class Document : qint8
|
||||
{
|
||||
FullLiteParse,
|
||||
LiteParse,
|
||||
LitePPParse,
|
||||
FullParse
|
||||
};
|
||||
enum class LabelType : qint8
|
||||
{
|
||||
NewPatternPiece,
|
||||
NewLabel
|
||||
};
|
||||
|
||||
// Don't touch values!!!. Same values stored in xml.
|
||||
enum class CrossCirclesPoint : qint8 {FirstPoint = 1, SecondPoint = 2};
|
||||
enum class VCrossCurvesPoint : qint8 {HighestPoint = 1, LowestPoint = 2};
|
||||
enum class HCrossCurvesPoint : qint8 {LeftmostPoint = 1, RightmostPoint = 2};
|
||||
enum class AxisType : qint8 {VerticalAxis = 1, HorizontalAxis = 2};
|
||||
enum class CrossCirclesPoint : qint8
|
||||
{
|
||||
FirstPoint = 1,
|
||||
SecondPoint = 2
|
||||
};
|
||||
enum class VCrossCurvesPoint : qint8
|
||||
{
|
||||
HighestPoint = 1,
|
||||
LowestPoint = 2
|
||||
};
|
||||
enum class HCrossCurvesPoint : qint8
|
||||
{
|
||||
LeftmostPoint = 1,
|
||||
RightmostPoint = 2
|
||||
};
|
||||
enum class AxisType : qint8
|
||||
{
|
||||
VerticalAxis = 1,
|
||||
HorizontalAxis = 2
|
||||
};
|
||||
|
||||
class VContainer;
|
||||
class VDataTool;
|
||||
|
@ -68,9 +93,9 @@ QT_WARNING_DISABLE_GCC("-Weffc++")
|
|||
|
||||
struct VFormulaField
|
||||
{
|
||||
QString expression;
|
||||
QString expression;
|
||||
QDomElement element;
|
||||
QString attribute;
|
||||
QString attribute;
|
||||
};
|
||||
|
||||
struct VFinalMeasurement
|
||||
|
@ -97,6 +122,7 @@ QT_WARNING_DISABLE_GCC("-Wsuggest-final-types")
|
|||
class VAbstractPattern : public VDomDocument
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit VAbstractPattern(QObject *parent = nullptr);
|
||||
virtual ~VAbstractPattern();
|
||||
|
@ -374,48 +400,48 @@ signals:
|
|||
* @brief ChangedActivPP change active pattern peace.
|
||||
* @param newName new pattern peace name.
|
||||
*/
|
||||
void ChangedActivPP(const QString &newName);
|
||||
void ChangedActivPP(const QString &newName);
|
||||
|
||||
/**
|
||||
* @brief ChangedCursor change cursor position.
|
||||
* @param id tool id.
|
||||
*/
|
||||
void ChangedCursor(quint32 id);
|
||||
void ChangedCursor(quint32 id);
|
||||
|
||||
/**
|
||||
* @brief ChangedNameDraw save new name pattern peace.
|
||||
* @param oldName old name.
|
||||
* @param newName new name.
|
||||
*/
|
||||
void ChangedNameDraw(const QString &oldName, const QString &newName);
|
||||
void ChangedNameDraw(const QString &oldName, const QString &newName);
|
||||
/**
|
||||
* @brief FullUpdateFromFile update tool data form file.
|
||||
*/
|
||||
void FullUpdateFromFile();
|
||||
void FullUpdateFromFile();
|
||||
/**
|
||||
* @brief patternChanged emit if we have unsaved change.
|
||||
*/
|
||||
void patternChanged(bool saved);
|
||||
void UpdatePatternLabel();
|
||||
void patternChanged(bool saved);
|
||||
void UpdatePatternLabel();
|
||||
/**
|
||||
* @brief ShowTool highlight tool.
|
||||
* @param id tool id.
|
||||
* @param enable enable or disable highlight.
|
||||
*/
|
||||
void ShowTool(quint32 id, bool enable);
|
||||
void ClearMainWindow();
|
||||
void UndoCommand();
|
||||
void SetEnabledGUI(bool enabled);
|
||||
void CheckLayout();
|
||||
void UpdateInLayoutList();
|
||||
void ShowDetail(quint32 id);
|
||||
void SetCurrentPP(const QString &patterPiece);
|
||||
void MadeProgress();
|
||||
void ShowTool(quint32 id, bool enable);
|
||||
void ClearMainWindow();
|
||||
void UndoCommand();
|
||||
void SetEnabledGUI(bool enabled);
|
||||
void CheckLayout();
|
||||
void UpdateInLayoutList();
|
||||
void ShowDetail(quint32 id);
|
||||
void SetCurrentPP(const QString &patterPiece);
|
||||
void MadeProgress();
|
||||
/**
|
||||
* @brief UpdateGroups emit if the groups have been updated
|
||||
*/
|
||||
void UpdateGroups();
|
||||
void UpdateToolTip();
|
||||
void UpdateGroups();
|
||||
void UpdateToolTip();
|
||||
|
||||
void BackgroundImageTransformationChanged(QUuid id);
|
||||
void BackgroundImagesHoldChanged();
|
||||
|
@ -428,31 +454,31 @@ signals:
|
|||
void BackgroundImageOpacityChanged(const QUuid &id);
|
||||
|
||||
public slots:
|
||||
virtual void LiteParseTree(const Document &parse)=0;
|
||||
void haveLiteChange();
|
||||
void NeedFullParsing();
|
||||
void ClearScene();
|
||||
void CheckInLayoutList();
|
||||
void SelectedDetail(quint32 id);
|
||||
void UpdateVisiblityGroups();
|
||||
virtual void LiteParseTree(const Document &parse) = 0;
|
||||
void haveLiteChange();
|
||||
void NeedFullParsing();
|
||||
void ClearScene();
|
||||
void CheckInLayoutList();
|
||||
void SelectedDetail(quint32 id);
|
||||
void UpdateVisiblityGroups();
|
||||
|
||||
protected:
|
||||
/** @brief nameActivDraw name current pattern peace. */
|
||||
QString nameActivPP;
|
||||
QString nameActivPP;
|
||||
|
||||
/** @brief cursor cursor keep id tool after which we will add new tool in file. */
|
||||
quint32 cursor;
|
||||
quint32 cursor;
|
||||
|
||||
QVector<VDataTool*> toolsOnRemove;
|
||||
QVector<VDataTool *> toolsOnRemove;
|
||||
|
||||
/** @brief history history records. */
|
||||
QVector<VToolRecord> history;
|
||||
|
||||
/** @brief patternPieces list of patern pieces names for combobox*/
|
||||
QStringList patternPieces;
|
||||
QStringList patternPieces;
|
||||
|
||||
/** @brief modified keep state of the document for cases that do not cover QUndoStack*/
|
||||
mutable bool modified;
|
||||
mutable bool modified;
|
||||
|
||||
Unit m_units{Unit::LAST_UNIT_DO_NOT_USE};
|
||||
QString m_patternNumber{};
|
||||
|
@ -463,23 +489,23 @@ protected:
|
|||
QString m_companyName{};
|
||||
|
||||
/** @brief tools list with pointer on tools. */
|
||||
static QHash<quint32, VDataTool*> tools;
|
||||
static QHash<quint32, VDataTool *> tools;
|
||||
/** @brief patternLabelLines list to speed up reading a template by many pieces. */
|
||||
static QVector<VLabelTemplateLine> patternLabelLines;
|
||||
/** @brief patternMaterials list to speed up reading materials by many pieces. */
|
||||
static QMap<int, QString> patternMaterials;
|
||||
static bool patternLabelWasChanged;
|
||||
|
||||
static void ToolExists(const quint32 &id);
|
||||
static void ToolExists(const quint32 &id);
|
||||
static auto ParsePathNodes(const QDomElement &domElement) -> VPiecePath;
|
||||
static auto ParseSANode(const QDomElement &domElement) -> VPieceNode;
|
||||
|
||||
void SetActivPP(const QString& name);
|
||||
void SetActivPP(const QString &name);
|
||||
|
||||
auto CheckTagExists(const QString &tag) -> QDomElement;
|
||||
void InsertTag(const QStringList &tags, const QDomElement &element);
|
||||
void InsertTag(const QStringList &tags, const QDomElement &element);
|
||||
|
||||
void SetChildTag(const QString& qsParent, const QString& qsChild, const QString& qsValue);
|
||||
void SetChildTag(const QString &qsParent, const QString &qsChild, const QString &qsValue);
|
||||
|
||||
auto GetIndexActivPP() const -> int;
|
||||
auto GetActivDrawElement(QDomElement &element) const -> bool;
|
||||
|
@ -489,10 +515,10 @@ protected:
|
|||
auto GroupHasItem(const QDomElement &groupDomElement, quint32 toolId, quint32 objectId) -> bool;
|
||||
|
||||
auto ReadUnits() const -> Unit;
|
||||
auto ReadPatternNumber() const ->QString;
|
||||
auto ReadLabelDateFormat() const ->QString;
|
||||
auto ReadPatternName() const ->QString;
|
||||
auto ReadMPath() const ->QString;
|
||||
auto ReadPatternNumber() const -> QString;
|
||||
auto ReadLabelDateFormat() const -> QString;
|
||||
auto ReadPatternName() const -> QString;
|
||||
auto ReadMPath() const -> QString;
|
||||
auto ReadWatermarkPath() const -> QString;
|
||||
auto ReadCompanyName() const -> QString;
|
||||
|
||||
|
@ -518,10 +544,10 @@ private:
|
|||
auto ParseItemElement(const QDomElement &domElement) -> QPair<bool, QMap<quint32, quint32>>;
|
||||
|
||||
auto GetMaterials(const QDomElement &element) const -> QMap<int, QString>;
|
||||
void SetMaterials(QDomElement &element, const QMap<int, QString> &materials);
|
||||
void SetMaterials(QDomElement &element, const QMap<int, QString> &materials);
|
||||
|
||||
auto GetFMeasurements(const QDomElement &element) const -> QVector<VFinalMeasurement>;
|
||||
void SetFMeasurements(QDomElement &element, const QVector<VFinalMeasurement> &measurements);
|
||||
void SetFMeasurements(QDomElement &element, const QVector<VFinalMeasurement> &measurements);
|
||||
|
||||
auto GetBackgroundPatternImage(const QDomElement &element) const -> VBackgroundPatternImage;
|
||||
auto GetBackgroundImageElement(const QUuid &id) const -> QDomElement;
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "vdomdocument.h"
|
||||
|
||||
#include <QSaveFile>
|
||||
#include <qcompilerdetection.h>
|
||||
#include <qdom.h>
|
||||
|
||||
#include "../exception/vexception.h"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VPATTERNCONVERTER_H
|
||||
#define VPATTERNCONVERTER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDomElement>
|
||||
#include <QMap>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VVITCONVERTER_H
|
||||
#define VVITCONVERTER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VMEASUREMENTCONVERTER_H
|
||||
#define VMEASUREMENTCONVERTER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#ifndef QMUFORMULABASE_H
|
||||
#define QMUFORMULABASE_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
|
@ -38,9 +37,9 @@ class QMUPARSERSHARED_EXPORT QmuFormulaBase : public QmuParser
|
|||
{
|
||||
public:
|
||||
QmuFormulaBase();
|
||||
virtual ~QmuFormulaBase() override;
|
||||
~QmuFormulaBase() override;
|
||||
|
||||
virtual void InitCharSets() override;
|
||||
void InitCharSets() override;
|
||||
|
||||
void SetSepForTr(bool osSeparator, bool fromUser);
|
||||
|
||||
|
@ -48,7 +47,8 @@ public:
|
|||
|
||||
protected:
|
||||
static auto AddVariable(const QString &a_szName, void *a_pUserData) -> qreal *;
|
||||
void SetSepForEval();
|
||||
void SetSepForEval();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(QmuFormulaBase) // NOLINT
|
||||
};
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#ifndef QMUPARSER_H
|
||||
#define QMUPARSER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
#include <locale>
|
||||
|
@ -37,73 +36,73 @@
|
|||
|
||||
namespace qmu
|
||||
{
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Wsuggest-final-types")
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Wsuggest-final-types")
|
||||
|
||||
/** @brief Mathematical expressions parser.
|
||||
*
|
||||
* Standard implementation of the mathematical expressions parser.
|
||||
* Can be used as a reference implementation for subclassing the parser.
|
||||
*
|
||||
* <small>
|
||||
* (C) 2011 Ingo Berg<br>
|
||||
* muparser(at)gmx.de
|
||||
* </small>
|
||||
*/
|
||||
/* final */ class QMUPARSERSHARED_EXPORT QmuParser : public QmuParserBase
|
||||
{
|
||||
public:
|
||||
QmuParser();
|
||||
virtual void InitCharSets() override;
|
||||
virtual void InitFun() override;
|
||||
virtual void InitConst() override;
|
||||
virtual void InitOprt() override;
|
||||
virtual void OnDetectVar(const QString &pExpr, qmusizetype &nStart, qmusizetype &nEnd) override;
|
||||
auto Diff(qreal *a_Var, qreal a_fPos, qreal a_fEpsilon = 0) const -> qreal;
|
||||
/** @brief Mathematical expressions parser.
|
||||
*
|
||||
* Standard implementation of the mathematical expressions parser.
|
||||
* Can be used as a reference implementation for subclassing the parser.
|
||||
*
|
||||
* <small>
|
||||
* (C) 2011 Ingo Berg<br>
|
||||
* muparser(at)gmx.de
|
||||
* </small>
|
||||
*/
|
||||
/* final */ class QMUPARSERSHARED_EXPORT QmuParser : public QmuParserBase
|
||||
{
|
||||
public:
|
||||
QmuParser();
|
||||
void InitCharSets() override;
|
||||
void InitFun() override;
|
||||
void InitConst() override;
|
||||
void InitOprt() override;
|
||||
void OnDetectVar(const QString &pExpr, qmusizetype &nStart, qmusizetype &nEnd) override;
|
||||
auto Diff(qreal *a_Var, qreal a_fPos, qreal a_fEpsilon = 0) const -> qreal;
|
||||
|
||||
protected:
|
||||
static auto IsVal(const QString &a_szExpr, qmusizetype *a_iPos, qreal *a_fVal, const QLocale &locale,
|
||||
bool cNumbers, const QChar &decimal, const QChar &thousand) -> int;
|
||||
// hyperbolic functions
|
||||
static auto Sinh(qreal) -> qreal;
|
||||
static auto Cosh(qreal) -> qreal;
|
||||
static auto Tanh(qreal) -> qreal;
|
||||
// arcus hyperbolic functions
|
||||
static auto ASinh(qreal) -> qreal;
|
||||
static auto ACosh(qreal) -> qreal;
|
||||
static auto ATanh(qreal) -> qreal;
|
||||
// functions working with degrees
|
||||
static auto DegreeToRadian(qreal) -> qreal;
|
||||
static auto RadianToDegree(qreal) -> qreal;
|
||||
static auto SinD(qreal) -> qreal;
|
||||
static auto CosD(qreal) -> qreal;
|
||||
static auto TanD(qreal) -> qreal;
|
||||
static auto ASinD(qreal) -> qreal;
|
||||
static auto ACosD(qreal) -> qreal;
|
||||
static auto ATanD(qreal) -> qreal;
|
||||
protected:
|
||||
static auto IsVal(const QString &a_szExpr, qmusizetype *a_iPos, qreal *a_fVal, const QLocale &locale, bool cNumbers,
|
||||
const QChar &decimal, const QChar &thousand) -> int;
|
||||
// hyperbolic functions
|
||||
static auto Sinh(qreal) -> qreal;
|
||||
static auto Cosh(qreal) -> qreal;
|
||||
static auto Tanh(qreal) -> qreal;
|
||||
// arcus hyperbolic functions
|
||||
static auto ASinh(qreal) -> qreal;
|
||||
static auto ACosh(qreal) -> qreal;
|
||||
static auto ATanh(qreal) -> qreal;
|
||||
// functions working with degrees
|
||||
static auto DegreeToRadian(qreal) -> qreal;
|
||||
static auto RadianToDegree(qreal) -> qreal;
|
||||
static auto SinD(qreal) -> qreal;
|
||||
static auto CosD(qreal) -> qreal;
|
||||
static auto TanD(qreal) -> qreal;
|
||||
static auto ASinD(qreal) -> qreal;
|
||||
static auto ACosD(qreal) -> qreal;
|
||||
static auto ATanD(qreal) -> qreal;
|
||||
|
||||
// Logarithm functions
|
||||
static auto Log2(qreal) -> qreal; // Logarithm Base 2
|
||||
static auto Log10(qreal) -> qreal; // Logarithm Base 10
|
||||
// misc
|
||||
static auto Abs(qreal) -> qreal;
|
||||
static auto Rint(qreal) -> qreal;
|
||||
static auto R2CM(qreal) -> qreal;
|
||||
static auto CSRCm(qreal length, qreal split, qreal arcLength) -> qreal;
|
||||
static auto CSRInch(qreal length, qreal split, qreal arcLength) -> qreal;
|
||||
static auto Sign(qreal) -> qreal;
|
||||
static auto FMod(qreal, qreal) -> qreal;
|
||||
// Prefix operators
|
||||
// !!! Unary Minus is a MUST if you want to use negative signs !!!
|
||||
static auto UnaryMinus(qreal v) -> qreal;
|
||||
// Functions with variable number of arguments
|
||||
static auto Sum(const qreal *, qmusizetype) -> qreal; // sum
|
||||
static auto Avg(const qreal *, qmusizetype) -> qreal; // mean value
|
||||
static auto Min(const qreal *, qmusizetype) -> qreal; // minimum
|
||||
static auto Max(const qreal *, qmusizetype) -> qreal; // maximum
|
||||
};
|
||||
// Logarithm functions
|
||||
static auto Log2(qreal) -> qreal; // Logarithm Base 2
|
||||
static auto Log10(qreal) -> qreal; // Logarithm Base 10
|
||||
// misc
|
||||
static auto Abs(qreal) -> qreal;
|
||||
static auto Rint(qreal) -> qreal;
|
||||
static auto R2CM(qreal) -> qreal;
|
||||
static auto CSRCm(qreal length, qreal split, qreal arcLength) -> qreal;
|
||||
static auto CSRInch(qreal length, qreal split, qreal arcLength) -> qreal;
|
||||
static auto Sign(qreal) -> qreal;
|
||||
static auto FMod(qreal, qreal) -> qreal;
|
||||
// Prefix operators
|
||||
// !!! Unary Minus is a MUST if you want to use negative signs !!!
|
||||
static auto UnaryMinus(qreal v) -> qreal;
|
||||
// Functions with variable number of arguments
|
||||
static auto Sum(const qreal *, qmusizetype) -> qreal; // sum
|
||||
static auto Avg(const qreal *, qmusizetype) -> qreal; // mean value
|
||||
static auto Min(const qreal *, qmusizetype) -> qreal; // minimum
|
||||
static auto Max(const qreal *, qmusizetype) -> qreal; // maximum
|
||||
};
|
||||
|
||||
QT_WARNING_POP
|
||||
QT_WARNING_POP
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
|
@ -111,9 +110,9 @@ namespace qmu
|
|||
* @param v The value to negate
|
||||
* @return -v
|
||||
*/
|
||||
inline auto QmuParser::UnaryMinus(qreal v) -> qreal
|
||||
{
|
||||
return -v;
|
||||
inline auto QmuParser::UnaryMinus(qreal v) -> qreal
|
||||
{
|
||||
return -v;
|
||||
}
|
||||
|
||||
} // namespace qmu
|
||||
|
|
|
@ -22,19 +22,18 @@
|
|||
#ifndef QMUQPARSERBASE_H
|
||||
#define QMUQPARSERBASE_H
|
||||
|
||||
#include <climits>
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QChar>
|
||||
#include <QLocale>
|
||||
#include <QMap>
|
||||
#include <QStack>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QVector>
|
||||
#include <QtCore/qcontainerfwd.h>
|
||||
#include <QtGlobal>
|
||||
#include <climits>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <QLocale>
|
||||
#include <QtCore/qcontainerfwd.h>
|
||||
|
||||
#include "qmuparser_global.h"
|
||||
#include "qmuparserbytecode.h"
|
||||
|
@ -69,40 +68,40 @@ QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
|
|||
class QMUPARSERSHARED_EXPORT QmuParserBase
|
||||
{
|
||||
friend class QmuParserTokenReader;
|
||||
|
||||
public:
|
||||
QmuParserBase();
|
||||
explicit QmuParserBase(const QmuParserBase &a_Parser);
|
||||
auto operator=(const QmuParserBase &a_Parser) -> QmuParserBase &;
|
||||
virtual ~QmuParserBase();
|
||||
|
||||
static void EnableDebugDump(bool bDumpCmd, bool bDumpStack);
|
||||
static void EnableDebugDump(bool bDumpCmd, bool bDumpStack);
|
||||
auto Eval() const -> qreal;
|
||||
auto Eval(int &nStackSize) const -> qreal *;
|
||||
void Eval(qreal *results, int nBulkSize) const;
|
||||
void Eval(qreal *results, int nBulkSize) const;
|
||||
auto GetNumResults() const -> int;
|
||||
void SetExpr(const QString &a_sExpr);
|
||||
void SetVarFactory(facfun_type a_pFactory, void *pUserData = nullptr);
|
||||
void ResetLocale();
|
||||
void EnableOptimizer(bool a_bIsOn=true);
|
||||
void EnableBuiltInOprt(bool a_bIsOn=true);
|
||||
void SetExpr(const QString &a_sExpr);
|
||||
void SetVarFactory(facfun_type a_pFactory, void *pUserData = nullptr);
|
||||
void ResetLocale();
|
||||
void EnableOptimizer(bool a_bIsOn = true);
|
||||
void EnableBuiltInOprt(bool a_bIsOn = true);
|
||||
auto HasBuiltInOprt() const -> bool;
|
||||
void AddValIdent(identfun_type a_pCallback);
|
||||
void DefineOprt(const QString &a_sName, fun_type2 a_pFun, unsigned a_iPrec=0,
|
||||
EOprtAssociativity a_eAssociativity = oaLEFT, bool a_bAllowOpt = false);
|
||||
void DefineConst(const QString &a_sName, qreal a_fVal);
|
||||
void DefineStrConst(const QString &a_strName, const QString &a_strVal);
|
||||
void DefineVar(const QString &a_sName, qreal *a_pVar);
|
||||
void DefinePostfixOprt(const QString &a_sFun, fun_type1 a_pFun, bool a_bAllowOpt=true);
|
||||
void DefineInfixOprt(const QString &a_sName, fun_type1 a_pFun, int a_iPrec=prINFIX,
|
||||
bool a_bAllowOpt=true);
|
||||
void AddValIdent(identfun_type a_pCallback);
|
||||
void DefineOprt(const QString &a_sName, fun_type2 a_pFun, unsigned a_iPrec = 0,
|
||||
EOprtAssociativity a_eAssociativity = oaLEFT, bool a_bAllowOpt = false);
|
||||
void DefineConst(const QString &a_sName, qreal a_fVal);
|
||||
void DefineStrConst(const QString &a_strName, const QString &a_strVal);
|
||||
void DefineVar(const QString &a_sName, qreal *a_pVar);
|
||||
void DefinePostfixOprt(const QString &a_sFun, fun_type1 a_pFun, bool a_bAllowOpt = true);
|
||||
void DefineInfixOprt(const QString &a_sName, fun_type1 a_pFun, int a_iPrec = prINFIX, bool a_bAllowOpt = true);
|
||||
// Clear user defined variables, constants or functions
|
||||
void ClearVar();
|
||||
void ClearFun();
|
||||
void ClearConst();
|
||||
void ClearInfixOprt();
|
||||
void ClearPostfixOprt();
|
||||
void ClearOprt();
|
||||
void RemoveVar(const QString &a_strVarName);
|
||||
void ClearVar();
|
||||
void ClearFun();
|
||||
void ClearConst();
|
||||
void ClearInfixOprt();
|
||||
void ClearPostfixOprt();
|
||||
void ClearOprt();
|
||||
void RemoveVar(const QString &a_strVarName);
|
||||
auto GetUsedVar() const -> const varmap_type &;
|
||||
auto GetVar() const -> const varmap_type &;
|
||||
auto GetConst() const -> const valmap_type &;
|
||||
|
@ -112,29 +111,28 @@ public:
|
|||
static auto GetOprtDef() -> const QStringList &;
|
||||
auto GetTokens() const -> QMap<qmusizetype, QString>;
|
||||
auto GetNumbers() const -> QMap<qmusizetype, QString>;
|
||||
void DefineNameChars(const QString &a_szCharset);
|
||||
void DefineOprtChars(const QString &a_szCharset);
|
||||
void DefineInfixOprtChars(const QString &a_szCharset);
|
||||
void DefineNameChars(const QString &a_szCharset);
|
||||
void DefineOprtChars(const QString &a_szCharset);
|
||||
void DefineInfixOprtChars(const QString &a_szCharset);
|
||||
auto ValidNameChars() const -> const QString &;
|
||||
auto ValidOprtChars() const -> const QString &;
|
||||
auto ValidInfixOprtChars() const -> const QString &;
|
||||
void SetArgSep(char_type cArgSep);
|
||||
void SetArgSep(char_type cArgSep);
|
||||
auto GetArgSep() const -> QChar;
|
||||
Q_NORETURN void Error(EErrorCodes a_iErrc, qmusizetype a_iPos = -1, const QString &a_sTok = QString() ) const;
|
||||
Q_NORETURN void Error(EErrorCodes a_iErrc, qmusizetype a_iPos = -1, const QString &a_sTok = QString()) const;
|
||||
|
||||
template<typename T>
|
||||
void DefineFun(const QString &a_strName, T a_pFun, bool a_bAllowOpt = true);
|
||||
template <typename T> void DefineFun(const QString &a_strName, T a_pFun, bool a_bAllowOpt = true);
|
||||
|
||||
void setAllowSubexpressions(bool value);
|
||||
|
||||
auto getLocale() const -> QLocale;
|
||||
void setLocale(const QLocale &value);
|
||||
void setLocale(const QLocale &value);
|
||||
|
||||
auto getDecimalPoint() const -> QChar;
|
||||
void setDecimalPoint(const QChar &c);
|
||||
void setDecimalPoint(const QChar &c);
|
||||
|
||||
auto getThousandsSeparator() const -> QChar;
|
||||
void setThousandsSeparator(const QChar &c);
|
||||
void setThousandsSeparator(const QChar &c);
|
||||
|
||||
auto getCNumbers() const -> bool;
|
||||
void setCNumbers(bool cNumbers);
|
||||
|
@ -146,16 +144,16 @@ protected:
|
|||
typedef QmuParserTokenReader token_reader_type;
|
||||
|
||||
static const QStringList c_DefaultOprt;
|
||||
QLocale m_locale;///< The locale used by the parser
|
||||
QLocale m_locale; ///< The locale used by the parser
|
||||
QChar m_decimalPoint;
|
||||
QChar m_thousandsSeparator;
|
||||
bool m_cNumbers{false}; ///< Search numbers in c locale
|
||||
funmap_type m_FunDef; ///< Map of function names and pointers.
|
||||
bool m_cNumbers{false}; ///< Search numbers in c locale
|
||||
funmap_type m_FunDef; ///< Map of function names and pointers.
|
||||
std::unique_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object.
|
||||
static bool g_DbgDumpCmdCode;
|
||||
static bool g_DbgDumpStack;
|
||||
void AddCallback(const QString &a_strName, const QmuParserCallback &a_Callback, funmap_type &a_Storage,
|
||||
const QString &a_szCharSet );
|
||||
const QString &a_szCharSet);
|
||||
void Init();
|
||||
virtual void InitCharSets() = 0;
|
||||
virtual void InitFun() = 0;
|
||||
|
@ -165,32 +163,38 @@ protected:
|
|||
/**
|
||||
* @brief A facet class used to change decimal and thousands separator.
|
||||
*/
|
||||
template<class TChar>
|
||||
class change_dec_sep : public std::numpunct<TChar>
|
||||
template <class TChar> class change_dec_sep : public std::numpunct<TChar>
|
||||
{
|
||||
public:
|
||||
explicit change_dec_sep(char_type cDecSep, char_type cThousandsSep = 0, int nGroup = 3)
|
||||
:std::numpunct<TChar>(), m_nGroup(nGroup), m_cDecPoint(cDecSep), m_cThousandsSep(cThousandsSep)
|
||||
{}
|
||||
protected:
|
||||
virtual auto do_decimal_point() const -> char_type override { return m_cDecPoint; }
|
||||
public:
|
||||
explicit change_dec_sep(char_type cDecSep, char_type cThousandsSep = 0, int nGroup = 3)
|
||||
: std::numpunct<TChar>(),
|
||||
m_nGroup(nGroup),
|
||||
m_cDecPoint(cDecSep),
|
||||
m_cThousandsSep(cThousandsSep)
|
||||
{
|
||||
}
|
||||
|
||||
virtual auto do_thousands_sep() const -> char_type override { return m_cThousandsSep; }
|
||||
protected:
|
||||
virtual auto do_decimal_point() const -> char_type override { return m_cDecPoint; }
|
||||
|
||||
virtual auto do_grouping() const -> std::string override
|
||||
{
|
||||
// fix for issue 4: https://code.google.com/p/muparser/issues/detail?id=4
|
||||
// courtesy of Jens Bartsch
|
||||
// original code:
|
||||
// return std::string(1, (char)m_nGroup);
|
||||
// new code:
|
||||
return std::string(1, static_cast<char>(m_cThousandsSep > 0 ? m_nGroup : CHAR_MAX));
|
||||
}
|
||||
private:
|
||||
int m_nGroup;
|
||||
char_type m_cDecPoint;
|
||||
char_type m_cThousandsSep;
|
||||
virtual auto do_thousands_sep() const -> char_type override { return m_cThousandsSep; }
|
||||
|
||||
virtual auto do_grouping() const -> std::string override
|
||||
{
|
||||
// fix for issue 4: https://code.google.com/p/muparser/issues/detail?id=4
|
||||
// courtesy of Jens Bartsch
|
||||
// original code:
|
||||
// return std::string(1, (char)m_nGroup);
|
||||
// new code:
|
||||
return std::string(1, static_cast<char>(m_cThousandsSep > 0 ? m_nGroup : CHAR_MAX));
|
||||
}
|
||||
|
||||
private:
|
||||
int m_nGroup;
|
||||
char_type m_cDecPoint;
|
||||
char_type m_cThousandsSep;
|
||||
};
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Typedef for the parse functions.
|
||||
|
@ -226,54 +230,53 @@ private:
|
|||
*
|
||||
* Eval() calls the function whose address is stored there.
|
||||
*/
|
||||
mutable ParseFunction m_pParseFormula;
|
||||
mutable QmuParserByteCode m_vRPN; ///< The Bytecode class.
|
||||
mutable stringbuf_type m_vStringBuf; ///< String buffer, used for storing string function arguments
|
||||
stringbuf_type m_vStringVarBuf;
|
||||
mutable ParseFunction m_pParseFormula;
|
||||
mutable QmuParserByteCode m_vRPN; ///< The Bytecode class.
|
||||
mutable stringbuf_type m_vStringBuf; ///< String buffer, used for storing string function arguments
|
||||
stringbuf_type m_vStringVarBuf;
|
||||
|
||||
funmap_type m_PostOprtDef; ///< Postfix operator callbacks
|
||||
funmap_type m_InfixOprtDef; ///< unary infix operator.
|
||||
funmap_type m_OprtDef; ///< Binary operator callbacks
|
||||
valmap_type m_ConstDef; ///< user constants.
|
||||
strmap_type m_StrVarDef; ///< user defined string constants
|
||||
varmap_type m_VarDef; ///< user defind variables.
|
||||
funmap_type m_PostOprtDef; ///< Postfix operator callbacks
|
||||
funmap_type m_InfixOprtDef; ///< unary infix operator.
|
||||
funmap_type m_OprtDef; ///< Binary operator callbacks
|
||||
valmap_type m_ConstDef; ///< user constants.
|
||||
strmap_type m_StrVarDef; ///< user defined string constants
|
||||
varmap_type m_VarDef; ///< user defind variables.
|
||||
|
||||
bool m_bBuiltInOp; ///< Flag that can be used for switching built in operators on and off
|
||||
bool m_bBuiltInOp; ///< Flag that can be used for switching built in operators on and off
|
||||
|
||||
QString m_sNameChars; ///< Charset for names
|
||||
QString m_sOprtChars; ///< Charset for postfix/ binary operator tokens
|
||||
QString m_sInfixOprtChars; ///< Charset for infix operator tokens
|
||||
|
||||
mutable int m_nIfElseCounter; ///< Internal counter for keeping track of nested if-then-else clauses
|
||||
mutable int m_nIfElseCounter; ///< Internal counter for keeping track of nested if-then-else clauses
|
||||
|
||||
// items merely used for caching state information
|
||||
mutable valbuf_type m_vStackBuffer; ///< This is merely a buffer used for the stack in the cmd parsing routine
|
||||
mutable int m_nFinalResultIdx;
|
||||
mutable QMap<qmusizetype, QString> m_Tokens;///< Keep all tokens that we can translate
|
||||
mutable QMap<qmusizetype, QString> m_Numbers;///< Keep all numbers what exist in formula
|
||||
mutable QMap<qmusizetype, QString> m_Tokens; ///< Keep all tokens that we can translate
|
||||
mutable QMap<qmusizetype, QString> m_Numbers; ///< Keep all numbers what exist in formula
|
||||
|
||||
bool allowSubexpressions;
|
||||
|
||||
void Assign(const QmuParserBase &a_Parser);
|
||||
void InitTokenReader();
|
||||
void ReInit() const;
|
||||
void ApplyRemainingOprt(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal) const;
|
||||
void ApplyBinOprt(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal) const;
|
||||
void ApplyIfElse(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal) const;
|
||||
void ApplyFunc(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal, int iArgCount) const;
|
||||
void Assign(const QmuParserBase &a_Parser);
|
||||
void InitTokenReader();
|
||||
void ReInit() const;
|
||||
void ApplyRemainingOprt(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal) const;
|
||||
void ApplyBinOprt(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal) const;
|
||||
void ApplyIfElse(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal) const;
|
||||
void ApplyFunc(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal, int iArgCount) const;
|
||||
auto ApplyStrFunc(const token_type &a_FunTok, const QVector<token_type> &a_vArg) const -> token_type;
|
||||
auto GetOprtPrecedence(const token_type &a_Tok) const -> int;
|
||||
auto GetOprtAssociativity(const token_type &a_Tok) const -> EOprtAssociativity;
|
||||
void CreateRPN() const;
|
||||
void CreateRPN() const;
|
||||
auto ParseString() const -> qreal;
|
||||
auto ParseCmdCode() const -> qreal;
|
||||
auto ParseCmdCodeBulk(int nOffset, int nThreadID) const -> qreal;
|
||||
// cppcheck-suppress functionStatic
|
||||
void CheckName(const QString &a_sName, const QString &a_szCharSet) const;
|
||||
void CheckName(const QString &a_sName, const QString &a_szCharSet) const;
|
||||
// cppcheck-suppress functionStatic
|
||||
void CheckOprt(const QString &a_sName, const QmuParserCallback &a_Callback,
|
||||
const QString &a_szCharSet) const;
|
||||
void StackDump(const QStack<token_type > &a_stVal, const QStack<token_type > &a_stOprt) const;
|
||||
void CheckOprt(const QString &a_sName, const QmuParserCallback &a_Callback, const QString &a_szCharSet) const;
|
||||
void StackDump(const QStack<token_type> &a_stVal, const QStack<token_type> &a_stOprt) const;
|
||||
};
|
||||
|
||||
// cppcheck-suppress unknownMacro
|
||||
|
@ -288,10 +291,9 @@ QT_WARNING_POP
|
|||
* @param a_pFun Pointer to the callback function
|
||||
* @param a_bAllowOpt A flag indicating this function may be optimized
|
||||
*/
|
||||
template<typename T>
|
||||
inline void QmuParserBase::DefineFun(const QString &a_strName, T a_pFun, bool a_bAllowOpt)
|
||||
template <typename T> inline void QmuParserBase::DefineFun(const QString &a_strName, T a_pFun, bool a_bAllowOpt)
|
||||
{
|
||||
AddCallback( a_strName, QmuParserCallback(a_pFun, a_bAllowOpt), m_FunDef, ValidNameChars() );
|
||||
AddCallback(a_strName, QmuParserCallback(a_pFun, a_bAllowOpt), m_FunDef, ValidNameChars());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -29,23 +29,26 @@
|
|||
namespace qmu
|
||||
{
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( fun_type0 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type0 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec, ECmdCode a_iCode )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti, a_iPrec, a_iCode))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec, ECmdCode a_iCode)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti, a_iPrec, a_iCode))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief Constructor for constructing funcstion callbacks taking two arguments.
|
||||
* @throw nothrow
|
||||
*/
|
||||
QmuParserCallback::QmuParserCallback ( fun_type2 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
|
@ -56,128 +59,152 @@ QmuParserCallback::QmuParserCallback ( fun_type2 a_pFun, bool a_bAllowOpti )
|
|||
* @param a_eOprtAsct The operators associativity
|
||||
* @throw nothrow
|
||||
*/
|
||||
QmuParserCallback::QmuParserCallback (fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eOprtAsct)
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti, a_iPrec, a_eOprtAsct))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eOprtAsct)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti, a_iPrec, a_eOprtAsct))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( fun_type3 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type3 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( fun_type4 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type4 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( fun_type5 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type5 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( fun_type6 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type6 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( fun_type7 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type7 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( fun_type8 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type8 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( fun_type9 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type9 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( fun_type10 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(fun_type10 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type0 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type0 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type1 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type1 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief Constructor for constructing funcstion callbacks taking two arguments.
|
||||
* @throw nothrow
|
||||
*/
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type2 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type2 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type3 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type3 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type4 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type4 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type5 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type5 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type6 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type6 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type7 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type7 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type8 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type8 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type9 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type9 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( bulkfun_type10 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(bulkfun_type10 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( multfun_type a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(multfun_type a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( strfun_type1 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(strfun_type1 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( strfun_type2 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(strfun_type2 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback ( strfun_type3 a_pFun, bool a_bAllowOpti )
|
||||
: d (new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(strfun_type3 a_pFun, bool a_bAllowOpti)
|
||||
: d(new QmuParserCallbackData(a_pFun, a_bAllowOpti))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
|
@ -185,22 +212,24 @@ QmuParserCallback::QmuParserCallback ( strfun_type3 a_pFun, bool a_bAllowOpti )
|
|||
* @throw nothrow
|
||||
*/
|
||||
QmuParserCallback::QmuParserCallback()
|
||||
: d (new QmuParserCallbackData)
|
||||
{}
|
||||
: d(new QmuParserCallbackData)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief Copy constructor.
|
||||
* @throw nothrow
|
||||
*/
|
||||
QmuParserCallback::QmuParserCallback (const QmuParserCallback &a_Fun )
|
||||
: d (a_Fun.d)
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(const QmuParserCallback &a_Fun)
|
||||
: d(a_Fun.d)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto QmuParserCallback::operator=(const QmuParserCallback &a_Fun) -> QmuParserCallback &
|
||||
{
|
||||
if ( &a_Fun == this )
|
||||
if (&a_Fun == this)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
@ -210,12 +239,13 @@ auto QmuParserCallback::operator=(const QmuParserCallback &a_Fun) -> QmuParserCa
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallback::QmuParserCallback(QmuParserCallback &&a_Fun) Q_DECL_NOTHROW
|
||||
: d (std::move(a_Fun.d))
|
||||
{}
|
||||
QmuParserCallback::QmuParserCallback(QmuParserCallback &&a_Fun) noexcept
|
||||
: d(std::move(a_Fun.d))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto QmuParserCallback::operator=(QmuParserCallback &&a_Fun) Q_DECL_NOTHROW->QmuParserCallback &
|
||||
auto QmuParserCallback::operator=(QmuParserCallback &&a_Fun) noexcept -> QmuParserCallback &
|
||||
{
|
||||
std::swap(d, a_Fun.d);
|
||||
return *this;
|
||||
|
@ -252,7 +282,7 @@ auto QmuParserCallback::GetAddr() const -> void *
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief Return the callback code.
|
||||
*/
|
||||
*/
|
||||
auto QmuParserCallback::GetCode() const -> ECmdCode
|
||||
{
|
||||
return d->m_iCode;
|
||||
|
@ -298,266 +328,438 @@ auto QmuParserCallback::GetArgc() const -> int
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
//Supressing specific warnings on gcc/g++ http://www.mr-edd.co.uk/blog/supressing_gcc_warnings
|
||||
// Supressing specific warnings on gcc/g++ http://www.mr-edd.co.uk/blog/supressing_gcc_warnings
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData()
|
||||
: m_pFun ( nullptr ), m_iArgc ( 0 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ), m_iCode ( cmUNKNOWN ),
|
||||
m_iType ( tpVOID ), m_bAllowOpti ( 0 )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData()
|
||||
: m_pFun(nullptr),
|
||||
m_iArgc(0),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmUNKNOWN),
|
||||
m_iType(tpVOID),
|
||||
m_bAllowOpti(0)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type0 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 0 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type0 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(0),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec, ECmdCode a_iCode )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 1 ), m_iPri ( a_iPrec ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( a_iCode ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec, ECmdCode a_iCode)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(1),
|
||||
m_iPri(a_iPrec),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(a_iCode),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type2 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 2 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type2 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(2),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData (fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eOprtAsct)
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 2 ), m_iPri ( a_iPrec ), m_eOprtAsct ( a_eOprtAsct ),
|
||||
m_iCode ( cmOPRT_BIN ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec,
|
||||
EOprtAssociativity a_eOprtAsct)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(2),
|
||||
m_iPri(a_iPrec),
|
||||
m_eOprtAsct(a_eOprtAsct),
|
||||
m_iCode(cmOPRT_BIN),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type3 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 3 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type3 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(3),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type4 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 4 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type4 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(4),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type5 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 5 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type5 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(5),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type6 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 6 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type6 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(6),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type7 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 7 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type7 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(7),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type8 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 8 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type8 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(8),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type9 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 9 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type9 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(9),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( fun_type10 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 10 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(fun_type10 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(10),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type0 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 0 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type0 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(0),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type1 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 1 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type1 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(1),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type2 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 2 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type2 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(2),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type3 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 3 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type3 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(3),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type4 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 4 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type4 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(4),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type5 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 5 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type5 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(5),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type6 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 6 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type6 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(6),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type7 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 7 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type7 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(7),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type8 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 8 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type8 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(8),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type9 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 9 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type9 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(9),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( bulkfun_type10 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 10 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_BULK ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(bulkfun_type10 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(10),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_BULK),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( multfun_type a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( -1 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC ), m_iType ( tpDBL ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(multfun_type a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(-1),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC),
|
||||
m_iType(tpDBL),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( strfun_type1 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 0 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_STR ), m_iType ( tpSTR ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(strfun_type1 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(0),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_STR),
|
||||
m_iType(tpSTR),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( strfun_type2 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 1 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_STR ), m_iType ( tpSTR ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(strfun_type2 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(1),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_STR),
|
||||
m_iType(tpSTR),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
QmuParserCallbackData::QmuParserCallbackData ( strfun_type3 a_pFun, bool a_bAllowOpti )
|
||||
: m_pFun ( reinterpret_cast<void*> ( a_pFun ) ), m_iArgc ( 2 ), m_iPri ( -1 ), m_eOprtAsct ( oaNONE ),
|
||||
m_iCode ( cmFUNC_STR ), m_iType ( tpSTR ), m_bAllowOpti ( a_bAllowOpti )
|
||||
{}
|
||||
QmuParserCallbackData::QmuParserCallbackData(strfun_type3 a_pFun, bool a_bAllowOpti)
|
||||
: m_pFun(reinterpret_cast<void *>(a_pFun)),
|
||||
m_iArgc(2),
|
||||
m_iPri(-1),
|
||||
m_eOprtAsct(oaNONE),
|
||||
m_iCode(cmFUNC_STR),
|
||||
m_iType(tpSTR),
|
||||
m_bAllowOpti(a_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallbackData::QmuParserCallbackData(const QmuParserCallbackData &a_Fun)
|
||||
: QSharedData(a_Fun), m_pFun(a_Fun.m_pFun), m_iArgc(a_Fun.m_iArgc), m_iPri(a_Fun.m_iPri),
|
||||
m_eOprtAsct(a_Fun.m_eOprtAsct), m_iCode(a_Fun.m_iCode), m_iType(a_Fun.m_iType), m_bAllowOpti(a_Fun.m_bAllowOpti)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QmuParserCallbackData::~QmuParserCallbackData()
|
||||
{}
|
||||
: QSharedData(a_Fun),
|
||||
m_pFun(a_Fun.m_pFun),
|
||||
m_iArgc(a_Fun.m_iArgc),
|
||||
m_iPri(a_Fun.m_iPri),
|
||||
m_eOprtAsct(a_Fun.m_eOprtAsct),
|
||||
m_iCode(a_Fun.m_iCode),
|
||||
m_iType(a_Fun.m_iType),
|
||||
m_bAllowOpti(a_Fun.m_bAllowOpti)
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace qmu
|
||||
|
|
|
@ -22,15 +22,14 @@
|
|||
#ifndef QMUPARSERCALLBACK_H
|
||||
#define QMUPARSERCALLBACK_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QString>
|
||||
#include <map>
|
||||
#include <QTypeInfo>
|
||||
#include <QSharedDataPointer>
|
||||
#include <QString>
|
||||
#include <QTypeInfo>
|
||||
#include <map>
|
||||
|
||||
#include "qmuparser_global.h"
|
||||
#include "qmuparserdef.h"
|
||||
#include "qmuparsercallback_p.h"
|
||||
#include "qmuparserdef.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
@ -53,29 +52,29 @@ namespace qmu
|
|||
class QMUPARSERSHARED_EXPORT QmuParserCallback
|
||||
{
|
||||
public:
|
||||
QmuParserCallback(fun_type0 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode=cmFUNC);
|
||||
QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eOprtAsct);
|
||||
QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type3 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type4 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type5 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type6 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type7 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type8 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type9 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type0 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode = cmFUNC);
|
||||
QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eOprtAsct);
|
||||
QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type3 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type4 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type5 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type6 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type7 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type8 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type9 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(fun_type10 a_pFun, bool a_bAllowOpti);
|
||||
|
||||
QmuParserCallback(bulkfun_type0 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type1 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type2 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type3 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type4 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type5 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type6 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type7 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type8 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type9 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type0 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type1 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type2 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type3 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type4 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type5 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type6 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type7 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type8 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type9 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallback(bulkfun_type10 a_pFun, bool a_bAllowOpti);
|
||||
|
||||
QmuParserCallback(multfun_type a_pFun, bool a_bAllowOpti);
|
||||
|
@ -87,8 +86,8 @@ public:
|
|||
auto operator=(const QmuParserCallback &a_Fun) -> QmuParserCallback &;
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QmuParserCallback(QmuParserCallback &&a_Fun) Q_DECL_NOTHROW;
|
||||
auto operator=(QmuParserCallback &&a_Fun) Q_DECL_NOTHROW->QmuParserCallback &;
|
||||
QmuParserCallback(QmuParserCallback &&a_Fun) noexcept;
|
||||
auto operator=(QmuParserCallback &&a_Fun) noexcept -> QmuParserCallback &;
|
||||
#endif
|
||||
|
||||
Q_REQUIRED_RESULT auto Clone() const -> QmuParserCallback *;
|
||||
|
@ -117,7 +116,7 @@ typedef std::map<QString, QmuParserCallback> funmap_type;
|
|||
*/
|
||||
inline auto QmuParserCallback::Clone() const -> QmuParserCallback *
|
||||
{
|
||||
return new QmuParserCallback ( *this );
|
||||
return new QmuParserCallback(*this);
|
||||
}
|
||||
|
||||
} // namespace qmu
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
#ifndef QMUPARSERCALLBACK_P_H
|
||||
#define QMUPARSERCALLBACK_P_H
|
||||
|
||||
#include <QSharedData>
|
||||
#include "qmuparserdef.h"
|
||||
#include <QSharedData>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
@ -43,29 +43,29 @@ class QmuParserCallbackData : public QSharedData
|
|||
{
|
||||
public:
|
||||
QmuParserCallbackData();
|
||||
QmuParserCallbackData(fun_type0 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode=cmFUNC);
|
||||
QmuParserCallbackData(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eOprtAsct);
|
||||
QmuParserCallbackData(fun_type2 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type3 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type4 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type5 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type6 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type7 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type8 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type9 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type0 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode = cmFUNC);
|
||||
QmuParserCallbackData(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eOprtAsct);
|
||||
QmuParserCallbackData(fun_type2 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type3 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type4 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type5 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type6 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type7 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type8 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type9 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(fun_type10 a_pFun, bool a_bAllowOpti);
|
||||
|
||||
QmuParserCallbackData(bulkfun_type0 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type1 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type2 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type3 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type4 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type5 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type6 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type7 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type8 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type9 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type0 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type1 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type2 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type3 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type4 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type5 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type6 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type7 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type8 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type9 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(bulkfun_type10 a_pFun, bool a_bAllowOpti);
|
||||
|
||||
QmuParserCallbackData(multfun_type a_pFun, bool a_bAllowOpti);
|
||||
|
@ -73,9 +73,9 @@ public:
|
|||
QmuParserCallbackData(strfun_type2 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(strfun_type3 a_pFun, bool a_bAllowOpti);
|
||||
QmuParserCallbackData(const QmuParserCallbackData &a_Fun);
|
||||
virtual ~QmuParserCallbackData();
|
||||
~QmuParserCallbackData() = default;
|
||||
|
||||
void *m_pFun; ///< Pointer to the callback function, casted to void
|
||||
void *m_pFun; ///< Pointer to the callback function, casted to void
|
||||
|
||||
/**
|
||||
* @brief Number of numeric function arguments
|
||||
|
@ -83,12 +83,12 @@ public:
|
|||
* This number is negative for functions with variable number of arguments. in this cases
|
||||
* they represent the actual number of arguments found.
|
||||
*/
|
||||
int m_iArgc;
|
||||
int m_iPri; ///< Valid only for binary and infix operators; Operator precedence.
|
||||
int m_iArgc;
|
||||
int m_iPri; ///< Valid only for binary and infix operators; Operator precedence.
|
||||
EOprtAssociativity m_eOprtAsct; ///< Operator associativity; Valid only for binary operators
|
||||
ECmdCode m_iCode;
|
||||
ECmdCode m_iCode;
|
||||
ETypeCode m_iType;
|
||||
bool m_bAllowOpti; ///< Flag indication optimizeability
|
||||
bool m_bAllowOpti; ///< Flag indication optimizeability
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(QmuParserCallbackData) // NOLINT
|
||||
|
@ -96,5 +96,5 @@ private:
|
|||
|
||||
QT_WARNING_POP
|
||||
|
||||
}
|
||||
} // namespace qmu
|
||||
#endif // QMUPARSERCALLBACK_P_H
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#ifndef QMUPARSERERROR_H
|
||||
#define QMUPARSERERROR_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QException>
|
||||
#include <QMap>
|
||||
|
@ -48,58 +47,58 @@ namespace qmu
|
|||
enum EErrorCodes
|
||||
{
|
||||
// Formula syntax errors
|
||||
ecUNEXPECTED_OPERATOR = 0, ///< Unexpected binary operator found
|
||||
ecUNASSIGNABLE_TOKEN = 1, ///< Token cant be identified.
|
||||
ecUNEXPECTED_EOF = 2, ///< Unexpected end of formula. (Example: "2+sin(")
|
||||
ecUNEXPECTED_ARG_SEP = 3, ///< An unexpected semicolon has been found. (Example: "1;23")
|
||||
ecUNEXPECTED_ARG = 4, ///< An unexpected argument has been found
|
||||
ecUNEXPECTED_VAL = 5, ///< An unexpected value token has been found
|
||||
ecUNEXPECTED_VAR = 6, ///< An unexpected variable token has been found
|
||||
ecUNEXPECTED_PARENS = 7, ///< Unexpected Parenthesis, opening or closing
|
||||
ecUNEXPECTED_STR = 8, ///< A string has been found at an inapropriate position
|
||||
ecSTRING_EXPECTED = 9, ///< A string function has been called with a different type of argument
|
||||
ecVAL_EXPECTED = 10, ///< A numerical function has been called with a non value type of argument
|
||||
ecMISSING_PARENS = 11, ///< Missing parens. (Example: "3*sin(3")
|
||||
ecUNEXPECTED_FUN = 12, ///< Unexpected function found. (Example: "sin(8)cos(9)")
|
||||
ecUNTERMINATED_STRING = 13, ///< unterminated string constant. (Example: "3*valueof("hello)")
|
||||
ecTOO_MANY_PARAMS = 14, ///< Too many function parameters
|
||||
ecTOO_FEW_PARAMS = 15, ///< Too few function parameters. (Example: "ite(1<2;2)")
|
||||
ecOPRT_TYPE_CONFLICT = 16, ///< binary operators may only be applied to value items of the same type
|
||||
ecSTR_RESULT = 17, ///< result is a string
|
||||
ecUNEXPECTED_OPERATOR = 0, ///< Unexpected binary operator found
|
||||
ecUNASSIGNABLE_TOKEN = 1, ///< Token cant be identified.
|
||||
ecUNEXPECTED_EOF = 2, ///< Unexpected end of formula. (Example: "2+sin(")
|
||||
ecUNEXPECTED_ARG_SEP = 3, ///< An unexpected semicolon has been found. (Example: "1;23")
|
||||
ecUNEXPECTED_ARG = 4, ///< An unexpected argument has been found
|
||||
ecUNEXPECTED_VAL = 5, ///< An unexpected value token has been found
|
||||
ecUNEXPECTED_VAR = 6, ///< An unexpected variable token has been found
|
||||
ecUNEXPECTED_PARENS = 7, ///< Unexpected Parenthesis, opening or closing
|
||||
ecUNEXPECTED_STR = 8, ///< A string has been found at an inapropriate position
|
||||
ecSTRING_EXPECTED = 9, ///< A string function has been called with a different type of argument
|
||||
ecVAL_EXPECTED = 10, ///< A numerical function has been called with a non value type of argument
|
||||
ecMISSING_PARENS = 11, ///< Missing parens. (Example: "3*sin(3")
|
||||
ecUNEXPECTED_FUN = 12, ///< Unexpected function found. (Example: "sin(8)cos(9)")
|
||||
ecUNTERMINATED_STRING = 13, ///< unterminated string constant. (Example: "3*valueof("hello)")
|
||||
ecTOO_MANY_PARAMS = 14, ///< Too many function parameters
|
||||
ecTOO_FEW_PARAMS = 15, ///< Too few function parameters. (Example: "ite(1<2;2)")
|
||||
ecOPRT_TYPE_CONFLICT = 16, ///< binary operators may only be applied to value items of the same type
|
||||
ecSTR_RESULT = 17, ///< result is a string
|
||||
|
||||
// Invalid Parser input Parameters
|
||||
ecINVALID_NAME = 18, ///< Invalid function, variable or constant name.
|
||||
ecINVALID_BINOP_IDENT = 19, ///< Invalid binary operator identifier
|
||||
ecINVALID_INFIX_IDENT = 20, ///< Invalid function, variable or constant name.
|
||||
ecINVALID_POSTFIX_IDENT = 21, ///< Invalid function, variable or constant name.
|
||||
ecINVALID_NAME = 18, ///< Invalid function, variable or constant name.
|
||||
ecINVALID_BINOP_IDENT = 19, ///< Invalid binary operator identifier
|
||||
ecINVALID_INFIX_IDENT = 20, ///< Invalid function, variable or constant name.
|
||||
ecINVALID_POSTFIX_IDENT = 21, ///< Invalid function, variable or constant name.
|
||||
|
||||
ecBUILTIN_OVERLOAD = 22, ///< Trying to overload builtin operator
|
||||
ecINVALID_FUN_PTR = 23, ///< Invalid callback function pointer
|
||||
ecINVALID_VAR_PTR = 24, ///< Invalid variable pointer
|
||||
ecEMPTY_EXPRESSION = 25, ///< The Expression is empty
|
||||
ecNAME_CONFLICT = 26, ///< Name conflict
|
||||
ecOPT_PRI = 27, ///< Invalid operator priority
|
||||
//
|
||||
ecDOMAIN_ERROR = 28, ///< catch division by zero, sqrt(-1), log(0) (currently unused)
|
||||
ecDIV_BY_ZERO = 29, ///< Division by zero (currently unused)
|
||||
ecGENERIC = 30, ///< Generic error
|
||||
ecLOCALE = 31, ///< Conflict with current locale
|
||||
ecBUILTIN_OVERLOAD = 22, ///< Trying to overload builtin operator
|
||||
ecINVALID_FUN_PTR = 23, ///< Invalid callback function pointer
|
||||
ecINVALID_VAR_PTR = 24, ///< Invalid variable pointer
|
||||
ecEMPTY_EXPRESSION = 25, ///< The Expression is empty
|
||||
ecNAME_CONFLICT = 26, ///< Name conflict
|
||||
ecOPT_PRI = 27, ///< Invalid operator priority
|
||||
//
|
||||
ecDOMAIN_ERROR = 28, ///< catch division by zero, sqrt(-1), log(0) (currently unused)
|
||||
ecDIV_BY_ZERO = 29, ///< Division by zero (currently unused)
|
||||
ecGENERIC = 30, ///< Generic error
|
||||
ecLOCALE = 31, ///< Conflict with current locale
|
||||
|
||||
ecUNEXPECTED_CONDITIONAL = 32,
|
||||
ecMISSING_ELSE_CLAUSE = 33,
|
||||
ecMISPLACED_COLON = 34,
|
||||
ecMISSING_ELSE_CLAUSE = 33,
|
||||
ecMISPLACED_COLON = 34,
|
||||
|
||||
// internal errors
|
||||
ecINTERNAL_ERROR = 35, ///< Internal error of any kind.
|
||||
ecINTERNAL_ERROR = 35, ///< Internal error of any kind.
|
||||
|
||||
// The last two are special entries
|
||||
ecCOUNT, ///< This is no error code, It just stores just the total number of error codes
|
||||
ecUNDEFINED = -1 ///< Undefined message, placeholder to detect unassigned error messages
|
||||
ecCOUNT, ///< This is no error code, It just stores just the total number of error codes
|
||||
ecUNDEFINED = -1 ///< Undefined message, placeholder to detect unassigned error messages
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/** @brief A class that handles the error messages.
|
||||
*/
|
||||
*/
|
||||
class QMUPARSERSHARED_EXPORT QmuParserErrorMsg
|
||||
{
|
||||
public:
|
||||
|
@ -114,8 +113,8 @@ public:
|
|||
private:
|
||||
// cppcheck-suppress unknownMacro
|
||||
Q_DISABLE_COPY_MOVE(QmuParserErrorMsg) // NOLINT
|
||||
QMap<int, QmuTranslation> m_vErrMsg; ///< A map with the predefined error messages
|
||||
static const self_type m_Instance; ///< The instance pointer
|
||||
QMap<int, QmuTranslation> m_vErrMsg; ///< A map with the predefined error messages
|
||||
static const self_type m_Instance; ///< The instance pointer
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -134,19 +133,19 @@ inline auto QmuParserErrorMsg::operator[](int a_iIdx) const -> QString
|
|||
class QMUPARSERSHARED_EXPORT QmuParserWarning : public QException
|
||||
{
|
||||
public:
|
||||
explicit QmuParserWarning ( const QString &sMsg );
|
||||
QmuParserWarning ( const QmuParserWarning &a_Obj );
|
||||
explicit QmuParserWarning(const QString &sMsg);
|
||||
QmuParserWarning(const QmuParserWarning &a_Obj);
|
||||
auto operator=(const QmuParserWarning &a_Obj) -> QmuParserWarning &;
|
||||
// cppcheck-suppress unknownMacro
|
||||
virtual ~QmuParserWarning() QMUP_NOEXCEPT_EXPR (true) override {}
|
||||
virtual ~QmuParserWarning() QMUP_NOEXCEPT_EXPR(true) override {}
|
||||
|
||||
auto GetMsg() const -> const QString &;
|
||||
|
||||
Q_NORETURN virtual void raise() const override;
|
||||
Q_NORETURN virtual void raise() const override;
|
||||
Q_REQUIRED_RESULT virtual auto clone() const -> QmuParserWarning * override;
|
||||
|
||||
private:
|
||||
QString m_sMsg; ///< The message string
|
||||
QString m_sMsg; ///< The message string
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -168,29 +167,30 @@ class QMUPARSERSHARED_EXPORT QmuParserError : public QException
|
|||
{
|
||||
public:
|
||||
QmuParserError();
|
||||
explicit QmuParserError ( EErrorCodes a_iErrc );
|
||||
explicit QmuParserError ( const QString &sMsg );
|
||||
QmuParserError ( EErrorCodes a_iErrc, const QString &sTok, const QString &sFormula = QString(), qmusizetype a_iPos = -1 );
|
||||
QmuParserError ( EErrorCodes a_iErrc, int a_iPos, const QString &sTok );
|
||||
QmuParserError ( const QString &szMsg, int iPos, const QString &sTok = QString() );
|
||||
QmuParserError ( const QmuParserError &a_Obj );
|
||||
explicit QmuParserError(EErrorCodes a_iErrc);
|
||||
explicit QmuParserError(const QString &sMsg);
|
||||
QmuParserError(EErrorCodes a_iErrc, const QString &sTok, const QString &sFormula = QString(),
|
||||
qmusizetype a_iPos = -1);
|
||||
QmuParserError(EErrorCodes a_iErrc, int a_iPos, const QString &sTok);
|
||||
QmuParserError(const QString &szMsg, int iPos, const QString &sTok = QString());
|
||||
QmuParserError(const QmuParserError &a_Obj);
|
||||
auto operator=(const QmuParserError &a_Obj) -> QmuParserError &;
|
||||
virtual ~QmuParserError() QMUP_NOEXCEPT_EXPR (true) override {}
|
||||
virtual ~QmuParserError() QMUP_NOEXCEPT_EXPR(true) override {}
|
||||
|
||||
void SetFormula ( const QString &a_strFormula );
|
||||
void SetFormula(const QString &a_strFormula);
|
||||
auto GetExpr() const -> const QString &;
|
||||
auto GetMsg() const -> const QString &;
|
||||
auto GetPos() const -> qmusizetype;
|
||||
auto GetToken() const -> const QString &;
|
||||
auto GetCode() const -> EErrorCodes;
|
||||
Q_NORETURN virtual void raise() const override;
|
||||
Q_NORETURN virtual void raise() const override;
|
||||
Q_REQUIRED_RESULT virtual auto clone() const -> QmuParserError * override;
|
||||
|
||||
private:
|
||||
QString m_sMsg; ///< The message string
|
||||
QString m_sExpr; ///< Formula string
|
||||
QString m_sTok; ///< Token related with the error
|
||||
qmusizetype m_iPos; ///< Formula position related to the error
|
||||
qmusizetype m_iPos; ///< Formula position related to the error
|
||||
EErrorCodes m_iErrc; ///< Error code
|
||||
const QmuParserErrorMsg &m_ErrMsg;
|
||||
void Reset();
|
||||
|
@ -200,7 +200,7 @@ private:
|
|||
/**
|
||||
* @brief Set the expression related to this error.
|
||||
*/
|
||||
inline void QmuParserError::SetFormula ( const QString &a_strFormula )
|
||||
inline void QmuParserError::SetFormula(const QString &a_strFormula)
|
||||
{
|
||||
m_sExpr = a_strFormula;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#ifndef QMUPARSERTOKENREADER_H
|
||||
#define QMUPARSERTOKENREADER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QChar>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
@ -52,25 +51,26 @@ class QmuParserTokenReader
|
|||
{
|
||||
private:
|
||||
using token_type = QmuParserToken<qreal, QString>;
|
||||
|
||||
public:
|
||||
explicit QmuParserTokenReader(QmuParserBase *a_pParent);
|
||||
~QmuParserTokenReader()=default;
|
||||
~QmuParserTokenReader() = default;
|
||||
|
||||
auto Clone(QmuParserBase *a_pParent) const -> QmuParserTokenReader*;
|
||||
auto Clone(QmuParserBase *a_pParent) const -> QmuParserTokenReader *;
|
||||
|
||||
void AddValIdent(identfun_type a_pCallback);
|
||||
void SetVarCreator(facfun_type a_pFactory, void *pUserData);
|
||||
void SetFormula(const QString &a_strFormula);
|
||||
void SetArgSep(char_type cArgSep);
|
||||
auto GetPos() const -> qmusizetype;
|
||||
auto GetExpr() const -> const QString&;
|
||||
auto GetUsedVar() -> varmap_type&;
|
||||
auto GetExpr() const -> const QString &;
|
||||
auto GetUsedVar() -> varmap_type &;
|
||||
auto GetArgSep() const -> QChar;
|
||||
void IgnoreUndefVar(bool bIgnore);
|
||||
void ReInit();
|
||||
auto ReadNextToken(const QLocale &locale, bool cNumbers, const QChar &decimal, const QChar &thousand) -> token_type;
|
||||
private:
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Syntax codes.
|
||||
*
|
||||
|
@ -80,29 +80,30 @@ private:
|
|||
*/
|
||||
enum ESynCodes
|
||||
{
|
||||
noBO = 1 << 0, ///< to avoid i.e. "cos(7)(" NOLINT(hicpp-signed-bitwise)
|
||||
noBC = 1 << 1, ///< to avoid i.e. "sin)" or "()" NOLINT(hicpp-signed-bitwise)
|
||||
noVAL = 1 << 2, ///< to avoid i.e. "tan 2" or "sin(8)3.14" NOLINT(hicpp-signed-bitwise)
|
||||
noVAR = 1 << 3, ///< to avoid i.e. "sin a" or "sin(8)a" NOLINT(hicpp-signed-bitwise)
|
||||
noARG_SEP = 1 << 4, ///< to avoid i.e. ",," or "+," ... NOLINT(hicpp-signed-bitwise)
|
||||
noFUN = 1 << 5, ///< to avoid i.e. "sqrt cos" or "(1)sin" NOLINT(hicpp-signed-bitwise)
|
||||
noOPT = 1 << 6, ///< to avoid i.e. "(+)" NOLINT(hicpp-signed-bitwise)
|
||||
noPOSTOP = 1 << 7, ///< to avoid i.e. "(5!!)" "sin!" NOLINT(hicpp-signed-bitwise)
|
||||
noINFIXOP = 1 << 8, ///< to avoid i.e. "++4" "!!4" NOLINT(hicpp-signed-bitwise)
|
||||
noEND = 1 << 9, ///< to avoid unexpected end of formula NOLINT(hicpp-signed-bitwise)
|
||||
noSTR = 1 << 10, ///< to block numeric arguments on string functions NOLINT(hicpp-signed-bitwise)
|
||||
noASSIGN = 1 << 11, ///< to block assignement to constant i.e. "4=7" NOLINT(hicpp-signed-bitwise)
|
||||
noIF = 1 << 12, // NOLINT(hicpp-signed-bitwise)
|
||||
noELSE = 1 << 13, // NOLINT(hicpp-signed-bitwise)
|
||||
sfSTART_OF_LINE = noOPT | noBC | noPOSTOP | noASSIGN | noIF | noELSE | noARG_SEP, // NOLINT(hicpp-signed-bitwise)
|
||||
noANY = ~0 ///< All of he above flags set NOLINT(hicpp-signed-bitwise)
|
||||
noBO = 1 << 0, ///< to avoid i.e. "cos(7)(" NOLINT(hicpp-signed-bitwise)
|
||||
noBC = 1 << 1, ///< to avoid i.e. "sin)" or "()" NOLINT(hicpp-signed-bitwise)
|
||||
noVAL = 1 << 2, ///< to avoid i.e. "tan 2" or "sin(8)3.14" NOLINT(hicpp-signed-bitwise)
|
||||
noVAR = 1 << 3, ///< to avoid i.e. "sin a" or "sin(8)a" NOLINT(hicpp-signed-bitwise)
|
||||
noARG_SEP = 1 << 4, ///< to avoid i.e. ",," or "+," ... NOLINT(hicpp-signed-bitwise)
|
||||
noFUN = 1 << 5, ///< to avoid i.e. "sqrt cos" or "(1)sin" NOLINT(hicpp-signed-bitwise)
|
||||
noOPT = 1 << 6, ///< to avoid i.e. "(+)" NOLINT(hicpp-signed-bitwise)
|
||||
noPOSTOP = 1 << 7, ///< to avoid i.e. "(5!!)" "sin!" NOLINT(hicpp-signed-bitwise)
|
||||
noINFIXOP = 1 << 8, ///< to avoid i.e. "++4" "!!4" NOLINT(hicpp-signed-bitwise)
|
||||
noEND = 1 << 9, ///< to avoid unexpected end of formula NOLINT(hicpp-signed-bitwise)
|
||||
noSTR = 1 << 10, ///< to block numeric arguments on string functions NOLINT(hicpp-signed-bitwise)
|
||||
noASSIGN = 1 << 11, ///< to block assignement to constant i.e. "4=7" NOLINT(hicpp-signed-bitwise)
|
||||
noIF = 1 << 12, // NOLINT(hicpp-signed-bitwise)
|
||||
noELSE = 1 << 13, // NOLINT(hicpp-signed-bitwise)
|
||||
sfSTART_OF_LINE =
|
||||
noOPT | noBC | noPOSTOP | noASSIGN | noIF | noELSE | noARG_SEP, // NOLINT(hicpp-signed-bitwise)
|
||||
noANY = ~0 ///< All of he above flags set NOLINT(hicpp-signed-bitwise)
|
||||
};
|
||||
|
||||
QmuParserBase *m_pParser;
|
||||
QString m_strFormula{};
|
||||
qmusizetype m_iPos{0};
|
||||
int m_iSynFlags{0};
|
||||
bool m_bIgnoreUndefVar{false};
|
||||
QmuParserBase *m_pParser;
|
||||
QString m_strFormula{};
|
||||
qmusizetype m_iPos{0};
|
||||
int m_iSynFlags{0};
|
||||
bool m_bIgnoreUndefVar{false};
|
||||
|
||||
const funmap_type *m_pFunDef{nullptr};
|
||||
const funmap_type *m_pPostOprtDef{nullptr};
|
||||
|
@ -110,18 +111,18 @@ private:
|
|||
const funmap_type *m_pOprtDef{nullptr};
|
||||
const valmap_type *m_pConstDef{nullptr};
|
||||
const strmap_type *m_pStrVarDef{nullptr};
|
||||
varmap_type *m_pVarDef{nullptr}; ///< The only non const pointer to parser internals
|
||||
facfun_type m_pFactory{nullptr};
|
||||
void *m_pFactoryData{nullptr};
|
||||
varmap_type *m_pVarDef{nullptr}; ///< The only non const pointer to parser internals
|
||||
facfun_type m_pFactory{nullptr};
|
||||
void *m_pFactoryData{nullptr};
|
||||
std::list<identfun_type> m_vIdentFun{}; ///< Value token identification function
|
||||
varmap_type m_UsedVar{};
|
||||
qreal m_fZero{0}; ///< Dummy value of zero, referenced by undefined variables
|
||||
int m_iBrackets{0}; ///< Keep count open brackets
|
||||
token_type m_lastTok{};
|
||||
QChar m_cArgSep{';'}; ///< The character used for separating function arguments
|
||||
varmap_type m_UsedVar{};
|
||||
qreal m_fZero{0}; ///< Dummy value of zero, referenced by undefined variables
|
||||
int m_iBrackets{0}; ///< Keep count open brackets
|
||||
token_type m_lastTok{};
|
||||
QChar m_cArgSep{';'}; ///< The character used for separating function arguments
|
||||
|
||||
QmuParserTokenReader(const QmuParserTokenReader &a_Reader);
|
||||
auto operator=(const QmuParserTokenReader &a_Reader) -> QmuParserTokenReader&;
|
||||
auto operator=(const QmuParserTokenReader &a_Reader) -> QmuParserTokenReader &;
|
||||
|
||||
void Assign(const QmuParserTokenReader &a_Reader);
|
||||
|
||||
|
@ -136,15 +137,15 @@ private:
|
|||
auto IsFunTok(token_type &a_Tok) -> bool;
|
||||
auto IsPostOpTok(token_type &a_Tok) -> bool;
|
||||
auto IsOprt(token_type &a_Tok) -> bool;
|
||||
auto IsValTok(token_type &a_Tok, const QLocale &locale, bool cNumbers, const QChar &decimal,
|
||||
const QChar &thousand) -> bool;
|
||||
auto IsValTok(token_type &a_Tok, const QLocale &locale, bool cNumbers, const QChar &decimal, const QChar &thousand)
|
||||
-> bool;
|
||||
auto IsVarTok(token_type &a_Tok) -> bool;
|
||||
auto IsStrVarTok(token_type &a_Tok) -> bool;
|
||||
auto IsUndefVarTok(token_type &a_Tok) -> bool;
|
||||
auto IsString(token_type &a_Tok) -> bool;
|
||||
Q_NORETURN void Error(EErrorCodes a_iErrc, qmusizetype a_iPos = -1, const QString &a_sTok = QString() ) const;
|
||||
Q_NORETURN void Error(EErrorCodes a_iErrc, qmusizetype a_iPos = -1, const QString &a_sTok = QString()) const;
|
||||
|
||||
auto SaveBeforeReturn(const token_type &tok) -> token_type&;
|
||||
auto SaveBeforeReturn(const token_type &tok) -> token_type &;
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -166,7 +167,7 @@ inline auto QmuParserTokenReader::GetPos() const -> qmusizetype
|
|||
* @return #m_strFormula
|
||||
* @throw nothrow
|
||||
*/
|
||||
inline auto QmuParserTokenReader::GetExpr() const -> const QString&
|
||||
inline auto QmuParserTokenReader::GetExpr() const -> const QString &
|
||||
{
|
||||
return m_strFormula;
|
||||
}
|
||||
|
@ -175,7 +176,7 @@ inline auto QmuParserTokenReader::GetExpr() const -> const QString&
|
|||
/**
|
||||
* @brief Return a map containing the used variables only.
|
||||
*/
|
||||
inline auto QmuParserTokenReader::GetUsedVar() -> varmap_type&
|
||||
inline auto QmuParserTokenReader::GetUsedVar() -> varmap_type &
|
||||
{
|
||||
return m_UsedVar;
|
||||
}
|
||||
|
@ -189,13 +190,13 @@ inline auto QmuParserTokenReader::GetUsedVar() -> varmap_type&
|
|||
* Those function should return a complete list of variables including
|
||||
* those the are not defined by the time of it's call.
|
||||
*/
|
||||
inline void QmuParserTokenReader::IgnoreUndefVar ( bool bIgnore )
|
||||
inline void QmuParserTokenReader::IgnoreUndefVar(bool bIgnore)
|
||||
{
|
||||
m_bIgnoreUndefVar = bIgnore;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline void QmuParserTokenReader::SetArgSep ( char_type cArgSep )
|
||||
inline void QmuParserTokenReader::SetArgSep(char_type cArgSep)
|
||||
{
|
||||
m_cArgSep = QChar(cArgSep);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#ifndef QMUTOKENPARSER_H
|
||||
#define QMUTOKENPARSER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include <QSize>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
#include <qcompilerdetection.h>
|
||||
#include <string>
|
||||
|
||||
#include "../vmisc/def.h"
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <QSize>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include "dxfdef.h"
|
||||
#include "libdxfrw/drw_base.h"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VMEASUREMENTS_H
|
||||
#define VMEASUREMENTS_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDomElement>
|
||||
#include <QString>
|
||||
|
|
|
@ -36,40 +36,48 @@
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArc::VAbstractArc(const GOType &type, const quint32 &idObject, const Draw &mode)
|
||||
: VAbstractCurve(type, idObject, mode), d (new VAbstractArcData())
|
||||
{}
|
||||
: VAbstractCurve(type, idObject, mode),
|
||||
d(new VAbstractArcData())
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArc::VAbstractArc(const GOType &type, const VPointF ¢er, qreal f1, const QString &formulaF1, qreal f2,
|
||||
const QString &formulaF2, quint32 idObject, Draw mode)
|
||||
: VAbstractCurve(type, idObject, mode), d (new VAbstractArcData(center, f1, formulaF1, f2, formulaF2))
|
||||
{}
|
||||
: VAbstractCurve(type, idObject, mode),
|
||||
d(new VAbstractArcData(center, f1, formulaF1, f2, formulaF2))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArc::VAbstractArc(const GOType &type, const VPointF ¢er, qreal f1, qreal f2, quint32 idObject, Draw mode)
|
||||
: VAbstractCurve(type, idObject, mode), d (new VAbstractArcData(center, f1, f2))
|
||||
{}
|
||||
: VAbstractCurve(type, idObject, mode),
|
||||
d(new VAbstractArcData(center, f1, f2))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArc::VAbstractArc(const GOType &type, const QString &formulaLength, const VPointF ¢er,
|
||||
qreal f1, const QString &formulaF1, quint32 idObject, Draw mode)
|
||||
: VAbstractCurve(type, idObject, mode), d (new VAbstractArcData(formulaLength, center, f1, formulaF1))
|
||||
{}
|
||||
VAbstractArc::VAbstractArc(const GOType &type, const QString &formulaLength, const VPointF ¢er, qreal f1,
|
||||
const QString &formulaF1, quint32 idObject, Draw mode)
|
||||
: VAbstractCurve(type, idObject, mode),
|
||||
d(new VAbstractArcData(formulaLength, center, f1, formulaF1))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArc::VAbstractArc(const GOType &type, const VPointF ¢er, qreal f1, quint32 idObject, Draw mode)
|
||||
: VAbstractCurve(type, idObject, mode), d (new VAbstractArcData(center, f1))
|
||||
{}
|
||||
: VAbstractCurve(type, idObject, mode),
|
||||
d(new VAbstractArcData(center, f1))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArc::VAbstractArc(const VAbstractArc &arc)
|
||||
: VAbstractCurve(arc), d (arc.d)
|
||||
{}
|
||||
VAbstractArc::VAbstractArc(const VAbstractArc &arc) = default;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VAbstractArc::operator=(const VAbstractArc &arc) -> VAbstractArc &
|
||||
{
|
||||
if ( &arc == this )
|
||||
if (&arc == this)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
@ -80,13 +88,14 @@ auto VAbstractArc::operator=(const VAbstractArc &arc) -> VAbstractArc &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArc::VAbstractArc(VAbstractArc &&arc) Q_DECL_NOTHROW
|
||||
: VAbstractCurve(std::move(arc)),
|
||||
d(std::move(arc.d))
|
||||
{}
|
||||
VAbstractArc::VAbstractArc(VAbstractArc &&arc) noexcept
|
||||
: VAbstractCurve(std::move(arc)),
|
||||
d(std::move(arc.d))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VAbstractArc::operator=(VAbstractArc &&arc) Q_DECL_NOTHROW -> VAbstractArc &
|
||||
auto VAbstractArc::operator=(VAbstractArc &&arc) noexcept -> VAbstractArc &
|
||||
{
|
||||
VAbstractCurve::operator=(arc);
|
||||
std::swap(d, arc.d);
|
||||
|
@ -95,8 +104,7 @@ auto VAbstractArc::operator=(VAbstractArc &&arc) Q_DECL_NOTHROW -> VAbstractArc
|
|||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArc::~VAbstractArc() // NOLINT(hicpp-use-equals-default, modernize-use-equals-default)
|
||||
{}
|
||||
VAbstractArc::~VAbstractArc() = default;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VAbstractArc::GetFormulaF1() const -> QString
|
||||
|
@ -171,26 +179,26 @@ void VAbstractArc::setId(const quint32 &id)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VAbstractArc::NameForHistory(const QString &toolName) const -> QString
|
||||
{
|
||||
QString name = toolName + QString(" %1").arg(GetCenter().name());
|
||||
QString name = toolName + QStringLiteral(" %1").arg(GetCenter().name());
|
||||
|
||||
if (VAbstractCurve::id() != NULL_ID)
|
||||
{
|
||||
name += QString("_%1").arg(VAbstractCurve::id());
|
||||
name += QStringLiteral("_%1").arg(VAbstractCurve::id());
|
||||
}
|
||||
|
||||
if (GetDuplicate() > 0)
|
||||
{
|
||||
name += QString("_%1").arg(GetDuplicate());
|
||||
name += QStringLiteral("_%1").arg(GetDuplicate());
|
||||
}
|
||||
|
||||
QString alias;
|
||||
|
||||
if (not GetAliasSuffix().isEmpty())
|
||||
{
|
||||
alias = QString("%1 %2").arg(toolName, GetAliasSuffix());
|
||||
alias = QStringLiteral("%1 %2").arg(toolName, GetAliasSuffix());
|
||||
}
|
||||
|
||||
return not alias.isEmpty() ? QString("%1 (%2)").arg(alias, name) : name;
|
||||
return not alias.isEmpty() ? QStringLiteral("%1 (%2)").arg(alias, name) : name;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VABSTRACTARC_H
|
||||
#define VABSTRACTARC_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QSharedDataPointer>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
@ -58,35 +57,37 @@ public:
|
|||
VAbstractArc(const VAbstractArc &arc);
|
||||
~VAbstractArc() override;
|
||||
|
||||
auto operator= (const VAbstractArc &arc) -> VAbstractArc&;
|
||||
auto operator=(const VAbstractArc &arc) -> VAbstractArc &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VAbstractArc(VAbstractArc &&arc) Q_DECL_NOTHROW;
|
||||
auto operator=(VAbstractArc &&arc) Q_DECL_NOTHROW -> VAbstractArc &;
|
||||
VAbstractArc(VAbstractArc &&arc) noexcept;
|
||||
auto operator=(VAbstractArc &&arc) noexcept -> VAbstractArc &;
|
||||
#endif
|
||||
|
||||
auto GetFormulaF1 () const -> QString;
|
||||
void SetFormulaF1 (const QString &formula, qreal value);
|
||||
auto GetStartAngle () const -> qreal override;
|
||||
auto GetFormulaF1() const -> QString;
|
||||
void SetFormulaF1(const QString &formula, qreal value);
|
||||
auto GetStartAngle() const -> qreal override;
|
||||
|
||||
auto GetFormulaF2 () const -> QString;
|
||||
void SetFormulaF2 (const QString &formula, qreal value);
|
||||
auto GetEndAngle () const -> qreal override;
|
||||
auto GetFormulaF2() const -> QString;
|
||||
void SetFormulaF2(const QString &formula, qreal value);
|
||||
auto GetEndAngle() const -> qreal override;
|
||||
|
||||
auto GetCenter () const -> VPointF;
|
||||
void SetCenter (const VPointF &point);
|
||||
auto GetCenter() const -> VPointF;
|
||||
void SetCenter(const VPointF &point);
|
||||
|
||||
auto GetFormulaLength () const -> QString;
|
||||
void SetFormulaLength (const QString &formula, qreal value);
|
||||
auto GetFormulaLength() const -> QString;
|
||||
void SetFormulaLength(const QString &formula, qreal value);
|
||||
|
||||
void setId(const quint32 &id) override;
|
||||
auto NameForHistory(const QString &toolName) const -> QString override;
|
||||
|
||||
auto IsFlipped() const -> bool;
|
||||
auto AngleArc() const -> qreal;
|
||||
|
||||
protected:
|
||||
void SetFlipped(bool value);
|
||||
virtual void FindF2(qreal length)=0;
|
||||
virtual void FindF2(qreal length) = 0;
|
||||
void SetFormulaLength(const QString &formula);
|
||||
|
||||
private:
|
||||
QSharedDataPointer<VAbstractArcData> d;
|
||||
};
|
||||
|
|
|
@ -42,109 +42,77 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VAbstractArcData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
VAbstractArcData();
|
||||
VAbstractArcData() = default;
|
||||
VAbstractArcData(const VPointF ¢er, qreal f1, const QString &formulaF1, qreal f2, const QString &formulaF2);
|
||||
VAbstractArcData(const QString &formulaLength, const VPointF ¢er, qreal f1, const QString &formulaF1);
|
||||
VAbstractArcData(const VPointF ¢er, qreal f1);
|
||||
VAbstractArcData(const VPointF ¢er, qreal f1, qreal f2);
|
||||
VAbstractArcData(const VAbstractArcData &arc);
|
||||
virtual ~VAbstractArcData();
|
||||
VAbstractArcData(const VAbstractArcData &arc) = default;
|
||||
~VAbstractArcData() = default;
|
||||
|
||||
/** @brief f1 start angle in degree. */
|
||||
qreal f1;
|
||||
qreal f1{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief formulaF1 formula for start angle. */
|
||||
QString formulaF1;
|
||||
QString formulaF1{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief f2 end angle in degree. */
|
||||
qreal f2;
|
||||
qreal f2{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief formulaF2 formula for end angle. */
|
||||
QString formulaF2;
|
||||
QString formulaF2{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief center center point of arc. */
|
||||
VPointF center;
|
||||
VPointF center{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
bool isFlipped;
|
||||
bool isFlipped{false}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
QString formulaLength;
|
||||
QString formulaLength{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VAbstractArcData) // NOLINT
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArcData::VAbstractArcData()
|
||||
: f1(0),
|
||||
formulaF1(),
|
||||
f2(0),
|
||||
formulaF2(),
|
||||
center(),
|
||||
isFlipped(false),
|
||||
formulaLength()
|
||||
{}
|
||||
inline VAbstractArcData::VAbstractArcData(const VPointF ¢er, qreal f1, const QString &formulaF1, qreal f2,
|
||||
const QString &formulaF2)
|
||||
: f1(f1),
|
||||
formulaF1(formulaF1),
|
||||
f2(f2),
|
||||
formulaF2(formulaF2),
|
||||
center(center)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArcData::VAbstractArcData(const VPointF ¢er, qreal f1, const QString &formulaF1, qreal f2,
|
||||
const QString &formulaF2)
|
||||
: f1(f1),
|
||||
formulaF1(formulaF1),
|
||||
f2(f2),
|
||||
formulaF2(formulaF2),
|
||||
center(center),
|
||||
isFlipped(false),
|
||||
formulaLength()
|
||||
{}
|
||||
inline VAbstractArcData::VAbstractArcData(const QString &formulaLength, const VPointF ¢er, qreal f1,
|
||||
const QString &formulaF1)
|
||||
: f1(f1),
|
||||
formulaF1(formulaF1),
|
||||
formulaF2('0'),
|
||||
center(center),
|
||||
formulaLength(formulaLength)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArcData::VAbstractArcData(const QString &formulaLength, const VPointF ¢er, qreal f1,
|
||||
const QString &formulaF1)
|
||||
: f1(f1),
|
||||
formulaF1(formulaF1),
|
||||
f2(0),
|
||||
formulaF2('0'),
|
||||
center(center),
|
||||
isFlipped(false),
|
||||
formulaLength(formulaLength)
|
||||
{}
|
||||
inline VAbstractArcData::VAbstractArcData(const VPointF ¢er, qreal f1)
|
||||
: f1(f1),
|
||||
formulaF1(QString::number(f1)),
|
||||
formulaF2('0'),
|
||||
center(center)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArcData::VAbstractArcData(const VPointF ¢er, qreal f1)
|
||||
: f1(f1),
|
||||
formulaF1(QString().number(f1)),
|
||||
f2(0),
|
||||
formulaF2('0'),
|
||||
center(center),
|
||||
isFlipped(false),
|
||||
formulaLength()
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArcData::VAbstractArcData(const VPointF ¢er, qreal f1, qreal f2)
|
||||
: f1(f1),
|
||||
formulaF1(QString().number(f1)),
|
||||
f2(f2),
|
||||
formulaF2(QString().number(f2)),
|
||||
center(center),
|
||||
isFlipped(false),
|
||||
formulaLength()
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArcData::VAbstractArcData(const VAbstractArcData &arc)
|
||||
: QSharedData(arc),
|
||||
f1(arc.f1),
|
||||
formulaF1(arc.formulaF1),
|
||||
f2(arc.f2),
|
||||
formulaF2(arc.formulaF2),
|
||||
center(arc.center),
|
||||
isFlipped(arc.isFlipped),
|
||||
formulaLength(arc.formulaLength)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractArcData::~VAbstractArcData()
|
||||
{}
|
||||
inline VAbstractArcData::VAbstractArcData(const VPointF ¢er, qreal f1, qreal f2)
|
||||
: f1(f1),
|
||||
formulaF1(QString::number(f1)),
|
||||
f2(f2),
|
||||
formulaF2(QString::number(f2)),
|
||||
center(center)
|
||||
{
|
||||
}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ public:
|
|||
~VAbstractBezier() override =default;
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VAbstractBezier(VAbstractBezier &&curve) Q_DECL_NOTHROW =default;
|
||||
auto operator=(VAbstractBezier &&curve) Q_DECL_NOTHROW -> VAbstractBezier & =default;
|
||||
VAbstractBezier(VAbstractBezier &&curve) noexcept =default;
|
||||
auto operator=(VAbstractBezier &&curve) noexcept -> VAbstractBezier & =default;
|
||||
#endif
|
||||
|
||||
virtual auto GetC1Length() const -> qreal =0;
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VABSTRACTCUBICBEZIER_H
|
||||
#define VABSTRACTCUBICBEZIER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QPointF>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
@ -49,18 +48,18 @@ public:
|
|||
explicit VAbstractCubicBezier(const GOType &type, const quint32 &idObject = NULL_ID,
|
||||
const Draw &mode = Draw::Calculation);
|
||||
VAbstractCubicBezier(const VAbstractCubicBezier &curve) = default;
|
||||
auto operator= (const VAbstractCubicBezier &curve) -> VAbstractCubicBezier&;
|
||||
auto operator=(const VAbstractCubicBezier &curve) -> VAbstractCubicBezier &;
|
||||
~VAbstractCubicBezier() override = default;
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VAbstractCubicBezier(VAbstractCubicBezier &&curve) Q_DECL_NOTHROW =default;
|
||||
auto operator=(VAbstractCubicBezier &&curve) Q_DECL_NOTHROW -> VAbstractCubicBezier & =default;
|
||||
VAbstractCubicBezier(VAbstractCubicBezier &&curve) noexcept = default;
|
||||
auto operator=(VAbstractCubicBezier &&curve) noexcept -> VAbstractCubicBezier & = default;
|
||||
#endif
|
||||
|
||||
virtual auto GetP1 () const -> VPointF =0;
|
||||
virtual auto GetP2 () const -> VPointF =0;
|
||||
virtual auto GetP3 () const -> VPointF =0;
|
||||
virtual auto GetP4 () const -> VPointF =0;
|
||||
virtual auto GetP1() const -> VPointF = 0;
|
||||
virtual auto GetP2() const -> VPointF = 0;
|
||||
virtual auto GetP3() const -> VPointF = 0;
|
||||
virtual auto GetP4() const -> VPointF = 0;
|
||||
|
||||
auto CutSpline(qreal length, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2, QPointF &spl2p3,
|
||||
const QString &pointName) const -> QPointF;
|
||||
|
@ -74,14 +73,14 @@ protected:
|
|||
void CreateName() override;
|
||||
void CreateAlias() override;
|
||||
|
||||
static auto GetCubicBezierPoints(const QPointF &p1, const QPointF &p2, const QPointF &p3,
|
||||
const QPointF &p4, qreal approximationScale) -> QVector<QPointF>;
|
||||
static auto GetCubicBezierPoints(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4,
|
||||
qreal approximationScale) -> QVector<QPointF>;
|
||||
static auto LengthBezier(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4,
|
||||
qreal approximationScale) -> qreal;
|
||||
|
||||
virtual auto GetControlPoint1() const -> QPointF =0;
|
||||
virtual auto GetControlPoint2() const -> QPointF =0;
|
||||
virtual auto GetRealLength() const -> qreal =0;
|
||||
virtual auto GetControlPoint1() const -> QPointF = 0;
|
||||
virtual auto GetControlPoint2() const -> QPointF = 0;
|
||||
virtual auto GetRealLength() const -> qreal = 0;
|
||||
};
|
||||
|
||||
QT_WARNING_POP
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VABSTRACTCUBICBEZIERPATH_H
|
||||
#define VABSTRACTCUBICBEZIERPATH_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QPointF>
|
||||
#include <QString>
|
||||
|
@ -50,18 +49,24 @@ QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
|
|||
class VAbstractCubicBezierPath : public VAbstractBezier
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(VAbstractCubicBezierPath) // NOLINT
|
||||
|
||||
public:
|
||||
explicit VAbstractCubicBezierPath(const GOType &type, const quint32 &idObject = NULL_ID,
|
||||
const Draw &mode = Draw::Calculation);
|
||||
VAbstractCubicBezierPath(const VAbstractCubicBezierPath &curve) = default;
|
||||
auto operator= (const VAbstractCubicBezierPath &curve) -> VAbstractCubicBezierPath&;
|
||||
auto operator=(const VAbstractCubicBezierPath &curve) -> VAbstractCubicBezierPath &;
|
||||
~VAbstractCubicBezierPath() override;
|
||||
|
||||
virtual auto CountSubSpl() const -> vsizetype =0;
|
||||
virtual auto CountPoints() const -> vsizetype =0;
|
||||
virtual void Clear() =0;
|
||||
virtual auto GetSpline(vsizetype index) const -> VSpline =0;
|
||||
virtual auto GetSplinePath() const -> QVector<VSplinePoint> =0;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VAbstractCubicBezierPath(VAbstractCubicBezierPath &&curve) noexcept = default;
|
||||
auto operator=(VAbstractCubicBezierPath &&curve) noexcept -> VAbstractCubicBezierPath & = default;
|
||||
#endif
|
||||
|
||||
virtual auto CountSubSpl() const -> vsizetype = 0;
|
||||
virtual auto CountPoints() const -> vsizetype = 0;
|
||||
virtual void Clear() = 0;
|
||||
virtual auto GetSpline(vsizetype index) const -> VSpline = 0;
|
||||
virtual auto GetSplinePath() const -> QVector<VSplinePoint> = 0;
|
||||
|
||||
auto GetPath() const -> QPainterPath override;
|
||||
auto GetPoints() const -> QVector<QPointF> override;
|
||||
|
@ -80,8 +85,8 @@ protected:
|
|||
void CreateName() override;
|
||||
void CreateAlias() override;
|
||||
|
||||
virtual auto FirstPoint() const -> VPointF =0;
|
||||
virtual auto LastPoint() const -> VPointF =0;
|
||||
virtual auto FirstPoint() const -> VPointF = 0;
|
||||
virtual auto LastPoint() const -> VPointF = 0;
|
||||
};
|
||||
|
||||
QT_WARNING_POP
|
||||
|
|
|
@ -69,12 +69,12 @@ auto VAbstractCurve::operator=(const VAbstractCurve &curve) -> VAbstractCurve &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractCurve::VAbstractCurve(VAbstractCurve &&curve) Q_DECL_NOTHROW
|
||||
VAbstractCurve::VAbstractCurve(VAbstractCurve &&curve) noexcept
|
||||
:VGObject(std::move(curve)), d (std::move(curve.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VAbstractCurve::operator=(VAbstractCurve &&curve) Q_DECL_NOTHROW -> VAbstractCurve &
|
||||
auto VAbstractCurve::operator=(VAbstractCurve &&curve) noexcept -> VAbstractCurve &
|
||||
{
|
||||
VGObject::operator=(curve);
|
||||
std::swap(d, curve.d);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VABSTRACTCURVE_H
|
||||
#define VABSTRACTCURVE_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QPointF>
|
||||
#include <QSharedDataPointer>
|
||||
#include <QString>
|
||||
|
@ -37,9 +36,9 @@
|
|||
#include <QVector>
|
||||
#include <QtGlobal>
|
||||
|
||||
#include "../vmisc/typedef.h"
|
||||
#include "vgeometrydef.h"
|
||||
#include "vgobject.h"
|
||||
#include "../vmisc/typedef.h"
|
||||
|
||||
using DirectionArrow = QPair<QLineF, QLineF>;
|
||||
|
||||
|
@ -50,7 +49,7 @@ QT_WARNING_PUSH
|
|||
QT_WARNING_DISABLE_GCC("-Wsuggest-final-types")
|
||||
QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
|
||||
|
||||
class VAbstractCurve :public VGObject
|
||||
class VAbstractCurve : public VGObject
|
||||
{
|
||||
public:
|
||||
explicit VAbstractCurve(const GOType &type, const quint32 &idObject = NULL_ID,
|
||||
|
@ -58,20 +57,20 @@ public:
|
|||
VAbstractCurve(const VAbstractCurve &curve);
|
||||
~VAbstractCurve() override;
|
||||
|
||||
auto operator= (const VAbstractCurve &curve) -> VAbstractCurve&;
|
||||
auto operator=(const VAbstractCurve &curve) -> VAbstractCurve &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VAbstractCurve(VAbstractCurve &&curve) Q_DECL_NOTHROW;
|
||||
auto operator=(VAbstractCurve &&curve) Q_DECL_NOTHROW -> VAbstractCurve &;
|
||||
VAbstractCurve(VAbstractCurve &&curve) noexcept;
|
||||
auto operator=(VAbstractCurve &&curve) noexcept -> VAbstractCurve &;
|
||||
#endif
|
||||
|
||||
virtual auto GetPoints() const -> QVector<QPointF> =0;
|
||||
static auto GetSegmentPoints(const QVector<QPointF> &points, const QPointF &begin, const QPointF &end,
|
||||
bool reverse, QString &error) -> QVector<QPointF>;
|
||||
virtual auto GetPoints() const -> QVector<QPointF> = 0;
|
||||
static auto GetSegmentPoints(const QVector<QPointF> &points, const QPointF &begin, const QPointF &end, bool reverse,
|
||||
QString &error) -> QVector<QPointF>;
|
||||
auto GetSegmentPoints(const QPointF &begin, const QPointF &end, bool reverse,
|
||||
const QString &piece = QString()) const -> QVector<QPointF>;
|
||||
|
||||
virtual auto GetPath() const -> QPainterPath;
|
||||
virtual auto GetLength() const -> qreal =0;
|
||||
virtual auto GetLength() const -> qreal = 0;
|
||||
auto GetLengthByPoint(const QPointF &point) const -> qreal;
|
||||
virtual auto IntersectLine(const QLineF &line) const -> QVector<QPointF>;
|
||||
virtual auto IsIntersectLine(const QLineF &line) const -> bool;
|
||||
|
@ -79,13 +78,13 @@ public:
|
|||
static auto IsPointOnCurve(const QVector<QPointF> &points, const QPointF &p) -> bool;
|
||||
auto IsPointOnCurve(const QPointF &p) const -> bool;
|
||||
|
||||
static auto SubdividePath(const QVector<QPointF> &points, QPointF p, QVector<QPointF> &sub1,
|
||||
QVector<QPointF> &sub2) -> bool;
|
||||
static auto SubdividePath(const QVector<QPointF> &points, QPointF p, QVector<QPointF> &sub1, QVector<QPointF> &sub2)
|
||||
-> bool;
|
||||
|
||||
auto ClosestPoint(QPointF scenePoint) const -> QPointF;
|
||||
|
||||
virtual auto GetStartAngle () const -> qreal=0;
|
||||
virtual auto GetEndAngle () const -> qreal=0;
|
||||
virtual auto GetStartAngle() const -> qreal = 0;
|
||||
virtual auto GetEndAngle() const -> qreal = 0;
|
||||
|
||||
auto GetDuplicate() const -> quint32;
|
||||
void SetDuplicate(quint32 number);
|
||||
|
@ -105,7 +104,7 @@ public:
|
|||
static auto CurveIntersectAxis(const QPointF &point, qreal angle, const QVector<QPointF> &curvePoints,
|
||||
QPointF *intersectionPoint) -> bool;
|
||||
|
||||
virtual auto NameForHistory(const QString &toolName) const -> QString=0;
|
||||
virtual auto NameForHistory(const QString &toolName) const -> QString = 0;
|
||||
virtual auto DirectionArrows() const -> QVector<DirectionArrow>;
|
||||
static auto ShowDirection(const QVector<DirectionArrow> &arrows, qreal width) -> QPainterPath;
|
||||
|
||||
|
@ -116,8 +115,9 @@ public:
|
|||
static constexpr qreal minLength = MmToPixel(1.);
|
||||
|
||||
protected:
|
||||
virtual void CreateName() =0;
|
||||
virtual void CreateAlias() =0;
|
||||
virtual void CreateName() = 0;
|
||||
virtual void CreateAlias() = 0;
|
||||
|
||||
private:
|
||||
QSharedDataPointer<VAbstractCurveData> d;
|
||||
|
||||
|
|
|
@ -43,39 +43,22 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VAbstractCurveData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
|
||||
VAbstractCurveData ()
|
||||
: duplicate(0),
|
||||
color(ColorBlack),
|
||||
penStyle(TypeLineLine),
|
||||
approximationScale(defCurveApproximationScale)
|
||||
{}
|
||||
|
||||
VAbstractCurveData(const VAbstractCurveData &curve)
|
||||
: QSharedData(curve),
|
||||
duplicate(curve.duplicate),
|
||||
color(curve.color),
|
||||
penStyle(curve.penStyle),
|
||||
approximationScale(curve.approximationScale)
|
||||
{}
|
||||
|
||||
virtual ~VAbstractCurveData();
|
||||
VAbstractCurveData() = default;
|
||||
VAbstractCurveData(const VAbstractCurveData &curve) = default;
|
||||
~VAbstractCurveData() = default;
|
||||
|
||||
/** @brief duplicate helps create unique name for curves that connects the same start and finish points. */
|
||||
quint32 duplicate;
|
||||
quint32 duplicate{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
QString color;
|
||||
QString penStyle;
|
||||
QString color{ColorBlack}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString penStyle{TypeLineLine}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
qreal approximationScale;
|
||||
qreal approximationScale{defCurveApproximationScale}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VAbstractCurveData) // NOLINT
|
||||
};
|
||||
|
||||
VAbstractCurveData::~VAbstractCurveData()
|
||||
{}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
||||
#endif // VABSTRACTCURVE_P_H
|
||||
|
|
|
@ -122,12 +122,12 @@ auto VArc::operator =(const VArc &arc) -> VArc &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArc::VArc(VArc &&arc) Q_DECL_NOTHROW
|
||||
VArc::VArc(VArc &&arc) noexcept
|
||||
: VAbstractArc(std::move(arc)), d (std::move(arc.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VArc::operator=(VArc &&arc) Q_DECL_NOTHROW -> VArc &
|
||||
auto VArc::operator=(VArc &&arc) noexcept -> VArc &
|
||||
{
|
||||
VAbstractArc::operator=(arc);
|
||||
std::swap(d, arc.d);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VARC_H
|
||||
#define VARC_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QPointF>
|
||||
#include <QSharedDataPointer>
|
||||
|
@ -39,7 +38,6 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#include "vabstractarc.h"
|
||||
#include "vgeometrydef.h"
|
||||
#include "vpointf.h"
|
||||
|
||||
class VArcData;
|
||||
|
@ -50,13 +48,14 @@ class VArcData;
|
|||
class VArc final : public VAbstractArc
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(VArc) // NOLINT
|
||||
|
||||
public:
|
||||
VArc();
|
||||
VArc(const VPointF ¢er, qreal radius, const QString &formulaRadius, qreal f1, const QString &formulaF1,
|
||||
qreal f2, const QString &formulaF2, quint32 idObject = 0, Draw mode = Draw::Calculation);
|
||||
VArc(const VPointF ¢er, qreal radius, qreal f1, qreal f2);
|
||||
VArc(qreal length, const QString &formulaLength, const VPointF ¢er, qreal radius, const QString &formulaRadius,
|
||||
qreal f1, const QString &formulaF1, quint32 idObject = 0, Draw mode = Draw::Calculation);
|
||||
qreal f1, const QString &formulaF1, quint32 idObject = 0, Draw mode = Draw::Calculation);
|
||||
VArc(qreal length, const VPointF ¢er, qreal radius, qreal f1);
|
||||
VArc(const VArc &arc);
|
||||
auto Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const -> VArc;
|
||||
|
@ -64,10 +63,10 @@ public:
|
|||
auto Move(qreal length, qreal angle, const QString &prefix = QString()) const -> VArc;
|
||||
~VArc() override;
|
||||
|
||||
auto operator= (const VArc &arc) -> VArc&;
|
||||
auto operator=(const VArc &arc) -> VArc &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VArc(VArc &&arc) Q_DECL_NOTHROW;
|
||||
auto operator=(VArc &&arc) Q_DECL_NOTHROW -> VArc &;
|
||||
VArc(VArc &&arc) noexcept;
|
||||
auto operator=(VArc &&arc) noexcept -> VArc &;
|
||||
#endif
|
||||
|
||||
auto GetFormulaRadius() const -> QString;
|
||||
|
@ -83,10 +82,12 @@ public:
|
|||
|
||||
auto CutArc(qreal length, VArc &arc1, VArc &arc2, const QString &pointName) const -> QPointF;
|
||||
auto CutArc(qreal length, const QString &pointName) const -> QPointF;
|
||||
|
||||
protected:
|
||||
void CreateName() override;
|
||||
void CreateAlias() override;
|
||||
void FindF2(qreal length) override;
|
||||
|
||||
private:
|
||||
QSharedDataPointer<VArcData> d;
|
||||
|
||||
|
|
|
@ -43,50 +43,35 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VArcData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
VArcData();
|
||||
VArcData() = default;
|
||||
VArcData(qreal radius, const QString &formulaRadius);
|
||||
explicit VArcData(qreal radius);
|
||||
VArcData(const VArcData &arc);
|
||||
virtual ~VArcData();
|
||||
VArcData(const VArcData &arc) = default;
|
||||
~VArcData() = default;
|
||||
|
||||
/** @brief radius arc radius. */
|
||||
qreal radius;
|
||||
qreal radius{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief formulaRadius formula for arc radius. */
|
||||
QString formulaRadius;
|
||||
QString formulaRadius{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VArcData) // NOLINT
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArcData::VArcData()
|
||||
: radius(0),
|
||||
formulaRadius(QString())
|
||||
{}
|
||||
inline VArcData::VArcData(qreal radius, const QString &formulaRadius)
|
||||
: radius(radius),
|
||||
formulaRadius(formulaRadius)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArcData::VArcData(qreal radius, const QString &formulaRadius)
|
||||
: radius(radius),
|
||||
formulaRadius(formulaRadius)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArcData::VArcData(qreal radius)
|
||||
: radius(radius),
|
||||
formulaRadius(QString().number(radius))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArcData::VArcData(const VArcData &arc)
|
||||
: QSharedData(arc),
|
||||
radius(arc.radius),
|
||||
formulaRadius(arc.formulaRadius)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArcData::~VArcData()
|
||||
{}
|
||||
inline VArcData::VArcData(qreal radius)
|
||||
: radius(radius),
|
||||
formulaRadius(QString::number(radius))
|
||||
{
|
||||
}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
||||
|
|
|
@ -66,12 +66,12 @@ auto VCubicBezier::operator=(const VCubicBezier &curve) -> VCubicBezier &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VCubicBezier::VCubicBezier(VCubicBezier &&curve) Q_DECL_NOTHROW
|
||||
VCubicBezier::VCubicBezier(VCubicBezier &&curve) noexcept
|
||||
: VAbstractCubicBezier(std::move(curve)), d(std::move(curve.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VCubicBezier::operator=(VCubicBezier &&curve) Q_DECL_NOTHROW->VCubicBezier &
|
||||
auto VCubicBezier::operator=(VCubicBezier &&curve) noexcept->VCubicBezier &
|
||||
{
|
||||
VAbstractCubicBezier::operator=(curve);
|
||||
std::swap(d, curve.d);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VCUBICBEZIER_H
|
||||
#define VCUBICBEZIER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QPointF>
|
||||
#include <QSharedDataPointer>
|
||||
#include <QString>
|
||||
|
@ -38,7 +37,6 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#include "vabstractcubicbezier.h"
|
||||
#include "vgeometrydef.h"
|
||||
#include "vpointf.h"
|
||||
|
||||
class VCubicBezierData;
|
||||
|
@ -57,21 +55,21 @@ public:
|
|||
|
||||
auto operator=(const VCubicBezier &curve) -> VCubicBezier &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VCubicBezier(VCubicBezier &&curve) Q_DECL_NOTHROW;
|
||||
auto operator=(VCubicBezier &&curve) Q_DECL_NOTHROW->VCubicBezier &;
|
||||
VCubicBezier(VCubicBezier &&curve) noexcept;
|
||||
auto operator=(VCubicBezier &&curve) noexcept -> VCubicBezier &;
|
||||
#endif
|
||||
|
||||
virtual auto GetP1() const -> VPointF override;
|
||||
void SetP1(const VPointF &p);
|
||||
void SetP1(const VPointF &p);
|
||||
|
||||
virtual auto GetP2() const -> VPointF override;
|
||||
void SetP2(const VPointF &p);
|
||||
void SetP2(const VPointF &p);
|
||||
|
||||
virtual auto GetP3() const -> VPointF override;
|
||||
void SetP3(const VPointF &p);
|
||||
void SetP3(const VPointF &p);
|
||||
|
||||
virtual auto GetP4() const -> VPointF override;
|
||||
void SetP4(const VPointF &p);
|
||||
void SetP4(const VPointF &p);
|
||||
|
||||
virtual auto GetStartAngle() const -> qreal override;
|
||||
virtual auto GetEndAngle() const -> qreal override;
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
#ifndef VCUBICBEZIER_P_H
|
||||
#define VCUBICBEZIER_P_H
|
||||
|
||||
#include <QSharedData>
|
||||
#include <QLineF>
|
||||
#include <QSharedData>
|
||||
|
||||
#include "vpointf.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
@ -44,57 +44,33 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VCubicBezierData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
VCubicBezierData();
|
||||
VCubicBezierData(const VCubicBezierData &curve);
|
||||
VCubicBezierData() = default;
|
||||
VCubicBezierData(const VCubicBezierData &curve) = default;
|
||||
VCubicBezierData(const VPointF &p1, const VPointF &p2, const VPointF &p3, const VPointF &p4);
|
||||
virtual ~VCubicBezierData();
|
||||
~VCubicBezierData() = default;
|
||||
|
||||
/** @brief p1 first spline point. */
|
||||
VPointF p1;
|
||||
VPointF p1{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief p2 fourth spline point. */
|
||||
VPointF p2;
|
||||
VPointF p2{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief p3 fourth spline point. */
|
||||
VPointF p3;
|
||||
VPointF p3{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief p4 fourth spline point. */
|
||||
VPointF p4;
|
||||
VPointF p4{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VCubicBezierData) // NOLINT
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VCubicBezierData::VCubicBezierData()
|
||||
: p1(),
|
||||
p2(),
|
||||
p3(),
|
||||
p4()
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VCubicBezierData::VCubicBezierData(const VCubicBezierData &curve)
|
||||
: QSharedData(curve),
|
||||
p1(curve.p1),
|
||||
p2(curve.p2),
|
||||
p3(curve.p3),
|
||||
p4(curve.p4)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VCubicBezierData::VCubicBezierData(const VPointF &p1, const VPointF &p2, const VPointF &p3, const VPointF &p4)
|
||||
: p1(p1),
|
||||
p2(p2),
|
||||
p3(p3),
|
||||
p4(p4)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VCubicBezierData::~VCubicBezierData()
|
||||
inline VCubicBezierData::VCubicBezierData(const VPointF &p1, const VPointF &p2, const VPointF &p3, const VPointF &p4)
|
||||
: p1(p1),
|
||||
p2(p2),
|
||||
p3(p3),
|
||||
p4(p4)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -32,31 +32,26 @@
|
|||
#include <QPoint>
|
||||
|
||||
#include "../ifc/exception/vexception.h"
|
||||
#include "../vmisc/vmath.h"
|
||||
#include "../vmisc/compatibility.h"
|
||||
#include "vabstractcurve.h"
|
||||
#include "vcubicbezierpath_p.h"
|
||||
#include "vspline.h"
|
||||
#include "vsplinepoint.h"
|
||||
#include "../vmisc/compatibility.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VCubicBezierPath::VCubicBezierPath(quint32 idObject, Draw mode)
|
||||
: VAbstractCubicBezierPath(GOType::CubicBezierPath, idObject, mode),
|
||||
d(new VCubicBezierPathData())
|
||||
: VAbstractCubicBezierPath(GOType::CubicBezierPath, idObject, mode),
|
||||
d(new VCubicBezierPathData())
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VCubicBezierPath::VCubicBezierPath(const VCubicBezierPath &curve)
|
||||
: VAbstractCubicBezierPath(curve),
|
||||
d(curve.d)
|
||||
{
|
||||
}
|
||||
VCubicBezierPath::VCubicBezierPath(const VCubicBezierPath &curve) = default;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VCubicBezierPath::VCubicBezierPath(const QVector<VPointF> &points, quint32 idObject, Draw mode)
|
||||
: VAbstractCubicBezierPath(GOType::CubicBezierPath, idObject, mode),
|
||||
d(new VCubicBezierPathData())
|
||||
: VAbstractCubicBezierPath(GOType::CubicBezierPath, idObject, mode),
|
||||
d(new VCubicBezierPathData())
|
||||
{
|
||||
if (points.isEmpty())
|
||||
{
|
||||
|
@ -70,7 +65,7 @@ VCubicBezierPath::VCubicBezierPath(const QVector<VPointF> &points, quint32 idObj
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VCubicBezierPath::operator=(const VCubicBezierPath &curve) -> VCubicBezierPath &
|
||||
{
|
||||
if ( &curve == this )
|
||||
if (&curve == this)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
@ -81,13 +76,14 @@ auto VCubicBezierPath::operator=(const VCubicBezierPath &curve) -> VCubicBezierP
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VCubicBezierPath::VCubicBezierPath(VCubicBezierPath &&curve) Q_DECL_NOTHROW
|
||||
: VAbstractCubicBezierPath(std::move(curve)),
|
||||
d(std::move(curve.d))
|
||||
{}
|
||||
VCubicBezierPath::VCubicBezierPath(VCubicBezierPath &&curve) noexcept
|
||||
: VAbstractCubicBezierPath(std::move(curve)),
|
||||
d(std::move(curve.d))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VCubicBezierPath::operator=(VCubicBezierPath &&curve) Q_DECL_NOTHROW->VCubicBezierPath &
|
||||
auto VCubicBezierPath::operator=(VCubicBezierPath &&curve) noexcept -> VCubicBezierPath &
|
||||
{
|
||||
VAbstractCubicBezierPath::operator=(curve);
|
||||
std::swap(d, curve.d);
|
||||
|
@ -163,9 +159,7 @@ auto VCubicBezierPath::Move(qreal length, qreal angle, const QString &prefix) co
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VCubicBezierPath::~VCubicBezierPath()
|
||||
{
|
||||
}
|
||||
VCubicBezierPath::~VCubicBezierPath() = default;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VCubicBezierPath::operator[](vsizetype indx) -> VPointF &
|
||||
|
@ -221,7 +215,7 @@ auto VCubicBezierPath::GetSpline(vsizetype index) const -> VSpline
|
|||
const vsizetype base = SubSplOffset(index);
|
||||
|
||||
// Correction the first control point of each next spline curve except for the first.
|
||||
QPointF p2 = static_cast<QPointF>(d->path.at(base + 1));
|
||||
auto p2 = static_cast<QPointF>(d->path.at(base + 1));
|
||||
if (base + 1 > 1)
|
||||
{
|
||||
const QPointF b = static_cast<QPointF>(d->path.at(base));
|
||||
|
@ -283,18 +277,18 @@ auto VCubicBezierPath::GetC2Length() const -> qreal
|
|||
auto VCubicBezierPath::GetSplinePath() const -> QVector<VSplinePoint>
|
||||
{
|
||||
const vsizetype size = CountSubSpl();
|
||||
QVector<VSplinePoint> splPoints(size+1);
|
||||
QVector<VSplinePoint> splPoints(size + 1);
|
||||
|
||||
for (qint32 i = 1; i <= size; ++i)
|
||||
{
|
||||
const VSpline spl = GetSpline(i);
|
||||
|
||||
{
|
||||
VSplinePoint p = splPoints.at(i-1);
|
||||
VSplinePoint p = splPoints.at(i - 1);
|
||||
p.SetP(spl.GetP1());
|
||||
p.SetAngle2(spl.GetStartAngle(), spl.GetStartAngleFormula());
|
||||
p.SetLength2(spl.GetC1Length(), spl.GetC1LengthFormula());
|
||||
splPoints[i-1] = p;
|
||||
splPoints[i - 1] = p;
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -366,7 +360,7 @@ auto VCubicBezierPath::LastPoint() const -> VPointF
|
|||
const vsizetype count = CountSubSpl();
|
||||
if (count >= 1)
|
||||
{
|
||||
return d->path.at(SubSplOffset(count) + 3);// Take last point of the last real spline
|
||||
return d->path.at(SubSplOffset(count) + 3); // Take last point of the last real spline
|
||||
}
|
||||
|
||||
return {};
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VCUBICBEZIERPATH_H
|
||||
#define VCUBICBEZIERPATH_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QPointF>
|
||||
#include <QSharedDataPointer>
|
||||
|
@ -39,7 +38,6 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#include "vabstractcubicbezierpath.h"
|
||||
#include "vgeometrydef.h"
|
||||
#include "vpointf.h"
|
||||
|
||||
class VCubicBezierPathData;
|
||||
|
@ -47,6 +45,7 @@ class VCubicBezierPathData;
|
|||
class VCubicBezierPath final : public VAbstractCubicBezierPath
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(VCubicBezierPath) // NOLINT
|
||||
|
||||
public:
|
||||
explicit VCubicBezierPath(quint32 idObject = 0, Draw mode = Draw::Calculation);
|
||||
VCubicBezierPath(const VCubicBezierPath &curve);
|
||||
|
@ -58,19 +57,19 @@ public:
|
|||
|
||||
auto operator=(const VCubicBezierPath &curve) -> VCubicBezierPath &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VCubicBezierPath(VCubicBezierPath &&curve) Q_DECL_NOTHROW;
|
||||
auto operator=(VCubicBezierPath &&curve) Q_DECL_NOTHROW->VCubicBezierPath &;
|
||||
VCubicBezierPath(VCubicBezierPath &&curve) noexcept;
|
||||
auto operator=(VCubicBezierPath &&curve) noexcept -> VCubicBezierPath &;
|
||||
#endif
|
||||
|
||||
auto operator[](vsizetype indx) -> VPointF &;
|
||||
|
||||
auto at(vsizetype indx) const -> const VPointF &;
|
||||
|
||||
void append(const VPointF &point);
|
||||
void append(const VPointF &point);
|
||||
|
||||
virtual auto CountSubSpl() const -> vsizetype override;
|
||||
virtual auto CountPoints() const -> vsizetype override;
|
||||
virtual void Clear() override;
|
||||
virtual void Clear() override;
|
||||
virtual auto GetSpline(vsizetype index) const -> VSpline override;
|
||||
virtual auto GetStartAngle() const -> qreal override;
|
||||
virtual auto GetEndAngle() const -> qreal override;
|
||||
|
|
|
@ -43,28 +43,17 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VCubicBezierPathData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
|
||||
VCubicBezierPathData()
|
||||
: path()
|
||||
{}
|
||||
|
||||
VCubicBezierPathData(const VCubicBezierPathData &splPath)
|
||||
: QSharedData(splPath),
|
||||
path(splPath.path)
|
||||
{}
|
||||
|
||||
virtual ~VCubicBezierPathData();
|
||||
VCubicBezierPathData() = default;
|
||||
VCubicBezierPathData(const VCubicBezierPathData &splPath) = default;
|
||||
~VCubicBezierPathData() = default;
|
||||
|
||||
/** @brief path list of points. */
|
||||
QVector<VPointF> path;
|
||||
QVector<VPointF> path{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VCubicBezierPathData) // NOLINT
|
||||
};
|
||||
|
||||
VCubicBezierPathData::~VCubicBezierPathData()
|
||||
{}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
||||
#endif // VCUBICBEZIERPATH_P_H
|
||||
|
|
|
@ -315,13 +315,13 @@ auto VEllipticalArc::operator =(const VEllipticalArc &arc) -> VEllipticalArc &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArc::VEllipticalArc(VEllipticalArc &&arc) Q_DECL_NOTHROW
|
||||
VEllipticalArc::VEllipticalArc(VEllipticalArc &&arc) noexcept
|
||||
: VAbstractArc(std::move(arc)),
|
||||
d(std::move(arc.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VEllipticalArc::operator=(VEllipticalArc &&arc) Q_DECL_NOTHROW -> VEllipticalArc &
|
||||
auto VEllipticalArc::operator=(VEllipticalArc &&arc) noexcept -> VEllipticalArc &
|
||||
{
|
||||
VAbstractArc::operator=(arc);
|
||||
std::swap(d, arc.d);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VELLIPTICALARC_H
|
||||
#define VELLIPTICALARC_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QPointF>
|
||||
#include <QSharedDataPointer>
|
||||
|
@ -47,6 +46,7 @@ class VEllipticalArcData;
|
|||
class VEllipticalArc final : public VAbstractArc
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(VEllipticalArc) // NOLINT
|
||||
|
||||
public:
|
||||
VEllipticalArc();
|
||||
VEllipticalArc(const VPointF ¢er, qreal radius1, qreal radius2, const QString &formulaRadius1,
|
||||
|
@ -67,10 +67,10 @@ public:
|
|||
|
||||
~VEllipticalArc() override;
|
||||
|
||||
auto operator= (const VEllipticalArc &arc) -> VEllipticalArc&;
|
||||
auto operator=(const VEllipticalArc &arc) -> VEllipticalArc &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VEllipticalArc(VEllipticalArc &&arc) Q_DECL_NOTHROW;
|
||||
auto operator=(VEllipticalArc &&arc) Q_DECL_NOTHROW -> VEllipticalArc &;
|
||||
VEllipticalArc(VEllipticalArc &&arc) noexcept;
|
||||
auto operator=(VEllipticalArc &&arc) noexcept -> VEllipticalArc &;
|
||||
#endif
|
||||
|
||||
auto GetFormulaRotationAngle() const -> QString;
|
||||
|
@ -101,15 +101,17 @@ public:
|
|||
auto GetStartAngle() const -> qreal override;
|
||||
auto GetEndAngle() const -> qreal override;
|
||||
|
||||
auto CutArc (const qreal &length, VEllipticalArc &arc1, VEllipticalArc &arc2,
|
||||
const QString &pointName) const -> QPointF;
|
||||
auto CutArc (const qreal &length, const QString &pointName) const -> QPointF;
|
||||
auto CutArc(const qreal &length, VEllipticalArc &arc1, VEllipticalArc &arc2, const QString &pointName) const
|
||||
-> QPointF;
|
||||
auto CutArc(const qreal &length, const QString &pointName) const -> QPointF;
|
||||
|
||||
static auto OptimizeAngle(qreal angle) -> qreal;
|
||||
|
||||
protected:
|
||||
void CreateName() override;
|
||||
void CreateAlias() override;
|
||||
void FindF2(qreal length) override;
|
||||
|
||||
private:
|
||||
QSharedDataPointer<VEllipticalArcData> d;
|
||||
|
||||
|
@ -118,13 +120,13 @@ private:
|
|||
auto ArcPoints(QVector<QPointF> points) const -> QVector<QPointF>;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(VEllipticalArc) // NOLINT
|
||||
Q_DECLARE_METATYPE(VEllipticalArc) // NOLINT
|
||||
Q_DECLARE_TYPEINFO(VEllipticalArc, Q_MOVABLE_TYPE); // NOLINT
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline auto VEllipticalArc::OptimizeAngle(qreal angle) -> qreal
|
||||
{
|
||||
return angle - 360.*qFloor(angle/360.);
|
||||
return angle - 360. * qFloor(angle / 360.);
|
||||
}
|
||||
|
||||
#endif // VELLIPTICALARC_H
|
||||
|
|
|
@ -15,84 +15,55 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VEllipticalArcData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
VEllipticalArcData ();
|
||||
VEllipticalArcData (qreal radius1, qreal radius2, const QString &formulaRadius1, const QString &formulaRadius2,
|
||||
qreal rotationAngle, const QString &formulaRotationAngle);
|
||||
VEllipticalArcData() = default;
|
||||
VEllipticalArcData(qreal radius1, qreal radius2, const QString &formulaRadius1, const QString &formulaRadius2,
|
||||
qreal rotationAngle, const QString &formulaRotationAngle);
|
||||
VEllipticalArcData(qreal radius1, qreal radius2, qreal rotationAngle);
|
||||
VEllipticalArcData(const VEllipticalArcData &arc);
|
||||
|
||||
virtual ~VEllipticalArcData();
|
||||
VEllipticalArcData(const VEllipticalArcData &arc) = default;
|
||||
~VEllipticalArcData() = default;
|
||||
|
||||
/** @brief radius1 elliptical arc major radius. */
|
||||
qreal radius1;
|
||||
qreal radius1{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
/** @brief radius2 elliptical arc minor radius. */
|
||||
qreal radius2;
|
||||
qreal radius2{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
/** @brief formulaRadius1 formula for elliptical arc major radius. */
|
||||
QString formulaRadius1;
|
||||
QString formulaRadius1{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
/** @brief formulaRadius2 formula for elliptical arc minor radius. */
|
||||
QString formulaRadius2;
|
||||
QString formulaRadius2{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
/** @brief rotationAngle in degree. */
|
||||
qreal rotationAngle;
|
||||
qreal rotationAngle{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
/** @brief formulaRotationAngle formula for rotationAngle. */
|
||||
QString formulaRotationAngle;
|
||||
QTransform m_transform;
|
||||
QString formulaRotationAngle{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QTransform m_transform{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VEllipticalArcData) // NOLINT
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArcData::VEllipticalArcData()
|
||||
: radius1(0),
|
||||
radius2(0),
|
||||
formulaRadius1(),
|
||||
formulaRadius2(),
|
||||
rotationAngle(0),
|
||||
formulaRotationAngle(),
|
||||
m_transform()
|
||||
{}
|
||||
inline VEllipticalArcData::VEllipticalArcData(qreal radius1, qreal radius2, const QString &formulaRadius1,
|
||||
const QString &formulaRadius2, qreal rotationAngle,
|
||||
const QString &formulaRotationAngle)
|
||||
: radius1(radius1),
|
||||
radius2(radius2),
|
||||
formulaRadius1(formulaRadius1),
|
||||
formulaRadius2(formulaRadius2),
|
||||
rotationAngle(rotationAngle),
|
||||
formulaRotationAngle(formulaRotationAngle)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArcData::VEllipticalArcData(qreal radius1, qreal radius2, const QString &formulaRadius1,
|
||||
const QString &formulaRadius2, qreal rotationAngle,
|
||||
const QString &formulaRotationAngle)
|
||||
: radius1(radius1),
|
||||
radius2(radius2),
|
||||
formulaRadius1(formulaRadius1),
|
||||
formulaRadius2(formulaRadius2),
|
||||
rotationAngle(rotationAngle),
|
||||
formulaRotationAngle(formulaRotationAngle),
|
||||
m_transform()
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArcData::VEllipticalArcData(qreal radius1, qreal radius2, qreal rotationAngle)
|
||||
: radius1(radius1),
|
||||
radius2(radius2),
|
||||
formulaRadius1(QString().number(radius1)),
|
||||
formulaRadius2(QString().number(radius2)),
|
||||
rotationAngle(rotationAngle),
|
||||
formulaRotationAngle(QString().number(rotationAngle)),
|
||||
m_transform()
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArcData::VEllipticalArcData(const VEllipticalArcData &arc)
|
||||
: QSharedData(arc),
|
||||
radius1(arc.radius1),
|
||||
radius2(arc.radius2),
|
||||
formulaRadius1(arc.formulaRadius1),
|
||||
formulaRadius2(arc.formulaRadius2),
|
||||
rotationAngle(arc.rotationAngle),
|
||||
formulaRotationAngle(arc.formulaRotationAngle),
|
||||
m_transform(arc.m_transform)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArcData::~VEllipticalArcData()
|
||||
{}
|
||||
inline VEllipticalArcData::VEllipticalArcData(qreal radius1, qreal radius2, qreal rotationAngle)
|
||||
: radius1(radius1),
|
||||
radius2(radius2),
|
||||
formulaRadius1(QString::number(radius1)),
|
||||
formulaRadius2(QString::number(radius2)),
|
||||
rotationAngle(rotationAngle),
|
||||
formulaRotationAngle(QString::number(rotationAngle))
|
||||
{
|
||||
}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
||||
#endif // VELLIPTICALARC_P
|
||||
|
||||
|
|
|
@ -64,8 +64,8 @@ public:
|
|||
|
||||
auto operator= (const VGObject &obj) -> VGObject&;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VGObject(VGObject &&obj) Q_DECL_NOTHROW;
|
||||
auto operator=(VGObject &&obj) Q_DECL_NOTHROW -> VGObject &;
|
||||
VGObject(VGObject &&obj) noexcept;
|
||||
auto operator=(VGObject &&obj) noexcept -> VGObject &;
|
||||
#endif
|
||||
|
||||
auto getIdObject() const -> quint32;
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
#ifndef VGOBJECT_P_H
|
||||
#define VGOBJECT_P_H
|
||||
|
||||
#include <QSharedData>
|
||||
#include "vgeometrydef.h"
|
||||
#include <QSharedData>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
@ -45,20 +45,15 @@ class VGObjectData final : public QSharedData
|
|||
{
|
||||
public:
|
||||
VGObjectData() = default;
|
||||
VGObjectData(const GOType &type, const quint32 &idObject, const Draw &mode)
|
||||
:type(type),
|
||||
idObject(idObject),
|
||||
mode(mode)
|
||||
{}
|
||||
|
||||
VGObjectData(const GOType &type, const quint32 &idObject, const Draw &mode);
|
||||
VGObjectData(const VGObjectData &obj) = default;
|
||||
virtual ~VGObjectData() = default;
|
||||
~VGObjectData() = default;
|
||||
|
||||
/** @brief _id id in container. Ned for arcs, spline and spline paths. */
|
||||
quint32 _id{NULL_ID}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief type type of graphical object */
|
||||
GOType type{GOType::Unknown}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
GOType type{GOType::Unknown}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief idObject id of parent object. */
|
||||
quint32 idObject{NULL_ID}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
@ -67,15 +62,23 @@ public:
|
|||
QString _name{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief mode object created in calculation or drawing mode */
|
||||
Draw mode{Draw::Calculation}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
Draw mode{Draw::Calculation}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
QString m_alias{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString m_alias{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString m_aliasSuffix{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VGObjectData) // NOLINT
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline VGObjectData::VGObjectData(const GOType &type, const quint32 &idObject, const Draw &mode)
|
||||
: type(type),
|
||||
idObject(idObject),
|
||||
mode(mode)
|
||||
{
|
||||
}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
||||
#endif // VGOBJECT_P_H
|
||||
|
|
|
@ -227,12 +227,12 @@ auto VPlaceLabelItem::operator=(const VPlaceLabelItem &item) -> VPlaceLabelItem
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPlaceLabelItem::VPlaceLabelItem(VPlaceLabelItem &&item) Q_DECL_NOTHROW
|
||||
VPlaceLabelItem::VPlaceLabelItem(VPlaceLabelItem &&item) noexcept
|
||||
: VPointF(std::move(item)), d(std::move(item.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VPlaceLabelItem::operator=(VPlaceLabelItem &&item) Q_DECL_NOTHROW->VPlaceLabelItem &
|
||||
auto VPlaceLabelItem::operator=(VPlaceLabelItem &&item) noexcept->VPlaceLabelItem &
|
||||
{
|
||||
VPointF::operator=(item);
|
||||
std::swap(d, item.d);
|
||||
|
|
|
@ -48,8 +48,8 @@ public:
|
|||
|
||||
auto operator=(const VPlaceLabelItem &item) -> VPlaceLabelItem &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VPlaceLabelItem(VPlaceLabelItem &&item) Q_DECL_NOTHROW;
|
||||
auto operator=(VPlaceLabelItem &&item) Q_DECL_NOTHROW->VPlaceLabelItem &;
|
||||
VPlaceLabelItem(VPlaceLabelItem &&item) noexcept;
|
||||
auto operator=(VPlaceLabelItem &&item) noexcept->VPlaceLabelItem &;
|
||||
#endif
|
||||
|
||||
auto GetWidthFormula() const -> QString;
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
#ifndef VPLACELABELITEM_P_H
|
||||
#define VPLACELABELITEM_P_H
|
||||
|
||||
#include <QSharedData>
|
||||
#include "vgeometrydef.h"
|
||||
#include <QSharedData>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
@ -41,46 +41,27 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VPlaceLabelItemData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
VPlaceLabelItemData()
|
||||
{}
|
||||
VPlaceLabelItemData() = default;
|
||||
VPlaceLabelItemData(const VPlaceLabelItemData &item) = default;
|
||||
~VPlaceLabelItemData() = default;
|
||||
|
||||
VPlaceLabelItemData(const VPlaceLabelItemData &item)
|
||||
: QSharedData(item),
|
||||
width(item.width),
|
||||
height(item.height),
|
||||
angle(item.angle),
|
||||
visibilityTrigger(item.visibilityTrigger),
|
||||
type(item.type),
|
||||
centerPoint(item.centerPoint),
|
||||
wValue(item.wValue),
|
||||
hValue(item.hValue),
|
||||
aValue(item.aValue),
|
||||
correctionAngle(item.correctionAngle),
|
||||
isVisible(item.isVisible)
|
||||
{}
|
||||
QString width{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString height{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString angle{'0'}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString visibilityTrigger{'1'}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
PlaceLabelType type{PlaceLabelType::Button}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
quint32 centerPoint{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
virtual ~VPlaceLabelItemData();
|
||||
|
||||
QString width{};
|
||||
QString height{};
|
||||
QString angle{'0'};
|
||||
QString visibilityTrigger{'1'};
|
||||
PlaceLabelType type{PlaceLabelType::Button};
|
||||
quint32 centerPoint{0};
|
||||
|
||||
qreal wValue{0};
|
||||
qreal hValue{0};
|
||||
qreal aValue{0};
|
||||
qreal correctionAngle{0};
|
||||
qreal isVisible{1};
|
||||
qreal wValue{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
qreal hValue{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
qreal aValue{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
qreal correctionAngle{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
qreal isVisible{1}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VPlaceLabelItemData) // NOLINT
|
||||
};
|
||||
|
||||
VPlaceLabelItemData::~VPlaceLabelItemData()
|
||||
{}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
||||
#endif // VPLACELABELITEM_P_H
|
||||
|
|
|
@ -104,12 +104,12 @@ auto VPointF::operator=(const VPointF &point) -> VPointF &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPointF::VPointF(VPointF &&point) Q_DECL_NOTHROW
|
||||
VPointF::VPointF(VPointF &&point) noexcept
|
||||
:VGObject(std::move(point)), d(std::move(point.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VPointF::operator=(VPointF &&point) Q_DECL_NOTHROW->VPointF &
|
||||
auto VPointF::operator=(VPointF &&point) noexcept->VPointF &
|
||||
{
|
||||
VGObject::operator=(point);
|
||||
std::swap(d, point.d);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VPOINTF_H
|
||||
#define VPOINTF_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QMetaType>
|
||||
#include <QSharedDataPointer>
|
||||
#include <QString>
|
||||
|
@ -65,8 +65,8 @@ public:
|
|||
|
||||
auto operator=(const VPointF &point) -> VPointF &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VPointF(VPointF &&point) Q_DECL_NOTHROW;
|
||||
auto operator=(VPointF &&point) Q_DECL_NOTHROW->VPointF &;
|
||||
VPointF(VPointF &&point) noexcept;
|
||||
auto operator=(VPointF &&point) noexcept->VPointF &;
|
||||
#endif
|
||||
|
||||
explicit operator QPointF() const;
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include <QPointF>
|
||||
#include "../vmisc/defglobal.h"
|
||||
#include <QPointF>
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||
|
@ -43,50 +43,56 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VPointFData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
|
||||
VPointFData()
|
||||
: _mx(0), _my(0), _x(0), _y(0), m_showLabel(true)
|
||||
{}
|
||||
|
||||
VPointFData(const VPointFData &point)
|
||||
:QSharedData(point), _mx(point._mx), _my(point._my), _x(point._x), _y(point._y), m_showLabel(point.m_showLabel)
|
||||
{}
|
||||
|
||||
explicit VPointFData(const QPointF &point)
|
||||
:_mx(0), _my(0), _x(point.x()), _y(point.y()), m_showLabel(true)
|
||||
{}
|
||||
|
||||
VPointFData(qreal x, qreal y, qreal mx, qreal my)
|
||||
:_mx(mx), _my(my), _x(x), _y(y), m_showLabel(true)
|
||||
{}
|
||||
|
||||
VPointFData(const QPointF &point, qreal mx, qreal my)
|
||||
:_mx(mx), _my(my), _x(point.x()), _y(point.y()), m_showLabel(true)
|
||||
{}
|
||||
|
||||
virtual ~VPointFData();
|
||||
VPointFData() = default;
|
||||
VPointFData(const VPointFData &point) = default;
|
||||
explicit VPointFData(const QPointF &point);
|
||||
VPointFData(qreal x, qreal y, qreal mx, qreal my);
|
||||
VPointFData(const QPointF &point, qreal mx, qreal my);
|
||||
~VPointFData() = default;
|
||||
|
||||
/** @brief _mx offset name respect to x */
|
||||
qreal _mx;
|
||||
qreal _mx{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief _my offset name respect to y */
|
||||
qreal _my;
|
||||
qreal _my{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief _x x coordinate */
|
||||
qreal _x;
|
||||
qreal _x{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief _y y coordinate */
|
||||
qreal _y;
|
||||
qreal _y{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief m_hideLabel show or not label for this point */
|
||||
bool m_showLabel;
|
||||
bool m_showLabel{true}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VPointFData) // NOLINT
|
||||
};
|
||||
|
||||
VPointFData::~VPointFData()
|
||||
{}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline VPointFData::VPointFData(const QPointF &point)
|
||||
: _x(point.x()),
|
||||
_y(point.y())
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline VPointFData::VPointFData(qreal x, qreal y, qreal mx, qreal my)
|
||||
: _mx(mx),
|
||||
_my(my),
|
||||
_x(x),
|
||||
_y(y)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline VPointFData::VPointFData(const QPointF &point, qreal mx, qreal my)
|
||||
: _mx(mx),
|
||||
_my(my),
|
||||
_x(point.x()),
|
||||
_y(point.y())
|
||||
{
|
||||
}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
||||
|
|
|
@ -269,13 +269,13 @@ auto VSpline::operator =(const VSpline &spline) -> VSpline &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSpline::VSpline(VSpline &&spline) Q_DECL_NOTHROW
|
||||
VSpline::VSpline(VSpline &&spline) noexcept
|
||||
: VAbstractCubicBezier(std::move(spline)),
|
||||
d(std::move(spline.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VSpline::operator=(VSpline &&spline) Q_DECL_NOTHROW -> VSpline &
|
||||
auto VSpline::operator=(VSpline &&spline) noexcept -> VSpline &
|
||||
{
|
||||
VAbstractCubicBezier::operator=(spline);
|
||||
std::swap(d, spline.d);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VSPLINE_H
|
||||
#define VSPLINE_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QLineF>
|
||||
#include <QMetaType>
|
||||
#include <QPointF>
|
||||
|
@ -47,7 +46,7 @@ class VSplineData;
|
|||
/**
|
||||
* @brief VSpline class that implements the spline.
|
||||
*/
|
||||
class VSpline final :public VAbstractCubicBezier
|
||||
class VSpline final : public VAbstractCubicBezier
|
||||
{
|
||||
public:
|
||||
VSpline();
|
||||
|
@ -66,8 +65,8 @@ public:
|
|||
|
||||
auto operator=(const VSpline &spline) -> VSpline &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VSpline(VSpline &&spline) Q_DECL_NOTHROW;
|
||||
auto operator=(VSpline &&spline) Q_DECL_NOTHROW -> VSpline &;
|
||||
VSpline(VSpline &&spline) noexcept;
|
||||
auto operator=(VSpline &&spline) noexcept -> VSpline &;
|
||||
#endif
|
||||
|
||||
auto GetP1() const -> VPointF override;
|
||||
|
@ -82,7 +81,7 @@ public:
|
|||
auto GetStartAngle() const -> qreal override;
|
||||
auto GetEndAngle() const -> qreal override;
|
||||
|
||||
auto GetStartAngleFormula () const -> QString;
|
||||
auto GetStartAngleFormula() const -> QString;
|
||||
auto GetEndAngleFormula() const -> QString;
|
||||
|
||||
void SetStartAngle(qreal angle, const QString &formula);
|
||||
|
@ -107,8 +106,8 @@ public:
|
|||
|
||||
auto GetPoints() const -> QVector<QPointF> override;
|
||||
// cppcheck-suppress unusedFunction
|
||||
static auto SplinePoints(const QPointF &p1, const QPointF &p4, qreal angle1, qreal angle2, qreal kAsm1,
|
||||
qreal kAsm2, qreal kCurve, qreal approximationScale) -> QVector<QPointF>;
|
||||
static auto SplinePoints(const QPointF &p1, const QPointF &p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2,
|
||||
qreal kCurve, qreal approximationScale) -> QVector<QPointF>;
|
||||
auto ParamT(const QPointF &pBt) const -> qreal;
|
||||
|
||||
auto ToJson() const -> QJsonObject override;
|
||||
|
@ -117,15 +116,16 @@ protected:
|
|||
auto GetControlPoint1() const -> QPointF override;
|
||||
auto GetControlPoint2() const -> QPointF override;
|
||||
auto GetRealLength() const -> qreal override;
|
||||
|
||||
private:
|
||||
QSharedDataPointer<VSplineData> d;
|
||||
static auto CalcT(qreal curveCoord1, qreal curveCoord2, qreal curveCoord3, qreal curveCoord4,
|
||||
qreal pointCoord) -> QVector<qreal>;
|
||||
static auto CalcT(qreal curveCoord1, qreal curveCoord2, qreal curveCoord3, qreal curveCoord4, qreal pointCoord)
|
||||
-> QVector<qreal>;
|
||||
static auto Cubic(QVector<qreal> &x, qreal a, qreal b, qreal c) -> qint32;
|
||||
static auto Sign(long double ld) -> int;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(VSpline) // NOLINT
|
||||
Q_DECLARE_METATYPE(VSpline) // NOLINT
|
||||
Q_DECLARE_TYPEINFO(VSpline, Q_MOVABLE_TYPE); // NOLINT
|
||||
|
||||
#endif // VSPLINE_H
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
#ifndef VSPLINE_P_H
|
||||
#define VSPLINE_P_H
|
||||
|
||||
#include <QSharedData>
|
||||
#include <QLineF>
|
||||
#include <QSharedData>
|
||||
#include <QtMath>
|
||||
|
||||
#include "vpointf.h"
|
||||
|
@ -42,97 +42,65 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VSplineData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
VSplineData();
|
||||
VSplineData(const VSplineData &spline);
|
||||
VSplineData(VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve);
|
||||
VSplineData(VPointF p1, QPointF p2, QPointF p3, VPointF p4);
|
||||
VSplineData(VPointF p1, VPointF p4, qreal angle1, const QString &angle1F, qreal angle2, const QString &angle2F,
|
||||
qreal c1Length, const QString &c1LengthF, qreal c2Length, const QString &c2LengthF);
|
||||
virtual ~VSplineData();
|
||||
VSplineData() = default;
|
||||
VSplineData(const VSplineData &spline) = default;
|
||||
VSplineData(const VPointF &p1, const VPointF &p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2,
|
||||
qreal kCurve);
|
||||
VSplineData(const VPointF &p1, QPointF p2, QPointF p3, const VPointF &p4);
|
||||
VSplineData(const VPointF &p1, const VPointF &p4, qreal angle1, const QString &angle1F, qreal angle2,
|
||||
const QString &angle2F, qreal c1Length, const QString &c1LengthF, qreal c2Length,
|
||||
const QString &c2LengthF);
|
||||
~VSplineData() = default;
|
||||
|
||||
static auto GetL(const QPointF &p1, const QPointF &p4, qreal kCurve) -> qreal;
|
||||
|
||||
/** @brief p1 first spline point. */
|
||||
VPointF p1;
|
||||
VPointF p1{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief p4 fourth spline point. */
|
||||
VPointF p4;
|
||||
VPointF p4{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief angle1 first angle control line. */
|
||||
qreal angle1;
|
||||
qreal angle1{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief angle1F the first control point angle formula*/
|
||||
QString angle1F;
|
||||
QString angle1F{'0'}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief angle2 second angle control line. */
|
||||
qreal angle2;
|
||||
qreal angle2{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief angle2F the second control point angle formula*/
|
||||
QString angle2F;
|
||||
QString angle2F{'0'}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief c1Length the length from the first spline point to the first control point. */
|
||||
qreal c1Length;
|
||||
qreal c1Length{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief c1LengthF the formula from the first spline point to the first control point. */
|
||||
QString c1LengthF;
|
||||
QString c1LengthF{'0'}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief c2Length the length from the fourth spline point to the second control point. */
|
||||
qreal c2Length;
|
||||
qreal c2Length{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief c2LengthF the formula length from the fourth spline point to the second control point. */
|
||||
QString c2LengthF;
|
||||
QString c2LengthF{'0'}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief kCurve coefficient of curvature spline. */
|
||||
qreal kCurve;
|
||||
qreal kCurve{1}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VSplineData) // NOLINT
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplineData::VSplineData()
|
||||
: p1(),
|
||||
p4(),
|
||||
angle1(0),
|
||||
angle1F('0'),
|
||||
angle2(0),
|
||||
angle2F('0'),
|
||||
c1Length(0),
|
||||
c1LengthF('0'),
|
||||
c2Length(0),
|
||||
c2LengthF('0'),
|
||||
kCurve(1)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplineData::VSplineData(const VSplineData &spline)
|
||||
: QSharedData(spline),
|
||||
p1(spline.p1),
|
||||
p4(spline.p4),
|
||||
angle1(spline.angle1),
|
||||
angle1F(spline.angle1F),
|
||||
angle2(spline.angle2),
|
||||
angle2F(spline.angle2F),
|
||||
c1Length(spline.c1Length),
|
||||
c1LengthF(spline.c1LengthF),
|
||||
c2Length(spline.c2Length),
|
||||
c2LengthF(spline.c2LengthF),
|
||||
kCurve(spline.kCurve)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplineData::VSplineData(VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve)
|
||||
: p1(p1),
|
||||
p4(p4),
|
||||
angle1(angle1),
|
||||
angle1F(QString().number(angle1)),
|
||||
angle2(angle2),
|
||||
angle2F(QString().number(angle2)),
|
||||
c1Length(0),
|
||||
c1LengthF('0'),
|
||||
c2Length(0),
|
||||
c2LengthF('0'),
|
||||
kCurve(kCurve)
|
||||
inline VSplineData::VSplineData(const VPointF &p1, const VPointF &p4, qreal angle1, qreal angle2, qreal kAsm1,
|
||||
qreal kAsm2, qreal kCurve)
|
||||
: p1(p1),
|
||||
p4(p4),
|
||||
angle1(angle1),
|
||||
angle1F(QString::number(angle1)),
|
||||
angle2(angle2),
|
||||
angle2F(QString::number(angle2)),
|
||||
kCurve(kCurve)
|
||||
{
|
||||
const qreal L = GetL(static_cast<QPointF>(p1), static_cast<QPointF>(p4), kCurve);
|
||||
|
||||
|
@ -148,23 +116,14 @@ VSplineData::VSplineData(VPointF p1, VPointF p4, qreal angle1, qreal angle2, qre
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplineData::VSplineData(VPointF p1, QPointF p2, QPointF p3, VPointF p4)
|
||||
: p1(p1),
|
||||
p4(p4),
|
||||
angle1(0),
|
||||
angle1F('0'),
|
||||
angle2(0),
|
||||
angle2F('0'),
|
||||
c1Length(0),
|
||||
c1LengthF('0'),
|
||||
c2Length(0),
|
||||
c2LengthF('0'),
|
||||
kCurve(1)
|
||||
inline VSplineData::VSplineData(const VPointF &p1, QPointF p2, QPointF p3, const VPointF &p4)
|
||||
: p1(p1),
|
||||
p4(p4)
|
||||
{
|
||||
QLineF p1p2(static_cast<QPointF>(p1), static_cast<QPointF>(p2));
|
||||
|
||||
angle1 = p1p2.angle();
|
||||
angle1F = QString().number(angle1);
|
||||
angle1F = QString::number(angle1);
|
||||
|
||||
c1Length = p1p2.length();
|
||||
c1LengthF = QString().number(c1Length);
|
||||
|
@ -172,40 +131,36 @@ VSplineData::VSplineData(VPointF p1, QPointF p2, QPointF p3, VPointF p4)
|
|||
QLineF p4p3(static_cast<QPointF>(p4), static_cast<QPointF>(p3));
|
||||
|
||||
angle2 = p4p3.angle();
|
||||
angle2F = QString().number(angle2);
|
||||
angle2F = QString::number(angle2);
|
||||
|
||||
c2Length = p4p3.length();
|
||||
c2LengthF = QString().number(c2Length);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplineData::VSplineData(VPointF p1, VPointF p4, qreal angle1, const QString &angle1F, qreal angle2,
|
||||
const QString &angle2F, qreal c1Length, const QString &c1LengthF,
|
||||
qreal c2Length, const QString &c2LengthF)
|
||||
: p1(p1),
|
||||
p4(p4),
|
||||
angle1(angle1),
|
||||
angle1F(angle1F),
|
||||
angle2(angle2),
|
||||
angle2F(angle2F),
|
||||
c1Length(c1Length),
|
||||
c1LengthF(c1LengthF),
|
||||
c2Length(c2Length),
|
||||
c2LengthF(c2LengthF),
|
||||
kCurve(1)
|
||||
{}
|
||||
inline VSplineData::VSplineData(const VPointF &p1, const VPointF &p4, qreal angle1, const QString &angle1F,
|
||||
qreal angle2, const QString &angle2F, qreal c1Length, const QString &c1LengthF,
|
||||
qreal c2Length, const QString &c2LengthF)
|
||||
: p1(p1),
|
||||
p4(p4),
|
||||
angle1(angle1),
|
||||
angle1F(angle1F),
|
||||
angle2(angle2),
|
||||
angle2F(angle2F),
|
||||
c1Length(c1Length),
|
||||
c1LengthF(c1LengthF),
|
||||
c2Length(c2Length),
|
||||
c2LengthF(c2LengthF)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplineData::~VSplineData()
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VSplineData::GetL(const QPointF &p1, const QPointF &p4, qreal kCurve) -> qreal
|
||||
inline auto VSplineData::GetL(const QPointF &p1, const QPointF &p4, qreal kCurve) -> qreal
|
||||
{
|
||||
static const qreal angle = 90;
|
||||
qreal length = VFuzzyComparePoints(p1, p4) ? accuracyPointOnLine*2 : QLineF(p1, p4).length();
|
||||
const qreal radius = length/M_SQRT2;
|
||||
return kCurve * radius * 4 / 3 * qTan( angle * M_PI_4 / 180.0 );
|
||||
qreal length = VFuzzyComparePoints(p1, p4) ? accuracyPointOnLine * 2 : QLineF(p1, p4).length();
|
||||
const qreal radius = length / M_SQRT2;
|
||||
return kCurve * radius * 4 / 3 * qTan(angle * M_PI_4 / 180.0);
|
||||
}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <QPoint>
|
||||
|
||||
#include "../ifc/exception/vexception.h"
|
||||
#include "../vmisc/vmath.h"
|
||||
#include "../vmisc/compatibility.h"
|
||||
#include "vabstractcurve.h"
|
||||
#include "vsplinepath_p.h"
|
||||
|
@ -317,13 +316,13 @@ auto VSplinePath::operator=(const VSplinePath &path) -> VSplinePath &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePath::VSplinePath(VSplinePath &&splPath) Q_DECL_NOTHROW
|
||||
VSplinePath::VSplinePath(VSplinePath &&splPath) noexcept
|
||||
: VAbstractCubicBezierPath(std::move(splPath)),
|
||||
d(std::move(splPath.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VSplinePath::operator=(VSplinePath &&path) Q_DECL_NOTHROW->VSplinePath &
|
||||
auto VSplinePath::operator=(VSplinePath &&path) noexcept->VSplinePath &
|
||||
{
|
||||
VAbstractCubicBezierPath::operator=(path);
|
||||
std::swap(d, path.d);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VSPLINEPATH_H
|
||||
#define VSPLINEPATH_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QPainterPath>
|
||||
#include <QPointF>
|
||||
|
@ -50,53 +49,54 @@ class VSplinePathData;
|
|||
/**
|
||||
* @brief The VSplinePath class keep information about splinePath.
|
||||
*/
|
||||
class VSplinePath final :public VAbstractCubicBezierPath
|
||||
class VSplinePath final : public VAbstractCubicBezierPath
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(VSplinePath) // NOLINT
|
||||
|
||||
public:
|
||||
explicit VSplinePath(quint32 idObject = 0, Draw mode = Draw::Calculation);
|
||||
VSplinePath(const QVector<VFSplinePoint> &points, qreal kCurve = 1, quint32 idObject = 0,
|
||||
Draw mode = Draw::Calculation);
|
||||
VSplinePath(const QVector<VSplinePoint> &points, quint32 idObject = 0, Draw mode = Draw::Calculation);
|
||||
VSplinePath(const VSplinePath& splPath);
|
||||
explicit VSplinePath(const QVector<VFSplinePoint> &points, qreal kCurve = 1, quint32 idObject = 0,
|
||||
Draw mode = Draw::Calculation);
|
||||
explicit VSplinePath(const QVector<VSplinePoint> &points, quint32 idObject = 0, Draw mode = Draw::Calculation);
|
||||
VSplinePath(const VSplinePath &splPath);
|
||||
auto Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const -> VSplinePath;
|
||||
auto Flip(const QLineF &axis, const QString &prefix = QString()) const -> VSplinePath;
|
||||
auto Move(qreal length, qreal angle, const QString &prefix = QString()) const -> VSplinePath;
|
||||
virtual ~VSplinePath() override;
|
||||
~VSplinePath() override;
|
||||
|
||||
auto operator[](vsizetype indx) -> VSplinePoint &;
|
||||
auto operator=(const VSplinePath &path) -> VSplinePath &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VSplinePath(VSplinePath&& splPath) Q_DECL_NOTHROW;
|
||||
auto operator=(VSplinePath &&path) Q_DECL_NOTHROW->VSplinePath &;
|
||||
VSplinePath(VSplinePath &&splPath) noexcept;
|
||||
auto operator=(VSplinePath &&path) noexcept -> VSplinePath &;
|
||||
#endif
|
||||
|
||||
void append(const VSplinePoint &point);
|
||||
void append(const VSplinePoint &point);
|
||||
|
||||
virtual auto CountSubSpl() const -> vsizetype override;
|
||||
virtual auto CountPoints() const -> vsizetype override;
|
||||
virtual void Clear() override;
|
||||
virtual auto GetSpline(vsizetype index) const -> VSpline override;
|
||||
auto CountSubSpl() const -> vsizetype override;
|
||||
auto CountPoints() const -> vsizetype override;
|
||||
void Clear() override;
|
||||
auto GetSpline(vsizetype index) const -> VSpline override;
|
||||
|
||||
virtual auto GetSplinePath() const -> QVector<VSplinePoint> override;
|
||||
auto GetSplinePath() const -> QVector<VSplinePoint> override;
|
||||
auto GetFSplinePath() const -> QVector<VFSplinePoint>;
|
||||
|
||||
virtual auto GetStartAngle() const -> qreal override;
|
||||
virtual auto GetEndAngle() const -> qreal override;
|
||||
auto GetStartAngle() const -> qreal override;
|
||||
auto GetEndAngle() const -> qreal override;
|
||||
|
||||
virtual auto GetC1Length() const -> qreal override;
|
||||
virtual auto GetC2Length() const -> qreal override;
|
||||
auto GetC1Length() const -> qreal override;
|
||||
auto GetC2Length() const -> qreal override;
|
||||
|
||||
void UpdatePoint(qint32 indexSpline, const SplinePointPosition &pos, const VSplinePoint &point);
|
||||
void UpdatePoint(qint32 indexSpline, const SplinePointPosition &pos, const VSplinePoint &point);
|
||||
auto GetSplinePoint(qint32 indexSpline, SplinePointPosition pos) const -> VSplinePoint;
|
||||
|
||||
auto at(vsizetype indx) const -> const VSplinePoint &;
|
||||
|
||||
virtual auto ToJson() const -> QJsonObject override;
|
||||
auto ToJson() const -> QJsonObject override;
|
||||
|
||||
protected:
|
||||
virtual auto FirstPoint() const -> VPointF override;
|
||||
virtual auto LastPoint() const -> VPointF override;
|
||||
auto FirstPoint() const -> VPointF override;
|
||||
auto LastPoint() const -> VPointF override;
|
||||
|
||||
private:
|
||||
QSharedDataPointer<VSplinePathData> d;
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
#ifndef VSPLINEPATH_P_H
|
||||
#define VSPLINEPATH_P_H
|
||||
|
||||
#include <QSharedData>
|
||||
#include "vsplinepoint.h"
|
||||
#include <QSharedData>
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||
|
@ -39,28 +39,19 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VSplinePathData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
|
||||
VSplinePathData() = default;
|
||||
|
||||
VSplinePathData(const VSplinePathData &splPath)
|
||||
: QSharedData(splPath),
|
||||
path(splPath.path)
|
||||
{}
|
||||
|
||||
virtual ~VSplinePathData();
|
||||
VSplinePathData(const VSplinePathData &splPath) = default;
|
||||
~VSplinePathData() = default;
|
||||
|
||||
/**
|
||||
* @brief path list spline point.
|
||||
*/
|
||||
QVector<VSplinePoint> path{};
|
||||
QVector<VSplinePoint> path{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VSplinePathData) // NOLINT
|
||||
};
|
||||
|
||||
VSplinePathData::~VSplinePathData()
|
||||
{}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
||||
#endif // VSPLINEPATH_P_H
|
||||
|
|
|
@ -77,12 +77,12 @@ auto VFSplinePoint::operator=(const VFSplinePoint &point) -> VFSplinePoint &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VFSplinePoint::VFSplinePoint(VFSplinePoint &&point) Q_DECL_NOTHROW
|
||||
VFSplinePoint::VFSplinePoint(VFSplinePoint &&point) noexcept
|
||||
:d(std::move(point.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VFSplinePoint::operator=(VFSplinePoint &&point) Q_DECL_NOTHROW->VFSplinePoint &
|
||||
auto VFSplinePoint::operator=(VFSplinePoint &&point) noexcept->VFSplinePoint &
|
||||
{
|
||||
std::swap(d, point.d);
|
||||
return *this;
|
||||
|
@ -236,12 +236,12 @@ auto VSplinePoint::operator=(const VSplinePoint &point) -> VSplinePoint &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePoint::VSplinePoint(VSplinePoint &&point) Q_DECL_NOTHROW
|
||||
VSplinePoint::VSplinePoint(VSplinePoint &&point) noexcept
|
||||
: d(std::move(point.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VSplinePoint::operator=(VSplinePoint &&point) Q_DECL_NOTHROW->VSplinePoint &
|
||||
auto VSplinePoint::operator=(VSplinePoint &&point) noexcept->VSplinePoint &
|
||||
{
|
||||
std::swap(d, point.d);
|
||||
return *this;
|
||||
|
@ -288,7 +288,7 @@ void VSplinePoint::SetAngle1(const qreal &value, const QString &angle1F)
|
|||
|
||||
line.setAngle(d->angle1+180);
|
||||
d->angle2 = line.angle();
|
||||
d->angle2F = QString().number(d->angle2);
|
||||
d->angle2F = QString::number(d->angle2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -314,7 +314,7 @@ void VSplinePoint::SetAngle2(const qreal &value, const QString &angle2F)
|
|||
|
||||
line.setAngle(d->angle2+180);
|
||||
d->angle1 = line.angle();
|
||||
d->angle1F = QString().number(d->angle1);
|
||||
d->angle1F = QString::number(d->angle1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -53,8 +53,8 @@ public:
|
|||
|
||||
auto operator=(const VFSplinePoint &point) -> VFSplinePoint &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VFSplinePoint(VFSplinePoint &&point) Q_DECL_NOTHROW;
|
||||
auto operator=(VFSplinePoint &&point) Q_DECL_NOTHROW->VFSplinePoint &;
|
||||
VFSplinePoint(VFSplinePoint &&point) noexcept;
|
||||
auto operator=(VFSplinePoint &&point) noexcept->VFSplinePoint &;
|
||||
#endif
|
||||
|
||||
auto P() const -> VPointF;
|
||||
|
@ -91,8 +91,8 @@ public:
|
|||
|
||||
auto operator=(const VSplinePoint &point) -> VSplinePoint &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VSplinePoint(VSplinePoint &&point) Q_DECL_NOTHROW;
|
||||
auto operator=(VSplinePoint &&point) Q_DECL_NOTHROW->VSplinePoint &;
|
||||
VSplinePoint(VSplinePoint &&point) noexcept;
|
||||
auto operator=(VSplinePoint &&point) noexcept->VSplinePoint &;
|
||||
#endif
|
||||
|
||||
auto P() const -> VPointF;
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
#include <QSharedData>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "vpointf.h"
|
||||
#include "../vmisc/def.h"
|
||||
#include "../qmuparser/qmutokenparser.h"
|
||||
#include "../vmisc/def.h"
|
||||
#include "vpointf.h"
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||
|
@ -44,158 +44,108 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VFSplinePointData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
|
||||
VFSplinePointData()
|
||||
: pSpline(VPointF()),
|
||||
angle1(0),
|
||||
angle2(180),
|
||||
kAsm1(1),
|
||||
kAsm2(1)
|
||||
{}
|
||||
|
||||
VFSplinePointData(VPointF pSpline, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
||||
: pSpline(pSpline),
|
||||
angle1(angle1),
|
||||
angle2(angle2),
|
||||
kAsm1(kAsm1),
|
||||
kAsm2(kAsm2)
|
||||
{
|
||||
if (VFuzzyComparePossibleNulls(angle1, angle2) || not qFuzzyCompare(qAbs(angle1-angle2), 180) )
|
||||
{
|
||||
this->angle2 = this->angle1 + 180;
|
||||
}
|
||||
}
|
||||
|
||||
VFSplinePointData(const VFSplinePointData &point)
|
||||
: QSharedData(point),
|
||||
pSpline(point.pSpline),
|
||||
angle1(point.angle1),
|
||||
angle2(point.angle2),
|
||||
kAsm1(point.kAsm1),
|
||||
kAsm2(point.kAsm2)
|
||||
{}
|
||||
|
||||
virtual ~VFSplinePointData();
|
||||
VFSplinePointData() = default;
|
||||
VFSplinePointData(const VPointF &pSpline, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
|
||||
VFSplinePointData(const VFSplinePointData &point) = default;
|
||||
~VFSplinePointData() = default;
|
||||
|
||||
/** @brief pSpline point. */
|
||||
VPointF pSpline;
|
||||
VPointF pSpline{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief angle1 first angle spline. */
|
||||
qreal angle1;
|
||||
qreal angle1{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief angle2 second angle spline. */
|
||||
qreal angle2;
|
||||
qreal angle2{180}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief kAsm1 coefficient of length first control line. */
|
||||
qreal kAsm1;
|
||||
qreal kAsm1{1}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief kAsm2 coefficient of length second control line. */
|
||||
qreal kAsm2;
|
||||
qreal kAsm2{1}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VFSplinePointData) // NOLINT
|
||||
};
|
||||
|
||||
VFSplinePointData::~VFSplinePointData()
|
||||
{}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline VFSplinePointData::VFSplinePointData(const VPointF &pSpline, qreal kAsm1, qreal angle1, qreal kAsm2,
|
||||
qreal angle2)
|
||||
: pSpline(pSpline),
|
||||
angle1(angle1),
|
||||
angle2(angle2),
|
||||
kAsm1(kAsm1),
|
||||
kAsm2(kAsm2)
|
||||
{
|
||||
if (VFuzzyComparePossibleNulls(angle1, angle2) || not qFuzzyCompare(qAbs(angle1 - angle2), 180))
|
||||
{
|
||||
this->angle2 = this->angle1 + 180;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------VSplinePointData---------------------------------------------------------------
|
||||
|
||||
class VSplinePointData final : public QSharedData
|
||||
{
|
||||
public:
|
||||
VSplinePointData()
|
||||
: pSpline(),
|
||||
angle1(0),
|
||||
angle1F('0'),
|
||||
angle2(180),
|
||||
angle2F("180"),
|
||||
length1(ToPixel(0.01, Unit::Mm)),
|
||||
length1F('0'),
|
||||
length2(ToPixel(0.01, Unit::Mm)),
|
||||
length2F('0')
|
||||
{}
|
||||
|
||||
VSplinePointData() = default;
|
||||
VSplinePointData(VPointF pSpline, qreal angle1, const QString &angle1F, qreal angle2, const QString &angle2F,
|
||||
qreal length1, const QString &length1F, qreal length2, const QString &length2F);
|
||||
|
||||
VSplinePointData(const VSplinePointData &point)
|
||||
: QSharedData(point),
|
||||
pSpline(point.pSpline),
|
||||
angle1(point.angle1),
|
||||
angle1F(point.angle1F),
|
||||
angle2(point.angle2),
|
||||
angle2F(point.angle2F),
|
||||
length1(point.length1),
|
||||
length1F(point.length1F),
|
||||
length2(point.length2),
|
||||
length2F(point.length2F)
|
||||
{
|
||||
if (qFuzzyIsNull(this->length1))
|
||||
{
|
||||
this->length1 = ToPixel(0.01, Unit::Mm);
|
||||
}
|
||||
|
||||
if (qFuzzyIsNull(this->length2))
|
||||
{
|
||||
this->length2 = ToPixel(0.01, Unit::Mm);
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~VSplinePointData();
|
||||
VSplinePointData(const VSplinePointData &point);
|
||||
~VSplinePointData() = default;
|
||||
|
||||
/** @brief pSpline point. */
|
||||
VPointF pSpline;
|
||||
VPointF pSpline{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief angle1 first angle spline. */
|
||||
qreal angle1;
|
||||
QString angle1F;
|
||||
qreal angle1{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString angle1F{'0'}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief angle2 second angle spline. */
|
||||
qreal angle2;
|
||||
QString angle2F;
|
||||
qreal angle2{180}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString angle2F{QStringLiteral("180")}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief length1 length a first control line. */
|
||||
qreal length1;
|
||||
QString length1F;
|
||||
qreal length1{ToPixel(0.01, Unit::Mm)}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString length1F{'0'}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief length2 length a second control line. */
|
||||
qreal length2;
|
||||
QString length2F;
|
||||
qreal length2{ToPixel(0.01, Unit::Mm)}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString length2F{'0'}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VSplinePointData) // NOLINT
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePointData::VSplinePointData(VPointF pSpline, qreal angle1, const QString &angle1F, qreal angle2,
|
||||
const QString &angle2F, qreal length1, const QString &length1F, qreal length2,
|
||||
const QString &length2F)
|
||||
: pSpline(pSpline),
|
||||
angle1(angle1),
|
||||
angle1F(angle1F),
|
||||
angle2(angle2),
|
||||
angle2F(angle2F),
|
||||
length1(length1),
|
||||
length1F(length1F),
|
||||
length2(length2),
|
||||
length2F(length2F)
|
||||
inline VSplinePointData::VSplinePointData(VPointF pSpline, qreal angle1, const QString &angle1F, qreal angle2,
|
||||
const QString &angle2F, qreal length1, const QString &length1F, qreal length2,
|
||||
const QString &length2F)
|
||||
: pSpline(pSpline),
|
||||
angle1(angle1),
|
||||
angle1F(angle1F),
|
||||
angle2(angle2),
|
||||
angle2F(angle2F),
|
||||
length1(length1),
|
||||
length1F(length1F),
|
||||
length2(length2),
|
||||
length2F(length2F)
|
||||
{
|
||||
if (not VFuzzyComparePossibleNulls(qAbs(angle1-angle2), 180))
|
||||
if (not VFuzzyComparePossibleNulls(qAbs(angle1 - angle2), 180))
|
||||
{
|
||||
QLineF line (0, 0, 100, 0);
|
||||
QLineF line(0, 0, 100, 0);
|
||||
|
||||
if (not qmu::QmuTokenParser::IsSingle(angle1F) || qmu::QmuTokenParser::IsSingle(angle2F))
|
||||
{
|
||||
line.setAngle(angle1 + 180);
|
||||
this->angle2 = line.angle();
|
||||
this->angle2F = QString().number(line.angle());
|
||||
this->angle2F = QString::number(line.angle());
|
||||
}
|
||||
else
|
||||
{
|
||||
line.setAngle(angle2 + 180);
|
||||
this->angle1 = line.angle();
|
||||
this->angle1F = QString().number(line.angle());
|
||||
this->angle1F = QString::number(line.angle());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,8 +161,28 @@ VSplinePointData::VSplinePointData(VPointF pSpline, qreal angle1, const QString
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePointData::~VSplinePointData()
|
||||
{}
|
||||
inline VSplinePointData::VSplinePointData(const VSplinePointData &point)
|
||||
: QSharedData(point),
|
||||
pSpline(point.pSpline),
|
||||
angle1(point.angle1),
|
||||
angle1F(point.angle1F),
|
||||
angle2(point.angle2),
|
||||
angle2F(point.angle2F),
|
||||
length1(point.length1),
|
||||
length1F(point.length1F),
|
||||
length2(point.length2),
|
||||
length2F(point.length2F)
|
||||
{
|
||||
if (qFuzzyIsNull(this->length1))
|
||||
{
|
||||
this->length1 = ToPixel(0.01, Unit::Mm);
|
||||
}
|
||||
|
||||
if (qFuzzyIsNull(this->length2))
|
||||
{
|
||||
this->length2 = ToPixel(0.01, Unit::Mm);
|
||||
}
|
||||
}
|
||||
|
||||
QT_WARNING_POP
|
||||
|
||||
|
|
|
@ -931,12 +931,12 @@ auto VAbstractPiece::operator=(const VAbstractPiece &piece) -> VAbstractPiece &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractPiece::VAbstractPiece(VAbstractPiece &&piece) Q_DECL_NOTHROW
|
||||
VAbstractPiece::VAbstractPiece(VAbstractPiece &&piece) noexcept
|
||||
:d (std::move(piece.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VAbstractPiece::operator=(VAbstractPiece &&piece) Q_DECL_NOTHROW -> VAbstractPiece &
|
||||
auto VAbstractPiece::operator=(VAbstractPiece &&piece) noexcept -> VAbstractPiece &
|
||||
{
|
||||
std::swap(d, piece.d);
|
||||
return *this;
|
||||
|
|
|
@ -60,8 +60,8 @@ public:
|
|||
|
||||
auto operator=(const VAbstractPiece &piece) -> VAbstractPiece &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VAbstractPiece(VAbstractPiece &&piece) Q_DECL_NOTHROW;
|
||||
auto operator=(VAbstractPiece &&piece) Q_DECL_NOTHROW -> VAbstractPiece &;
|
||||
VAbstractPiece(VAbstractPiece &&piece) noexcept;
|
||||
auto operator=(VAbstractPiece &&piece) noexcept -> VAbstractPiece &;
|
||||
#endif
|
||||
|
||||
auto GetName() const -> QString;
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
#ifndef VABSTRACTPIECE_P_H
|
||||
#define VABSTRACTPIECE_P_H
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QSharedData>
|
||||
#include <QString>
|
||||
#include <QCoreApplication>
|
||||
#include <QUuid>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
@ -39,11 +39,11 @@
|
|||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
# include "../vmisc/vdatastreamenum.h"
|
||||
#include "../vmisc/vdatastreamenum.h"
|
||||
#endif
|
||||
|
||||
#include "../vmisc/defglobal.h"
|
||||
#include "../ifc/exception/vexception.h"
|
||||
#include "../vmisc/defglobal.h"
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||
|
@ -52,29 +52,28 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VAbstractPieceData : public QSharedData
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(VAbstractPieceData) // NOLINT
|
||||
|
||||
public:
|
||||
VAbstractPieceData() = default;
|
||||
|
||||
VAbstractPieceData(const VAbstractPieceData &piece) = default;
|
||||
|
||||
~VAbstractPieceData() = default;
|
||||
|
||||
friend auto operator<<(QDataStream& dataStream, const VAbstractPieceData& piece) -> QDataStream&;
|
||||
friend auto operator>>(QDataStream& dataStream, VAbstractPieceData& piece) -> QDataStream&;
|
||||
friend auto operator<<(QDataStream &dataStream, const VAbstractPieceData &piece) -> QDataStream &;
|
||||
friend auto operator>>(QDataStream &dataStream, VAbstractPieceData &piece) -> QDataStream &;
|
||||
|
||||
QString m_name{tr("Detail")}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
/** @brief forbidFlipping forbid piece be mirrored in a layout. */
|
||||
bool m_forbidFlipping{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_forceFlipping{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_seamAllowance{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_seamAllowanceBuiltIn{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_hideMainPath{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
qreal m_width{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
qreal m_mx{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
qreal m_my{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
uint m_priority{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
QUuid m_uuid{QUuid::createUuid()}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_onDrawing{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_forbidFlipping{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_forceFlipping{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_seamAllowance{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_seamAllowanceBuiltIn{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_hideMainPath{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
qreal m_width{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
qreal m_mx{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
qreal m_my{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
uint m_priority{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
QUuid m_uuid{QUuid::createUuid()}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool m_onDrawing{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VAbstractPieceData) // NOLINT
|
||||
|
@ -86,9 +85,9 @@ private:
|
|||
QT_WARNING_POP
|
||||
|
||||
// See https://stackoverflow.com/a/46719572/3045403
|
||||
#if __cplusplus < 201703L // C++17
|
||||
constexpr quint32 VAbstractPieceData::streamHeader; // NOLINT(readability-redundant-declaration)
|
||||
constexpr quint16 VAbstractPieceData::classVersion; // NOLINT(readability-redundant-declaration)
|
||||
#if __cplusplus < 201703L // C++17
|
||||
constexpr quint32 VAbstractPieceData::streamHeader; // NOLINT(readability-redundant-declaration)
|
||||
constexpr quint16 VAbstractPieceData::classVersion; // NOLINT(readability-redundant-declaration)
|
||||
#endif
|
||||
|
||||
// Friend functions
|
||||
|
@ -130,8 +129,8 @@ inline auto operator>>(QDataStream &dataStream, VAbstractPieceData &piece) -> QD
|
|||
{
|
||||
QString message = QCoreApplication::tr("VAbstractPieceData prefix mismatch error: actualStreamHeader = 0x%1 "
|
||||
"and streamHeader = 0x%2")
|
||||
.arg(actualStreamHeader, 8, 0x10, QChar('0'))
|
||||
.arg(VAbstractPieceData::streamHeader, 8, 0x10, QChar('0'));
|
||||
.arg(actualStreamHeader, 8, 0x10, QChar('0'))
|
||||
.arg(VAbstractPieceData::streamHeader, 8, 0x10, QChar('0'));
|
||||
throw VException(message);
|
||||
}
|
||||
|
||||
|
@ -142,7 +141,8 @@ inline auto operator>>(QDataStream &dataStream, VAbstractPieceData &piece) -> QD
|
|||
{
|
||||
QString message = QCoreApplication::tr("VAbstractPieceData compatibility error: actualClassVersion = %1 and "
|
||||
"classVersion = %2")
|
||||
.arg(actualClassVersion).arg(VAbstractPieceData::classVersion);
|
||||
.arg(actualClassVersion)
|
||||
.arg(VAbstractPieceData::classVersion);
|
||||
throw VException(message);
|
||||
}
|
||||
|
||||
|
@ -175,4 +175,3 @@ inline auto operator>>(QDataStream &dataStream, VAbstractPieceData &piece) -> QD
|
|||
}
|
||||
|
||||
#endif // VABSTRACTPIECE_P_H
|
||||
|
||||
|
|
|
@ -71,12 +71,12 @@ auto VBestSquare::operator=(const VBestSquare &res) -> VBestSquare &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VBestSquare::VBestSquare(VBestSquare &&res) Q_DECL_NOTHROW
|
||||
VBestSquare::VBestSquare(VBestSquare &&res) noexcept
|
||||
: d(std::move(res.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VBestSquare::operator=(VBestSquare &&res) Q_DECL_NOTHROW->VBestSquare &
|
||||
auto VBestSquare::operator=(VBestSquare &&res) noexcept->VBestSquare &
|
||||
{
|
||||
std::swap(d, res.d);
|
||||
return *this;
|
||||
|
|
|
@ -49,8 +49,8 @@ public:
|
|||
|
||||
auto operator=(const VBestSquare &res) -> VBestSquare &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VBestSquare(VBestSquare &&res) Q_DECL_NOTHROW;
|
||||
auto operator=(VBestSquare &&res) Q_DECL_NOTHROW->VBestSquare &;
|
||||
VBestSquare(VBestSquare &&res) noexcept;
|
||||
auto operator=(VBestSquare &&res) noexcept->VBestSquare &;
|
||||
#endif
|
||||
|
||||
void NewResult(const VBestSquareResData &data);
|
||||
|
|
|
@ -44,40 +44,20 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VBestSquareData : public QSharedData
|
||||
{
|
||||
public:
|
||||
VBestSquareData()
|
||||
{}
|
||||
VBestSquareData() = default;
|
||||
VBestSquareData(const QSizeF &sheetSize, bool saveLength, bool isPortrait);
|
||||
|
||||
VBestSquareData(const QSizeF &sheetSize, bool saveLength, bool isPortrait)
|
||||
: isValid(true),
|
||||
sheetSize(sheetSize),
|
||||
saveLength(saveLength),
|
||||
isPortrait(isPortrait)
|
||||
{
|
||||
data.bestSize = QSizeF(sheetSize.width()+10, sheetSize.height()+10);
|
||||
}
|
||||
VBestSquareData(const VBestSquareData &res) = default;
|
||||
~VBestSquareData() = default;
|
||||
|
||||
VBestSquareData(const VBestSquareData &res)
|
||||
: QSharedData(res),
|
||||
isValid(res.isValid),
|
||||
sheetSize(res.sheetSize),
|
||||
valideResult(res.valideResult),
|
||||
saveLength(res.saveLength),
|
||||
data(res.data),
|
||||
isPortrait(res.isPortrait),
|
||||
terminatedByException(res.terminatedByException),
|
||||
exceptionReason(res.exceptionReason)
|
||||
{}
|
||||
|
||||
~VBestSquareData() {}
|
||||
|
||||
bool isValid{false};
|
||||
QSizeF sheetSize{};
|
||||
bool valideResult{false};
|
||||
bool saveLength{false};
|
||||
VBestSquareResData data{};
|
||||
bool isPortrait{true};
|
||||
bool terminatedByException{false};
|
||||
QString exceptionReason{};
|
||||
bool isValid{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
QSizeF sheetSize{}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool valideResult{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool saveLength{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
VBestSquareResData data{}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool isPortrait{true}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool terminatedByException{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
QString exceptionReason{}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VBestSquareData) // NOLINT
|
||||
|
@ -85,4 +65,14 @@ private:
|
|||
|
||||
QT_WARNING_POP
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline VBestSquareData::VBestSquareData(const QSizeF &sheetSize, bool saveLength, bool isPortrait)
|
||||
: isValid(true),
|
||||
sheetSize(sheetSize),
|
||||
saveLength(saveLength),
|
||||
isPortrait(isPortrait)
|
||||
{
|
||||
data.bestSize = QSizeF(sheetSize.width() + 10, sheetSize.height() + 10);
|
||||
}
|
||||
|
||||
#endif // VBESTSQUARE_P_H
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
#include "vcontour_p.h"
|
||||
#include "vlayoutpiece.h"
|
||||
#include "../vmisc/vmath.h"
|
||||
#include "../vgeometry/vgeometrydef.h"
|
||||
#include "../vgeometry/vgobject.h"
|
||||
|
||||
|
@ -122,12 +121,12 @@ auto VContour::operator=(const VContour &contour) -> VContour &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VContour::VContour(VContour &&contour) Q_DECL_NOTHROW
|
||||
VContour::VContour(VContour &&contour) noexcept
|
||||
:d (std::move(contour.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VContour::operator=(VContour &&contour) Q_DECL_NOTHROW->VContour &
|
||||
auto VContour::operator=(VContour &&contour) noexcept->VContour &
|
||||
{
|
||||
std::swap(d, contour.d);
|
||||
return *this;
|
||||
|
|
|
@ -56,8 +56,8 @@ public:
|
|||
|
||||
auto operator=(const VContour &contour) -> VContour &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VContour(VContour &&contour) Q_DECL_NOTHROW;
|
||||
auto operator=(VContour &&contour) Q_DECL_NOTHROW->VContour &;
|
||||
VContour(VContour &&contour) noexcept;
|
||||
auto operator=(VContour &&contour) noexcept->VContour &;
|
||||
#endif
|
||||
|
||||
void CeateEmptySheetContour();
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
#ifndef VCONTOUR_P_H
|
||||
#define VCONTOUR_P_H
|
||||
|
||||
#include <QSharedData>
|
||||
#include <QPointF>
|
||||
#include <QVector>
|
||||
#include <QRectF>
|
||||
#include <QPainterPath>
|
||||
#include <QPointF>
|
||||
#include <QRectF>
|
||||
#include <QSharedData>
|
||||
#include <QVector>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
|
@ -47,41 +47,25 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VContourData : public QSharedData
|
||||
{
|
||||
public:
|
||||
VContourData()
|
||||
{}
|
||||
|
||||
VContourData(int height, int width, qreal layoutWidth)
|
||||
: paperHeight(height),
|
||||
paperWidth(width),
|
||||
layoutWidth(layoutWidth)
|
||||
{}
|
||||
|
||||
VContourData(const VContourData &contour)
|
||||
: QSharedData(contour),
|
||||
globalContour(contour.globalContour),
|
||||
paperHeight(contour.paperHeight),
|
||||
paperWidth(contour.paperWidth),
|
||||
shift(contour.shift),
|
||||
layoutWidth(contour.layoutWidth),
|
||||
m_emptySheetEdgesCount(contour.m_emptySheetEdgesCount)
|
||||
{}
|
||||
|
||||
~VContourData() {}
|
||||
VContourData() = default;
|
||||
VContourData(int height, int width, qreal layoutWidth);
|
||||
VContourData(const VContourData &contour) = default;
|
||||
~VContourData() = default;
|
||||
|
||||
/** @brief globalContour list of global points contour. */
|
||||
QVector<QPointF> globalContour{};
|
||||
QVector<QPointF> globalContour{}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief paperHeight height of paper in pixels*/
|
||||
int paperHeight{0};
|
||||
int paperHeight{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief paperWidth width of paper in pixels*/
|
||||
int paperWidth{0};
|
||||
int paperWidth{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
qreal shift{0};
|
||||
qreal shift{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
qreal layoutWidth{0};
|
||||
qreal layoutWidth{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
vsizetype m_emptySheetEdgesCount{0};
|
||||
vsizetype m_emptySheetEdgesCount{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VContourData) // NOLINT
|
||||
|
@ -90,4 +74,12 @@ private:
|
|||
// cppcheck-suppress unknownMacro
|
||||
QT_WARNING_POP
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline VContourData::VContourData(int height, int width, qreal layoutWidth)
|
||||
: paperHeight(height),
|
||||
paperWidth(width),
|
||||
layoutWidth(layoutWidth)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // VCONTOUR_P_H
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VLAYOUTGENERATOR_H
|
||||
#define VLAYOUTGENERATOR_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QList>
|
||||
#include <QMetaObject>
|
||||
#include <QObject>
|
||||
|
|
|
@ -47,33 +47,36 @@
|
|||
#include <QMutex>
|
||||
#endif
|
||||
|
||||
#include "vbestsquare.h"
|
||||
#include "vcontour.h"
|
||||
#include "vlayoutpiece.h"
|
||||
#include "vlayoutpaper_p.h"
|
||||
#include "vposition.h"
|
||||
#include "../ifc/exception/vexceptionterminatedposition.h"
|
||||
#include "../vmisc/compatibility.h"
|
||||
#include "vbestsquare.h"
|
||||
#include "vcontour.h"
|
||||
#include "vlayoutpaper_p.h"
|
||||
#include "vlayoutpiece.h"
|
||||
#include "vposition.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VLayoutPaper::VLayoutPaper()
|
||||
:d(new VLayoutPaperData)
|
||||
{}
|
||||
: d(new VLayoutPaperData)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VLayoutPaper::VLayoutPaper(int height, int width, qreal layoutWidth)
|
||||
:d(new VLayoutPaperData(height, width, layoutWidth))
|
||||
{}
|
||||
: d(new VLayoutPaperData(height, width, layoutWidth))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VLayoutPaper::VLayoutPaper(const VLayoutPaper &paper)
|
||||
:d (paper.d)
|
||||
{}
|
||||
: d(paper.d)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VLayoutPaper::operator=(const VLayoutPaper &paper) -> VLayoutPaper &
|
||||
{
|
||||
if ( &paper == this )
|
||||
if (&paper == this)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
@ -83,12 +86,13 @@ auto VLayoutPaper::operator=(const VLayoutPaper &paper) -> VLayoutPaper &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VLayoutPaper::VLayoutPaper(VLayoutPaper &&paper) Q_DECL_NOTHROW
|
||||
:d (std::move(paper.d))
|
||||
{}
|
||||
VLayoutPaper::VLayoutPaper(VLayoutPaper &&paper) noexcept
|
||||
: d(std::move(paper.d))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VLayoutPaper::operator=(VLayoutPaper &&paper) Q_DECL_NOTHROW->VLayoutPaper &
|
||||
auto VLayoutPaper::operator=(VLayoutPaper &&paper) noexcept -> VLayoutPaper &
|
||||
{
|
||||
std::swap(d, paper.d);
|
||||
return *this;
|
||||
|
@ -97,7 +101,8 @@ auto VLayoutPaper::operator=(VLayoutPaper &&paper) Q_DECL_NOTHROW->VLayoutPaper
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VLayoutPaper::~VLayoutPaper()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VLayoutPaper::GetHeight() const -> int
|
||||
|
@ -229,7 +234,7 @@ auto VLayoutPaper::ArrangeDetail(const VLayoutPiece &detail, std::atomic_bool &s
|
|||
{
|
||||
if (detail.LayoutEdgesCount() < 3 || detail.DetailEdgesCount() < 3)
|
||||
{
|
||||
return false;//Not enough edges
|
||||
return false; // Not enough edges
|
||||
}
|
||||
|
||||
if ((detail.IsForceFlipping() || detail.IsForbidFlipping()) && not d->globalRotate)
|
||||
|
@ -285,7 +290,7 @@ auto VLayoutPaper::SaveResult(const VBestSquare &bestResult, const VLayoutPiece
|
|||
if (bestResult.HasValidResult())
|
||||
{
|
||||
VLayoutPiece workDetail = detail;
|
||||
workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix
|
||||
workDetail.SetMatrix(bestResult.Matrix()); // Don't forget set matrix
|
||||
workDetail.SetMirror(bestResult.Mirror());
|
||||
|
||||
if (d->saveLength)
|
||||
|
@ -293,9 +298,8 @@ auto VLayoutPaper::SaveResult(const VBestSquare &bestResult, const VLayoutPiece
|
|||
d->globalContour.CeateEmptySheetContour();
|
||||
}
|
||||
|
||||
const QVector<QPointF> newGContour = d->globalContour.UniteWithContour(workDetail, bestResult.GContourEdge(),
|
||||
bestResult.DetailEdge(),
|
||||
bestResult.Type());
|
||||
const QVector<QPointF> newGContour = d->globalContour.UniteWithContour(
|
||||
workDetail, bestResult.GContourEdge(), bestResult.DetailEdge(), bestResult.Type());
|
||||
if (newGContour.isEmpty())
|
||||
{
|
||||
return false;
|
||||
|
@ -310,9 +314,9 @@ auto VLayoutPaper::SaveResult(const VBestSquare &bestResult, const VLayoutPiece
|
|||
d->positionsCache.append(positionChache);
|
||||
|
||||
#ifdef LAYOUT_DEBUG
|
||||
# ifdef SHOW_BEST
|
||||
#ifdef SHOW_BEST
|
||||
VPosition::DumpFrame(d->globalContour, workDetail, mutex, d->details);
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else if (bestResult.IsTerminatedByException())
|
||||
|
@ -390,23 +394,23 @@ auto VLayoutPaper::GetGlobalContour() const -> QGraphicsPathItem *
|
|||
const qreal radius = 1;
|
||||
for (auto point : points)
|
||||
{
|
||||
path.addEllipse(point.x()-radius, point.y()-radius, radius*2, radius*2);
|
||||
path.addEllipse(point.x() - radius, point.y() - radius, radius * 2, radius * 2);
|
||||
}
|
||||
|
||||
for (int i=0; i < points.size()-1; ++i)
|
||||
for (int i = 0; i < points.size() - 1; ++i)
|
||||
{
|
||||
QLineF line(points.at(i), points.at(i+1));
|
||||
line.setLength(line.length()/2);
|
||||
QLineF line(points.at(i), points.at(i + 1));
|
||||
line.setLength(line.length() / 2);
|
||||
|
||||
path.moveTo(line.p2());
|
||||
QLineF side1(line.p2(), line.p1());
|
||||
side1.setAngle(side1.angle()+35);
|
||||
side1.setAngle(side1.angle() + 35);
|
||||
side1.setLength(3);
|
||||
path.lineTo(side1.p2());
|
||||
|
||||
path.moveTo(line.p2());
|
||||
QLineF side2(line.p2(), line.p1());
|
||||
side2.setAngle(side2.angle()-35);
|
||||
side2.setAngle(side2.angle() - 35);
|
||||
side2.setLength(3);
|
||||
path.lineTo(side2.p2());
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VLAYOUTPAPER_H
|
||||
#define VLAYOUTPAPER_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QSharedDataPointer>
|
||||
#include <QTypeInfo>
|
||||
#include <QtGlobal>
|
||||
|
@ -58,8 +58,8 @@ public:
|
|||
|
||||
auto operator=(const VLayoutPaper &paper) -> VLayoutPaper &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VLayoutPaper(VLayoutPaper &&paper) Q_DECL_NOTHROW;
|
||||
auto operator=(VLayoutPaper &&paper) Q_DECL_NOTHROW->VLayoutPaper &;
|
||||
VLayoutPaper(VLayoutPaper &&paper) noexcept;
|
||||
auto operator=(VLayoutPaper &&paper) noexcept->VLayoutPaper &;
|
||||
#endif
|
||||
|
||||
auto GetHeight() const -> int;
|
||||
|
|
|
@ -29,12 +29,12 @@
|
|||
#ifndef VLAYOUTPAPER_P_H
|
||||
#define VLAYOUTPAPER_P_H
|
||||
|
||||
#include <QPointF>
|
||||
#include <QSharedData>
|
||||
#include <QVector>
|
||||
#include <QPointF>
|
||||
|
||||
#include "vlayoutpiece.h"
|
||||
#include "vcontour.h"
|
||||
#include "vlayoutpiece.h"
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||
|
@ -43,49 +43,28 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VLayoutPaperData : public QSharedData
|
||||
{
|
||||
public:
|
||||
VLayoutPaperData()
|
||||
{}
|
||||
|
||||
VLayoutPaperData(int height, int width, qreal layoutWidth)
|
||||
: globalContour(VContour(height, width, layoutWidth)),
|
||||
layoutWidth(layoutWidth)
|
||||
{}
|
||||
|
||||
VLayoutPaperData(const VLayoutPaperData &paper)
|
||||
: QSharedData(paper),
|
||||
details(paper.details),
|
||||
positionsCache(paper.positionsCache),
|
||||
globalContour(paper.globalContour),
|
||||
paperIndex(paper.paperIndex),
|
||||
layoutWidth(paper.layoutWidth),
|
||||
globalRotate(paper.globalRotate),
|
||||
localRotate(paper.localRotate),
|
||||
globalRotationNumber(paper.globalRotationNumber),
|
||||
localRotationNumber(paper.localRotationNumber),
|
||||
saveLength(paper.saveLength),
|
||||
followGrainline(paper.followGrainline),
|
||||
originPaperOrientation(paper.originPaperOrientation)
|
||||
{}
|
||||
|
||||
~VLayoutPaperData() {}
|
||||
VLayoutPaperData() = default;
|
||||
VLayoutPaperData(int height, int width, qreal layoutWidth);
|
||||
VLayoutPaperData(const VLayoutPaperData &paper) = default;
|
||||
~VLayoutPaperData() = default;
|
||||
|
||||
/** @brief details list of arranged details. */
|
||||
QVector<VLayoutPiece> details{};
|
||||
QVector<VLayoutPiece> details{}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
QVector<VCachedPositions> positionsCache{};
|
||||
QVector<VCachedPositions> positionsCache{}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief globalContour list of global points contour. */
|
||||
VContour globalContour{};
|
||||
VContour globalContour{}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
quint32 paperIndex{0};
|
||||
qreal layoutWidth{0};
|
||||
bool globalRotate{true};
|
||||
bool localRotate{true};
|
||||
int globalRotationNumber{2};
|
||||
int localRotationNumber{2};
|
||||
bool saveLength{false};
|
||||
bool followGrainline{false};
|
||||
bool originPaperOrientation{true};
|
||||
quint32 paperIndex{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
qreal layoutWidth{0}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool globalRotate{true}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool localRotate{true}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
int globalRotationNumber{2}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
int localRotationNumber{2}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool saveLength{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool followGrainline{false}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
bool originPaperOrientation{true}; // NOLINT (misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VLayoutPaperData) // NOLINT
|
||||
|
@ -93,4 +72,11 @@ private:
|
|||
|
||||
QT_WARNING_POP
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline VLayoutPaperData::VLayoutPaperData(int height, int width, qreal layoutWidth)
|
||||
: globalContour(VContour(height, width, layoutWidth)),
|
||||
layoutWidth(layoutWidth)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // VLAYOUTPAPER_P_H
|
||||
|
|
|
@ -615,13 +615,13 @@ auto VLayoutPiece::operator=(const VLayoutPiece &detail) -> VLayoutPiece &
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VLayoutPiece::VLayoutPiece(VLayoutPiece &&detail) Q_DECL_NOTHROW : VAbstractPiece(std::move(detail)),
|
||||
VLayoutPiece::VLayoutPiece(VLayoutPiece &&detail) noexcept : VAbstractPiece(std::move(detail)),
|
||||
d(std::move(detail.d))
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VLayoutPiece::operator=(VLayoutPiece &&detail) Q_DECL_NOTHROW
|
||||
auto VLayoutPiece::operator=(VLayoutPiece &&detail) noexcept
|
||||
->VLayoutPiece &
|
||||
{
|
||||
VAbstractPiece::operator=(detail);
|
||||
|
|
|
@ -90,8 +90,8 @@ public:
|
|||
|
||||
auto operator=(const VLayoutPiece &detail) -> VLayoutPiece &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VLayoutPiece(VLayoutPiece &&detail) Q_DECL_NOTHROW;
|
||||
auto operator=(VLayoutPiece &&detail) Q_DECL_NOTHROW
|
||||
VLayoutPiece(VLayoutPiece &&detail) noexcept;
|
||||
auto operator=(VLayoutPiece &&detail) noexcept
|
||||
->VLayoutPiece &;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -29,10 +29,10 @@
|
|||
#ifndef VLAYOUTDETAIL_P_H
|
||||
#define VLAYOUTDETAIL_P_H
|
||||
|
||||
#include <QSharedData>
|
||||
#include <QPointF>
|
||||
#include <QVector>
|
||||
#include <QSharedData>
|
||||
#include <QTransform>
|
||||
#include <QVector>
|
||||
|
||||
#include "../vpatterndb/floatItemData/floatitemdef.h"
|
||||
#include "../vwidgets/vpiecegrainline.h"
|
||||
|
@ -43,15 +43,15 @@
|
|||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
# include "../vmisc/vdatastreamenum.h"
|
||||
#include "../vmisc/vdatastreamenum.h"
|
||||
#endif
|
||||
|
||||
#include "vlayoutpiecepath.h"
|
||||
#include "../vgeometry/vgeometrydef.h"
|
||||
#include "vtextmanager.h"
|
||||
#include "../ifc/exception/vexception.h"
|
||||
#include "vlayoutpoint.h"
|
||||
#include "../vgeometry/vgeometrydef.h"
|
||||
#include "../vgeometry/vlayoutplacelabel.h"
|
||||
#include "vlayoutpiecepath.h"
|
||||
#include "vlayoutpoint.h"
|
||||
#include "vtextmanager.h"
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||
|
@ -60,50 +60,49 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VLayoutPieceData : public QSharedData
|
||||
{
|
||||
public:
|
||||
VLayoutPieceData(){} // NOLINT(modernize-use-equals-default)
|
||||
|
||||
VLayoutPieceData() = default;
|
||||
VLayoutPieceData(const VLayoutPieceData &detail) = default;
|
||||
~VLayoutPieceData() = default;
|
||||
|
||||
friend auto operator<<(QDataStream& dataStream, const VLayoutPieceData& piece) -> QDataStream&;
|
||||
friend auto operator>>(QDataStream& dataStream, VLayoutPieceData& piece) -> QDataStream&;
|
||||
friend auto operator<<(QDataStream &dataStream, const VLayoutPieceData &piece) -> QDataStream &;
|
||||
friend auto operator>>(QDataStream &dataStream, VLayoutPieceData &piece) -> QDataStream &;
|
||||
|
||||
/** @brief contour list of contour points. */
|
||||
QVector<VLayoutPoint> m_contour{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QVector<VLayoutPoint> m_contour{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief seamAllowance list of seam allowance points. */
|
||||
QVector<VLayoutPoint> m_seamAllowance{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QVector<VLayoutPoint> m_seamAllowance{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief layoutAllowance list of layout allowance points. */
|
||||
QVector<QPointF> m_layoutAllowance{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QVector<QPointF> m_layoutAllowance{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief passmarks list of passmakrs. */
|
||||
QVector<VLayoutPassmark> m_passmarks{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QVector<VLayoutPassmark> m_passmarks{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief m_internalPaths list of internal paths. */
|
||||
QVector<VLayoutPiecePath> m_internalPaths{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief matrix transformation matrix*/
|
||||
QTransform m_matrix{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QTransform m_matrix{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief layoutWidth value layout allowance width in pixels. */
|
||||
qreal m_layoutWidth{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
qreal m_layoutWidth{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
bool m_mirror{false}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
bool m_mirror{false}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief detailLabel detail label rectangle */
|
||||
QVector<QPointF> m_detailLabel{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QVector<QPointF> m_detailLabel{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief patternInfo pattern info rectangle */
|
||||
QVector<QPointF> m_patternInfo{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QVector<QPointF> m_patternInfo{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
VPieceGrainline m_grainline{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
VPieceGrainline m_grainline{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief m_tmDetail text manager for laying out detail info */
|
||||
VTextManager m_tmDetail{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
VTextManager m_tmDetail{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief m_tmPattern text manager for laying out pattern info */
|
||||
VTextManager m_tmPattern{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
VTextManager m_tmPattern{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief m_placeLabels list of place labels. */
|
||||
QVector<VLayoutPlaceLabel> m_placeLabels{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
@ -130,9 +129,9 @@ private:
|
|||
QT_WARNING_POP
|
||||
|
||||
// See https://stackoverflow.com/a/46719572/3045403
|
||||
#if __cplusplus < 201703L // C++17
|
||||
constexpr quint32 VLayoutPieceData::streamHeader; // NOLINT(readability-redundant-declaration)
|
||||
constexpr quint16 VLayoutPieceData::classVersion; // NOLINT(readability-redundant-declaration)
|
||||
#if __cplusplus < 201703L // C++17
|
||||
constexpr quint32 VLayoutPieceData::streamHeader; // NOLINT(readability-redundant-declaration)
|
||||
constexpr quint16 VLayoutPieceData::classVersion; // NOLINT(readability-redundant-declaration)
|
||||
#endif
|
||||
|
||||
// Friend functions
|
||||
|
@ -175,8 +174,8 @@ inline auto operator>>(QDataStream &dataStream, VLayoutPieceData &piece) -> QDat
|
|||
{
|
||||
QString message = QCoreApplication::tr("VLayoutPieceData prefix mismatch error: actualStreamHeader = 0x%1 and "
|
||||
"streamHeader = 0x%2")
|
||||
.arg(actualStreamHeader, 8, 0x10, QChar('0'))
|
||||
.arg(VLayoutPieceData::streamHeader, 8, 0x10, QChar('0'));
|
||||
.arg(actualStreamHeader, 8, 0x10, QChar('0'))
|
||||
.arg(VLayoutPieceData::streamHeader, 8, 0x10, QChar('0'));
|
||||
throw VException(message);
|
||||
}
|
||||
|
||||
|
@ -187,7 +186,8 @@ inline auto operator>>(QDataStream &dataStream, VLayoutPieceData &piece) -> QDat
|
|||
{
|
||||
QString message = QCoreApplication::tr("VLayoutPieceData compatibility error: actualClassVersion = %1 and "
|
||||
"classVersion = %2")
|
||||
.arg(actualClassVersion).arg(VLayoutPieceData::classVersion);
|
||||
.arg(actualClassVersion)
|
||||
.arg(VLayoutPieceData::classVersion);
|
||||
throw VException(message);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,12 +77,12 @@ auto VLayoutPiecePath::operator=(const VLayoutPiecePath &path) -> VLayoutPiecePa
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VLayoutPiecePath::VLayoutPiecePath(VLayoutPiecePath &&path) Q_DECL_NOTHROW
|
||||
VLayoutPiecePath::VLayoutPiecePath(VLayoutPiecePath &&path) noexcept
|
||||
: d(std::move(path.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VLayoutPiecePath::operator=(VLayoutPiecePath &&path) Q_DECL_NOTHROW->VLayoutPiecePath &
|
||||
auto VLayoutPiecePath::operator=(VLayoutPiecePath &&path) noexcept->VLayoutPiecePath &
|
||||
{
|
||||
std::swap(d, path.d);
|
||||
return *this;
|
||||
|
|
|
@ -29,17 +29,17 @@
|
|||
#ifndef VLAYOUTPIECEPATH_P_H
|
||||
#define VLAYOUTPIECEPATH_P_H
|
||||
|
||||
#include <QSharedData>
|
||||
#include <QPointF>
|
||||
#include <QVector>
|
||||
#include <QDataStream>
|
||||
#include <QPointF>
|
||||
#include <QSharedData>
|
||||
#include <QVector>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
# include "../vmisc/vdatastreamenum.h"
|
||||
#include "../vmisc/vdatastreamenum.h"
|
||||
#endif
|
||||
|
||||
#include "../ifc/exception/vexception.h"
|
||||
|
@ -52,12 +52,8 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
|
|||
class VLayoutPiecePathData : public QSharedData
|
||||
{
|
||||
public:
|
||||
VLayoutPiecePathData(){} // NOLINT(modernize-use-equals-default)
|
||||
|
||||
explicit VLayoutPiecePathData(const QVector<VLayoutPoint> &points)
|
||||
: m_points(points)
|
||||
{}
|
||||
|
||||
VLayoutPiecePathData() = default;
|
||||
explicit VLayoutPiecePathData(const QVector<VLayoutPoint> &points);
|
||||
VLayoutPiecePathData(const VLayoutPiecePathData &path) = default;
|
||||
~VLayoutPiecePathData() = default;
|
||||
|
||||
|
@ -65,12 +61,12 @@ public:
|
|||
friend auto operator>>(QDataStream &dataStream, VLayoutPiecePathData &path) -> QDataStream &;
|
||||
|
||||
/** @brief m_points list of path points. */
|
||||
QVector<VLayoutPoint> m_points{};
|
||||
QVector<VLayoutPoint> m_points{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
/** @brief m_penStyle path pen style. */
|
||||
Qt::PenStyle m_penStyle{Qt::SolidLine};
|
||||
Qt::PenStyle m_penStyle{Qt::SolidLine}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
bool m_cut{false};
|
||||
bool m_cut{false}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
Q_DISABLE_ASSIGN_MOVE(VLayoutPiecePathData) // NOLINT
|
||||
|
@ -82,15 +78,21 @@ private:
|
|||
QT_WARNING_POP
|
||||
|
||||
// See https://stackoverflow.com/a/46719572/3045403
|
||||
#if __cplusplus < 201703L // C++17
|
||||
constexpr quint32 VLayoutPiecePathData::streamHeader; // NOLINT(readability-redundant-declaration)
|
||||
constexpr quint16 VLayoutPiecePathData::classVersion; // NOLINT(readability-redundant-declaration)
|
||||
#if __cplusplus < 201703L // C++17
|
||||
constexpr quint32 VLayoutPiecePathData::streamHeader; // NOLINT(readability-redundant-declaration)
|
||||
constexpr quint16 VLayoutPiecePathData::classVersion; // NOLINT(readability-redundant-declaration)
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline VLayoutPiecePathData::VLayoutPiecePathData(const QVector<VLayoutPoint> &points)
|
||||
: m_points(points)
|
||||
{
|
||||
}
|
||||
|
||||
// Friend functions
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto operator<<(QDataStream &dataStream, const VLayoutPiecePathData &path) -> QDataStream &
|
||||
{
|
||||
auto operator<<(QDataStream &dataStream, const VLayoutPiecePathData &path) -> QDataStream &
|
||||
{
|
||||
dataStream << VLayoutPiecePathData::streamHeader << VLayoutPiecePathData::classVersion;
|
||||
|
||||
// Added in classVersion = 1
|
||||
|
@ -113,8 +115,8 @@ auto operator>>(QDataStream &dataStream, VLayoutPiecePathData &path) -> QDataStr
|
|||
{
|
||||
QString message = QCoreApplication::tr("VLayoutPiecePathData prefix mismatch error: actualStreamHeader = 0x%1 "
|
||||
"and streamHeader = 0x%2")
|
||||
.arg(actualStreamHeader, 8, 0x10, QChar('0'))
|
||||
.arg(VLayoutPiecePathData::streamHeader, 8, 0x10, QChar('0'));
|
||||
.arg(actualStreamHeader, 8, 0x10, QChar('0'))
|
||||
.arg(VLayoutPiecePathData::streamHeader, 8, 0x10, QChar('0'));
|
||||
throw VException(message);
|
||||
}
|
||||
|
||||
|
@ -125,7 +127,8 @@ auto operator>>(QDataStream &dataStream, VLayoutPiecePathData &path) -> QDataStr
|
|||
{
|
||||
QString message = QCoreApplication::tr("VLayoutPiecePathData compatibility error: actualClassVersion = %1 and "
|
||||
"classVersion = %2")
|
||||
.arg(actualClassVersion).arg(VLayoutPiecePathData::classVersion);
|
||||
.arg(actualClassVersion)
|
||||
.arg(VLayoutPiecePathData::classVersion);
|
||||
throw VException(message);
|
||||
}
|
||||
|
||||
|
@ -142,13 +145,12 @@ auto operator>>(QDataStream &dataStream, VLayoutPiecePathData &path) -> QDataStr
|
|||
dataStream >> path.m_penStyle;
|
||||
dataStream >> path.m_cut;
|
||||
|
||||
// if (actualClassVersion >= 2)
|
||||
// {
|
||||
// if (actualClassVersion >= 2)
|
||||
// {
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
return dataStream;
|
||||
}
|
||||
|
||||
#endif // VLAYOUTPIECEPATH_P_H
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VPOSITION_H
|
||||
#define VPOSITION_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QRunnable>
|
||||
#include <QVector>
|
||||
#include <QtGlobal>
|
||||
|
|
|
@ -44,11 +44,11 @@ template <typename... Args>
|
|||
struct QNonConstOverload
|
||||
{
|
||||
template <typename R, typename T>
|
||||
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...)) const Q_DECL_NOTHROW -> decltype(ptr)
|
||||
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...)) const noexcept -> decltype(ptr)
|
||||
{ return ptr; }
|
||||
|
||||
template <typename R, typename T>
|
||||
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
|
||||
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...)) noexcept -> decltype(ptr)
|
||||
{ return ptr; }
|
||||
};
|
||||
|
||||
|
@ -56,11 +56,11 @@ template <typename... Args>
|
|||
struct QConstOverload
|
||||
{
|
||||
template <typename R, typename T>
|
||||
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const Q_DECL_NOTHROW -> decltype(ptr)
|
||||
Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const noexcept -> decltype(ptr)
|
||||
{ return ptr; }
|
||||
|
||||
template <typename R, typename T>
|
||||
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...) const) Q_DECL_NOTHROW -> decltype(ptr)
|
||||
static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...) const) noexcept -> decltype(ptr)
|
||||
{ return ptr; }
|
||||
};
|
||||
|
||||
|
@ -73,11 +73,11 @@ struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...>
|
|||
using QNonConstOverload<Args...>::operator();
|
||||
|
||||
template <typename R>
|
||||
Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args...)) const Q_DECL_NOTHROW -> decltype(ptr)
|
||||
Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args...)) const noexcept -> decltype(ptr)
|
||||
{ return ptr; }
|
||||
|
||||
template <typename R>
|
||||
static Q_DECL_CONSTEXPR auto of(R (*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
|
||||
static Q_DECL_CONSTEXPR auto of(R (*ptr)(Args...)) noexcept -> decltype(ptr)
|
||||
{ return ptr; }
|
||||
};
|
||||
|
||||
|
|
|
@ -29,13 +29,11 @@
|
|||
#ifndef CUSTOMEVENTS_H
|
||||
#define CUSTOMEVENTS_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QEvent>
|
||||
#include <QString>
|
||||
|
||||
#include "typedef.h"
|
||||
|
||||
enum CustomEventType {
|
||||
enum CustomEventType
|
||||
{
|
||||
UndoEventType = 1,
|
||||
LiteParseEventType = 2,
|
||||
FitBestCurrentEventType = 3,
|
||||
|
@ -50,13 +48,15 @@ const QEvent::Type UNDO_EVENT =
|
|||
class UndoEvent : public QEvent
|
||||
{
|
||||
public:
|
||||
UndoEvent()
|
||||
: QEvent(UNDO_EVENT)
|
||||
{}
|
||||
|
||||
virtual ~UndoEvent() =default;
|
||||
UndoEvent();
|
||||
~UndoEvent() override = default;
|
||||
};
|
||||
|
||||
inline UndoEvent::UndoEvent()
|
||||
: QEvent(UNDO_EVENT)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const QEvent::Type LITE_PARSE_EVENT =
|
||||
static_cast<QEvent::Type>(QEvent::User + static_cast<int>(CustomEventType::LiteParseEventType));
|
||||
|
@ -64,13 +64,15 @@ const QEvent::Type LITE_PARSE_EVENT =
|
|||
class LiteParseEvent : public QEvent
|
||||
{
|
||||
public:
|
||||
LiteParseEvent()
|
||||
: QEvent(LITE_PARSE_EVENT)
|
||||
{}
|
||||
|
||||
virtual ~LiteParseEvent() =default;
|
||||
LiteParseEvent();
|
||||
~LiteParseEvent() override = default;
|
||||
};
|
||||
|
||||
inline LiteParseEvent::LiteParseEvent()
|
||||
: QEvent(LITE_PARSE_EVENT)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const QEvent::Type FIT_BEST_CURRENT_EVENT =
|
||||
static_cast<QEvent::Type>(QEvent::User + static_cast<int>(CustomEventType::FitBestCurrentEventType));
|
||||
|
@ -78,13 +80,15 @@ const QEvent::Type FIT_BEST_CURRENT_EVENT =
|
|||
class FitBestCurrentEvent : public QEvent
|
||||
{
|
||||
public:
|
||||
FitBestCurrentEvent()
|
||||
: QEvent(FIT_BEST_CURRENT_EVENT)
|
||||
{}
|
||||
|
||||
virtual ~FitBestCurrentEvent() =default;
|
||||
FitBestCurrentEvent();
|
||||
~FitBestCurrentEvent() override = default;
|
||||
};
|
||||
|
||||
inline FitBestCurrentEvent::FitBestCurrentEvent()
|
||||
: QEvent(FIT_BEST_CURRENT_EVENT)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const QEvent::Type WARNING_MESSAGE_EVENT =
|
||||
static_cast<QEvent::Type>(QEvent::User + static_cast<int>(CustomEventType::WarningMessageEventType));
|
||||
|
@ -92,13 +96,8 @@ const QEvent::Type WARNING_MESSAGE_EVENT =
|
|||
class WarningMessageEvent : public QEvent
|
||||
{
|
||||
public:
|
||||
WarningMessageEvent(const QString &message, QtMsgType severity)
|
||||
: QEvent(WARNING_MESSAGE_EVENT),
|
||||
m_message(message),
|
||||
m_severity(severity)
|
||||
{}
|
||||
|
||||
virtual ~WarningMessageEvent() =default;
|
||||
WarningMessageEvent(const QString &message, QtMsgType severity);
|
||||
~WarningMessageEvent() override = default;
|
||||
|
||||
auto Message() const -> QString;
|
||||
|
||||
|
@ -109,6 +108,13 @@ private:
|
|||
QtMsgType m_severity;
|
||||
};
|
||||
|
||||
inline WarningMessageEvent::WarningMessageEvent(const QString &message, QtMsgType severity)
|
||||
: QEvent(WARNING_MESSAGE_EVENT),
|
||||
m_message(message),
|
||||
m_severity(severity)
|
||||
{
|
||||
}
|
||||
|
||||
inline auto WarningMessageEvent::Message() const -> QString
|
||||
{
|
||||
return m_message;
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include <QStringList>
|
||||
#include <Qt>
|
||||
#include <csignal>
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include "debugbreak.h"
|
||||
#include "defglobal.h"
|
||||
|
|
|
@ -35,7 +35,7 @@ constexpr qreal PrintDPI = 96.0;
|
|||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
// this adds const to non-const objects (like std::as_const)
|
||||
template <typename T>
|
||||
Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
|
||||
Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) noexcept { return t; }
|
||||
// prevent rvalue arguments:
|
||||
template <typename T>
|
||||
void qAsConst(const T &&) Q_DECL_EQ_DELETE;
|
||||
|
|
|
@ -37,54 +37,54 @@
|
|||
* Warning/diagnostic handling
|
||||
*/
|
||||
|
||||
#define QT_DO_PRAGMA(text) _Pragma(#text)
|
||||
#define QT_DO_PRAGMA(text) _Pragma(#text)
|
||||
#if defined(Q_CC_INTEL) && defined(Q_CC_MSVC)
|
||||
/* icl.exe: Intel compiler on Windows */
|
||||
# undef QT_DO_PRAGMA /* not needed */
|
||||
# define QT_WARNING_PUSH __pragma(warning(push))
|
||||
# define QT_WARNING_POP __pragma(warning(pop))
|
||||
# define QT_WARNING_DISABLE_MSVC(number)
|
||||
# define QT_WARNING_DISABLE_INTEL(number) __pragma(warning(disable: number))
|
||||
# define QT_WARNING_DISABLE_CLANG(text)
|
||||
# define QT_WARNING_DISABLE_GCC(text)
|
||||
#undef QT_DO_PRAGMA /* not needed */
|
||||
#define QT_WARNING_PUSH __pragma(warning(push))
|
||||
#define QT_WARNING_POP __pragma(warning(pop))
|
||||
#define QT_WARNING_DISABLE_MSVC(number)
|
||||
#define QT_WARNING_DISABLE_INTEL(number) __pragma(warning(disable : number))
|
||||
#define QT_WARNING_DISABLE_CLANG(text)
|
||||
#define QT_WARNING_DISABLE_GCC(text)
|
||||
#elif defined(Q_CC_INTEL)
|
||||
/* icc: Intel compiler on Linux or OS X */
|
||||
# define QT_WARNING_PUSH QT_DO_PRAGMA(warning(push))
|
||||
# define QT_WARNING_POP QT_DO_PRAGMA(warning(pop))
|
||||
# define QT_WARNING_DISABLE_INTEL(number) QT_DO_PRAGMA(warning(disable: number))
|
||||
# define QT_WARNING_DISABLE_MSVC(number)
|
||||
# define QT_WARNING_DISABLE_CLANG(text)
|
||||
# define QT_WARNING_DISABLE_GCC(text)
|
||||
#define QT_WARNING_PUSH QT_DO_PRAGMA(warning(push))
|
||||
#define QT_WARNING_POP QT_DO_PRAGMA(warning(pop))
|
||||
#define QT_WARNING_DISABLE_INTEL(number) QT_DO_PRAGMA(warning(disable : number))
|
||||
#define QT_WARNING_DISABLE_MSVC(number)
|
||||
#define QT_WARNING_DISABLE_CLANG(text)
|
||||
#define QT_WARNING_DISABLE_GCC(text)
|
||||
#elif defined(Q_CC_MSVC) && _MSC_VER >= 1500
|
||||
# undef QT_DO_PRAGMA /* not needed */
|
||||
# define QT_WARNING_PUSH __pragma(warning(push))
|
||||
# define QT_WARNING_POP __pragma(warning(pop))
|
||||
# define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable: number))
|
||||
# define QT_WARNING_DISABLE_INTEL(number)
|
||||
# define QT_WARNING_DISABLE_CLANG(text)
|
||||
# define QT_WARNING_DISABLE_GCC(text)
|
||||
#undef QT_DO_PRAGMA /* not needed */
|
||||
#define QT_WARNING_PUSH __pragma(warning(push))
|
||||
#define QT_WARNING_POP __pragma(warning(pop))
|
||||
#define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable : number))
|
||||
#define QT_WARNING_DISABLE_INTEL(number)
|
||||
#define QT_WARNING_DISABLE_CLANG(text)
|
||||
#define QT_WARNING_DISABLE_GCC(text)
|
||||
#elif defined(Q_CC_CLANG)
|
||||
# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
|
||||
# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
|
||||
# define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
|
||||
# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) // GCC directives work in Clang too
|
||||
# define QT_WARNING_DISABLE_INTEL(number)
|
||||
# define QT_WARNING_DISABLE_MSVC(number)
|
||||
#define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
|
||||
#define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
|
||||
#define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
|
||||
#define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) // GCC directives work in Clang too
|
||||
#define QT_WARNING_DISABLE_INTEL(number)
|
||||
#define QT_WARNING_DISABLE_MSVC(number)
|
||||
#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
|
||||
# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
|
||||
# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
|
||||
# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
|
||||
# define QT_WARNING_DISABLE_CLANG(text)
|
||||
# define QT_WARNING_DISABLE_INTEL(number)
|
||||
# define QT_WARNING_DISABLE_MSVC(number)
|
||||
#else // All other compilers, GCC < 4.6 and MSVC < 2008
|
||||
# define QT_WARNING_DISABLE_GCC(text)
|
||||
# define QT_WARNING_PUSH
|
||||
# define QT_WARNING_POP
|
||||
# define QT_WARNING_DISABLE_INTEL(number)
|
||||
# define QT_WARNING_DISABLE_MSVC(number)
|
||||
# define QT_WARNING_DISABLE_CLANG(text)
|
||||
# define QT_WARNING_DISABLE_GCC(text)
|
||||
#define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
|
||||
#define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
|
||||
#define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
|
||||
#define QT_WARNING_DISABLE_CLANG(text)
|
||||
#define QT_WARNING_DISABLE_INTEL(number)
|
||||
#define QT_WARNING_DISABLE_MSVC(number)
|
||||
#else // All other compilers, GCC < 4.6 and MSVC < 2008
|
||||
#define QT_WARNING_DISABLE_GCC(text)
|
||||
#define QT_WARNING_PUSH
|
||||
#define QT_WARNING_POP
|
||||
#define QT_WARNING_DISABLE_INTEL(number)
|
||||
#define QT_WARNING_DISABLE_MSVC(number)
|
||||
#define QT_WARNING_DISABLE_CLANG(text)
|
||||
#define QT_WARNING_DISABLE_GCC(text)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include "projectversion.h"
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QLatin1Char>
|
||||
#include <QLatin1String>
|
||||
|
@ -42,8 +41,8 @@
|
|||
#define LATEST_TAG_DISTANCE VCS_REPO_STATE_DISTANCE
|
||||
#endif
|
||||
|
||||
extern const QString APP_VERSION_STR(QStringLiteral("%1.%2.%3.%4").arg(MAJOR_VERSION).arg(MINOR_VERSION)
|
||||
.arg(DEBUG_VERSION).arg(LATEST_TAG_DISTANCE));
|
||||
extern const QString APP_VERSION_STR(
|
||||
QStringLiteral("%1.%2.%3.%4").arg(MAJOR_VERSION).arg(MINOR_VERSION).arg(DEBUG_VERSION).arg(LATEST_TAG_DISTANCE));
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto compilerString() -> QString
|
||||
|
@ -62,7 +61,7 @@ auto compilerString() -> QString
|
|||
QString iccVersion;
|
||||
if (__INTEL_COMPILER >= 1300)
|
||||
{
|
||||
iccVersion = QString::number(__INTEL_COMPILER/100);
|
||||
iccVersion = QString::number(__INTEL_COMPILER / 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -77,16 +76,16 @@ auto compilerString() -> QString
|
|||
QLatin1String(__INTEL_COMPILER_BUILD_DATE) + QLatin1String(" [") + iccCompact +
|
||||
QLatin1String(" compatibility]");
|
||||
#endif
|
||||
#elif defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too
|
||||
#elif defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too
|
||||
// cppcheck-suppress unassignedVariable
|
||||
QString isAppleString;
|
||||
#if defined(__apple_build_version__) // Apple clang has other version numbers
|
||||
isAppleString = QLatin1String(" (Apple)");
|
||||
#endif
|
||||
return QLatin1String("Clang " ) + QString::number(__clang_major__) + QLatin1Char('.')
|
||||
+ QString::number(__clang_minor__) + isAppleString;
|
||||
return QLatin1String("Clang ") + QString::number(__clang_major__) + QLatin1Char('.') +
|
||||
QString::number(__clang_minor__) + isAppleString;
|
||||
#elif defined(Q_CC_GNU)
|
||||
return QLatin1String("GCC " ) + QLatin1String(__VERSION__);
|
||||
return QLatin1String("GCC ") + QLatin1String(__VERSION__);
|
||||
#elif defined(Q_CC_MSVC)
|
||||
if (_MSC_VER >= 1800) // 1800: MSVC 2013 (yearly release cycle)
|
||||
{
|
||||
|
@ -105,6 +104,6 @@ auto compilerString() -> QString
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto buildCompatibilityString() -> QString
|
||||
{
|
||||
return QCoreApplication::tr("Based on Qt %1 (%2, %3 bit)").arg(QLatin1String(qVersion()), compilerString(),
|
||||
QString::number(QSysInfo::WordSize));
|
||||
return QCoreApplication::tr("Based on Qt %1 (%2, %3 bit)")
|
||||
.arg(QLatin1String(qVersion()), compilerString(), QString::number(QSysInfo::WordSize));
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#ifndef QXTCSVMODEL_H
|
||||
#define QXTCSVMODEL_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QAbstractTableModel>
|
||||
#include <QChar>
|
||||
#include <QFlags>
|
||||
|
@ -57,6 +56,7 @@ class VTextCodec;
|
|||
class QxtCsvModel final : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit QxtCsvModel(QObject *parent = nullptr);
|
||||
explicit QxtCsvModel(QIODevice *file, QObject *parent = nullptr, bool withHeader = false, QChar separator = ',',
|
||||
|
@ -73,13 +73,13 @@ public:
|
|||
-> QVariant override;
|
||||
virtual auto setHeaderData(int section, Qt::Orientation orientation, const QVariant &value,
|
||||
int role = Qt::DisplayRole) -> bool override;
|
||||
void setHeaderData(const QStringList& data);
|
||||
void setHeaderData(const QStringList &data);
|
||||
|
||||
auto text(int row, int column) const -> QString;
|
||||
void setText(int row, int column, const QString& value);
|
||||
void setText(int row, int column, const QString &value);
|
||||
|
||||
auto headerText(int column) const -> QString;
|
||||
void setHeaderText(int column, const QString& value);
|
||||
void setHeaderText(int column, const QString &value);
|
||||
|
||||
auto insertRow(int row, const QModelIndex &parent = QModelIndex()) -> bool;
|
||||
virtual auto insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) -> bool override;
|
||||
|
@ -93,24 +93,27 @@ public:
|
|||
auto removeColumn(int col, const QModelIndex &parent = QModelIndex()) -> bool;
|
||||
virtual auto removeColumns(int col, int count, const QModelIndex &parent = QModelIndex()) -> bool override;
|
||||
|
||||
void setSource(QIODevice *file, bool withHeader = false, QChar separator = ',', VTextCodec* codec = nullptr);
|
||||
void setSource(QIODevice *file, bool withHeader = false, QChar separator = ',', VTextCodec *codec = nullptr);
|
||||
void setSource(const QString &filename, bool withHeader = false, QChar separator = ',',
|
||||
VTextCodec* codec = nullptr);
|
||||
VTextCodec *codec = nullptr);
|
||||
|
||||
auto toCSV(QIODevice *file, QString &error, bool withHeader = false, QChar separator = ',',
|
||||
VTextCodec *codec = nullptr) const -> bool;
|
||||
auto toCSV(const QString &filename, QString &error, bool withHeader = false, QChar separator = ',',
|
||||
VTextCodec *codec = nullptr) const -> bool;
|
||||
|
||||
enum QuoteOption { NoQuotes = 0,
|
||||
SingleQuote = 1,
|
||||
DoubleQuote = 2,
|
||||
BothQuotes = 3,
|
||||
NoEscape = 0,
|
||||
TwoQuoteEscape = 4,
|
||||
BackslashEscape = 8,
|
||||
AlwaysQuoteOutput = 16,
|
||||
DefaultQuoteMode = BothQuotes | BackslashEscape | AlwaysQuoteOutput };
|
||||
enum QuoteOption
|
||||
{
|
||||
NoQuotes = 0,
|
||||
SingleQuote = 1,
|
||||
DoubleQuote = 2,
|
||||
BothQuotes = 3,
|
||||
NoEscape = 0,
|
||||
TwoQuoteEscape = 4,
|
||||
BackslashEscape = 8,
|
||||
AlwaysQuoteOutput = 16,
|
||||
DefaultQuoteMode = BothQuotes | BackslashEscape | AlwaysQuoteOutput
|
||||
};
|
||||
Q_DECLARE_FLAGS(QuoteMode, QuoteOption)
|
||||
|
||||
auto quoteMode() const -> QuoteMode;
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
VSvgFontData() = default;
|
||||
explicit VSvgFontData(qreal horizAdvX);
|
||||
VSvgFontData(const VSvgFontData &font) = default;
|
||||
virtual ~VSvgFontData() = default;
|
||||
~VSvgFontData() = default;
|
||||
|
||||
QString m_id{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QString m_familyName{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
VSvgFontEngineData() = default;
|
||||
explicit VSvgFontEngineData(const VSvgFont &font);
|
||||
VSvgFontEngineData(const VSvgFontEngineData &engine) = default;
|
||||
virtual ~VSvgFontEngineData() = default;
|
||||
~VSvgFontEngineData() = default;
|
||||
|
||||
VSvgFont m_font{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QHash<QChar, VSvgGlyph> m_glyphs{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
VSvgGlyphData() = default;
|
||||
VSvgGlyphData(QChar unicode, const QPainterPath &path, qreal horizAdvX);
|
||||
VSvgGlyphData(const VSvgGlyphData &glyph) = default;
|
||||
virtual ~VSvgGlyphData() = default;
|
||||
~VSvgGlyphData() = default;
|
||||
|
||||
QChar m_unicode{0}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
QPainterPath m_path{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <QString>
|
||||
#include <QTranslator>
|
||||
#include <QtGlobal>
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include "../vmisc/def.h"
|
||||
#include "../vpatterndb/vtranslatevars.h"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VOBJENGINE_H
|
||||
#define VOBJENGINE_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QPaintEngine>
|
||||
#include <QPolygonF>
|
||||
#include <QRectF>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef VOBJPAINTDEVICE_H
|
||||
#define VOBJPAINTDEVICE_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
#include <QPaintDevice>
|
||||
#include <QSharedPointer>
|
||||
#include <QSize>
|
||||
|
|
|
@ -28,14 +28,14 @@
|
|||
|
||||
#include "calculator.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QSharedPointer>
|
||||
#include <QStringList>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "../vmisc/def.h"
|
||||
#include "../qmuparser/qmuparsererror.h"
|
||||
#include "variables/vinternalvariable.h"
|
||||
#include "../vmisc/def.h"
|
||||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "variables/vinternalvariable.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
|
@ -52,9 +52,6 @@
|
|||
*
|
||||
*/
|
||||
Calculator::Calculator()
|
||||
: QmuFormulaBase(),
|
||||
m_varsValues(),
|
||||
m_vars(nullptr)
|
||||
{
|
||||
InitCharSets();
|
||||
|
||||
|
@ -88,7 +85,7 @@ auto Calculator::EvalFormula(const QHash<QString, QSharedPointer<VInternalVariab
|
|||
return result;
|
||||
}
|
||||
|
||||
SetSepForEval();//Reset separators options
|
||||
SetSepForEval(); // Reset separators options
|
||||
m_vars = vars;
|
||||
SetExpr(formula);
|
||||
|
||||
|
@ -116,14 +113,15 @@ auto Calculator::VarFactory(const QString &a_szName, void *a_pUserData) -> qreal
|
|||
return val.data();
|
||||
}
|
||||
|
||||
throw qmu::QmuParserError (qmu::ecUNASSIGNABLE_TOKEN);
|
||||
throw qmu::QmuParserError(qmu::ecUNASSIGNABLE_TOKEN);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto Calculator::Warning(const QString &warningMsg, qreal value) -> qreal
|
||||
{
|
||||
VAbstractApplication::VApp()->IsPedantic() ? throw qmu::QmuParserWarning(warningMsg) :
|
||||
qWarning() << VAbstractApplication::warningMessageSignature + warningMsg;
|
||||
VAbstractApplication::VApp()->IsPedantic()
|
||||
? throw qmu::QmuParserWarning(warningMsg)
|
||||
: qWarning() << VAbstractApplication::warningMessageSignature + warningMsg;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef CALCULATOR_H
|
||||
#define CALCULATOR_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QHash>
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
|
@ -61,7 +60,7 @@ class Calculator final : public qmu::QmuFormulaBase
|
|||
{
|
||||
public:
|
||||
Calculator();
|
||||
virtual ~Calculator() = default;
|
||||
~Calculator() override = default;
|
||||
|
||||
auto EvalFormula(const QHash<QString, QSharedPointer<VInternalVariable>> *vars, const QString &formula) -> qreal;
|
||||
|
||||
|
@ -71,8 +70,8 @@ protected:
|
|||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(Calculator) // NOLINT
|
||||
QVector<QSharedPointer<qreal>> m_varsValues;
|
||||
const QHash<QString, QSharedPointer<VInternalVariable> > *m_vars;
|
||||
QVector<QSharedPointer<qreal>> m_varsValues{};
|
||||
const QHash<QString, QSharedPointer<VInternalVariable>> *m_vars{nullptr};
|
||||
};
|
||||
|
||||
#endif // CALCULATOR_H
|
||||
|
|
|
@ -52,12 +52,12 @@ auto VAbstractFloatItemData::operator=(const VAbstractFloatItemData &data) -> VA
|
|||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractFloatItemData::VAbstractFloatItemData(VAbstractFloatItemData &&data) Q_DECL_NOTHROW
|
||||
VAbstractFloatItemData::VAbstractFloatItemData(VAbstractFloatItemData &&data) noexcept
|
||||
: d (std::move(data.d))
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VAbstractFloatItemData::operator=(VAbstractFloatItemData &&data) Q_DECL_NOTHROW->VAbstractFloatItemData &
|
||||
auto VAbstractFloatItemData::operator=(VAbstractFloatItemData &&data) noexcept->VAbstractFloatItemData &
|
||||
{
|
||||
std::swap(d, data.d);
|
||||
return *this;
|
||||
|
|
|
@ -44,8 +44,8 @@ public:
|
|||
|
||||
auto operator=(const VAbstractFloatItemData &data) -> VAbstractFloatItemData &;
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
VAbstractFloatItemData(VAbstractFloatItemData &&data) Q_DECL_NOTHROW;
|
||||
auto operator=(VAbstractFloatItemData &&data) Q_DECL_NOTHROW->VAbstractFloatItemData &;
|
||||
VAbstractFloatItemData(VAbstractFloatItemData &&data) noexcept;
|
||||
auto operator=(VAbstractFloatItemData &&data) noexcept->VAbstractFloatItemData &;
|
||||
#endif
|
||||
|
||||
// methods, which set and return values of different parameters
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user