KiCad PCB EDA Suite
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-2021 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 
31 
32 namespace KIGFX
33 {
34 
35 class GAL;
36 class VIEW;
37 
38 namespace PREVIEW
39 {
40 
45 {
46 
47 public:
48  POLYGON_ITEM();
49 
51  virtual const BOX2I ViewBBox() const override;
52 
60  void SetPoints( const SHAPE_LINE_CHAIN& aLockedInPts,
61  const SHAPE_LINE_CHAIN& aLeaderPts );
62 
63 private:
65  void drawPreviewShape( KIGFX::VIEW* aView ) const override;
66 
69 
72 
73  static const double POLY_LINE_WIDTH;
74 };
75 
76 } // PREVIEW
77 } // KIGFX
78 
79 #endif // PREVIEW_POLYGON_ITEM__H_
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
static const double POLY_LINE_WIDTH
Definition: polygon_item.h:73
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:236
SIMPLE_OVERLAY_ITEM is class that represents a visual area drawn on a canvas, used to temporarily dem...
Represent a set of closed polygons.
void drawPreviewShape(KIGFX::VIEW *aView) const override
< Draw rectangle and center line onto GAL
SHAPE_LINE_CHAIN m_leaderChain
polygon fill
Definition: polygon_item.h:68
A preview item which shows an in-progress polygon, which can be used for zone outlines,...
Definition: polygon_item.h:44
Represent a polyline (an zero-thickness chain of connected line segments).
void SetPoints(const SHAPE_LINE_CHAIN &aLockedInPts, const SHAPE_LINE_CHAIN &aLeaderPts)
Set the polygon points.
POLYGON_ITEM()
Gets the bounding box of the polygon.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
SHAPE_LINE_CHAIN m_lockedChain
Definition: polygon_item.h:68