From f179183deae6a2a5e20a5b74300f93a652510caa Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 11 Sep 2013 16:38:40 +0200 Subject: [PATCH] Removed some dead code. --- common/view/view.cpp | 6 +++--- common/view/view_group.cpp | 4 ++-- common/view/view_item.cpp | 7 +------ common/worksheet_item.cpp | 6 +++--- include/view/view_group.h | 3 +-- include/view/view_item.h | 9 ++------- include/worksheet_item.h | 2 +- pcbnew/tools/selection_area.cpp | 2 +- pcbnew/tools/selection_area.h | 2 +- 9 files changed, 15 insertions(+), 26 deletions(-) diff --git a/common/view/view.cpp b/common/view/view.cpp index 4c16035a36..ac72ab9157 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -586,7 +586,7 @@ void VIEW::draw( VIEW_ITEM* aItem, int aLayer, bool aImmediate ) const group = m_gal->BeginGroup(); aItem->setGroup( aLayer, group ); if( !m_painter->Draw( aItem, aLayer ) ) - aItem->ViewDraw( aLayer, m_gal, BOX2I() ); // Alternative drawing method + aItem->ViewDraw( aLayer, m_gal ); // Alternative drawing method m_gal->EndGroup(); } } @@ -594,7 +594,7 @@ void VIEW::draw( VIEW_ITEM* aItem, int aLayer, bool aImmediate ) const { // Immediate mode if( !m_painter->Draw( aItem, aLayer ) ) - aItem->ViewDraw( aLayer, m_gal, BOX2I() ); // Alternative drawing method + aItem->ViewDraw( aLayer, m_gal ); // Alternative drawing method } // Draws a bright contour around the item @@ -673,7 +673,7 @@ struct VIEW::recacheLayer int group = gal->BeginGroup(); aItem->setGroup( layer, group ); if( !view->m_painter->Draw( aItem, layer ) ) - aItem->ViewDraw( layer, gal, BOX2I() ); // Alternative drawing method + aItem->ViewDraw( layer, gal ); // Alternative drawing method gal->EndGroup(); } else diff --git a/common/view/view_group.cpp b/common/view/view_group.cpp index d4cc2472bc..d6f90bb0ba 100644 --- a/common/view/view_group.cpp +++ b/common/view/view_group.cpp @@ -85,7 +85,7 @@ const BOX2I VIEW_GROUP::ViewBBox() const } -void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal, const BOX2I& aVisibleArea ) const +void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal ) const { PAINTER* painter = m_view->GetPainter(); @@ -103,7 +103,7 @@ void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal, const BOX2I& aVisibleArea ) co aGal->SetLayerDepth( m_view->GetLayerOrder( layers[i] ) ); if( !painter->Draw( item, layers[i] ) ) - item->ViewDraw( layers[i], aGal, aVisibleArea ); // Alternative drawing method + item->ViewDraw( layers[i], aGal ); // Alternative drawing method } } } diff --git a/common/view/view_item.cpp b/common/view/view_item.cpp index 4104d06c1a..94b4ccafe7 100644 --- a/common/view/view_item.cpp +++ b/common/view/view_item.cpp @@ -48,17 +48,12 @@ void VIEW_ITEM::ViewSetVisible( bool aIsVisible ) } -void VIEW_ITEM::ViewUpdate( int aUpdateFlags, bool aForceImmediateRedraw ) +void VIEW_ITEM::ViewUpdate( int aUpdateFlags ) { if( !m_view ) return; m_view->invalidateItem( this, aUpdateFlags ); - - if( aForceImmediateRedraw ) - { - m_view->Redraw(); - } } diff --git a/common/worksheet_item.cpp b/common/worksheet_item.cpp index 40790de477..9845e48f92 100644 --- a/common/worksheet_item.cpp +++ b/common/worksheet_item.cpp @@ -76,7 +76,7 @@ const BOX2I WORKSHEET_ITEM::ViewBBox() const } -void WORKSHEET_ITEM::ViewDraw( int aLayer, GAL* aGal, const BOX2I& aVisibleArea ) const +void WORKSHEET_ITEM::ViewDraw( int aLayer, GAL* aGal ) const { RENDER_SETTINGS* settings = m_view->GetPainter()->GetSettings(); wxString fileName( m_fileName ); @@ -84,8 +84,8 @@ void WORKSHEET_ITEM::ViewDraw( int aLayer, GAL* aGal, const BOX2I& aVisibleArea WS_DRAW_ITEM_LIST drawList; drawList.SetPenSize( settings->GetWorksheetLineWidth() ); - // Sorry,but I don't get this multi #ifdef from include/convert_to_biu.h, so here goes a magic - // number. IU_PER_MILS should be 25400 (as in a different compiltion unit), but somehow + // Sorry, but I don't get this multi #ifdef from include/convert_to_biu.h, so here goes a magic + // number. IU_PER_MILS should be 25400 (as in a different compilation unit), but somehow // it equals 1 in this case.. drawList.SetMilsToIUfactor( 25400 /* IU_PER_MILS */ ); drawList.SetSheetNumber( m_sheetNumber ); diff --git a/include/view/view_group.h b/include/view/view_group.h index ab48e80028..514000bac3 100644 --- a/include/view/view_group.h +++ b/include/view/view_group.h @@ -107,9 +107,8 @@ public: * * @param aLayer is the layer which should be drawn. * @param aGal is the GAL that should be used for drawing. - * @param aVisibleArea is limiting the drawing area. */ - virtual void ViewDraw( int aLayer, GAL* aGal, const BOX2I& aVisibleArea ) const; + virtual void ViewDraw( int aLayer, GAL* aGal ) const; /** * Function ViewGetLayers() diff --git a/include/view/view_item.h b/include/view/view_item.h index 49f0b7d492..5200acb973 100644 --- a/include/view/view_item.h +++ b/include/view/view_item.h @@ -101,11 +101,8 @@ public: * * @param aLayer: current drawing layer * @param aGal: pointer to the GAL device we are drawing on - * @param aVisibleArea: area (in world space coordinates) that is relevant for drawing. For - * example, when drawing a bitmap, one can clip the blitting area to aVisibleArea, reducing - * drawing time. */ - virtual void ViewDraw( int aLayer, GAL* aGal, const BOX2I& aVisibleArea ) const { }; + virtual void ViewDraw( int aLayer, GAL* aGal ) const {}; /** * Function ViewGetLayers() @@ -155,10 +152,8 @@ public: * this item has changed. For static views calling has no effect. * * @param aUpdateFlags: how much the object has changed - * @param aForceImmediateRedraw: when true, the VIEW is redrawn immediately, - * otherwise, it will be redrawn upon next call of VIEW::Update() */ - virtual void ViewUpdate( int aUpdateFlags = ALL, bool aForceImmediateRedraw = false ); + virtual void ViewUpdate( int aUpdateFlags = ALL ); /** * Function ViewRelease() diff --git a/include/worksheet_item.h b/include/worksheet_item.h index e4cff49fa3..b26ec01085 100644 --- a/include/worksheet_item.h +++ b/include/worksheet_item.h @@ -120,7 +120,7 @@ public: const BOX2I ViewBBox() const; /// @copydoc VIEW_ITEM::ViewDraw() - void ViewDraw( int aLayer, GAL* aGal, const BOX2I& aVisibleArea ) const; + void ViewDraw( int aLayer, GAL* aGal ) const; /// @copydoc VIEW_ITEM::ViewGetLayers() void ViewGetLayers( int aLayers[], int& aCount ) const; diff --git a/pcbnew/tools/selection_area.cpp b/pcbnew/tools/selection_area.cpp index 5c30de222c..33d73d6d68 100644 --- a/pcbnew/tools/selection_area.cpp +++ b/pcbnew/tools/selection_area.cpp @@ -47,7 +47,7 @@ void SELECTION_AREA::ViewGetLayers( int aLayers[], int& aCount ) const } -void SELECTION_AREA::ViewDraw( int aLayer, GAL* aGal, const BOX2I& aVisibleArea ) const +void SELECTION_AREA::ViewDraw( int aLayer, GAL* aGal ) const { aGal->SetLineWidth( 1.0 ); aGal->SetStrokeColor( COLOR4D( 1.0, 1.0, 0.4, 1.0 ) ); diff --git a/pcbnew/tools/selection_area.h b/pcbnew/tools/selection_area.h index 28bf0f8b63..50db94f927 100644 --- a/pcbnew/tools/selection_area.h +++ b/pcbnew/tools/selection_area.h @@ -50,7 +50,7 @@ public: virtual const BOX2I ViewBBox() const; - void ViewDraw( int aLayer, KiGfx::GAL* aGal, const BOX2I& aVisibleArea ) const; + void ViewDraw( int aLayer, KiGfx::GAL* aGal ) const; void ViewGetLayers( int aLayers[], int& aCount ) const; void SetOrigin ( VECTOR2I aOrigin )