Loading CHANGELOG.txt +15 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,21 @@ KiCad ChangeLog 2012 Please add newer entries at the top, list the date and your name with email address. 2012-Feb-19 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ ++pcbnew * Remove virtual BOARD_ITEM::{Get,Set}Position() which in turn means all derived classes' implementations of these functions become non virtual and can be truly _inlined_ for speed. GetPosition() in derived classes were also all changed to return const wxPoint&, that is, a reference rather than a full copy of the position wxPoint. There was no need for polymorphism in {Get,Set}Position() since we never call these functions via generic pointer. * Remove BOARD::{Get,Set}Position() since they were only there to satisfy the pure virtuals established BOARD_ITEM, which are now gone. * Added const wxPoint& CPolyLine::GetPos(), made CPolyLine::Get{X,Y}() inline. * Derive CPolyPt from wxPoint so we can return const wxPoint& fromt GetPos(). 2012-Feb-19 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ ++pcbnew Loading gerbview/class_gerber_draw_item.h +2 −9 Original line number Diff line number Diff line Loading @@ -167,15 +167,8 @@ public: * @return const wxPoint& - The position of this object. * This function exists mainly to satisfy the virtual GetPosition() in parent class */ const wxPoint GetPosition() const { return m_Start; // it had to be start or end. } void SetPosition( const wxPoint& aPos ) { m_Start = aPos; } const wxPoint& GetPosition() const { return m_Start; } void SetPosition( const wxPoint& aPos ) { m_Start = aPos; } /** * Function GetABPosition Loading include/base_struct.h +8 −5 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ enum KICAD_T { PCB_MODULE_TEXT_T, ///< class TEXTE_MODULE, text in a footprint PCB_MODULE_EDGE_T, ///< class EDGE_MODULE, a footprint edge PCB_TRACE_T, ///< class TRACKE, a track segment (segment on a copper layer) PCB_VIA_T, ///< class VIA, a via (like a track segment on a copper layer) PCB_VIA_T, ///< class SEGVIA, a via (like a track segment on a copper layer) PCB_ZONE_T, ///< class SEGZONE, a segment used to fill a zone area (segment on a ///< copper layer) PCB_MARKER_T, ///< class MARKER_PCB, a marker used to show something Loading Loading @@ -239,16 +239,19 @@ public: */ bool Contains( const EDA_RECT& aRect ) const; wxSize GetSize() const { return m_Size; } const wxSize& GetSize() const { return m_Size; } int GetX() const { return m_Pos.x; } int GetY() const { return m_Pos.y; } wxPoint GetOrigin() const { return m_Pos; } wxPoint GetPosition() const { return m_Pos; } wxPoint GetEnd() const { return wxPoint( GetRight(), GetBottom() ); } const wxPoint& GetOrigin() const { return m_Pos; } const wxPoint& GetPosition() const { return m_Pos; } const wxPoint GetEnd() const { return wxPoint( GetRight(), GetBottom() ); } int GetWidth() const { return m_Size.x; } int GetHeight() const { return m_Size.y; } int GetRight() const { return m_Pos.x + m_Size.x; } int GetBottom() const { return m_Pos.y + m_Size.y; } void SetOrigin( const wxPoint& pos ) { m_Pos = pos; } void SetOrigin( int x, int y ) { m_Pos.x = x; m_Pos.y = y; } void SetSize( const wxSize& size ) { m_Size = size; } Loading include/class_board_item.h +6 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,11 @@ public: BOARD_ITEM* Back() const { return (BOARD_ITEM*) Pback; } BOARD_ITEM* GetParent() const { return (BOARD_ITEM*) m_Parent; } #if 0 // DICK: there is no value in having a polymorphic {Get,Set}Position(). We never // call GetPosition() using a generic pointer, and the virtual is slower and // can never be inlined. /** * Function GetPosition * returns the position of this object. Loading @@ -107,6 +112,7 @@ public: * @param aPos is the new position of this object */ virtual void SetPosition( const wxPoint& aPos ) = 0; #endif /** * Function GetLayer Loading pcbnew/class_board.h +0 −6 Original line number Diff line number Diff line Loading @@ -268,12 +268,6 @@ public: */ static wxString GetDefaultLayerName( int aLayerNumber ); const wxPoint GetPosition() const // overload { return wxPoint( 0, 0 ); // dummy for pure virtual } void SetPosition( const wxPoint& aPos ) {} // overload /** * Function Add * adds the given item to this BOARD and takes ownership of its memory. Loading Loading
CHANGELOG.txt +15 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,21 @@ KiCad ChangeLog 2012 Please add newer entries at the top, list the date and your name with email address. 2012-Feb-19 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ ++pcbnew * Remove virtual BOARD_ITEM::{Get,Set}Position() which in turn means all derived classes' implementations of these functions become non virtual and can be truly _inlined_ for speed. GetPosition() in derived classes were also all changed to return const wxPoint&, that is, a reference rather than a full copy of the position wxPoint. There was no need for polymorphism in {Get,Set}Position() since we never call these functions via generic pointer. * Remove BOARD::{Get,Set}Position() since they were only there to satisfy the pure virtuals established BOARD_ITEM, which are now gone. * Added const wxPoint& CPolyLine::GetPos(), made CPolyLine::Get{X,Y}() inline. * Derive CPolyPt from wxPoint so we can return const wxPoint& fromt GetPos(). 2012-Feb-19 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ ++pcbnew Loading
gerbview/class_gerber_draw_item.h +2 −9 Original line number Diff line number Diff line Loading @@ -167,15 +167,8 @@ public: * @return const wxPoint& - The position of this object. * This function exists mainly to satisfy the virtual GetPosition() in parent class */ const wxPoint GetPosition() const { return m_Start; // it had to be start or end. } void SetPosition( const wxPoint& aPos ) { m_Start = aPos; } const wxPoint& GetPosition() const { return m_Start; } void SetPosition( const wxPoint& aPos ) { m_Start = aPos; } /** * Function GetABPosition Loading
include/base_struct.h +8 −5 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ enum KICAD_T { PCB_MODULE_TEXT_T, ///< class TEXTE_MODULE, text in a footprint PCB_MODULE_EDGE_T, ///< class EDGE_MODULE, a footprint edge PCB_TRACE_T, ///< class TRACKE, a track segment (segment on a copper layer) PCB_VIA_T, ///< class VIA, a via (like a track segment on a copper layer) PCB_VIA_T, ///< class SEGVIA, a via (like a track segment on a copper layer) PCB_ZONE_T, ///< class SEGZONE, a segment used to fill a zone area (segment on a ///< copper layer) PCB_MARKER_T, ///< class MARKER_PCB, a marker used to show something Loading Loading @@ -239,16 +239,19 @@ public: */ bool Contains( const EDA_RECT& aRect ) const; wxSize GetSize() const { return m_Size; } const wxSize& GetSize() const { return m_Size; } int GetX() const { return m_Pos.x; } int GetY() const { return m_Pos.y; } wxPoint GetOrigin() const { return m_Pos; } wxPoint GetPosition() const { return m_Pos; } wxPoint GetEnd() const { return wxPoint( GetRight(), GetBottom() ); } const wxPoint& GetOrigin() const { return m_Pos; } const wxPoint& GetPosition() const { return m_Pos; } const wxPoint GetEnd() const { return wxPoint( GetRight(), GetBottom() ); } int GetWidth() const { return m_Size.x; } int GetHeight() const { return m_Size.y; } int GetRight() const { return m_Pos.x + m_Size.x; } int GetBottom() const { return m_Pos.y + m_Size.y; } void SetOrigin( const wxPoint& pos ) { m_Pos = pos; } void SetOrigin( int x, int y ) { m_Pos.x = x; m_Pos.y = y; } void SetSize( const wxSize& size ) { m_Size = size; } Loading
include/class_board_item.h +6 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,11 @@ public: BOARD_ITEM* Back() const { return (BOARD_ITEM*) Pback; } BOARD_ITEM* GetParent() const { return (BOARD_ITEM*) m_Parent; } #if 0 // DICK: there is no value in having a polymorphic {Get,Set}Position(). We never // call GetPosition() using a generic pointer, and the virtual is slower and // can never be inlined. /** * Function GetPosition * returns the position of this object. Loading @@ -107,6 +112,7 @@ public: * @param aPos is the new position of this object */ virtual void SetPosition( const wxPoint& aPos ) = 0; #endif /** * Function GetLayer Loading
pcbnew/class_board.h +0 −6 Original line number Diff line number Diff line Loading @@ -268,12 +268,6 @@ public: */ static wxString GetDefaultLayerName( int aLayerNumber ); const wxPoint GetPosition() const // overload { return wxPoint( 0, 0 ); // dummy for pure virtual } void SetPosition( const wxPoint& aPos ) {} // overload /** * Function Add * adds the given item to this BOARD and takes ownership of its memory. Loading