KiCad PCB EDA Suite
Loading...
Searching...
No Matches
rule_area_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 (C) 2024 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 EESCHEMA_TOOLS_RULE_CREATE_HELPER__H_
25#define EESCHEMA_TOOLS_RULE_CREATE_HELPER__H_
26
29#include "sch_rule_area.h"
30#include <view/view.h>
31
32namespace KIGFX
33{
34class VIEW;
35}
36
37class TOOL_MANAGER;
38
45{
46public:
48
50
51 SCH_RULE_AREA* GetRuleArea() const { return m_rule_area.get(); }
52
53 /*
54 * Interface for receiving #POLYGON_GEOM_MANAGER update
55 */
56 void OnGeometryChange( const POLYGON_GEOM_MANAGER& aMgr ) override;
57
58 bool OnFirstPoint( POLYGON_GEOM_MANAGER& aMgr ) override;
59
60 void OnComplete( const POLYGON_GEOM_MANAGER& aMgr ) override;
61
67 std::unique_ptr<SCH_RULE_AREA> createNewRuleArea();
68
74 void commitRuleArea( std::unique_ptr<SCH_RULE_AREA> aRuleArea );
75
76private:
79
82
85
87 std::unique_ptr<SCH_RULE_AREA> m_rule_area;
88
91};
92
93#endif // EESCHEMA_TOOLS_RULE_CREATE_HELPER__H_
A preview item which shows an in-progress polygon, which can be used for zone outlines,...
Definition: polygon_item.h:46
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
"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...
An adjunct helper to the DRAWING_TOOL interactive tool, which handles incoming geometry changes from ...
std::unique_ptr< SCH_RULE_AREA > createNewRuleArea()
Create a new SCH_RULE_AREA.
std::unique_ptr< SCH_RULE_AREA > m_rule_area
The TOOL_MANAGER running the tool.
void OnGeometryChange(const POLYGON_GEOM_MANAGER &aMgr) override
Called when the polygon is complete.
void OnComplete(const POLYGON_GEOM_MANAGER &aMgr) override
KIGFX::VIEW & m_parentView
The active schematic edit frame.
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...
void commitRuleArea(std::unique_ptr< SCH_RULE_AREA > aRuleArea)
Commit the current rule area in progress to the schematic.
SCH_RULE_AREA * GetRuleArea() const
KIGFX::PREVIEW::POLYGON_ITEM m_previewItem
< The preview item to display
SCH_EDIT_FRAME * m_frame
The rule area in progress.
Schematic editor (Eeschema) main window.
Master controller class:
Definition: tool_manager.h:62
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:247