Seamly2D
Code documentation
vtoolpointofintersectionarcs.h
Go to the documentation of this file.
1 /******************************************************************************
2 * @file vtoolpointofintersectionarcs.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 vtoolpointofintersectionarcs.h
31  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
32  ** @date 25 5, 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 VTOOLPOINTOFINTERSECTIONARCS_H
57 #define VTOOLPOINTOFINTERSECTIONARCS_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 
78 public:
79  virtual void setDialog() Q_DECL_OVERRIDE;
80 
83  static VToolPointOfIntersectionArcs *Create(const quint32 _id, const QString &pointName, const quint32 &firstArcId,
84  const quint32 &secondArcId, CrossCirclesPoint pType,
85  qreal mx, qreal my, VMainGraphicsScene *scene,
86  VAbstractPattern *doc, VContainer *data, const Document &parse,
87  const Source &typeCreation);
88 
89  static QPointF FindPoint(const VArc *arc1, const VArc *arc2, const CrossCirclesPoint pType);
90 
91  static const QString ToolType;
92  virtual int type() const Q_DECL_OVERRIDE {return Type;}
93  enum { Type = UserType + static_cast<int>(Tool::PointOfIntersectionArcs) };
94 
95  QString FirstArcName() const;
96  QString SecondArcName() const;
97 
98  quint32 GetFirstArcId() const;
99  void SetFirstArcId(const quint32 &value);
100 
101  quint32 GetSecondArcId() const;
102  void SetSecondArcId(const quint32 &value);
103 
105  void setCirclesCrossPoint(const CrossCirclesPoint &value);
106 
107  virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
108 
109 protected slots:
110  virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE;
111 
112 protected:
113  virtual void RemoveReferens() Q_DECL_OVERRIDE;
114  virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;
115  virtual void SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj) Q_DECL_OVERRIDE;
116  virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE;
117  virtual void SetVisualization() Q_DECL_OVERRIDE;
118 
119 private:
120  Q_DISABLE_COPY(VToolPointOfIntersectionArcs)
121 
122  /** @brief firstArcId id first arc. */
123  quint32 firstArcId;
124 
125  /** @brief secondArcId id second arc. */
126  quint32 secondArcId;
127 
129 
131  const quint32 &firstArcId, const quint32 &secondArcId,
132  CrossCirclesPoint pType, const Source &typeCreation,
133  QGraphicsItem * parent = nullptr);};
134 
135 #endif // VTOOLPOINTOFINTERSECTIONARCS_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.
static VToolPointOfIntersectionArcs * Create(QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE
void setCirclesCrossPoint(const CrossCirclesPoint &value)
virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE
virtual void setDialog() Q_DECL_OVERRIDE
setDialog set dialog when user want change tool option.
static QPointF FindPoint(const VArc *arc1, const VArc *arc2, const CrossCirclesPoint pType)
virtual void RemoveReferens() Q_DECL_OVERRIDE
RemoveReferens decrement value of reference.
virtual void SetVisualization() Q_DECL_OVERRIDE
virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE
quint32 secondArcId
secondArcId id second arc.
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE
SaveDialog save options into file after change in dialog.
quint32 firstArcId
firstArcId id first arc.
virtual void SaveOptions(QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
CrossCirclesPoint GetCrossCirclesPoint() const
virtual int type() const Q_DECL_OVERRIDE
The VToolSinglePoint class parent for all tools what create points.
@ PointOfIntersectionArcs
Source
Definition: def.h:106
#define NULL_ID
Definition: ifcdef.h:76
Document
CrossCirclesPoint