Commit f5de166a authored by Maciej Suminski's avatar Maciej Suminski

Removed an unused parameter from TOOL_BASE::getModel<T>() method.

parent 2099dd70
...@@ -185,7 +185,7 @@ protected: ...@@ -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();
......
...@@ -241,7 +241,7 @@ void ROUTER_TOOL::Reset( RESET_REASON aReason ) ...@@ -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;
...@@ -266,7 +266,7 @@ int ROUTER_TOOL::getDefaultWidth( int aNetCode ) ...@@ -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;
...@@ -394,7 +394,7 @@ void ROUTER_TOOL::handleCommonEvents( TOOL_EVENT& aEvent ) ...@@ -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();
...@@ -413,7 +413,7 @@ void ROUTER_TOOL::handleCommonEvents( TOOL_EVENT& aEvent ) ...@@ -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() );
...@@ -526,7 +526,7 @@ void ROUTER_TOOL::performRouting() ...@@ -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 );
...@@ -632,7 +632,7 @@ void ROUTER_TOOL::performRouting() ...@@ -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
......
...@@ -62,7 +62,7 @@ void DRAWING_TOOL::Reset( RESET_REASON aReason ) ...@@ -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();
......
...@@ -188,7 +188,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent ) ...@@ -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();
...@@ -257,7 +257,7 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent ) ...@@ -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 );
} }
...@@ -312,7 +312,7 @@ int EDIT_TOOL::Rotate( TOOL_EVENT& aEvent ) ...@@ -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 );
...@@ -362,7 +362,7 @@ int EDIT_TOOL::Flip( TOOL_EVENT& aEvent ) ...@@ -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 );
...@@ -403,7 +403,7 @@ int EDIT_TOOL::Remove( TOOL_EVENT& aEvent ) ...@@ -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();
...@@ -413,7 +413,7 @@ int EDIT_TOOL::Remove( TOOL_EVENT& aEvent ) ...@@ -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() )
{ {
...@@ -472,7 +472,7 @@ void EDIT_TOOL::setTransitions() ...@@ -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 )
......
...@@ -106,7 +106,7 @@ int PCBNEW_CONTROL::ZoomFitScreen( TOOL_EVENT& aEvent ) ...@@ -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;
...@@ -136,7 +136,7 @@ int PCBNEW_CONTROL::TrackDisplayMode( TOOL_EVENT& aEvent ) ...@@ -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 );
...@@ -168,7 +168,7 @@ int PCBNEW_CONTROL::ViaDisplayMode( TOOL_EVENT& aEvent ) ...@@ -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 )
...@@ -448,7 +448,7 @@ int PCBNEW_CONTROL::GridSetOrigin( TOOL_EVENT& aEvent ) ...@@ -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() )
...@@ -469,7 +469,7 @@ int PCBNEW_CONTROL::TrackWidthInc( TOOL_EVENT& aEvent ) ...@@ -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 )
...@@ -490,7 +490,7 @@ int PCBNEW_CONTROL::TrackWidthDec( TOOL_EVENT& aEvent ) ...@@ -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() )
...@@ -511,7 +511,7 @@ int PCBNEW_CONTROL::ViaSizeInc( TOOL_EVENT& aEvent ) ...@@ -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 )
......
...@@ -721,7 +721,7 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint ) ...@@ -721,7 +721,7 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint )
newSegment->SetStart( wxPoint( nearestPoint.x, nearestPoint.y ) ); newSegment->SetStart( wxPoint( nearestPoint.x, nearestPoint.y ) );
newSegment->SetEnd( wxPoint( seg.B.x, seg.B.y ) ); newSegment->SetEnd( wxPoint( seg.B.x, seg.B.y ) );
getModel<BOARD>( PCB_T )->Add( newSegment ); getModel<BOARD>()->Add( newSegment );
getView()->Add( newSegment ); getView()->Add( newSegment );
} }
} }
......
...@@ -228,7 +228,7 @@ void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem ) ...@@ -228,7 +228,7 @@ void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem )
bool SELECTION_TOOL::selectSingle( const VECTOR2I& aWhere, bool aAllowDisambiguation ) bool SELECTION_TOOL::selectSingle( const VECTOR2I& aWhere, bool aAllowDisambiguation )
{ {
BOARD* pcb = getModel<BOARD>( PCB_T ); BOARD* pcb = getModel<BOARD>();
BOARD_ITEM* item; BOARD_ITEM* item;
GENERAL_COLLECTORS_GUIDE guide = getEditFrame<PCB_EDIT_FRAME>()->GetCollectorsGuide(); GENERAL_COLLECTORS_GUIDE guide = getEditFrame<PCB_EDIT_FRAME>()->GetCollectorsGuide();
GENERAL_COLLECTOR collector; GENERAL_COLLECTOR collector;
...@@ -524,7 +524,7 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const ...@@ -524,7 +524,7 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const
return false; return false;
} }
BOARD* board = getModel<BOARD>( PCB_T ); BOARD* board = getModel<BOARD>();
switch( aItem->Type() ) switch( aItem->Type() )
{ {
...@@ -678,7 +678,7 @@ void SELECTION_TOOL::highlightNet( const VECTOR2I& aPoint ) ...@@ -678,7 +678,7 @@ void SELECTION_TOOL::highlightNet( const VECTOR2I& aPoint )
int net = -1; int net = -1;
// Find a connected item for which we are going to highlight a net // Find a connected item for which we are going to highlight a net
collector.Collect( getModel<BOARD>( PCB_T ), GENERAL_COLLECTOR::PadsTracksOrZones, collector.Collect( getModel<BOARD>(), GENERAL_COLLECTOR::PadsTracksOrZones,
wxPoint( aPoint.x, aPoint.y ), guide ); wxPoint( aPoint.x, aPoint.y ), guide );
bool enableHighlight = ( collector.GetCount() > 0 ); bool enableHighlight = ( collector.GetCount() > 0 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment