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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef PREVIEW_ANGLE_ITEM_H
25#define PREVIEW_ANGLE_ITEM_H
26
27#include <memory>
28
30
31class EDIT_POINTS;
32
33namespace KIGFX
34{
35namespace PREVIEW
36{
37
39{
40public:
41 ANGLE_ITEM( const std::shared_ptr<EDIT_POINTS>& aPoints );
42
43 const BOX2I ViewBBox() const override;
44
45 void SetEditPoints( const std::shared_ptr<EDIT_POINTS>& aPoints )
46 {
47 m_points = aPoints;
48 }
49
50private:
51 void drawPreviewShape( KIGFX::VIEW* aView ) const override;
52
53 std::weak_ptr<EDIT_POINTS> m_points;
54};
55
56} // PREVIEW
57} // KIGFX
58
59#endif
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
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:45
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:53
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:66
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:33