router: use one global logger object

This commit is contained in:
Tomasz Wlostowski 2020-02-19 18:21:56 +01:00
parent 4281bd8207
commit dbe90e163e
4 changed files with 11 additions and 15 deletions

View File

@ -40,7 +40,9 @@ class ALGO_BASE
{ {
public: public:
ALGO_BASE( ROUTER* aRouter ) : ALGO_BASE( ROUTER* aRouter ) :
m_debugDecorator( nullptr ), m_router( aRouter ) m_debugDecorator( nullptr ),
m_router( aRouter ),
m_logger( nullptr )
{} {}
virtual ~ALGO_BASE() {} virtual ~ALGO_BASE() {}
@ -57,6 +59,11 @@ public:
///> Returns the logger object, allowing to dump geometry to a file. ///> Returns the logger object, allowing to dump geometry to a file.
virtual LOGGER* Logger(); virtual LOGGER* Logger();
void SetLogger( LOGGER* aLogger )
{
m_logger = aLogger;
}
/** /**
* Function SetDebugDecorator * Function SetDebugDecorator
* *
@ -72,9 +79,10 @@ public:
return m_debugDecorator; return m_debugDecorator;
} }
private: protected:
DEBUG_DECORATOR *m_debugDecorator; DEBUG_DECORATOR *m_debugDecorator;
ROUTER* m_router; ROUTER* m_router;
LOGGER* m_logger;
}; };
} }

View File

@ -397,13 +397,4 @@ const ITEM_SET DRAGGER::Traces()
return m_draggedItems; return m_draggedItems;
} }
LOGGER* DRAGGER::Logger()
{
if( m_shove )
return m_shove->Logger();
return NULL;
}
} }

View File

@ -97,9 +97,6 @@ public:
*/ */
const ITEM_SET Traces(); const ITEM_SET Traces();
/// @copydoc ALGO_BASE::Logger()
virtual LOGGER* Logger() override;
void SetMode( int aDragMode ); void SetMode( int aDragMode );
private: private:

View File

@ -178,7 +178,7 @@ bool ROUTER::isStartingPointRoutable( const VECTOR2I& aWhere, int aLayer )
} }
bool ROUTER::StartRouting( const VECTOR2I& aP, ITEM* aStartItem, int aLayer ) bool ROUTER::StartRouting( const VECTOR2I& aP, ITEM* aStartItem, int aLayer )
{ {
if( ! isStartingPointRoutable( aP, aLayer ) ) if( ! isStartingPointRoutable( aP, aLayer ) )
{ {