KiCad PCB EDA Suite
Loading...
Searching...
No Matches
polygon_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 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_POLYGON_ITEM__H_
21#define PREVIEW_POLYGON_ITEM__H_
22
24
25#include <gal/color4d.h>
28
29namespace KIGFX
30{
31
32class GAL;
33class VIEW;
34
35namespace PREVIEW
36{
37
42{
43
44public:
46
48 void SetLineColor( KIGFX::COLOR4D lineColor );
49
51 void SetLeaderColor( KIGFX::COLOR4D leaderColor );
52
54 virtual const BOX2I ViewBBox() const override;
55
64 void SetPoints( const SHAPE_LINE_CHAIN& aLockedInPts, const SHAPE_LINE_CHAIN& aLeaderPts,
65 const SHAPE_LINE_CHAIN& aLoopPts );
66
67private:
69 void drawPreviewShape( KIGFX::VIEW* aView ) const override;
70
73
76
79
82
83 static const double POLY_LINE_WIDTH;
84};
85
86} // PREVIEW
87} // KIGFX
88
89#endif // PREVIEW_POLYGON_ITEM__H_
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
Abstract interface for drawing on a 2D-surface.
KIGFX::COLOR4D m_lineColor
the preview leader line color
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void SetLeaderColor(KIGFX::COLOR4D leaderColor)
Gets the bounding box of the polygon.
void drawPreviewShape(KIGFX::VIEW *aView) const override
< Draw rectangle and center line onto GAL
void SetLineColor(KIGFX::COLOR4D lineColor)
Sets the color of the outline leader line.
SHAPE_LINE_CHAIN m_lockedChain
void SetPoints(const SHAPE_LINE_CHAIN &aLockedInPts, const SHAPE_LINE_CHAIN &aLeaderPts, const SHAPE_LINE_CHAIN &aLoopPts)
Set the polygon points.
static const double POLY_LINE_WIDTH
SHAPE_LINE_CHAIN m_leaderChain
POLYGON_ITEM()
Sets the color of the preview outline.
SHAPE_POLY_SET m_polyfill
the preview outline color
SHAPE_LINE_CHAIN m_loopChain
polygon fill
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:29