Seamly2D
Code documentation
vtoolellipticalarc.h
Go to the documentation of this file.
1 /******************************************************************************
2  * @file vtoolellipticalarc.h
3  ** @author Douglas S Caskey
4  ** @date 21 Mar, 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  ** You should have received a copy of the GNU General Public License
15  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
16  **
17  *****************************************************************************/
18 /************************************************************************
19  **
20  ** @file vtoolellipticalarc.h
21  ** @author Valentina Zhuravska <zhuravska19(at)gmail.com>
22  ** @date 20 10, 2016
23  **
24  ** @brief
25  ** @copyright
26  ** This source code is part of the Valentine project, a pattern making
27  ** program, whose allow create and modeling patterns of clothing.
28  ** Copyright (C) 2016 Seamly2D project
29  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
30  **
31  ** Seamly2D is free software: you can redistribute it and/or modify
32  ** it under the terms of the GNU General Public License as published by
33  ** the Free Software Foundation, either version 3 of the License, or
34  ** (at your option) any later version.
35  **
36  ** Seamly2D is distributed in the hope that it will be useful,
37  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
38  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39  ** GNU General Public License for more details.
40  **
41  ** You should have received a copy of the GNU General Public License
42  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
43  **
44  *************************************************************************/
45 
46 #ifndef VTOOLELLIPTICALARC_H
47 #define VTOOLELLIPTICALARC_H
48 
49 #include <qcompilerdetection.h>
50 #include <QGraphicsItem>
51 #include <QMetaObject>
52 #include <QObject>
53 #include <QString>
54 #include <QtGlobal>
55 
56 #include "../ifc/xml/vabstractpattern.h"
57 #include "../vmisc/def.h"
58 #include "vabstractspline.h"
59 
60 class VFormula;
61 template <class T> class QSharedPointer;
62 
63 /**
64  * @brief The VToolEllipticalArc class tool for creation elliptical arc.
65  */
67 {
68  Q_OBJECT
69 public:
70  virtual void setDialog() Q_DECL_OVERRIDE;
73  static VToolEllipticalArc *Create(const quint32 _id, const quint32 &center, QString &radius1, QString &radius2,
74  QString &f1, QString &f2, QString &rotationAngle, const QString &color,
75  const QString &penStyle, const QString &lineWeight, VMainGraphicsScene *scene,
77  const Document &parse, const Source &typeCreation);
78  static const QString ToolType;
79  virtual int type() const Q_DECL_OVERRIDE {return Type;}
80  enum { Type = UserType + static_cast<int>(Tool::EllipticalArc)};
81  virtual QString getTagName() const Q_DECL_OVERRIDE;
82 
83  QString CenterPointName() const;
84 
85  quint32 getCenter() const;
86  void setCenter(const quint32 &value);
87 
89  void SetFormulaRadius1(const VFormula &value);
90 
92  void SetFormulaRadius2(const VFormula &value);
93 
94  VFormula GetFormulaF1() const;
95  void SetFormulaF1(const VFormula &value);
96 
97  VFormula GetFormulaF2() const;
98  void SetFormulaF2(const VFormula &value);
99 
101  void SetFormulaRotationAngle(const VFormula &value);
102 
103  virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
104 
105 
106 protected slots:
107  virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE;
108 
109 protected:
110  virtual void RemoveReferens() Q_DECL_OVERRIDE;
111  virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;
112  virtual void SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj) Q_DECL_OVERRIDE;
113  virtual void SetVisualization() Q_DECL_OVERRIDE;
114  virtual QString makeToolTip() const Q_DECL_OVERRIDE;
115 
116 private:
117  Q_DISABLE_COPY(VToolEllipticalArc)
119  const Source &typeCreation, QGraphicsItem * parent = nullptr);
120 };
121 
122 #endif // VTOOLELLIPTICALARC_H
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 VToolEllipticalArc class tool for creation elliptical arc.
virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE
contextMenuEvent handle context menu events.
virtual void RemoveReferens() Q_DECL_OVERRIDE
RemoveReferens decrement value of reference.
void setCenter(const quint32 &value)
void SetFormulaF2(const VFormula &value)
virtual void SaveOptions(QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
virtual QString getTagName() const Q_DECL_OVERRIDE
void SetFormulaRotationAngle(const VFormula &value)
virtual QString makeToolTip() const Q_DECL_OVERRIDE
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE
virtual int type() const Q_DECL_OVERRIDE
VFormula GetFormulaRotationAngle() const
void SetFormulaRadius1(const VFormula &value)
VFormula GetFormulaF2() const
VFormula GetFormulaRadius1() const
static const QString ToolType
virtual void SetVisualization() Q_DECL_OVERRIDE
quint32 getCenter() const
static VToolEllipticalArc * Create(QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
Create help create tool.
void SetFormulaF1(const VFormula &value)
QString CenterPointName() const
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE
SaveDialog save options into file after change in dialog.
virtual void setDialog() Q_DECL_OVERRIDE
setDialog set dialog when user want change tool option.
void SetFormulaRadius2(const VFormula &value)
VFormula GetFormulaF1() const
VFormula GetFormulaRadius2() const
@ EllipticalArc
Source
Definition: def.h:106
#define NULL_ID
Definition: ifcdef.h:76
Document