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 Kicad Developers, see change_log.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 
37 namespace PREVIEW
38 {
39 
47 {
48 
49 public:
50 
51  POLYGON_ITEM();
52 
54  virtual const BOX2I ViewBBox() const override;
55 
56 
64  void SetPoints( const std::vector<VECTOR2I>& aLockedInPts,
65  const std::vector<VECTOR2I>& aLeaderPts );
66 
67 private:
68 
70  void drawPreviewShape( KIGFX::GAL& aGal ) const override;
71 
74 
77 };
78 
79 } // PREVIEW
80 } // KIGFX
81 
82 #endif // PREVIEW_POLYGON_ITEM__H_
virtual const BOX2I ViewBBox() const override
Gets the bounding box of the polygon
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:56
SIMPLE_OVERLAY_ITEM is class that represents a visual area drawn on a canvas, used to temporarily dem...
void SetPoints(const std::vector< VECTOR2I > &aLockedInPts, const std::vector< VECTOR2I > &aLeaderPts)
Set the polygon points.
SHAPE_POLY_SET m_polyfill
polygon fill
Definition: polygon_item.h:76
Class SHAPE_POLY_SET.
SHAPE_LINE_CHAIN m_leaderChain
Definition: polygon_item.h:73
Class POLYGON_ITEM.
Definition: polygon_item.h:46
Class SHAPE_LINE_CHAIN.
void drawPreviewShape(KIGFX::GAL &aGal) const override
Draw rectangle and centre line onto GAL
SHAPE_LINE_CHAIN m_lockedChain
complete polyline of locked in and leader points
Definition: polygon_item.h:73
Class GAL is the abstract interface for drawing on a 2D-surface.