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 (C) 2017-2022 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_POLYGON_ITEM__H_
25#define PREVIEW_POLYGON_ITEM__H_
26
28
29#include <gal/color4d.h>
32
33namespace KIGFX
34{
35
36class GAL;
37class VIEW;
38
39namespace PREVIEW
40{
41
46{
47
48public:
50
52 void SetLineColor( KIGFX::COLOR4D lineColor );
53
55 void SetLeaderColor( KIGFX::COLOR4D leaderColor );
56
58 virtual const BOX2I ViewBBox() const override;
59
68 void SetPoints( const SHAPE_LINE_CHAIN& aLockedInPts, const SHAPE_LINE_CHAIN& aLeaderPts,
69 const SHAPE_LINE_CHAIN& aLoopPts );
70
71private:
73 void drawPreviewShape( KIGFX::VIEW* aView ) const override;
74
77
80
83
86
87 static const double POLY_LINE_WIDTH;
88};
89
90} // PREVIEW
91} // KIGFX
92
93#endif // PREVIEW_POLYGON_ITEM__H_
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
A preview item which shows an in-progress polygon, which can be used for zone outlines,...
Definition: polygon_item.h:46
KIGFX::COLOR4D m_lineColor
the preview leader line color
Definition: polygon_item.h:82
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
KIGFX::COLOR4D m_leaderColor
Definition: polygon_item.h:85
void SetLineColor(KIGFX::COLOR4D lineColor)
Sets the color of the outline leader line.
SHAPE_LINE_CHAIN m_lockedChain
Definition: polygon_item.h:76
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
Definition: polygon_item.h:87
SHAPE_LINE_CHAIN m_leaderChain
Definition: polygon_item.h:76
POLYGON_ITEM()
Sets the color of the preview outline.
SHAPE_POLY_SET m_polyfill
the preview outline color
Definition: polygon_item.h:79
SHAPE_LINE_CHAIN m_loopChain
polygon fill
Definition: polygon_item.h:76
SIMPLE_OVERLAY_ITEM is class that represents a visual area drawn on a canvas, used to temporarily dem...
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
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: color4d.cpp:247