Seamly2D
Code documentation
vtoolpointfromarcandtangent.h
Go to the documentation of this file.
1 /******************************************************************************
2 * @file vtoolpointfromarcandtangent.h
3 ** @author Douglas S Caskey
4 ** @date 30 Apr, 2023
5 **
6 ** @brief
7 ** @copyright
8 ** This source code is part of the Seamly2D project, a pattern making
9 ** program to create and model patterns of clothing.
10 ** Copyright (C) 2017-2023 Seamly2D project
11 ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
12 **
13 ** Seamly2D is free software: you can redistribute it and/or modify
14 ** it under the terms of the GNU General Public License as published by
15 ** the Free Software Foundation, either version 3 of the License, or
16 ** (at your option) any later version.
17 **
18 ** Seamly2D is distributed in the hope that it will be useful,
19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ** GNU General Public License for more details.
22 **
23 ** You should have received a copy of the GNU General Public License
24 ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
25 **
26 *************************************************************************/
27 
28 /************************************************************************
29  **
30  ** @file vtoolpointfromarcandtangent.h
31  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
32  ** @date 6 6, 2015
33  **
34  ** @brief
35  ** @copyright
36  ** This source code is part of the Valentine project, a pattern making
37  ** program, whose allow create and modeling patterns of clothing.
38  ** Copyright (C) 2015 Seamly2D project
39  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
40  **
41  ** Seamly2D is free software: you can redistribute it and/or modify
42  ** it under the terms of the GNU General Public License as published by
43  ** the Free Software Foundation, either version 3 of the License, or
44  ** (at your option) any later version.
45  **
46  ** Seamly2D is distributed in the hope that it will be useful,
47  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
48  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49  ** GNU General Public License for more details.
50  **
51  ** You should have received a copy of the GNU General Public License
52  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
53  **
54  *************************************************************************/
55 
56 #ifndef VTOOLPOINTFROMARCANDTANGENT_H
57 #define VTOOLPOINTFROMARCANDTANGENT_H
58 
59 #include <qcompilerdetection.h>
60 #include <QDomElement>
61 #include <QGraphicsItem>
62 #include <QMetaObject>
63 #include <QObject>
64 #include <QPointF>
65 #include <QString>
66 #include <QtGlobal>
67 
68 #include "../ifc/xml/vabstractpattern.h"
69 #include "../vmisc/def.h"
70 #include "vtoolsinglepoint.h"
71 
72 template <class T> class QSharedPointer;
73 
75 {
76  Q_OBJECT
77 public:
78  virtual void setDialog() Q_DECL_OVERRIDE;
79 
82  static VToolPointFromArcAndTangent *Create(const quint32 _id,
83  const QString &pointName,
84  quint32 arcId,
85  quint32 tangentPointId,
87  qreal mx, qreal my,
88  bool showPointName,
89  VMainGraphicsScene *scene,
92  const Document &parse,
93  const Source &typeCreation);
94 
95  static QPointF FindPoint(const QPointF &p, const VArc *arc, const CrossCirclesPoint pType);
96 
97  static const QString ToolType;
98  virtual int type() const Q_DECL_OVERRIDE {return Type;}
99  enum { Type = UserType + static_cast<int>(Tool::PointFromArcAndTangent) };
100 
101  QString TangentPointName() const;
102  QString ArcName() const;
103 
104  quint32 GetTangentPointId() const;
105  void SetTangentPointId(const quint32 &value);
106 
107  quint32 GetArcId() const;
108  void SetArcId(const quint32 &value);
109 
111  void setCirclesCrossPoint(const CrossCirclesPoint &value);
112 
113  virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
114 
115 protected slots:
116  virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE;
117 
118 protected:
119  virtual void RemoveReferens() Q_DECL_OVERRIDE;
120  virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;
121  virtual void SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj) Q_DECL_OVERRIDE;
122  virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE;
123  virtual void SetVisualization() Q_DECL_OVERRIDE;
124 
125 private:
126  Q_DISABLE_COPY(VToolPointFromArcAndTangent)
127 
128  quint32 arcId;
129  quint32 tangentPointId;
131 
133  quint32 arcId, quint32 tangentPointId,
134  CrossCirclesPoint crossPoint, const Source &typeCreation,
135  QGraphicsItem * parent = nullptr);
136 };
137 
138 #endif // VTOOLPOINTFROMARCANDTANGENT_H
VAbstractPattern * doc
doc dom document container
VArc class for anticlockwise arc.
Definition: varc.h:74
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.
virtual int type() const Q_DECL_OVERRIDE
virtual void setDialog() Q_DECL_OVERRIDE
setDialog set dialog when user want change tool option.
virtual void RemoveReferens() Q_DECL_OVERRIDE
RemoveReferens decrement value of reference.
virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE
void setCirclesCrossPoint(const CrossCirclesPoint &value)
static VToolPointFromArcAndTangent * Create(QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE
virtual void SaveOptions(QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
void SetTangentPointId(const quint32 &value)
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE
SaveDialog save options into file after change in dialog.
virtual void SetVisualization() Q_DECL_OVERRIDE
CrossCirclesPoint GetCrossCirclesPoint() const
static QPointF FindPoint(const QPointF &p, const VArc *arc, const CrossCirclesPoint pType)
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE
The VToolSinglePoint class parent for all tools what create points.
@ PointFromArcAndTangent
Source
Definition: def.h:106
#define NULL_ID
Definition: ifcdef.h:76
Document
CrossCirclesPoint