Seamly2D
Code documentation
point_intersectxy_tool.h
Go to the documentation of this file.
1 /**************************************************************************
2  **
3  ** @file point_intersectxy_tool.h
4  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
5  ** @date November 15, 2013
6  **
7  ** @author Douglas S Caskey
8  ** @date 7.21.2022
9  **
10  ** @brief
11  ** @copyright
12  ** This source code is part of the Valentine project, a pattern making
13  ** program, whose allow create and modeling patterns of clothing.
14  ** Copyright (C) 2013-2022 Seamly2D project
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 by
19  ** the Free Software Foundation, either version 3 of the License, or
20  ** (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 POINT_INTERSECTXY_TOOL_H
33 #define POINT_INTERSECTXY_TOOL_H
34 
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 <QString>
45 #include <QtGlobal>
46 
47 template <class T> class QSharedPointer;
48 
49 /**
50  * @brief The PointIntersectXYTool class tool for creation point intersection two lines.
51  */
53 {
54  Q_OBJECT
55 public:
56  virtual void setDialog() Q_DECL_OVERRIDE;
57 
60  static PointIntersectXYTool *Create(const quint32 _id, const QString &pointName, const QString &lineType,
61  const QString &lineWeight,
62  const QString &lineColor, const quint32 &firstPointId,
63  const quint32 &secondPointId, qreal mx, qreal my, bool showPointName,
65  const Document &parse, const Source &typeCreation);
66 
67  static const QString ToolType;
68  virtual int type() const Q_DECL_OVERRIDE {return Type;}
69  enum {Type = UserType + static_cast<int>(Tool::PointOfIntersection)};
70 
71  QString firstPointName() const;
72  QString secondPointName() const;
73 
74  virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
75 
76 protected slots:
77  virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE;
78 
79 protected:
80  virtual void RemoveReferens() Q_DECL_OVERRIDE;
81  virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;
82  virtual void SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj) Q_DECL_OVERRIDE;
83  virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE;
84  virtual void SetVisualization() Q_DECL_OVERRIDE;
85 
86 private:
87  Q_DISABLE_COPY(PointIntersectXYTool)
89  const QString &lineType, const QString &lineWeight,
90  const QString &lineColor,
91  const quint32 &firstPointId, const quint32 &secondPointId,
92  const Source &typeCreation, QGraphicsItem * parent = nullptr);
93 };
94 
95 #endif // POINT_INTERSECTXY_TOOL_H
The DoubleLinePointTool class parent for all tools what creates a point with 2 lines.
quint32 secondPointId
firstPointId id first line point.
QString lineColor
secondLine second line item.
The PointIntersectXYTool class tool for creation point intersection two lines.
static const QString ToolType
virtual int type() const Q_DECL_OVERRIDE
virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE
virtual void RemoveReferens() Q_DECL_OVERRIDE
RemoveReferens decrement value of reference.
static PointIntersectXYTool * Create(QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
Create help create tool from GUI.
virtual void SetVisualization() Q_DECL_OVERRIDE
virtual void setDialog() Q_DECL_OVERRIDE
setDialog set dialog when user want change tool option.
virtual void SaveOptions(QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE
virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE
contextMenuEvent handle context menu events.
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE
SaveDialog save options into file after change in dialog.
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.
@ PointOfIntersection
Source
Definition: def.h:106
#define NULL_ID
Definition: ifcdef.h:76
Document