Seamly2D
Code documentation
intersect_circletangent_tool.h
Go to the documentation of this file.
1 /**************************************************************************
2  **
3  ** @file intersect_circletangent_tool.h
4  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
5  ** @date 3 6, 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_CIRCLETANGENT_TOOL_H
33 #define INTERSECT_CIRCLETANGENT_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 public:
55  virtual void setDialog() Q_DECL_OVERRIDE;
56 
59  static IntersectCircleTangentTool *Create(const quint32 _id, const QString &pointName,
60  quint32 circleCenterId, QString &circleRadius, quint32 tangentPointId,
61  CrossCirclesPoint crossPoint, qreal mx, qreal my, bool showPointName,
63  const Document &parse, const Source &typeCreation);
64 
65  static QPointF FindPoint(const QPointF &p, const QPointF &center, qreal radius,
67 
68  static const QString ToolType;
69  virtual int type() const Q_DECL_OVERRIDE {return Type;}
70  enum {Type = UserType + static_cast<int>(Tool::PointFromCircleAndTangent) };
71 
72  QString TangentPointName() const;
73  QString CircleCenterPointName() const;
74 
75  quint32 GetTangentPointId() const;
76  void SetTangentPointId(const quint32 &value);
77 
78  quint32 GetCircleCenterId() const;
79  void SetCircleCenterId(const quint32 &value);
80 
81  VFormula GetCircleRadius() const;
82  void SetCircleRadius(const VFormula &value);
83 
85  void setCirclesCrossPoint(const CrossCirclesPoint &value);
86 
87  virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
88 
89 protected slots:
90  virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE;
91 
92 protected:
93  virtual void RemoveReferens() Q_DECL_OVERRIDE;
94  virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;
95  virtual void SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj) Q_DECL_OVERRIDE;
96  virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE;
97  virtual void SetVisualization() Q_DECL_OVERRIDE;
98 
99 private:
100  Q_DISABLE_COPY(IntersectCircleTangentTool)
101 
102  quint32 circleCenterId;
103  quint32 tangentPointId;
104  QString circleRadius;
106 
108  quint32 circleCenterId, const QString &circleRadius,
110  const Source &typeCreation, QGraphicsItem * parent = nullptr);
111 };
112 
113 #endif // INTERSECT_CIRCLETANGENT_TOOL_H
virtual void setDialog() Q_DECL_OVERRIDE
setDialog set dialog when user want change tool option.
virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE
void SetCircleCenterId(const quint32 &value)
virtual void SaveOptions(QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE
virtual int type() const Q_DECL_OVERRIDE
void SetCircleRadius(const VFormula &value)
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE
SaveDialog save options into file after change in dialog.
void SetTangentPointId(const quint32 &value)
CrossCirclesPoint GetCrossCirclesPoint() const
void setCirclesCrossPoint(const CrossCirclesPoint &value)
virtual void RemoveReferens() Q_DECL_OVERRIDE
RemoveReferens decrement value of reference.
static IntersectCircleTangentTool * Create(QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
virtual void SetVisualization() Q_DECL_OVERRIDE
static QPointF FindPoint(const QPointF &p, const QPointF &center, qreal radius, const CrossCirclesPoint crossPoint)
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE
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.
@ PointFromCircleAndTangent
Source
Definition: def.h:106
#define NULL_ID
Definition: ifcdef.h:76
Document
CrossCirclesPoint