2014-05-14 13:53:54 +00:00
|
|
|
/*
|
|
|
|
* KiRouter - a push-and-(sometimes-)shove PCB router
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013-2014 CERN
|
2016-08-29 14:38:11 +00:00
|
|
|
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
2014-05-14 13:53:54 +00:00
|
|
|
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PNS_ALGO_BASE_H
|
|
|
|
#define __PNS_ALGO_BASE_H
|
|
|
|
|
|
|
|
#include "pns_routing_settings.h"
|
|
|
|
|
2016-08-29 14:38:11 +00:00
|
|
|
namespace PNS {
|
|
|
|
|
2016-08-29 17:31:13 +00:00
|
|
|
class ROUTER;
|
|
|
|
class LOGGER;
|
|
|
|
class DEBUG_DECORATOR;
|
2014-05-14 13:53:54 +00:00
|
|
|
|
|
|
|
/**
|
2020-01-10 14:31:00 +00:00
|
|
|
* ALGO_BASE
|
2014-05-14 13:53:54 +00:00
|
|
|
*
|
|
|
|
* Base class for all P&S algorithms (shoving, walkaround, line placement, dragging, etc.)
|
|
|
|
* Holds a bunch of objects commonly used by all algorithms (P&S settings, parent router instance, logging)
|
2015-02-18 16:53:46 +00:00
|
|
|
*/
|
2016-08-29 17:31:13 +00:00
|
|
|
class ALGO_BASE
|
2014-05-16 11:37:31 +00:00
|
|
|
{
|
2014-05-14 13:53:54 +00:00
|
|
|
public:
|
2016-08-29 17:31:13 +00:00
|
|
|
ALGO_BASE( ROUTER* aRouter ) :
|
2017-03-11 21:18:45 +00:00
|
|
|
m_debugDecorator( nullptr ), m_router( aRouter )
|
2015-02-18 16:53:46 +00:00
|
|
|
{}
|
2014-05-14 13:53:54 +00:00
|
|
|
|
2016-08-29 17:31:13 +00:00
|
|
|
virtual ~ALGO_BASE() {}
|
2014-05-14 13:53:54 +00:00
|
|
|
|
2015-02-18 16:53:46 +00:00
|
|
|
///> Returns the instance of our router
|
2016-08-29 17:31:13 +00:00
|
|
|
ROUTER* Router() const
|
2015-02-18 16:53:46 +00:00
|
|
|
{
|
|
|
|
return m_router;
|
|
|
|
}
|
2014-05-14 13:53:54 +00:00
|
|
|
|
2015-02-18 16:53:46 +00:00
|
|
|
///> Returns current router settings
|
2016-08-29 17:31:13 +00:00
|
|
|
ROUTING_SETTINGS& Settings() const;
|
2014-05-14 13:53:54 +00:00
|
|
|
|
2015-02-18 16:53:46 +00:00
|
|
|
///> Returns the logger object, allowing to dump geometry to a file.
|
2016-08-29 17:31:13 +00:00
|
|
|
virtual LOGGER* Logger();
|
2015-02-18 00:29:54 +00:00
|
|
|
|
2016-08-15 15:16:48 +00:00
|
|
|
/**
|
|
|
|
* Function SetDebugDecorator
|
|
|
|
*
|
|
|
|
* Assign a debug decorator allowing this algo to draw extra graphics for visual debugging
|
|
|
|
*/
|
2016-08-29 17:31:13 +00:00
|
|
|
void SetDebugDecorator( DEBUG_DECORATOR* aDecorator )
|
2016-08-15 15:16:48 +00:00
|
|
|
{
|
|
|
|
m_debugDecorator = aDecorator;
|
|
|
|
}
|
|
|
|
|
2016-08-29 17:31:13 +00:00
|
|
|
DEBUG_DECORATOR* Dbg() const
|
2016-08-15 15:16:48 +00:00
|
|
|
{
|
|
|
|
return m_debugDecorator;
|
|
|
|
}
|
|
|
|
|
2014-05-14 13:53:54 +00:00
|
|
|
private:
|
2016-08-29 17:31:13 +00:00
|
|
|
DEBUG_DECORATOR *m_debugDecorator;
|
|
|
|
ROUTER* m_router;
|
2014-05-14 13:53:54 +00:00
|
|
|
};
|
|
|
|
|
2016-08-29 14:38:11 +00:00
|
|
|
}
|
|
|
|
|
2014-05-14 13:53:54 +00:00
|
|
|
#endif
|