KiCad PCB EDA Suite
pns_tool_base.h
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2014 CERN
5 * Copyright (C) 2016-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 * Author: Tomasz Wlostowski <[email protected]>
7 * Author: Maciej Suminski <[email protected]>
8 *
9 * This program is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#ifndef __PNS_TOOL_BASE_H
24#define __PNS_TOOL_BASE_H
25
26#include <memory>
27#include <import_export.h>
28
29#include <math/vector2d.h>
30#include <tools/pcb_tool_base.h>
31#include <board_commit.h>
32
33#include <widgets/msgpanel.h>
34
35#include "pns_router.h"
36
37class PCB_GRID_HELPER;
38
39class PNS_KICAD_IFACE;
41
42namespace PNS
43{
44
46{
47public:
48 TOOL_BASE( const std::string& aToolName );
49 virtual ~TOOL_BASE();
50
51 virtual void Reset( RESET_REASON aReason ) override;
52
53 ROUTER* Router() const;
54
55protected:
56 bool checkSnap( ITEM* aItem );
57
58 const VECTOR2I snapToItem( ITEM* aSnapToItem, const VECTOR2I& aP);
59
60 virtual ITEM* pickSingleItem( const VECTOR2I& aWhere, int aNet = -1, int aLayer = -1,
61 bool aIgnorePads = false,
62 const std::vector<ITEM*> aAvoidItems = {} );
63
64 virtual void highlightNet( bool aEnabled, int aNetcode = -1 );
65
66 virtual void updateStartItem( const TOOL_EVENT& aEvent, bool aIgnorePads = false );
67 virtual void updateEndItem( const TOOL_EVENT& aEvent );
68
69 SIZES_SETTINGS m_savedSizes; // Stores sizes settings between router invocations
72 bool m_startHighlight; // Was net highlighted before routing?
73
76
80
82};
83
84}
85
86#endif
Base class for PNS router board items.
Definition: pns_item.h:56
SIZES_SETTINGS m_savedSizes
Definition: pns_tool_base.h:69
PNS_KICAD_IFACE * m_iface
Definition: pns_tool_base.h:78
ITEM * m_startItem
Definition: pns_tool_base.h:70
ROUTER * m_router
Definition: pns_tool_base.h:79
VECTOR2I m_endSnapPoint
Definition: pns_tool_base.h:75
PCB_GRID_HELPER * m_gridHelper
Definition: pns_tool_base.h:77
VECTOR2I m_startSnapPoint
Definition: pns_tool_base.h:71
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
Generic, UI-independent tool event.
Definition: tool_event.h:155
#define APIEXPORT
Macros which export functions from a DLL/DSO.
Definition: import_export.h:44
Message panel definition file.
Push and Shove diff pair dimensions (gap) settings dialog.
static bool highlightNet(TOOL_MANAGER *aToolMgr, const VECTOR2D &aPosition)