Seamly2D
Code documentation
intersect_circles_tool.h
Go to the documentation of this file.
1 /**************************************************************************
2  **
3  ** @file intersect_circles_tool.h
4  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
5  ** @date 29 5, 2015
6  **
7  ** @author Douglas S. Caskey
8  ** @date 7.16.2022
9  **
10  ** @copyright
11  ** Copyright (C) 2013-2022 Seamly2D project.
12  ** This source code is part of the Seamly2D project, a pattern making
13  ** program, whose allow create and modeling patterns of clothing.
14  **
15  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
16  **
17  ** Seamly2D is free software: you can redistribute it and/or modify
18  ** it under the terms of the GNU General Public License as published
19  ** by the Free Software Foundation, either version 3 of the License,
20  ** or (at your option) any later version.
21  **
22  ** Seamly2D is distributed in the hope that it will be useful,
23  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
24  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  ** GNU General Public License for more details.
26  **
27  ** You should have received a copy of the GNU General Public License
28  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
29  **
30  *************************************************************************/
31 
32 #ifndef INTERSECT_CIRCLES_TOOL_H
33 #define INTERSECT_CIRCLES_TOOL_H
34 
35 #include "vtoolsinglepoint.h"
36 #include "../ifc/xml/vabstractpattern.h"
37 #include "../vmisc/def.h"
38 
39 #include <qcompilerdetection.h>
40 #include <QDomElement>
41 #include <QGraphicsItem>
42 #include <QMetaObject>
43 #include <QObject>
44 #include <QPointF>
45 #include <QString>
46 #include <QtGlobal>
47 
48 class VFormula;
49 template <class T> class QSharedPointer;
50 
52 {
53  Q_OBJECT
54 
55 public:
56  virtual void setDialog() Q_DECL_OVERRIDE;
57 
60 
61  static IntersectCirclesTool *Create(const quint32 _id, const QString &pointName,
63  QString &firstCircleRadius, QString &secondCircleRadius,
65  qreal mx, qreal my, bool showPointName, VMainGraphicsScene *scene,
66  VAbstractPattern *doc, VContainer *data, const Document &parse,
67  const Source &typeCreation);
68 
69  static QPointF FindPoint(const QPointF &c1Point, const QPointF &c2Point, qreal c1Radius, qreal c2Radius,
71 
72  static const QString ToolType;
73  virtual int type() const Q_DECL_OVERRIDE {return Type;}
74  enum {Type = UserType + static_cast<int>(Tool::PointOfIntersectionCircles)};
75 
76  QString FirstCircleCenterPointName() const;
77  QString SecondCircleCenterPointName() const;
78 
79  quint32 GetFirstCircleCenterId() const;
80  void SetFirstCircleCenterId(const quint32 &value);
81 
82  quint32 GetSecondCircleCenterId() const;
83  void SetSecondCircleCenterId(const quint32 &value);
84 
86  void SetFirstCircleRadius(const VFormula &value);
87 
89  void SetSecondCircleRadius(const VFormula &value);
90 
92  void setCirclesCrossPoint(const CrossCirclesPoint &value);
93 
94  virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
95 
96 protected slots:
97  virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE;
98 
99 protected:
100  virtual void RemoveReferens() Q_DECL_OVERRIDE;
101  virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;
102  virtual void SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj) Q_DECL_OVERRIDE;
103  virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE;
104  virtual void SetVisualization() Q_DECL_OVERRIDE;
105 
106 private:
107  Q_DISABLE_COPY(IntersectCirclesTool)
108 
111 
114 
116 
118  const quint32 firstCircleCenterId, quint32 secondCircleCenterId,
119  const QString &firstCircleRadius, const QString &secondCircleRadius,
120  CrossCirclesPoint crossPoint, const Source &typeCreation,
121  QGraphicsItem * parent = nullptr);
122 };
123 
124 #endif // INTERSECT_CIRCLES_TOOL_H
virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE
void setCirclesCrossPoint(const CrossCirclesPoint &value)
CrossCirclesPoint crossPoint
static IntersectCirclesTool * Create(QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE
SaveDialog save options into file after change in dialog.
virtual void SaveOptions(QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
QString FirstCircleCenterPointName() const
virtual int type() const Q_DECL_OVERRIDE
void SetSecondCircleRadius(const VFormula &value)
VFormula GetFirstCircleRadius() const
void SetFirstCircleCenterId(const quint32 &value)
VFormula GetSecondCircleRadius() const
virtual void setDialog() Q_DECL_OVERRIDE
setDialog set dialog when user want change tool option.
quint32 GetSecondCircleCenterId() const
QString SecondCircleCenterPointName() const
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE
virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE
static const QString ToolType
void SetSecondCircleCenterId(const quint32 &value)
virtual void SetVisualization() Q_DECL_OVERRIDE
CrossCirclesPoint GetCrossCirclesPoint() const
void SetFirstCircleRadius(const VFormula &value)
quint32 GetFirstCircleCenterId() const
static QPointF FindPoint(const QPointF &c1Point, const QPointF &c2Point, qreal c1Radius, qreal c2Radius, const CrossCirclesPoint crossPoint)
virtual void RemoveReferens() Q_DECL_OVERRIDE
RemoveReferens decrement value of reference.
VAbstractPattern * doc
doc dom document container
The VContainer class container of all variables.
Definition: vcontainer.h:141
VContainer data
data container with data
Definition: vdatatool.h:84
The VGObject class keep information graphical objects.
Definition: vgobject.h:74
The VMainGraphicsScene class main scene.
The VToolSinglePoint class parent for all tools what create points.
@ PointOfIntersectionCircles
Source
Definition: def.h:106
#define NULL_ID
Definition: ifcdef.h:76
Document
CrossCirclesPoint