KiCad PCB EDA Suite
Loading...
Searching...
No Matches
drc_rule_editor_tool.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 modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef DRC_RULE_EDITOR_TOOL_H
21#define DRC_RULE_EDITOR_TOOL_H
22
23#include <board_commit.h>
24#include <board.h>
25#include <memory>
26#include <vector>
27#include <tools/pcb_tool_base.h>
28
29
30class PCB_EDIT_FRAME;
33class DRC_ENGINE;
34
35
37{
38public:
41
43 void Reset( RESET_REASON aReason ) override;
44
51 void ShowDRCRuleEditorDialog( wxWindow* aParent );
52
53 int ShowDRCRuleEditorDialog( const TOOL_EVENT& aEvent );
54
59
64
65 std::shared_ptr<DRC_ENGINE> GetDRCEngine() { return m_drcEngine; }
66
67private:
69 void setTransitions() override;
70
74 void updatePointers();
75
76 EDA_UNITS userUnits() const { return m_editFrame->GetUserUnits(); }
77
78private:
82 std::shared_ptr<DRC_ENGINE> m_drcEngine;
83};
84
85
86#endif // DRC_RULE_EDITOR_TOOL_H
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
Design Rule Checker object that performs all the DRC tests.
Definition drc_engine.h:133
std::shared_ptr< DRC_ENGINE > m_drcEngine
std::shared_ptr< DRC_ENGINE > GetDRCEngine()
void updatePointers()
Update needed pointers from the one pointer which is known not to change.
void ShowDRCRuleEditorDialog(wxWindow *aParent)
Opens the DRC Rule Editor dialog.
bool IsDRCRuleEditorDialogShown()
Check to see if the DRC_TOOL dialog is currently shown.
PCB_EDIT_FRAME * m_editFrame
void DestroyDRCRuleEditorDialog()
Close and free the DRC dialog.
void setTransitions() override
< Set up handlers for various events.
DIALOG_DRC_RULE_EDITOR * m_drcRuleEditorDlg
EDA_UNITS userUnits() const
The main frame for Pcbnew.
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
RESET_REASON
Determine the reason of reset for a tool.
Definition tool_base.h:78
Generic, UI-independent tool event.
Definition tool_event.h:171
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
EDA_UNITS
Definition eda_units.h:48
void Reset() override