Loading include/tool/tool_base.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -185,7 +185,7 @@ protected: * Returns the model object if it matches the requested type. * Returns the model object if it matches the requested type. */ */ template <typename T> template <typename T> T* getModel( KICAD_T aModelType ) const T* getModel() const { { EDA_ITEM* m = getModelInt(); EDA_ITEM* m = getModelInt(); Loading pcbnew/router/router_tool.cpp +6 −6 Original line number Original line Diff line number Diff line Loading @@ -241,7 +241,7 @@ void ROUTER_TOOL::Reset( RESET_REASON aReason ) TRACEn( 0, "Reset" ); TRACEn( 0, "Reset" ); m_router->ClearWorld(); m_router->ClearWorld(); m_router->SetBoard( getModel<BOARD>( PCB_T ) ); m_router->SetBoard( getModel<BOARD>() ); m_router->SyncWorld(); m_router->SyncWorld(); m_router->LoadSettings( m_settings ); m_router->LoadSettings( m_settings ); m_needsSync = false; m_needsSync = false; Loading @@ -266,7 +266,7 @@ int ROUTER_TOOL::getDefaultWidth( int aNetCode ) void ROUTER_TOOL::getNetclassDimensions( int aNetCode, int& aWidth, void ROUTER_TOOL::getNetclassDimensions( int aNetCode, int& aWidth, int& aViaDiameter, int& aViaDrill ) int& aViaDiameter, int& aViaDrill ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); BOARD_DESIGN_SETTINGS &bds = board->GetDesignSettings(); BOARD_DESIGN_SETTINGS &bds = board->GetDesignSettings(); NETCLASSPTR netClass; NETCLASSPTR netClass; Loading Loading @@ -394,7 +394,7 @@ void ROUTER_TOOL::handleCommonEvents( TOOL_EVENT& aEvent ) else if( aEvent.IsAction( &ACT_CustomTrackWidth ) ) else if( aEvent.IsAction( &ACT_CustomTrackWidth ) ) { { DIALOG_TRACK_VIA_SIZE sizeDlg( getEditFrame<PCB_EDIT_FRAME>(), m_router->Settings() ); DIALOG_TRACK_VIA_SIZE sizeDlg( getEditFrame<PCB_EDIT_FRAME>(), m_router->Settings() ); BOARD_DESIGN_SETTINGS& bds = getModel<BOARD>( PCB_T )->GetDesignSettings(); BOARD_DESIGN_SETTINGS& bds = getModel<BOARD>()->GetDesignSettings(); sizeDlg.ShowModal(); sizeDlg.ShowModal(); Loading @@ -413,7 +413,7 @@ void ROUTER_TOOL::handleCommonEvents( TOOL_EVENT& aEvent ) else if( aEvent.IsAction( &COMMON_ACTIONS::trackViaSizeChanged ) ) else if( aEvent.IsAction( &COMMON_ACTIONS::trackViaSizeChanged ) ) { { BOARD_DESIGN_SETTINGS& bds = getModel<BOARD>( PCB_T )->GetDesignSettings(); BOARD_DESIGN_SETTINGS& bds = getModel<BOARD>()->GetDesignSettings(); m_router->Settings().SetTrackWidth( bds.GetCurrentTrackWidth() ); m_router->Settings().SetTrackWidth( bds.GetCurrentTrackWidth() ); m_router->Settings().SetViaDiameter( bds.GetCurrentViaSize() ); m_router->Settings().SetViaDiameter( bds.GetCurrentViaSize() ); Loading Loading @@ -526,7 +526,7 @@ void ROUTER_TOOL::performRouting() bool saveUndoBuffer = true; bool saveUndoBuffer = true; VIEW_CONTROLS* ctls = getViewControls(); VIEW_CONTROLS* ctls = getViewControls(); if( getModel<BOARD>( PCB_T )->GetDesignSettings().m_UseConnectedTrackWidth ) if( getModel<BOARD>()->GetDesignSettings().m_UseConnectedTrackWidth ) { { int width = getDefaultWidth( m_startItem ? m_startItem->Net() : -1 ); int width = getDefaultWidth( m_startItem ? m_startItem->Net() : -1 ); Loading Loading @@ -632,7 +632,7 @@ void ROUTER_TOOL::performRouting() int ROUTER_TOOL::Main( TOOL_EVENT& aEvent ) int ROUTER_TOOL::Main( TOOL_EVENT& aEvent ) { { VIEW_CONTROLS* ctls = getViewControls(); VIEW_CONTROLS* ctls = getViewControls(); BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); BOARD_DESIGN_SETTINGS& bds = board->GetDesignSettings(); BOARD_DESIGN_SETTINGS& bds = board->GetDesignSettings(); // Deselect all items // Deselect all items Loading pcbnew/tools/drawing_tool.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -62,7 +62,7 @@ void DRAWING_TOOL::Reset( RESET_REASON aReason ) // Init variables used by every drawing tool // Init variables used by every drawing tool m_view = getView(); m_view = getView(); m_controls = getViewControls(); m_controls = getViewControls(); m_board = getModel<BOARD>( PCB_T ); m_board = getModel<BOARD>(); m_frame = getEditFrame<PCB_EDIT_FRAME>(); m_frame = getEditFrame<PCB_EDIT_FRAME>(); setTransitions(); setTransitions(); Loading pcbnew/tools/edit_tool.cpp +7 −7 Original line number Original line Diff line number Diff line Loading @@ -188,7 +188,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent ) if( unselect ) if( unselect ) m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); RN_DATA* ratsnest = getModel<BOARD>( PCB_T )->GetRatsnest(); RN_DATA* ratsnest = getModel<BOARD>()->GetRatsnest(); ratsnest->ClearSimple(); ratsnest->ClearSimple(); ratsnest->Recalculate(); ratsnest->Recalculate(); Loading Loading @@ -257,7 +257,7 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent ) processChanges( currentChange ); processChanges( currentChange ); updateRatsnest( true ); updateRatsnest( true ); getModel<BOARD>( PCB_T )->GetRatsnest()->Recalculate(); getModel<BOARD>()->GetRatsnest()->Recalculate(); m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate ); m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate ); } } Loading Loading @@ -312,7 +312,7 @@ int EDIT_TOOL::Rotate( TOOL_EVENT& aEvent ) if( m_dragging ) if( m_dragging ) selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); else else getModel<BOARD>( PCB_T )->GetRatsnest()->Recalculate(); getModel<BOARD>()->GetRatsnest()->Recalculate(); if( unselect ) if( unselect ) m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); Loading Loading @@ -362,7 +362,7 @@ int EDIT_TOOL::Flip( TOOL_EVENT& aEvent ) if( m_dragging ) if( m_dragging ) selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); else else getModel<BOARD>( PCB_T )->GetRatsnest()->Recalculate(); getModel<BOARD>()->GetRatsnest()->Recalculate(); if( unselect ) if( unselect ) m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); Loading Loading @@ -403,7 +403,7 @@ int EDIT_TOOL::Remove( TOOL_EVENT& aEvent ) for( unsigned int i = 0; i < selectedItems.GetCount(); ++i ) for( unsigned int i = 0; i < selectedItems.GetCount(); ++i ) remove( static_cast<BOARD_ITEM*>( selectedItems.GetPickedItem( i ) ) ); remove( static_cast<BOARD_ITEM*>( selectedItems.GetPickedItem( i ) ) ); getModel<BOARD>( PCB_T )->GetRatsnest()->Recalculate(); getModel<BOARD>()->GetRatsnest()->Recalculate(); setTransitions(); setTransitions(); Loading @@ -413,7 +413,7 @@ int EDIT_TOOL::Remove( TOOL_EVENT& aEvent ) void EDIT_TOOL::remove( BOARD_ITEM* aItem ) void EDIT_TOOL::remove( BOARD_ITEM* aItem ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); switch( aItem->Type() ) switch( aItem->Type() ) { { Loading Loading @@ -472,7 +472,7 @@ void EDIT_TOOL::setTransitions() void EDIT_TOOL::updateRatsnest( bool aRedraw ) void EDIT_TOOL::updateRatsnest( bool aRedraw ) { { const SELECTION_TOOL::SELECTION& selection = m_selectionTool->GetSelection(); const SELECTION_TOOL::SELECTION& selection = m_selectionTool->GetSelection(); RN_DATA* ratsnest = getModel<BOARD>( PCB_T )->GetRatsnest(); RN_DATA* ratsnest = getModel<BOARD>()->GetRatsnest(); ratsnest->ClearSimple(); ratsnest->ClearSimple(); for( unsigned int i = 0; i < selection.items.GetCount(); ++i ) for( unsigned int i = 0; i < selection.items.GetCount(); ++i ) Loading pcbnew/tools/pcbnew_control.cpp +7 −7 Original line number Original line Diff line number Diff line Loading @@ -106,7 +106,7 @@ int PCBNEW_CONTROL::ZoomFitScreen( TOOL_EVENT& aEvent ) { { KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView(); KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView(); KIGFX::GAL* gal = m_frame->GetGalCanvas()->GetGAL(); KIGFX::GAL* gal = m_frame->GetGalCanvas()->GetGAL(); BOX2I boardBBox = getModel<BOARD>( PCB_T )->ViewBBox(); BOX2I boardBBox = getModel<BOARD>()->ViewBBox(); VECTOR2I screenSize = gal->GetScreenPixelSize(); VECTOR2I screenSize = gal->GetScreenPixelSize(); double iuPerX = screenSize.x ? boardBBox.GetWidth() / screenSize.x : 1.0; double iuPerX = screenSize.x ? boardBBox.GetWidth() / screenSize.x : 1.0; Loading Loading @@ -136,7 +136,7 @@ int PCBNEW_CONTROL::TrackDisplayMode( TOOL_EVENT& aEvent ) m_frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; m_frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; settings->LoadDisplayOptions( DisplayOpt ); settings->LoadDisplayOptions( DisplayOpt ); BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); for( TRACK* track = board->m_Track; track; track = track->Next() ) for( TRACK* track = board->m_Track; track; track = track->Next() ) track->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); track->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); Loading Loading @@ -168,7 +168,7 @@ int PCBNEW_CONTROL::ViaDisplayMode( TOOL_EVENT& aEvent ) m_frame->m_DisplayViaFill = DisplayOpt.DisplayViaFill; m_frame->m_DisplayViaFill = DisplayOpt.DisplayViaFill; settings->LoadDisplayOptions( DisplayOpt ); settings->LoadDisplayOptions( DisplayOpt ); BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); for( TRACK* track = board->m_Track; track; track = track->Next() ) for( TRACK* track = board->m_Track; track; track = track->Next() ) { { if( track->Type() == PCB_VIA_T ) if( track->Type() == PCB_VIA_T ) Loading Loading @@ -448,7 +448,7 @@ int PCBNEW_CONTROL::GridSetOrigin( TOOL_EVENT& aEvent ) // Track & via size control // Track & via size control int PCBNEW_CONTROL::TrackWidthInc( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::TrackWidthInc( TOOL_EVENT& aEvent ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() + 1; int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() + 1; if( widthIndex >= (int) board->GetDesignSettings().m_TrackWidthList.size() ) if( widthIndex >= (int) board->GetDesignSettings().m_TrackWidthList.size() ) Loading @@ -469,7 +469,7 @@ int PCBNEW_CONTROL::TrackWidthInc( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::TrackWidthDec( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::TrackWidthDec( TOOL_EVENT& aEvent ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() - 1; int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() - 1; if( widthIndex < 0 ) if( widthIndex < 0 ) Loading @@ -490,7 +490,7 @@ int PCBNEW_CONTROL::TrackWidthDec( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::ViaSizeInc( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::ViaSizeInc( TOOL_EVENT& aEvent ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() + 1; int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() + 1; if( sizeIndex >= (int) board->GetDesignSettings().m_ViasDimensionsList.size() ) if( sizeIndex >= (int) board->GetDesignSettings().m_ViasDimensionsList.size() ) Loading @@ -511,7 +511,7 @@ int PCBNEW_CONTROL::ViaSizeInc( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::ViaSizeDec( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::ViaSizeDec( TOOL_EVENT& aEvent ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() - 1; int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() - 1; if( sizeIndex < 0 ) if( sizeIndex < 0 ) Loading Loading
include/tool/tool_base.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -185,7 +185,7 @@ protected: * Returns the model object if it matches the requested type. * Returns the model object if it matches the requested type. */ */ template <typename T> template <typename T> T* getModel( KICAD_T aModelType ) const T* getModel() const { { EDA_ITEM* m = getModelInt(); EDA_ITEM* m = getModelInt(); Loading
pcbnew/router/router_tool.cpp +6 −6 Original line number Original line Diff line number Diff line Loading @@ -241,7 +241,7 @@ void ROUTER_TOOL::Reset( RESET_REASON aReason ) TRACEn( 0, "Reset" ); TRACEn( 0, "Reset" ); m_router->ClearWorld(); m_router->ClearWorld(); m_router->SetBoard( getModel<BOARD>( PCB_T ) ); m_router->SetBoard( getModel<BOARD>() ); m_router->SyncWorld(); m_router->SyncWorld(); m_router->LoadSettings( m_settings ); m_router->LoadSettings( m_settings ); m_needsSync = false; m_needsSync = false; Loading @@ -266,7 +266,7 @@ int ROUTER_TOOL::getDefaultWidth( int aNetCode ) void ROUTER_TOOL::getNetclassDimensions( int aNetCode, int& aWidth, void ROUTER_TOOL::getNetclassDimensions( int aNetCode, int& aWidth, int& aViaDiameter, int& aViaDrill ) int& aViaDiameter, int& aViaDrill ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); BOARD_DESIGN_SETTINGS &bds = board->GetDesignSettings(); BOARD_DESIGN_SETTINGS &bds = board->GetDesignSettings(); NETCLASSPTR netClass; NETCLASSPTR netClass; Loading Loading @@ -394,7 +394,7 @@ void ROUTER_TOOL::handleCommonEvents( TOOL_EVENT& aEvent ) else if( aEvent.IsAction( &ACT_CustomTrackWidth ) ) else if( aEvent.IsAction( &ACT_CustomTrackWidth ) ) { { DIALOG_TRACK_VIA_SIZE sizeDlg( getEditFrame<PCB_EDIT_FRAME>(), m_router->Settings() ); DIALOG_TRACK_VIA_SIZE sizeDlg( getEditFrame<PCB_EDIT_FRAME>(), m_router->Settings() ); BOARD_DESIGN_SETTINGS& bds = getModel<BOARD>( PCB_T )->GetDesignSettings(); BOARD_DESIGN_SETTINGS& bds = getModel<BOARD>()->GetDesignSettings(); sizeDlg.ShowModal(); sizeDlg.ShowModal(); Loading @@ -413,7 +413,7 @@ void ROUTER_TOOL::handleCommonEvents( TOOL_EVENT& aEvent ) else if( aEvent.IsAction( &COMMON_ACTIONS::trackViaSizeChanged ) ) else if( aEvent.IsAction( &COMMON_ACTIONS::trackViaSizeChanged ) ) { { BOARD_DESIGN_SETTINGS& bds = getModel<BOARD>( PCB_T )->GetDesignSettings(); BOARD_DESIGN_SETTINGS& bds = getModel<BOARD>()->GetDesignSettings(); m_router->Settings().SetTrackWidth( bds.GetCurrentTrackWidth() ); m_router->Settings().SetTrackWidth( bds.GetCurrentTrackWidth() ); m_router->Settings().SetViaDiameter( bds.GetCurrentViaSize() ); m_router->Settings().SetViaDiameter( bds.GetCurrentViaSize() ); Loading Loading @@ -526,7 +526,7 @@ void ROUTER_TOOL::performRouting() bool saveUndoBuffer = true; bool saveUndoBuffer = true; VIEW_CONTROLS* ctls = getViewControls(); VIEW_CONTROLS* ctls = getViewControls(); if( getModel<BOARD>( PCB_T )->GetDesignSettings().m_UseConnectedTrackWidth ) if( getModel<BOARD>()->GetDesignSettings().m_UseConnectedTrackWidth ) { { int width = getDefaultWidth( m_startItem ? m_startItem->Net() : -1 ); int width = getDefaultWidth( m_startItem ? m_startItem->Net() : -1 ); Loading Loading @@ -632,7 +632,7 @@ void ROUTER_TOOL::performRouting() int ROUTER_TOOL::Main( TOOL_EVENT& aEvent ) int ROUTER_TOOL::Main( TOOL_EVENT& aEvent ) { { VIEW_CONTROLS* ctls = getViewControls(); VIEW_CONTROLS* ctls = getViewControls(); BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); BOARD_DESIGN_SETTINGS& bds = board->GetDesignSettings(); BOARD_DESIGN_SETTINGS& bds = board->GetDesignSettings(); // Deselect all items // Deselect all items Loading
pcbnew/tools/drawing_tool.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -62,7 +62,7 @@ void DRAWING_TOOL::Reset( RESET_REASON aReason ) // Init variables used by every drawing tool // Init variables used by every drawing tool m_view = getView(); m_view = getView(); m_controls = getViewControls(); m_controls = getViewControls(); m_board = getModel<BOARD>( PCB_T ); m_board = getModel<BOARD>(); m_frame = getEditFrame<PCB_EDIT_FRAME>(); m_frame = getEditFrame<PCB_EDIT_FRAME>(); setTransitions(); setTransitions(); Loading
pcbnew/tools/edit_tool.cpp +7 −7 Original line number Original line Diff line number Diff line Loading @@ -188,7 +188,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent ) if( unselect ) if( unselect ) m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); RN_DATA* ratsnest = getModel<BOARD>( PCB_T )->GetRatsnest(); RN_DATA* ratsnest = getModel<BOARD>()->GetRatsnest(); ratsnest->ClearSimple(); ratsnest->ClearSimple(); ratsnest->Recalculate(); ratsnest->Recalculate(); Loading Loading @@ -257,7 +257,7 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent ) processChanges( currentChange ); processChanges( currentChange ); updateRatsnest( true ); updateRatsnest( true ); getModel<BOARD>( PCB_T )->GetRatsnest()->Recalculate(); getModel<BOARD>()->GetRatsnest()->Recalculate(); m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate ); m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate ); } } Loading Loading @@ -312,7 +312,7 @@ int EDIT_TOOL::Rotate( TOOL_EVENT& aEvent ) if( m_dragging ) if( m_dragging ) selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); else else getModel<BOARD>( PCB_T )->GetRatsnest()->Recalculate(); getModel<BOARD>()->GetRatsnest()->Recalculate(); if( unselect ) if( unselect ) m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); Loading Loading @@ -362,7 +362,7 @@ int EDIT_TOOL::Flip( TOOL_EVENT& aEvent ) if( m_dragging ) if( m_dragging ) selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); else else getModel<BOARD>( PCB_T )->GetRatsnest()->Recalculate(); getModel<BOARD>()->GetRatsnest()->Recalculate(); if( unselect ) if( unselect ) m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear ); Loading Loading @@ -403,7 +403,7 @@ int EDIT_TOOL::Remove( TOOL_EVENT& aEvent ) for( unsigned int i = 0; i < selectedItems.GetCount(); ++i ) for( unsigned int i = 0; i < selectedItems.GetCount(); ++i ) remove( static_cast<BOARD_ITEM*>( selectedItems.GetPickedItem( i ) ) ); remove( static_cast<BOARD_ITEM*>( selectedItems.GetPickedItem( i ) ) ); getModel<BOARD>( PCB_T )->GetRatsnest()->Recalculate(); getModel<BOARD>()->GetRatsnest()->Recalculate(); setTransitions(); setTransitions(); Loading @@ -413,7 +413,7 @@ int EDIT_TOOL::Remove( TOOL_EVENT& aEvent ) void EDIT_TOOL::remove( BOARD_ITEM* aItem ) void EDIT_TOOL::remove( BOARD_ITEM* aItem ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); switch( aItem->Type() ) switch( aItem->Type() ) { { Loading Loading @@ -472,7 +472,7 @@ void EDIT_TOOL::setTransitions() void EDIT_TOOL::updateRatsnest( bool aRedraw ) void EDIT_TOOL::updateRatsnest( bool aRedraw ) { { const SELECTION_TOOL::SELECTION& selection = m_selectionTool->GetSelection(); const SELECTION_TOOL::SELECTION& selection = m_selectionTool->GetSelection(); RN_DATA* ratsnest = getModel<BOARD>( PCB_T )->GetRatsnest(); RN_DATA* ratsnest = getModel<BOARD>()->GetRatsnest(); ratsnest->ClearSimple(); ratsnest->ClearSimple(); for( unsigned int i = 0; i < selection.items.GetCount(); ++i ) for( unsigned int i = 0; i < selection.items.GetCount(); ++i ) Loading
pcbnew/tools/pcbnew_control.cpp +7 −7 Original line number Original line Diff line number Diff line Loading @@ -106,7 +106,7 @@ int PCBNEW_CONTROL::ZoomFitScreen( TOOL_EVENT& aEvent ) { { KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView(); KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView(); KIGFX::GAL* gal = m_frame->GetGalCanvas()->GetGAL(); KIGFX::GAL* gal = m_frame->GetGalCanvas()->GetGAL(); BOX2I boardBBox = getModel<BOARD>( PCB_T )->ViewBBox(); BOX2I boardBBox = getModel<BOARD>()->ViewBBox(); VECTOR2I screenSize = gal->GetScreenPixelSize(); VECTOR2I screenSize = gal->GetScreenPixelSize(); double iuPerX = screenSize.x ? boardBBox.GetWidth() / screenSize.x : 1.0; double iuPerX = screenSize.x ? boardBBox.GetWidth() / screenSize.x : 1.0; Loading Loading @@ -136,7 +136,7 @@ int PCBNEW_CONTROL::TrackDisplayMode( TOOL_EVENT& aEvent ) m_frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; m_frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill; settings->LoadDisplayOptions( DisplayOpt ); settings->LoadDisplayOptions( DisplayOpt ); BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); for( TRACK* track = board->m_Track; track; track = track->Next() ) for( TRACK* track = board->m_Track; track; track = track->Next() ) track->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); track->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); Loading Loading @@ -168,7 +168,7 @@ int PCBNEW_CONTROL::ViaDisplayMode( TOOL_EVENT& aEvent ) m_frame->m_DisplayViaFill = DisplayOpt.DisplayViaFill; m_frame->m_DisplayViaFill = DisplayOpt.DisplayViaFill; settings->LoadDisplayOptions( DisplayOpt ); settings->LoadDisplayOptions( DisplayOpt ); BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); for( TRACK* track = board->m_Track; track; track = track->Next() ) for( TRACK* track = board->m_Track; track; track = track->Next() ) { { if( track->Type() == PCB_VIA_T ) if( track->Type() == PCB_VIA_T ) Loading Loading @@ -448,7 +448,7 @@ int PCBNEW_CONTROL::GridSetOrigin( TOOL_EVENT& aEvent ) // Track & via size control // Track & via size control int PCBNEW_CONTROL::TrackWidthInc( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::TrackWidthInc( TOOL_EVENT& aEvent ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() + 1; int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() + 1; if( widthIndex >= (int) board->GetDesignSettings().m_TrackWidthList.size() ) if( widthIndex >= (int) board->GetDesignSettings().m_TrackWidthList.size() ) Loading @@ -469,7 +469,7 @@ int PCBNEW_CONTROL::TrackWidthInc( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::TrackWidthDec( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::TrackWidthDec( TOOL_EVENT& aEvent ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() - 1; int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() - 1; if( widthIndex < 0 ) if( widthIndex < 0 ) Loading @@ -490,7 +490,7 @@ int PCBNEW_CONTROL::TrackWidthDec( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::ViaSizeInc( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::ViaSizeInc( TOOL_EVENT& aEvent ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() + 1; int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() + 1; if( sizeIndex >= (int) board->GetDesignSettings().m_ViasDimensionsList.size() ) if( sizeIndex >= (int) board->GetDesignSettings().m_ViasDimensionsList.size() ) Loading @@ -511,7 +511,7 @@ int PCBNEW_CONTROL::ViaSizeInc( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::ViaSizeDec( TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::ViaSizeDec( TOOL_EVENT& aEvent ) { { BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>(); int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() - 1; int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() - 1; if( sizeIndex < 0 ) if( sizeIndex < 0 ) Loading