KiCad PCB EDA Suite
zone_filler.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) 2014-2017 CERN
5  * Copyright (C) 2014-2017 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Tomasz W┼éostowski <tomasz.wlostowski@cern.ch>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #ifndef __ZONE_FILLER_H
27 #define __ZONE_FILLER_H
28 
29 #include <vector>
30 #include <class_zone.h>
31 
33 class BOARD;
34 class COMMIT;
35 class SHAPE_POLY_SET;
36 class SHAPE_LINE_CHAIN;
37 
39 {
40 public:
41  ZONE_FILLER( BOARD* aBoard, COMMIT* aCommit = nullptr );
42  ~ZONE_FILLER();
43 
44  void SetProgressReporter( WX_PROGRESS_REPORTER* aReporter );
45  bool Fill( std::vector<ZONE_CONTAINER*> aZones, bool aCheck = false );
46 
47 private:
48 
49  void buildZoneFeatureHoleList( const ZONE_CONTAINER* aZone,
50  SHAPE_POLY_SET& aFeatures ) const;
51 
64  void computeRawFilledAreas( const ZONE_CONTAINER* aZone,
65  const SHAPE_POLY_SET& aSmoothedOutline,
66  SHAPE_POLY_SET& aRawPolys,
67  SHAPE_POLY_SET& aFinalPolys ) const;
68 
70  ZONE_SEGMENT_FILL& aFillSegmList, int aStep ) const;
71 
80  bool fillZoneWithSegments( const ZONE_CONTAINER* aZone,
81  const SHAPE_POLY_SET& aFilledPolys,
82  ZONE_SEGMENT_FILL& aFillSegs ) const;
83 
95  const ZONE_CONTAINER* aZone,
96  const SHAPE_POLY_SET& aRawFilledArea,
97  double aArcCorrection,
98  double aRoundPadThermalRotation ) const;
99 
114  bool fillSingleZone( const ZONE_CONTAINER* aZone,
115  SHAPE_POLY_SET& aRawPolys,
116  SHAPE_POLY_SET& aFinalPolys ) const;
117 
121 };
122 
123 #endif
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
std::vector< SEG > ZONE_SEGMENT_FILL
Definition: class_zone.h:50
BOARD * m_board
Definition: zone_filler.h:118
WX_PROGRESS_REPORTER * m_progressReporter
Definition: zone_filler.h:120
Classes to handle copper zones.
Class COMMIT.
Definition: commit.h:71
void buildZoneFeatureHoleList(const ZONE_CONTAINER *aZone, SHAPE_POLY_SET &aFeatures) const
void SetProgressReporter(WX_PROGRESS_REPORTER *aReporter)
Definition: zone_filler.cpp:78
COMMIT * m_commit
Definition: zone_filler.h:119
Class SHAPE_POLY_SET.
ZONE_FILLER(BOARD *aBoard, COMMIT *aCommit=nullptr)
Definition: zone_filler.cpp:67
bool Fill(std::vector< ZONE_CONTAINER * > aZones, bool aCheck=false)
Definition: zone_filler.cpp:83
bool fillZoneWithSegments(const ZONE_CONTAINER *aZone, const SHAPE_POLY_SET &aFilledPolys, ZONE_SEGMENT_FILL &aFillSegs) const
Function fillZoneWithSegments Fill sub areas in a zone with segments with m_ZoneMinThickness width A ...
bool fillSingleZone(const ZONE_CONTAINER *aZone, SHAPE_POLY_SET &aRawPolys, SHAPE_POLY_SET &aFinalPolys) const
Build the filled solid areas polygons from zone outlines (stored in m_Poly) The solid areas can be mo...
bool fillPolygonWithHorizontalSegments(const SHAPE_LINE_CHAIN &aPolygon, ZONE_SEGMENT_FILL &aFillSegmList, int aStep) const
Helper function fillPolygonWithHorizontalSegments fills a polygon with horizontal segments...
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
Class SHAPE_LINE_CHAIN.
void computeRawFilledAreas(const ZONE_CONTAINER *aZone, const SHAPE_POLY_SET &aSmoothedOutline, SHAPE_POLY_SET &aRawPolys, SHAPE_POLY_SET &aFinalPolys) const
Function computeRawFilledAreas Add non copper areas polygons (pads and tracks with clearance) to a fi...
void buildUnconnectedThermalStubsPolygonList(SHAPE_POLY_SET &aCornerBuffer, const ZONE_CONTAINER *aZone, const SHAPE_POLY_SET &aRawFilledArea, double aArcCorrection, double aRoundPadThermalRotation) const
Function buildUnconnectedThermalStubsPolygonList Creates a set of polygons corresponding to stubs cre...