KiCad PCB EDA Suite
Loading...
Searching...
No Matches
zone_create_helper.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 TOOLS_ZONE_CREATE_HELPER__H_
21#define TOOLS_ZONE_CREATE_HELPER__H_
22
25
26#include <tools/drawing_tool.h>
27
28namespace KIGFX
29{
30class VIEW;
31}
32
39{
40public:
64
69 ZONE_CREATE_HELPER( DRAWING_TOOL& aTool, PARAMS& aParams );
70
71 virtual ~ZONE_CREATE_HELPER();
72
73 ZONE* GetZone() const { return m_zone.get(); }
74
75 /*
76 * Interface for receiving #POLYGON_GEOM_MANAGER update
77 */
78 void OnGeometryChange( const POLYGON_GEOM_MANAGER& aMgr ) override;
79
80 bool OnFirstPoint( POLYGON_GEOM_MANAGER& aMgr ) override;
81
82 void OnComplete( const POLYGON_GEOM_MANAGER& aMgr ) override;
83
90 std::unique_ptr<ZONE> createNewZone( bool aKeepout );
91
98 std::unique_ptr<ZONE> createZoneFromExisting( const ZONE& aSrcZone );
99
106 void performZoneCutout( ZONE& aZone, const ZONE& aCutout );
107
116 void commitZone( std::unique_ptr<ZONE> aZone );
117
118private:
119
124 void setUniquePriority( ZONE_SETTINGS& aZoneInfo );
125
127
130
133
136
138 std::unique_ptr<ZONE> m_zone;
139};
140
141#endif // TOOLS_ZONE_CREATE_HELPER__H_
Tool responsible for drawing graphical elements like lines, arcs, circles, etc.
A preview item which shows an in-progress polygon, which can be used for zone outlines,...
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
"Listener" interface for a class that wants to be updated about polygon geometry changes
Class that handles the drawing of a polygon, including management of last corner deletion and drawing...
void commitZone(std::unique_ptr< ZONE > aZone)
Commit the current zone-in-progress to the BOARD.
PARAMS & m_params
The preview item to display.
bool OnFirstPoint(POLYGON_GEOM_MANAGER &aMgr) override
Called before the first point is added - clients can do initialization here, and can veto the start o...
ZONE_CREATE_HELPER(DRAWING_TOOL &aTool, PARAMS &aParams)
std::unique_ptr< ZONE > createNewZone(bool aKeepout)
Prompt the user for new zone settings, and create a new zone with those settings.
void performZoneCutout(ZONE &aZone, const ZONE &aCutout)
Cut one zone out of another one (i.e.
void setUniquePriority(ZONE_SETTINGS &aZoneInfo)
Choose a new priority for @aZoneInfo.
void OnGeometryChange(const POLYGON_GEOM_MANAGER &aMgr) override
Called when the polygon is complete.
std::unique_ptr< ZONE > m_zone
std::unique_ptr< ZONE > createZoneFromExisting(const ZONE &aSrcZone)
Create a new zone with the settings from an existing zone.
KIGFX::PREVIEW::POLYGON_ITEM m_previewItem
view that show the preview item
void OnComplete(const POLYGON_GEOM_MANAGER &aMgr) override
KIGFX::VIEW & m_parentView
The zone-in-progress.
DRAWING_TOOL & m_tool
Parameters of the zone to be drawn.
ZONE_SETTINGS handles zones parameters.
Handle a list of polygons defining a copper zone.
Definition zone.h:70
LEADER_MODE
The kind of the leader line.
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:29
ZONE_MODE
Definition pcb_actions.h:31
Parameters used to fully describe a zone creation process.
bool m_thieving
Layer to begin drawing.
ZONE_MODE m_mode
Zone settings source (for similar and cutout zones)
bool m_keepout
< Should create a keepout zone?
ZONE * m_sourceZone
Zone leader mode.
PCB_LAYER_ID m_layer
The zone mode to operate in.