New internal variable RotationElArc.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-01-05 21:07:47 +02:00
parent 8b16cead24
commit e6dcfd708b
8 changed files with 43 additions and 18 deletions

View File

@ -36,6 +36,7 @@
- [#783] Flipping control.
- [#790] Generate unique name for each detail.
- [#792] New feature. Visibility trigger for internal path.
- New internal variable RotationElArc.
# Version 0.5.1
- [#683] Tool Seam allowance's dialog is off screen on small resolutions.

View File

@ -283,6 +283,8 @@ const QString angle2SplPath = angle2_V + splPath;
const QString seg_ = QStringLiteral("Seg_");
const QString currentLength = QStringLiteral("CurrentLength");
const QString currentSeamAllowance = QStringLiteral("CurrentSeamAllowance");
const QString rotation_V = QStringLiteral("Rotation");
const QString rotationElArc_ = rotation_V + elarc_;
const QStringList builInVariables = QStringList() << measurement_
<< increment_
@ -309,4 +311,5 @@ const QStringList builInVariables = QStringList() << measurement_
<< c1LengthSpl_
<< c2LengthSpl_
<< c1LengthSplPath
<< c2LengthSplPath;
<< c2LengthSplPath
<< rotationElArc_;

View File

@ -219,6 +219,8 @@ extern const QString angle2SplPath;
extern const QString seg_;
extern const QString currentLength;
extern const QString currentSeamAllowance;
extern const QString rotation_V;
extern const QString rotationElArc_;
extern const QStringList builInVariables;

View File

@ -35,6 +35,7 @@
#include "../ifc/ifcdef.h"
#include "../vgeometry/vabstractcurve.h"
#include "../vgeometry/vspline.h"
#include "../vgeometry/vellipticalarc.h"
#include "vcurvevariable.h"
//---------------------------------------------------------------------------------------------------------------------
@ -44,6 +45,13 @@ VCurveAngle::VCurveAngle()
SetType(VarType::CurveAngle);
}
//---------------------------------------------------------------------------------------------------------------------
VCurveAngle::VCurveAngle(const quint32 &id, const quint32 &parentId)
:VCurveVariable(id, parentId)
{
SetType(VarType::CurveAngle);
}
//---------------------------------------------------------------------------------------------------------------------
VCurveAngle::VCurveAngle(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve, CurveAngle angle)
:VCurveVariable(id, parentId)
@ -81,21 +89,18 @@ VCurveAngle::VCurveAngle(const quint32 &id, const quint32 &parentId, const QStri
}
//---------------------------------------------------------------------------------------------------------------------
VCurveAngle::VCurveAngle(const VCurveAngle &var)
:VCurveVariable(var)
{}
//---------------------------------------------------------------------------------------------------------------------
VCurveAngle &VCurveAngle::operator=(const VCurveAngle &var)
VEllipticalArcRotation::VEllipticalArcRotation()
: VCurveAngle()
{
if ( &var == this )
{
return *this;
}
VCurveVariable::operator=(var);
return *this;
SetType(VarType::CurveAngle);
}
//---------------------------------------------------------------------------------------------------------------------
VCurveAngle::~VCurveAngle()
{}
VEllipticalArcRotation::VEllipticalArcRotation(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc)
: VCurveAngle(id, parentId)
{
SetType(VarType::CurveAngle);
SCASSERT(elArc != nullptr)
SetValue(elArc->GetRotationAngle());
SetName(rotation_V + elArc->name());
}

View File

@ -37,6 +37,7 @@
class VAbstractCurve;
class VSpline;
class VEllipticalArc;
enum class CurveAngle : char { StartAngle, EndAngle };
@ -47,9 +48,17 @@ public:
VCurveAngle(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve, CurveAngle angle);
VCurveAngle(const quint32 &id, const quint32 &parentId, const QString &baseCurveName, const VSpline &spl,
CurveAngle angle, qint32 segment);
VCurveAngle(const VCurveAngle &var);
VCurveAngle &operator=(const VCurveAngle &var);
virtual ~VCurveAngle() Q_DECL_OVERRIDE;
virtual ~VCurveAngle() =default;
protected:
VCurveAngle(const quint32 &id, const quint32 &parentId);
};
class VEllipticalArcRotation : public VCurveAngle
{
public:
VEllipticalArcRotation();
VEllipticalArcRotation(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc);
virtual ~VEllipticalArcRotation() =default;
};
#endif // VCURVEANGLE_H

View File

@ -376,6 +376,9 @@ void VContainer::AddArc(const QSharedPointer<VAbstractCurve> &arc, const quint32
VArcRadius *radius2 = new VArcRadius(id, parentId, casted.data(), 2, *GetPatternUnit());
AddVariable(radius2->GetName(), radius2);
VEllipticalArcRotation *rotation = new VEllipticalArcRotation(id, parentId, casted.data());
AddVariable(rotation->GetName(), rotation);
}
}

View File

@ -401,6 +401,7 @@ void VTranslateVars::InitVariables()
"Do not add symbol _ to the end of the name"));
variables.insert(c2LengthSplPath, translate("VTranslateVars", "C2LengthSplPath",
"Do not add symbol _ to the end of the name"));
variables.insert(rotationElArc_, translate("VTranslateVars", "RotationElArc_", "Left symbol _ in the name"));
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -145,6 +145,7 @@ void TST_BuitInRegExp::TestCheckUnderlineExists_data()
data.insert(c2LengthSpl_, true);
data.insert(c1LengthSplPath, false);
data.insert(c2LengthSplPath, false);
data.insert(rotationElArc_, true);
//Catch case when new internal variable appears.
QCOMPARE(data.size(), builInVariables.size());