refactoring: remove PNS router dependency on PCB_EDIT_FRAME
This commit is contained in:
parent
d0ef881a53
commit
26f862a9d0
|
@ -46,6 +46,7 @@
|
||||||
#include <geometry/shape_convex.h>
|
#include <geometry/shape_convex.h>
|
||||||
#include <geometry/convex_hull.h>
|
#include <geometry/convex_hull.h>
|
||||||
|
|
||||||
|
#include "tools/pcb_tool.h"
|
||||||
|
|
||||||
#include "pns_kicad_iface.h"
|
#include "pns_kicad_iface.h"
|
||||||
#include "pns_routing_settings.h"
|
#include "pns_routing_settings.h"
|
||||||
|
@ -470,7 +471,7 @@ PNS_KICAD_IFACE::PNS_KICAD_IFACE()
|
||||||
{
|
{
|
||||||
m_ruleResolver = nullptr;
|
m_ruleResolver = nullptr;
|
||||||
m_board = nullptr;
|
m_board = nullptr;
|
||||||
m_frame = nullptr;
|
m_tool = nullptr;
|
||||||
m_view = nullptr;
|
m_view = nullptr;
|
||||||
m_previewItems = nullptr;
|
m_previewItems = nullptr;
|
||||||
m_world = nullptr;
|
m_world = nullptr;
|
||||||
|
@ -989,7 +990,7 @@ void PNS_KICAD_IFACE::Commit()
|
||||||
{
|
{
|
||||||
EraseView();
|
EraseView();
|
||||||
m_commit->Push( wxT( "Added a track" ) );
|
m_commit->Push( wxT( "Added a track" ) );
|
||||||
m_commit.reset( new BOARD_COMMIT( m_frame ) );
|
m_commit.reset( new BOARD_COMMIT( m_tool ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1032,10 +1033,13 @@ void PNS_KICAD_IFACE::SetRouter( PNS::ROUTER* aRouter )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PNS_KICAD_IFACE::SetHostFrame( PCB_EDIT_FRAME* aFrame )
|
void PNS_KICAD_IFACE::SetHostTool( PCB_TOOL* aTool )
|
||||||
{
|
{
|
||||||
m_frame = aFrame;
|
m_tool = aTool;
|
||||||
|
m_commit.reset( new BOARD_COMMIT( m_tool ) );
|
||||||
m_commit.reset( new BOARD_COMMIT( m_frame ) );
|
}
|
||||||
m_dispOptions = (PCB_DISPLAY_OPTIONS*) m_frame->GetDisplayOptions();
|
|
||||||
|
void PNS_KICAD_IFACE::SetDisplayOptions( PCB_DISPLAY_OPTIONS *aDispOptions )
|
||||||
|
{
|
||||||
|
m_dispOptions = aDispOptions;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ class PNS_PCBNEW_DEBUG_DECORATOR;
|
||||||
class BOARD;
|
class BOARD;
|
||||||
class BOARD_COMMIT;
|
class BOARD_COMMIT;
|
||||||
class PCB_DISPLAY_OPTIONS;
|
class PCB_DISPLAY_OPTIONS;
|
||||||
|
class PCB_TOOL;
|
||||||
|
|
||||||
namespace KIGFX
|
namespace KIGFX
|
||||||
{
|
{
|
||||||
|
@ -44,7 +45,8 @@ public:
|
||||||
~PNS_KICAD_IFACE();
|
~PNS_KICAD_IFACE();
|
||||||
|
|
||||||
void SetRouter( PNS::ROUTER* aRouter ) override;
|
void SetRouter( PNS::ROUTER* aRouter ) override;
|
||||||
void SetHostFrame( PCB_EDIT_FRAME* aFrame );
|
void SetHostTool( PCB_TOOL* aTool );
|
||||||
|
void SetDisplayOptions( PCB_DISPLAY_OPTIONS* aDispOptions );
|
||||||
|
|
||||||
void SetBoard( BOARD* aBoard );
|
void SetBoard( BOARD* aBoard );
|
||||||
void SetView( KIGFX::VIEW* aView );
|
void SetView( KIGFX::VIEW* aView );
|
||||||
|
@ -76,7 +78,7 @@ private:
|
||||||
PNS::NODE* m_world;
|
PNS::NODE* m_world;
|
||||||
PNS::ROUTER* m_router;
|
PNS::ROUTER* m_router;
|
||||||
BOARD* m_board;
|
BOARD* m_board;
|
||||||
PCB_EDIT_FRAME* m_frame;
|
PCB_TOOL* m_tool;
|
||||||
std::unique_ptr<BOARD_COMMIT> m_commit;
|
std::unique_ptr<BOARD_COMMIT> m_commit;
|
||||||
PCB_DISPLAY_OPTIONS* m_dispOptions;
|
PCB_DISPLAY_OPTIONS* m_dispOptions;
|
||||||
};
|
};
|
||||||
|
|
|
@ -100,7 +100,7 @@ void TOOL_BASE::Reset( RESET_REASON aReason )
|
||||||
m_iface = new PNS_KICAD_IFACE;
|
m_iface = new PNS_KICAD_IFACE;
|
||||||
m_iface->SetBoard( board() );
|
m_iface->SetBoard( board() );
|
||||||
m_iface->SetView( getView() );
|
m_iface->SetView( getView() );
|
||||||
m_iface->SetHostFrame( frame() );
|
m_iface->SetHostTool( this );
|
||||||
|
|
||||||
m_router = new ROUTER;
|
m_router = new ROUTER;
|
||||||
m_router->SetInterface( m_iface );
|
m_router->SetInterface( m_iface );
|
||||||
|
@ -156,14 +156,12 @@ ITEM* TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLayer )
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM* rv = NULL;
|
ITEM* rv = NULL;
|
||||||
PCB_EDIT_FRAME* frame = getEditFrame<PCB_EDIT_FRAME>();
|
|
||||||
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*)frame->GetDisplayOptions();
|
|
||||||
|
|
||||||
for( int i = 0; i < 4; i++ )
|
for( int i = 0; i < 4; i++ )
|
||||||
{
|
{
|
||||||
ITEM* item = prioritized[i];
|
ITEM* item = prioritized[i];
|
||||||
|
|
||||||
if( displ_opts->m_ContrastModeDisplay )
|
if( displayOptions()->m_ContrastModeDisplay )
|
||||||
if( item && !item->Layers().Overlaps( tl ) )
|
if( item && !item->Layers().Overlaps( tl ) )
|
||||||
item = NULL;
|
item = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue