KiCad PCB EDA Suite
Loading...
Searching...
No Matches
angle_item.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KICAD, a free EDA CAD application.
3 *
4 * Copyright (C) 2024 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef PREVIEW_ANGLE_ITEM_H
21#define PREVIEW_ANGLE_ITEM_H
22
23#include <memory>
24
26
27class EDIT_POINTS;
28
29namespace KIGFX
30{
31namespace PREVIEW
32{
33
35{
36public:
37 ANGLE_ITEM( const std::shared_ptr<EDIT_POINTS>& aPoints );
38
39 const BOX2I ViewBBox() const override;
40
41 void SetEditPoints( const std::shared_ptr<EDIT_POINTS>& aPoints )
42 {
43 m_points = aPoints;
44 }
45
46private:
47 void drawPreviewShape( KIGFX::VIEW* aView ) const override;
48
49 std::weak_ptr<EDIT_POINTS> m_points;
50};
51
52} // PREVIEW
53} // KIGFX
54
55#endif
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
EDIT_POINTS is a VIEW_ITEM that manages EDIT_POINTs and EDIT_LINEs and draws them.
void SetEditPoints(const std::shared_ptr< EDIT_POINTS > &aPoints)
Definition angle_item.h:41
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
std::weak_ptr< EDIT_POINTS > m_points
Definition angle_item.h:49
void drawPreviewShape(KIGFX::VIEW *aView) const override
Draw the preview onto the given GAL.
ANGLE_ITEM(const std::shared_ptr< EDIT_POINTS > &aPoints)
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:29