From 3715af2172620d1e42d971f44559ea92b265f8f6 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 1 Oct 2013 10:21:32 +0200 Subject: [PATCH] Comments, refactoring --- include/worksheet_item.h | 1 - include/wxBasePcbFrame.h | 2 ++ pcbnew/basepcbframe.cpp | 2 -- pcbnew/tools/move_tool.cpp | 12 ++++++------ pcbnew/tools/move_tool.h | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/worksheet_item.h b/include/worksheet_item.h index b26ec01085..8b2b7d2165 100644 --- a/include/worksheet_item.h +++ b/include/worksheet_item.h @@ -49,7 +49,6 @@ class WORKSHEET_ITEM : public EDA_ITEM public: WORKSHEET_ITEM( const std::string& aFileName, const std::string& aSheetName, const PAGE_INFO* aPageInfo, const TITLE_BLOCK* aTitleBlock ); - ~WORKSHEET_ITEM() {} /** * Function SetFileName() diff --git a/include/wxBasePcbFrame.h b/include/wxBasePcbFrame.h index 58ddac8154..7e1605895f 100644 --- a/include/wxBasePcbFrame.h +++ b/include/wxBasePcbFrame.h @@ -115,6 +115,8 @@ protected: MODULE* loadFootprint( const FPID& aFootprintId ) throw( IO_ERROR, PARSE_ERROR ); + ///> Rendering order of layers on GAL-based canvas (lower index in the array + ///> means that layer is displayed closer to the user, ie. on the top). static const LAYER_NUM GAL_LAYER_ORDER[]; public: diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index be2c8d756e..63e3636314 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -70,8 +70,6 @@ static const wxString DisplayModuleTextEntry( wxT( "DiModTx" ) ); static const wxString FastGrid1Entry( wxT( "FastGrid1" ) ); static const wxString FastGrid2Entry( wxT( "FastGrid2" ) ); -/// Rendering order of layers on GAL-based canvas (lower index in the array -/// means that layer is displayed closer to the user, ie. on the top). const LAYER_NUM PCB_BASE_FRAME::GAL_LAYER_ORDER[] = { ITEM_GAL_LAYER( GP_OVERLAY ), ITEM_GAL_LAYER( SELECTION ), diff --git a/pcbnew/tools/move_tool.cpp b/pcbnew/tools/move_tool.cpp index 3e2170a051..8ee55879e1 100644 --- a/pcbnew/tools/move_tool.cpp +++ b/pcbnew/tools/move_tool.cpp @@ -139,7 +139,7 @@ int MOVE_TOOL::Main( TOOL_EVENT& aEvent ) m_state.Save( *it ); // Gather all selected items into one VIEW_GROUP - viewGroupAdd( *it, &m_items ); + vgAdd( *it, &m_items ); } // Hide the original items, they are temporarily shown in VIEW_GROUP on overlay @@ -183,7 +183,7 @@ int MOVE_TOOL::Main( TOOL_EVENT& aEvent ) } -void MOVE_TOOL::viewGroupAdd( BOARD_ITEM* aItem, VIEW_GROUP* aGroup ) +void MOVE_TOOL::vgAdd( BOARD_ITEM* aItem, VIEW_GROUP* aGroup ) { // Modules are treated in a special way - when they are moved, we have to // move all the parts that make the module, not the module itself @@ -193,14 +193,14 @@ void MOVE_TOOL::viewGroupAdd( BOARD_ITEM* aItem, VIEW_GROUP* aGroup ) // Add everything that belongs to the module (besides the module itself) for( D_PAD* pad = module->Pads().GetFirst(); pad; pad = pad->Next() ) - viewGroupAdd( pad, &m_items ); + aGroup->Add( pad ); for( BOARD_ITEM* drawing = module->GraphicalItems().GetFirst(); drawing; drawing = drawing->Next() ) - viewGroupAdd( drawing, &m_items ); + aGroup->Add( drawing ); - viewGroupAdd( &module->Reference(), &m_items ); - viewGroupAdd( &module->Value(), &m_items ); + aGroup->Add( &module->Reference() ); + aGroup->Add( &module->Value() ); } // Add items to the VIEW_GROUP, so they will be displayed on the overlay diff --git a/pcbnew/tools/move_tool.h b/pcbnew/tools/move_tool.h index 0074ba70b4..e564879bca 100644 --- a/pcbnew/tools/move_tool.h +++ b/pcbnew/tools/move_tool.h @@ -66,7 +66,7 @@ public: private: /// Adds an item to the VIEW_GROUP that holds all moved items and displays them on the overlay - void viewGroupAdd( BOARD_ITEM* aItem, KiGfx::VIEW_GROUP* aGroup ); + void vgAdd( BOARD_ITEM* aItem, KiGfx::VIEW_GROUP* aGroup ); /// Changes visibility settings for items stored in a VIEW_GROUP void vgSetVisibility( KiGfx::VIEW_GROUP* aGroup, bool aVisible ) const;