KiCad PCB EDA Suite
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 <tomasz.wlostowski@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_ALGO_BASE_H
24 #define __PNS_ALGO_BASE_H
25 
26 #include <math/box2.h>
27 
28 #include "pns_routing_settings.h"
29 
30 namespace PNS {
31 
32 class ROUTER;
33 class LOGGER;
34 class DEBUG_DECORATOR;
35 
42 class ALGO_BASE
43 {
44 public:
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 
60  ROUTING_SETTINGS& Settings() const;
61 
63  virtual LOGGER* Logger();
64 
65  void SetLogger( LOGGER* aLogger )
66  {
67  m_logger = aLogger;
68  }
69 
73  void SetDebugDecorator( DEBUG_DECORATOR* aDecorator )
74  {
75  m_debugDecorator = aDecorator;
76  }
77 
79  {
80  return m_debugDecorator;
81  }
82 
83  const BOX2I& VisibleViewArea() const;
84 
85 protected:
89 };
90 
91 }
92 
93 #endif
Contain all persistent settings of the router, such as the mode, optimization effort,...
ROUTER * Router() const
Return current router settings.
Definition: pns_algo_base.h:54
Base class for all P&S algorithms (shoving, walkaround, line placement, dragging, etc....
Definition: pns_algo_base.h:42
virtual LOGGER * Logger()
LOGGER * m_logger
Definition: pns_algo_base.h:88
ROUTING_SETTINGS & Settings() const
Return the logger object, allowing to dump geometry to a file.
ROUTER * m_router
Definition: pns_algo_base.h:87
ALGO_BASE(ROUTER *aRouter)
Definition: pns_algo_base.h:45
DEBUG_DECORATOR * Dbg() const
Definition: pns_algo_base.h:78
const BOX2I & VisibleViewArea() const
DEBUG_DECORATOR * m_debugDecorator
Definition: pns_algo_base.h:86
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
virtual ~ALGO_BASE()
Return the instance of our router.
Definition: pns_algo_base.h:51
Push and Shove diff pair dimensions (gap) settings dialog.
void SetLogger(LOGGER *aLogger)
Definition: pns_algo_base.h:65