2015-05-30 12:02:20 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vtoolpointofintersectioncircles.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 29 5, 2015
|
|
|
|
**
|
|
|
|
** @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) 2015 Valentina project
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#ifndef VTOOLPOINTOFINTERSECTIONCIRCLES_H
|
|
|
|
#define VTOOLPOINTOFINTERSECTIONCIRCLES_H
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <qcompilerdetection.h>
|
|
|
|
#include <QDomElement>
|
|
|
|
#include <QGraphicsItem>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QPointF>
|
|
|
|
#include <QString>
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
|
|
|
#include "../ifc/xml/vabstractpattern.h"
|
2016-08-09 15:55:46 +02:00
|
|
|
#include "../vmisc/def.h"
|
2015-06-20 08:23:04 +02:00
|
|
|
#include "vtoolsinglepoint.h"
|
2015-05-30 12:02:20 +02:00
|
|
|
|
|
|
|
class VFormula;
|
2016-08-08 13:44:49 +02:00
|
|
|
template <class T> class QSharedPointer;
|
2015-05-30 12:02:20 +02:00
|
|
|
|
2015-06-20 08:23:04 +02:00
|
|
|
class VToolPointOfIntersectionCircles : public VToolSinglePoint
|
2015-05-30 12:02:20 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-07-03 15:36:54 +02:00
|
|
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
2017-04-15 16:39:59 +02:00
|
|
|
static VToolPointOfIntersectionCircles *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
|
|
|
VAbstractPattern *doc, VContainer *data);
|
2015-05-30 12:02:20 +02:00
|
|
|
static VToolPointOfIntersectionCircles *Create(const quint32 _id, const QString &pointName,
|
|
|
|
quint32 firstCircleCenterId, quint32 secondCircleCenterId,
|
|
|
|
QString &firstCircleRadius, QString &secondCircleRadius,
|
|
|
|
CrossCirclesPoint crossPoint,
|
|
|
|
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
2015-06-18 19:23:24 +02:00
|
|
|
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
2015-05-30 12:02:20 +02:00
|
|
|
const Source &typeCreation);
|
|
|
|
static QPointF FindPoint(const QPointF &c1Point, const QPointF &c2Point, qreal c1Radius, qreal c2Radius,
|
|
|
|
const CrossCirclesPoint crossPoint);
|
|
|
|
static const QString ToolType;
|
2015-07-03 15:36:54 +02:00
|
|
|
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
2015-05-30 12:02:20 +02:00
|
|
|
enum { Type = UserType + static_cast<int>(Tool::PointOfIntersectionCircles) };
|
|
|
|
|
2017-03-19 16:13:02 +01:00
|
|
|
QString FirstCircleCenterPointName() const;
|
|
|
|
QString SecondCircleCenterPointName() const;
|
|
|
|
|
2015-05-30 12:02:20 +02:00
|
|
|
quint32 GetFirstCircleCenterId() const;
|
|
|
|
void SetFirstCircleCenterId(const quint32 &value);
|
|
|
|
|
|
|
|
quint32 GetSecondCircleCenterId() const;
|
|
|
|
void SetSecondCircleCenterId(const quint32 &value);
|
|
|
|
|
|
|
|
VFormula GetFirstCircleRadius() const;
|
|
|
|
void SetFirstCircleRadius(const VFormula &value);
|
|
|
|
|
|
|
|
VFormula GetSecondCircleRadius() const;
|
|
|
|
void SetSecondCircleRadius(const VFormula &value);
|
|
|
|
|
|
|
|
CrossCirclesPoint GetCrossCirclesPoint() const;
|
2015-10-28 15:22:36 +01:00
|
|
|
void SetCrossCirclesPoint(const CrossCirclesPoint &value);
|
2015-05-30 12:02:20 +02:00
|
|
|
|
2015-07-03 15:36:54 +02:00
|
|
|
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
|
2017-09-15 16:32:23 +02:00
|
|
|
protected slots:
|
|
|
|
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE;
|
2015-05-30 12:02:20 +02:00
|
|
|
protected:
|
2015-07-03 15:36:54 +02:00
|
|
|
virtual void RemoveReferens() Q_DECL_OVERRIDE;
|
|
|
|
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;
|
|
|
|
virtual void SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj) Q_DECL_OVERRIDE;
|
|
|
|
virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE;
|
|
|
|
virtual void SetVisualization() Q_DECL_OVERRIDE;
|
2015-05-30 12:02:20 +02:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(VToolPointOfIntersectionCircles)
|
|
|
|
|
|
|
|
quint32 firstCircleCenterId;
|
|
|
|
quint32 secondCircleCenterId;
|
|
|
|
|
|
|
|
QString firstCircleRadius;
|
|
|
|
QString secondCircleRadius;
|
|
|
|
|
|
|
|
CrossCirclesPoint crossPoint;
|
2016-05-14 21:54:57 +02:00
|
|
|
|
|
|
|
VToolPointOfIntersectionCircles(VAbstractPattern *doc, VContainer *data, const quint32 &id, const
|
|
|
|
quint32 firstCircleCenterId, quint32 secondCircleCenterId,
|
|
|
|
const QString &firstCircleRadius, const QString &secondCircleRadius,
|
|
|
|
CrossCirclesPoint crossPoint, const Source &typeCreation,
|
|
|
|
QGraphicsItem * parent = nullptr);
|
2015-05-30 12:02:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VTOOLPOINTOFINTERSECTIONCIRCLES_H
|