KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_algo_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-2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Tomasz Wlostowski <[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_ALGO_BASE_H
24#define __PNS_ALGO_BASE_H
25
26#include <math/box2.h>
27
29
30namespace PNS {
31
32class ROUTER;
33class LOGGER;
34class DEBUG_DECORATOR;
35
43{
44public:
45 ALGO_BASE( ROUTER* aRouter ) :
46 m_debugDecorator( nullptr ),
47 m_router( aRouter ),
48 m_logger( nullptr )
49 {}
50
51 virtual ~ALGO_BASE() {}
52
54 ROUTER* Router() const
55 {
56 return m_router;
57 }
58
61
63 virtual LOGGER* Logger();
64
65 void SetLogger( LOGGER* aLogger )
66 {
67 m_logger = aLogger;
68 }
69
74 {
75 m_debugDecorator = aDecorator;
76 }
77
79 {
80 return m_debugDecorator;
81 }
82
83 const BOX2I& VisibleViewArea() const;
84
85protected:
89};
90
91}
92
93#endif
Base class for all P&S algorithms (shoving, walkaround, line placement, dragging, etc....
Definition: pns_algo_base.h:43
const BOX2I & VisibleViewArea() const
virtual ~ALGO_BASE()
Return the instance of our router.
Definition: pns_algo_base.h:51
void SetDebugDecorator(DEBUG_DECORATOR *aDecorator)
Assign a debug decorator allowing this algo to draw extra graphics for visual debugging.
Definition: pns_algo_base.h:73
void SetLogger(LOGGER *aLogger)
Definition: pns_algo_base.h:65
virtual LOGGER * Logger()
ROUTER * Router() const
Return current router settings.
Definition: pns_algo_base.h:54
LOGGER * m_logger
Definition: pns_algo_base.h:88
DEBUG_DECORATOR * m_debugDecorator
Definition: pns_algo_base.h:86
ROUTER * m_router
Definition: pns_algo_base.h:87
ALGO_BASE(ROUTER *aRouter)
Definition: pns_algo_base.h:45
ROUTING_SETTINGS & Settings() const
Return the logger object, allowing to dump geometry to a file.
DEBUG_DECORATOR * Dbg() const
Definition: pns_algo_base.h:78
Contain all persistent settings of the router, such as the mode, optimization effort,...
Push and Shove diff pair dimensions (gap) settings dialog.