Seamly2D
Code documentation
pieceanchorpoint_visual.h
Go to the documentation of this file.
1 /************************************************************************
2  ** @file pieceanchorpoint_visual.cpp
3  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
4  ** @date 14 2, 2017
5  **
6  ** @brief
7  ** @copyright
8  ** This source code is part of the Valentine project, a pattern making
9  ** program, whose allow create and modeling patterns of clothing.
10  ** Copyright (C) 2022 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 #ifndef PIECE_ANCHOR_POINT_VISUAL_H
29 #define PIECE_ANCHOR_POINT_VISUAL_H
30 
31 #include "vispath.h"
32 
33 class VSimplePoint;
34 
36 {
37  Q_OBJECT
38 
39 public:
40  PieceAnchorPointVisual(const VContainer *data, QGraphicsItem *parent = nullptr);
41  virtual ~PieceAnchorPointVisual() Q_DECL_EQ_DEFAULT;
42 
43  virtual void RefreshGeometry() Q_DECL_OVERRIDE;
44  void setAnchors(const QVector<quint32> &anchors);
45  virtual int type() const Q_DECL_OVERRIDE {return Type;}
46  enum { Type = UserType + static_cast<int>(Vis::PieceAnchors)};
47 
48 private:
49  Q_DISABLE_COPY(PieceAnchorPointVisual)
51  QVector<quint32> m_anchors;
52 
53  VSimplePoint *GetPoint(quint32 i, const QColor &color);
54 
55  void HideAllItems();
56 };
57 
58 #endif // PIECE_ANCHOR_POINT_VISUAL_H
virtual void RefreshGeometry() Q_DECL_OVERRIDE
void setAnchors(const QVector< quint32 > &anchors)
QVector< VSimplePoint * > m_points
virtual ~PieceAnchorPointVisual() Q_DECL_EQ_DEFAULT
PieceAnchorPointVisual(const VContainer *data, QGraphicsItem *parent=nullptr)
virtual int type() const Q_DECL_OVERRIDE
VSimplePoint * GetPoint(quint32 i, const QColor &color)
The VContainer class container of all variables.
Definition: vcontainer.h:141
const VContainer * data
Definition: visualization.h:97
@ PieceAnchors