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 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  * Author: Maciej Suminski <maciej.suminski@cern.ch>
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 <msgpanel.h>
34 
35 #include "pns_router.h"
36 
37 class GRID_HELPER;
38 
39 class PNS_KICAD_IFACE;
41 
42 namespace PNS {
43 
45 {
46 public:
47  TOOL_BASE( const std::string& aToolName );
48  virtual ~TOOL_BASE();
49 
50  virtual void Reset( RESET_REASON aReason ) override;
51 
52  ROUTER* Router() const;
53 
54 protected:
55  bool checkSnap( ITEM* aItem );
56  const VECTOR2I snapToItem( bool aEnabled, ITEM* aItem, VECTOR2I aP);
57  virtual ITEM* pickSingleItem( const VECTOR2I& aWhere, int aNet = -1, int aLayer = -1,
58  bool aIgnorePads = false, const std::vector<ITEM*> aAvoidItems = {} );
59  virtual void highlightNet( bool aEnabled, int aNetcode = -1 );
60  virtual void updateStartItem( const TOOL_EVENT& aEvent, bool aIgnorePads = false );
61  virtual void updateEndItem( const TOOL_EVENT& aEvent );
62  void deleteTraces( ITEM* aStartItem, bool aWholeTrack );
63 
65 
71 
74 
78 
80 };
81 
82 }
83 
84 #endif
ITEM.
Definition: pns_item.h:53
#define APIEXPORT
Macros which export functions from a DLL/DSO.
Definition: import_export.h:44
GRID_HELPER * m_gridHelper
Definition: pns_tool_base.h:75
VECTOR2I m_startSnapPoint
Definition: pns_tool_base.h:69
bool m_startHighlight
Keeps track of whether the net was highlighted before routing.
Definition: pns_tool_base.h:70
SIZES_SETTINGS m_savedSizes
Stores sizes settings between router invocations.
Definition: pns_tool_base.h:66
MSG_PANEL_ITEMS m_panelItems
Definition: pns_tool_base.h:64
TOOL_EVENT.
Definition: tool_event.h:171
ITEM * m_startItem
Definition: pns_tool_base.h:67
ROUTER * m_router
Definition: pns_tool_base.h:77
static bool highlightNet(TOOL_MANAGER *aToolMgr, const VECTOR2D &aPosition)
VECTOR2I m_endSnapPoint
Definition: pns_tool_base.h:73
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
RESET_REASON
Determines the reason of reset for a tool
Definition: tool_base.h:79
void Reset(RESET_REASON aReason) override
Function Reset() Brings the tool to a known, initial state.
Message panel definition file.
Push and Shove diff pair dimensions (gap) settings dialog.
PNS_KICAD_IFACE * m_iface
Definition: pns_tool_base.h:76