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