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.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:
48 
49  TOOL_BASE( const std::string& aToolName );
50  virtual ~TOOL_BASE();
51 
52  virtual void Reset( RESET_REASON aReason ) override;
53 
55  {
56  return m_savedSettings;
57  }
58 
59  ROUTER* Router() const;
60 
61 protected:
62  const VECTOR2I snapToItem( bool aEnabled, ITEM* aItem, VECTOR2I aP);
63  virtual ITEM* pickSingleItem( const VECTOR2I& aWhere, int aNet = -1, int aLayer = -1 );
64  virtual void highlightNet( bool aEnabled, int aNetcode = -1 );
65  virtual void updateStartItem( TOOL_EVENT& aEvent );
66  virtual void updateEndItem( const TOOL_EVENT& aEvent );
67  void deleteTraces( ITEM* aStartItem, bool aWholeTrack );
68 
70 
76 
79 
86 };
87 
88 }
89 
90 #endif
Class ITEM.
Definition: pns_item.h:53
static TOOL_ACTION ACT_RouterOptions
Definition: pns_tool_base.h:47
Class ROUTING_SETTINGS.
#define APIEXPORT
Macros which export functions from a DLL/DSO.
Definition: import_export.h:44
GRID_HELPER * m_gridHelper
Definition: pns_tool_base.h:83
VECTOR2I m_startSnapPoint
Definition: pns_tool_base.h:75
SIZES_SETTINGS m_savedSizes
Stores sizes settings between router invocations.
Definition: pns_tool_base.h:72
const ROUTING_SETTINGS & PNSSettings() const
Definition: pns_tool_base.h:54
KIGFX::VIEW_CONTROLS * m_ctls
Definition: pns_tool_base.h:81
MSG_PANEL_ITEMS m_panelItems
Definition: pns_tool_base.h:69
Class TOOL_EVENT.
Definition: tool_event.h:162
ITEM * m_startItem
Definition: pns_tool_base.h:73
ROUTER * m_router
Definition: pns_tool_base.h:85
Class VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (...
Definition: view_controls.h:94
ROUTING_SETTINGS m_savedSettings
Stores routing settings between router invocations.
Definition: pns_tool_base.h:71
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
VECTOR2I m_endSnapPoint
Definition: pns_tool_base.h:78
Class TOOL_ACTION.
Definition: tool_action.h:46
static bool highlightNet(TOOL_MANAGER *aToolMgr, const VECTOR2D &aPosition)
Function highlightNet() Looks for a BOARD_CONNECTED_ITEM in a given spot, and if one is found - it en...
PCB_EDIT_FRAME * m_frame
Definition: pns_tool_base.h:80
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:80
Message panel definition file.
Push and Shove diff pair dimensions (gap) settings dialog.
PNS_KICAD_IFACE * m_iface
Definition: pns_tool_base.h:84