2016-04-10 16:40:55 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vabstractarc.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 10 4, 2016
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2016-04-10 16:40:55 +02:00
|
|
|
** 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 VABSTRACTARC_H
|
|
|
|
#define VABSTRACTARC_H
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <qcompilerdetection.h>
|
|
|
|
#include <QSharedDataPointer>
|
|
|
|
#include <QString>
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
|
|
|
#include "../ifc/ifcdef.h"
|
2016-04-10 16:40:55 +02:00
|
|
|
#include "vabstractcurve.h"
|
2016-08-08 13:44:49 +02:00
|
|
|
#include "vgeometrydef.h"
|
2016-04-10 16:40:55 +02:00
|
|
|
|
|
|
|
class VAbstractArcData;
|
|
|
|
class VPointF;
|
|
|
|
|
|
|
|
class VAbstractArc : public VAbstractCurve
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit VAbstractArc(const GOType &type, const quint32 &idObject = NULL_ID, const Draw &mode = Draw::Calculation);
|
|
|
|
VAbstractArc (const GOType &type, const VPointF ¢er, qreal f1, const QString &formulaF1, qreal f2,
|
|
|
|
const QString &formulaF2, quint32 idObject = 0, Draw mode = Draw::Calculation);
|
|
|
|
VAbstractArc (const GOType &type, const VPointF ¢er, qreal f1, qreal f2, quint32 idObject = 0,
|
|
|
|
Draw mode = Draw::Calculation);
|
|
|
|
VAbstractArc (const GOType &type, const QString &formulaLength, const VPointF ¢er, qreal f1,
|
|
|
|
const QString &formulaF1, quint32 idObject = 0, Draw mode = Draw::Calculation);
|
|
|
|
VAbstractArc (const GOType &type, const VPointF ¢er, qreal f1, quint32 idObject = 0,
|
|
|
|
Draw mode = Draw::Calculation);
|
|
|
|
explicit VAbstractArc(const VAbstractArc &arc);
|
|
|
|
virtual ~VAbstractArc();
|
|
|
|
|
2017-04-19 12:27:17 +02:00
|
|
|
VAbstractArc& operator= (const VAbstractArc &arc);
|
|
|
|
#ifdef Q_COMPILER_RVALUE_REFS
|
|
|
|
VAbstractArc &operator=(VAbstractArc &&arc) Q_DECL_NOTHROW { Swap(arc); return *this; }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void Swap(VAbstractArc &arc) Q_DECL_NOTHROW
|
2017-04-28 08:38:09 +02:00
|
|
|
{ VAbstractCurve::Swap(arc); std::swap(d, arc.d); }
|
2017-04-19 12:27:17 +02:00
|
|
|
|
2016-04-10 16:40:55 +02:00
|
|
|
QString GetFormulaF1 () const;
|
|
|
|
void SetFormulaF1 (const QString &formula, qreal value);
|
|
|
|
virtual qreal GetStartAngle () const Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
QString GetFormulaF2 () const;
|
|
|
|
void SetFormulaF2 (const QString &formula, qreal value);
|
|
|
|
virtual qreal GetEndAngle () const Q_DECL_OVERRIDE;
|
|
|
|
|
2018-01-05 18:41:09 +01:00
|
|
|
virtual VPointF GetCenter () const;
|
2016-04-10 16:40:55 +02:00
|
|
|
void SetCenter (const VPointF &point);
|
|
|
|
|
|
|
|
QString GetFormulaLength () const;
|
|
|
|
void SetFormulaLength (const QString &formula, qreal value);
|
|
|
|
|
|
|
|
virtual void setId(const quint32 &id) Q_DECL_OVERRIDE;
|
|
|
|
virtual QString NameForHistory(const QString &toolName) const Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
bool IsFlipped() const;
|
|
|
|
qreal AngleArc() const;
|
|
|
|
protected:
|
|
|
|
void SetFlipped(bool value);
|
|
|
|
virtual void FindF2(qreal length)=0;
|
|
|
|
void SetFormulaLength(const QString &formula);
|
|
|
|
private:
|
|
|
|
QSharedDataPointer<VAbstractArcData> d;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VABSTRACTARC_H
|