Fixed issue #631. Runtime Error when using elliptical arc and opening
Measurements Table of Variables or Formula Wizard. --HG-- branch : develop
This commit is contained in:
parent
5a2604d2bd
commit
5dff5b36d0
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include "../ifc/ifcdef.h"
|
||||
#include "../vgeometry/varc.h"
|
||||
#include "vcurvevariable.h"
|
||||
#include "../vgeometry/vellipticalarc.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArcRadius::VArcRadius()
|
||||
|
@ -49,10 +49,29 @@ VArcRadius::VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *a
|
|||
SCASSERT(arc != nullptr)
|
||||
|
||||
SetType(VarType::ArcRadius);
|
||||
SetName(QString(radius_V+"%1").arg(arc->name()));
|
||||
SetName(radius_V + QString("%1").arg(arc->name()));
|
||||
SetValue(FromPixel(arc->GetRadius(), patternUnit));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArcRadius::VArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc, const int numberRadius,
|
||||
Unit patternUnit)
|
||||
: VCurveVariable(id, parentId)
|
||||
{
|
||||
SCASSERT(elArc != nullptr)
|
||||
|
||||
SetType(VarType::ArcRadius);
|
||||
SetName(radius_V + QString("%1%2").arg(numberRadius).arg(elArc->name()));
|
||||
if (numberRadius == 1)
|
||||
{
|
||||
SetValue(FromPixel(elArc->GetRadius1(), patternUnit));
|
||||
}
|
||||
else
|
||||
{
|
||||
SetValue(FromPixel(elArc->GetRadius2(), patternUnit));
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArcRadius::VArcRadius(const VArcRadius &var)
|
||||
:VCurveVariable(var)
|
||||
|
|
|
@ -37,12 +37,15 @@
|
|||
#include "vcurvevariable.h"
|
||||
|
||||
class VArc;
|
||||
class VEllipticalArc;
|
||||
|
||||
class VArcRadius :public VCurveVariable
|
||||
{
|
||||
public:
|
||||
VArcRadius();
|
||||
VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc, Unit patternUnit);
|
||||
VArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc, const int numberRadius,
|
||||
Unit patternUnit);
|
||||
VArcRadius(const VArcRadius &var);
|
||||
VArcRadius &operator=(const VArcRadius &var);
|
||||
virtual ~VArcRadius() Q_DECL_OVERRIDE;
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vellipticalarcradius.cpp
|
||||
** @author Valentina Zhuravska <zhuravska19(at)gmail.com>
|
||||
** @date 16 12, 2016
|
||||
**
|
||||
** @brief
|
||||
** @copyright
|
||||
** This source code is part of the Valentine project, a pattern making
|
||||
** program, whose allow create and modeling patterns of clothing.
|
||||
** Copyright (C) 2016 Valentina project
|
||||
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||
**
|
||||
** Valentina is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** Valentina is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||
**
|
||||
*************************************************************************/
|
||||
#include "vellipticalarcradius.h"
|
||||
|
||||
#include <QMessageLogger>
|
||||
#include <QString>
|
||||
|
||||
#include "../ifc/ifcdef.h"
|
||||
#include "../vgeometry/vellipticalarc.h"
|
||||
#include "vcurvevariable.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArcRadius::VEllipticalArcRadius()
|
||||
:VCurveVariable()
|
||||
{
|
||||
SetType(VarType::ArcRadius);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArcRadius::VEllipticalArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc,
|
||||
const int numberRadius, Unit patternUnit) : VCurveVariable(id, parentId)
|
||||
{
|
||||
SCASSERT(elArc != nullptr)
|
||||
|
||||
SetType(VarType::ArcRadius);
|
||||
SetName(QString(radius_V+"%1"+"%2").arg(numberRadius).arg(elArc->name()));
|
||||
if (numberRadius == 1)
|
||||
{
|
||||
SetValue(FromPixel(elArc->GetRadius1(), patternUnit));
|
||||
}
|
||||
else
|
||||
{
|
||||
SetValue(FromPixel(elArc->GetRadius2(), patternUnit));
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArcRadius::VEllipticalArcRadius(const VEllipticalArcRadius &var)
|
||||
:VCurveVariable(var)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArcRadius &VEllipticalArcRadius::operator=(const VEllipticalArcRadius &var)
|
||||
{
|
||||
if ( &var == this )
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
VCurveVariable::operator=(var);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VEllipticalArcRadius::~VEllipticalArcRadius()
|
||||
{}
|
|
@ -1,51 +0,0 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vellipticalarcradius.h
|
||||
** @author Valentina Zhuravska <zhuravska19(at)gmail.com>
|
||||
** @date 16 12, 2016
|
||||
**
|
||||
** @brief
|
||||
** @copyright
|
||||
** This source code is part of the Valentine project, a pattern making
|
||||
** program, whose allow create and modeling patterns of clothing.
|
||||
** Copyright (C) 2016 Valentina project
|
||||
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||
**
|
||||
** Valentina is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** Valentina is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||
**
|
||||
*************************************************************************/
|
||||
#ifndef VELLIPTICALARCRADIUS_H
|
||||
#define VELLIPTICALARCRADIUS_H
|
||||
|
||||
#include <qcompilerdetection.h>
|
||||
#include <QtGlobal>
|
||||
|
||||
#include "../vmisc/def.h"
|
||||
#include "../ifc/ifcdef.h"
|
||||
#include "vcurvevariable.h"
|
||||
|
||||
class VEllipticalArc;
|
||||
|
||||
class VEllipticalArcRadius :public VCurveVariable
|
||||
{
|
||||
public:
|
||||
VEllipticalArcRadius();
|
||||
VEllipticalArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc,
|
||||
const int numberRadius, Unit patternUnit);
|
||||
VEllipticalArcRadius(const VEllipticalArcRadius &var);
|
||||
VEllipticalArcRadius &operator=(const VEllipticalArcRadius &var);
|
||||
virtual ~VEllipticalArcRadius() Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // VELLIPTICALARCRADIUS_H
|
|
@ -45,7 +45,6 @@
|
|||
#include "../vmisc/logging.h"
|
||||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "variables/varcradius.h"
|
||||
#include "variables/vellipticalarcradius.h"
|
||||
#include "variables/vcurveangle.h"
|
||||
#include "variables/vcurvelength.h"
|
||||
#include "variables/vcurveclength.h"
|
||||
|
@ -410,10 +409,10 @@ void VContainer::AddArc(const QSharedPointer<VAbstractCurve> &arc, const quint32
|
|||
{
|
||||
const QSharedPointer<VEllipticalArc> casted = arc.staticCast<VEllipticalArc>();
|
||||
|
||||
VEllipticalArcRadius *radius1 = new VEllipticalArcRadius(id, parentId, casted.data(), 1, *GetPatternUnit());
|
||||
VArcRadius *radius1 = new VArcRadius(id, parentId, casted.data(), 1, *GetPatternUnit());
|
||||
AddVariable(radius1->GetName(), radius1);
|
||||
|
||||
VEllipticalArcRadius *radius2 = new VEllipticalArcRadius(id, parentId, casted.data(), 2, *GetPatternUnit());
|
||||
VArcRadius *radius2 = new VArcRadius(id, parentId, casted.data(), 2, *GetPatternUnit());
|
||||
AddVariable(radius2->GetName(), radius2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ SOURCES += \
|
|||
$$PWD/vpatterninfogeometry.cpp \
|
||||
$$PWD/vgrainlinegeometry.cpp \
|
||||
$$PWD/variables/vcurveclength.cpp \
|
||||
$$PWD/variables/vellipticalarcradius.cpp \
|
||||
$$PWD/vpiece.cpp \
|
||||
$$PWD/vpiecenode.cpp \
|
||||
$$PWD/vpiecepath.cpp
|
||||
|
@ -59,7 +58,6 @@ HEADERS += \
|
|||
$$PWD/vpatterninfogeometry.h \
|
||||
$$PWD/vgrainlinegeometry.h \
|
||||
$$PWD/variables/vcurveclength.h \
|
||||
$$PWD/variables/vellipticalarcradius.h \
|
||||
$$PWD/vpiece.h \
|
||||
$$PWD/vpiece_p.h \
|
||||
$$PWD/vpiecenode.h \
|
||||
|
|
Loading…
Reference in New Issue
Block a user