Loading eeschema/dialogs/dialog_edit_one_field.cpp +1 −1 Original line number Diff line number Diff line /** * @file dialog_lib_edit_one_field.cpp * @file dialog_edit_one_field.cpp * @brief dialog to editing a field ( not a graphic text) in current component. */ Loading eeschema/lib_arc.cpp +9 −10 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or Loading Loading @@ -228,7 +227,7 @@ EDA_ITEM* LIB_ARC::doClone() const } int LIB_ARC::DoCompare( const LIB_ITEM& aOther ) const int LIB_ARC::compare( const LIB_ITEM& aOther ) const { wxASSERT( aOther.Type() == LIB_ARC_T ); Loading @@ -250,7 +249,7 @@ int LIB_ARC::DoCompare( const LIB_ITEM& aOther ) const } void LIB_ARC::DoOffset( const wxPoint& aOffset ) void LIB_ARC::SetOffset( const wxPoint& aOffset ) { m_Pos += aOffset; m_ArcStart += aOffset; Loading @@ -258,14 +257,14 @@ void LIB_ARC::DoOffset( const wxPoint& aOffset ) } bool LIB_ARC::DoTestInside( EDA_RECT& aRect ) const bool LIB_ARC::Inside( EDA_RECT& aRect ) const { return aRect.Contains( m_ArcStart.x, -m_ArcStart.y ) || aRect.Contains( m_ArcEnd.x, -m_ArcEnd.y ); } void LIB_ARC::DoMove( const wxPoint& aPosition ) void LIB_ARC::Move( const wxPoint& aPosition ) { wxPoint offset = aPosition - m_Pos; m_Pos = aPosition; Loading @@ -274,7 +273,7 @@ void LIB_ARC::DoMove( const wxPoint& aPosition ) } void LIB_ARC::DoMirrorHorizontal( const wxPoint& aCenter ) void LIB_ARC::MirrorHorizontal( const wxPoint& aCenter ) { m_Pos.x -= aCenter.x; m_Pos.x *= -1; Loading @@ -288,7 +287,7 @@ void LIB_ARC::DoMirrorHorizontal( const wxPoint& aCenter ) EXCHG( m_ArcStart, m_ArcEnd ); } void LIB_ARC::DoMirrorVertical( const wxPoint& aCenter ) void LIB_ARC::MirrorVertical( const wxPoint& aCenter ) { m_Pos.y -= aCenter.y; m_Pos.y *= -1; Loading @@ -302,7 +301,7 @@ void LIB_ARC::DoMirrorVertical( const wxPoint& aCenter ) EXCHG( m_ArcStart, m_ArcEnd ); } void LIB_ARC::DoRotate( const wxPoint& aCenter, bool aRotateCCW ) void LIB_ARC::Rotate( const wxPoint& aCenter, bool aRotateCCW ) { int rot_angle = aRotateCCW ? -900 : 900; RotatePoint( &m_Pos, aCenter, rot_angle ); Loading @@ -312,7 +311,7 @@ void LIB_ARC::DoRotate( const wxPoint& aCenter, bool aRotateCCW ) void LIB_ARC::DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, void LIB_ARC::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ) { wxASSERT( aPlotter != NULL ); Loading eeschema/lib_arc.h +60 −15 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or Loading Loading @@ -148,34 +147,80 @@ public: */ void EndEdit( const wxPoint& aPosition, bool aAbort = false ); /** * @copydoc LIB_ITEM::SetOffset(const wxPoint&) */ virtual void SetOffset( const wxPoint& aOffset ); /** * @copydoc LIB_ITEM::Inside() */ virtual bool Inside( EDA_RECT& aRect ) const; /** * @copydoc LIB_ITEM::Move() */ virtual void Move( const wxPoint& aPosition ); /** * @copydoc LIB_ITEM::GetPosition() */ virtual wxPoint GetPosition() const { return m_Pos; } /** * @copydoc LIB_ITEM::MirrorHorizontal() */ virtual void MirrorHorizontal( const wxPoint& aCenter ); /** * @copydoc LIB_ITEM::MirrorVertical() */ virtual void MirrorVertical( const wxPoint& aCenter ); /** * @copydoc LIB_ITEM::Rotate(const wxPoint&,bool) */ virtual void Rotate( const wxPoint& aCenter, bool aRotateCCW = true ); /** * @copydoc LIB_ITEM::Plot() */ virtual void Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ); /** * @copydoc LIB_ITEM::GetWidth() */ virtual int GetWidth() const { return m_Width; } /** * @copydoc LIB_ITEM::SetWidth() */ virtual void SetWidth( int aWidth ) { m_Width = aWidth; } virtual wxString GetSelectMenuText() const; virtual BITMAP_DEF GetMenuImage() const { return add_arc_xpm; } protected: private: virtual EDA_ITEM* doClone() const; /** * Provide the arc draw object specific comparison. * Function compare * provides the arc draw object specific comparison. * * The sort order is as follows: * - Arc horizontal (X) position. * - Arc vertical (Y) position. * - Arc start angle. * - Arc end angle. * * @param aOther A reference to the other #LIB_ITEM to compare the arc against. * @return An integer value less than 0 if the arc is less than \a aOther, zero * if the arc is equal to \a aOther, or greater than 0 if the arc is * greater than \a aOther. */ virtual int DoCompare( const LIB_ITEM& aOther ) const; virtual void DoOffset( const wxPoint& aOffset ); virtual bool DoTestInside( EDA_RECT& aRect ) const; virtual void DoMove( const wxPoint& aPosition ); virtual wxPoint DoGetPosition() const { return m_Pos; } virtual void DoMirrorHorizontal( const wxPoint& aCenter ); virtual void DoMirrorVertical( const wxPoint& aCenter ); virtual void DoRotate( const wxPoint& aCenter, bool aRotateCCW = true ); virtual void DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ); virtual int DoGetWidth() const { return m_Width; } virtual void DoSetWidth( int aWidth ) { m_Width = aWidth; } virtual int compare( const LIB_ITEM& aOther ) const; }; Loading eeschema/lib_bezier.cpp +10 −11 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or Loading Loading @@ -139,7 +138,7 @@ EDA_ITEM* LIB_BEZIER::doClone() const } int LIB_BEZIER::DoCompare( const LIB_ITEM& aOther ) const int LIB_BEZIER::compare( const LIB_ITEM& aOther ) const { wxASSERT( aOther.Type() == LIB_BEZIER_T ); Loading @@ -161,7 +160,7 @@ int LIB_BEZIER::DoCompare( const LIB_ITEM& aOther ) const } void LIB_BEZIER::DoOffset( const wxPoint& aOffset ) void LIB_BEZIER::SetOffset( const wxPoint& aOffset ) { size_t i; Loading @@ -173,7 +172,7 @@ void LIB_BEZIER::DoOffset( const wxPoint& aOffset ) } bool LIB_BEZIER::DoTestInside( EDA_RECT& aRect ) const bool LIB_BEZIER::Inside( EDA_RECT& aRect ) const { for( size_t i = 0; i < m_PolyPoints.size(); i++ ) { Loading @@ -185,13 +184,13 @@ bool LIB_BEZIER::DoTestInside( EDA_RECT& aRect ) const } void LIB_BEZIER::DoMove( const wxPoint& aPosition ) void LIB_BEZIER::Move( const wxPoint& aPosition ) { DoOffset( aPosition - m_PolyPoints[0] ); SetOffset( aPosition - m_PolyPoints[0] ); } void LIB_BEZIER::DoMirrorHorizontal( const wxPoint& aCenter ) void LIB_BEZIER::MirrorHorizontal( const wxPoint& aCenter ) { size_t i, imax = m_PolyPoints.size(); Loading @@ -212,7 +211,7 @@ void LIB_BEZIER::DoMirrorHorizontal( const wxPoint& aCenter ) } } void LIB_BEZIER::DoMirrorVertical( const wxPoint& aCenter ) void LIB_BEZIER::MirrorVertical( const wxPoint& aCenter ) { size_t i, imax = m_PolyPoints.size(); Loading @@ -233,7 +232,7 @@ void LIB_BEZIER::DoMirrorVertical( const wxPoint& aCenter ) } } void LIB_BEZIER::DoRotate( const wxPoint& aCenter, bool aRotateCCW ) void LIB_BEZIER::Rotate( const wxPoint& aCenter, bool aRotateCCW ) { int rot_angle = aRotateCCW ? -900 : 900; Loading @@ -253,7 +252,7 @@ void LIB_BEZIER::DoRotate( const wxPoint& aCenter, bool aRotateCCW ) } void LIB_BEZIER::DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ) { wxASSERT( aPlotter != NULL ); Loading eeschema/lib_bezier.h +61 −17 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or Loading Loading @@ -75,6 +74,11 @@ public: void AddPoint( const wxPoint& aPoint ); /** * @copydoc LIB_ITEM::SetOffset(const wxPoint&) */ virtual void SetOffset( const wxPoint& aOffset ); /** * @return the number of corners */ Loading Loading @@ -102,6 +106,52 @@ public: */ virtual EDA_RECT GetBoundingBox() const; /** * @copydoc LIB_ITEM::Inside() */ virtual bool Inside( EDA_RECT& aRect ) const; /** * @copydoc LIB_ITEM::Move() */ virtual void Move( const wxPoint& aPosition ); /** * @copydoc LIB_ITEM::GetPosition() */ virtual wxPoint GetPosition() const { return m_PolyPoints[0]; } /** * @copydoc LIB_ITEM::MirrorHorizontal() */ virtual void MirrorHorizontal( const wxPoint& aCenter ); /** * @copydoc LIB_ITEM::MirrorVertical() */ virtual void MirrorVertical( const wxPoint& aCenter ); /** * @copydoc LIB_ITEM::Rotate(const wxPoint&,bool) */ virtual void Rotate( const wxPoint& aCenter, bool aRotateCCW = true ); /** * @copydoc LIB_ITEM::Plot() */ virtual void Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ); /** * @copydoc LIB_ITEM::GetWidth() */ virtual int GetWidth() const { return m_Width; } /** * @copydoc LIB_ITEM::SetWidth() */ virtual void SetWidth( int aWidth ) { m_Width = aWidth; } /** * Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item Loading @@ -110,29 +160,23 @@ public: virtual void DisplayInfo( EDA_DRAW_FRAME* aFrame ); protected: private: virtual EDA_ITEM* doClone() const; /** * Provide the bezier curve draw object specific comparison. * Function compare * provides the bezier curve draw object specific comparison. * * The sort order for each bezier curve segment point is as follows: * - Bezier point horizontal (X) point position. * - Bezier point vertical (Y) point position. * * @param aOther A reference to the other #LIB_ITEM to compare the bezier curve against. * @return An integer value less than 0 if the bezier curve is less than \a aOther, zero * if the bezier curve is equal to \a aOther, or greater than 0 if the bezier * curve is greater than \a aOther. */ virtual int DoCompare( const LIB_ITEM& aOther ) const; virtual void DoOffset( const wxPoint& aOffset ); virtual bool DoTestInside( EDA_RECT& aRect ) const; virtual void DoMove( const wxPoint& aPosition ); virtual wxPoint DoGetPosition() const { return m_PolyPoints[0]; } virtual void DoMirrorHorizontal( const wxPoint& aCenter ); virtual void DoMirrorVertical( const wxPoint& aCenter ); virtual void DoRotate( const wxPoint& aCenter, bool aRotateCCW = true ); virtual void DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ); virtual int DoGetWidth() const { return m_Width; } virtual void DoSetWidth( int aWidth ) { m_Width = aWidth; } virtual int compare( const LIB_ITEM& aOther ) const; }; Loading Loading
eeschema/dialogs/dialog_edit_one_field.cpp +1 −1 Original line number Diff line number Diff line /** * @file dialog_lib_edit_one_field.cpp * @file dialog_edit_one_field.cpp * @brief dialog to editing a field ( not a graphic text) in current component. */ Loading
eeschema/lib_arc.cpp +9 −10 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or Loading Loading @@ -228,7 +227,7 @@ EDA_ITEM* LIB_ARC::doClone() const } int LIB_ARC::DoCompare( const LIB_ITEM& aOther ) const int LIB_ARC::compare( const LIB_ITEM& aOther ) const { wxASSERT( aOther.Type() == LIB_ARC_T ); Loading @@ -250,7 +249,7 @@ int LIB_ARC::DoCompare( const LIB_ITEM& aOther ) const } void LIB_ARC::DoOffset( const wxPoint& aOffset ) void LIB_ARC::SetOffset( const wxPoint& aOffset ) { m_Pos += aOffset; m_ArcStart += aOffset; Loading @@ -258,14 +257,14 @@ void LIB_ARC::DoOffset( const wxPoint& aOffset ) } bool LIB_ARC::DoTestInside( EDA_RECT& aRect ) const bool LIB_ARC::Inside( EDA_RECT& aRect ) const { return aRect.Contains( m_ArcStart.x, -m_ArcStart.y ) || aRect.Contains( m_ArcEnd.x, -m_ArcEnd.y ); } void LIB_ARC::DoMove( const wxPoint& aPosition ) void LIB_ARC::Move( const wxPoint& aPosition ) { wxPoint offset = aPosition - m_Pos; m_Pos = aPosition; Loading @@ -274,7 +273,7 @@ void LIB_ARC::DoMove( const wxPoint& aPosition ) } void LIB_ARC::DoMirrorHorizontal( const wxPoint& aCenter ) void LIB_ARC::MirrorHorizontal( const wxPoint& aCenter ) { m_Pos.x -= aCenter.x; m_Pos.x *= -1; Loading @@ -288,7 +287,7 @@ void LIB_ARC::DoMirrorHorizontal( const wxPoint& aCenter ) EXCHG( m_ArcStart, m_ArcEnd ); } void LIB_ARC::DoMirrorVertical( const wxPoint& aCenter ) void LIB_ARC::MirrorVertical( const wxPoint& aCenter ) { m_Pos.y -= aCenter.y; m_Pos.y *= -1; Loading @@ -302,7 +301,7 @@ void LIB_ARC::DoMirrorVertical( const wxPoint& aCenter ) EXCHG( m_ArcStart, m_ArcEnd ); } void LIB_ARC::DoRotate( const wxPoint& aCenter, bool aRotateCCW ) void LIB_ARC::Rotate( const wxPoint& aCenter, bool aRotateCCW ) { int rot_angle = aRotateCCW ? -900 : 900; RotatePoint( &m_Pos, aCenter, rot_angle ); Loading @@ -312,7 +311,7 @@ void LIB_ARC::DoRotate( const wxPoint& aCenter, bool aRotateCCW ) void LIB_ARC::DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, void LIB_ARC::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ) { wxASSERT( aPlotter != NULL ); Loading
eeschema/lib_arc.h +60 −15 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or Loading Loading @@ -148,34 +147,80 @@ public: */ void EndEdit( const wxPoint& aPosition, bool aAbort = false ); /** * @copydoc LIB_ITEM::SetOffset(const wxPoint&) */ virtual void SetOffset( const wxPoint& aOffset ); /** * @copydoc LIB_ITEM::Inside() */ virtual bool Inside( EDA_RECT& aRect ) const; /** * @copydoc LIB_ITEM::Move() */ virtual void Move( const wxPoint& aPosition ); /** * @copydoc LIB_ITEM::GetPosition() */ virtual wxPoint GetPosition() const { return m_Pos; } /** * @copydoc LIB_ITEM::MirrorHorizontal() */ virtual void MirrorHorizontal( const wxPoint& aCenter ); /** * @copydoc LIB_ITEM::MirrorVertical() */ virtual void MirrorVertical( const wxPoint& aCenter ); /** * @copydoc LIB_ITEM::Rotate(const wxPoint&,bool) */ virtual void Rotate( const wxPoint& aCenter, bool aRotateCCW = true ); /** * @copydoc LIB_ITEM::Plot() */ virtual void Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ); /** * @copydoc LIB_ITEM::GetWidth() */ virtual int GetWidth() const { return m_Width; } /** * @copydoc LIB_ITEM::SetWidth() */ virtual void SetWidth( int aWidth ) { m_Width = aWidth; } virtual wxString GetSelectMenuText() const; virtual BITMAP_DEF GetMenuImage() const { return add_arc_xpm; } protected: private: virtual EDA_ITEM* doClone() const; /** * Provide the arc draw object specific comparison. * Function compare * provides the arc draw object specific comparison. * * The sort order is as follows: * - Arc horizontal (X) position. * - Arc vertical (Y) position. * - Arc start angle. * - Arc end angle. * * @param aOther A reference to the other #LIB_ITEM to compare the arc against. * @return An integer value less than 0 if the arc is less than \a aOther, zero * if the arc is equal to \a aOther, or greater than 0 if the arc is * greater than \a aOther. */ virtual int DoCompare( const LIB_ITEM& aOther ) const; virtual void DoOffset( const wxPoint& aOffset ); virtual bool DoTestInside( EDA_RECT& aRect ) const; virtual void DoMove( const wxPoint& aPosition ); virtual wxPoint DoGetPosition() const { return m_Pos; } virtual void DoMirrorHorizontal( const wxPoint& aCenter ); virtual void DoMirrorVertical( const wxPoint& aCenter ); virtual void DoRotate( const wxPoint& aCenter, bool aRotateCCW = true ); virtual void DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ); virtual int DoGetWidth() const { return m_Width; } virtual void DoSetWidth( int aWidth ) { m_Width = aWidth; } virtual int compare( const LIB_ITEM& aOther ) const; }; Loading
eeschema/lib_bezier.cpp +10 −11 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or Loading Loading @@ -139,7 +138,7 @@ EDA_ITEM* LIB_BEZIER::doClone() const } int LIB_BEZIER::DoCompare( const LIB_ITEM& aOther ) const int LIB_BEZIER::compare( const LIB_ITEM& aOther ) const { wxASSERT( aOther.Type() == LIB_BEZIER_T ); Loading @@ -161,7 +160,7 @@ int LIB_BEZIER::DoCompare( const LIB_ITEM& aOther ) const } void LIB_BEZIER::DoOffset( const wxPoint& aOffset ) void LIB_BEZIER::SetOffset( const wxPoint& aOffset ) { size_t i; Loading @@ -173,7 +172,7 @@ void LIB_BEZIER::DoOffset( const wxPoint& aOffset ) } bool LIB_BEZIER::DoTestInside( EDA_RECT& aRect ) const bool LIB_BEZIER::Inside( EDA_RECT& aRect ) const { for( size_t i = 0; i < m_PolyPoints.size(); i++ ) { Loading @@ -185,13 +184,13 @@ bool LIB_BEZIER::DoTestInside( EDA_RECT& aRect ) const } void LIB_BEZIER::DoMove( const wxPoint& aPosition ) void LIB_BEZIER::Move( const wxPoint& aPosition ) { DoOffset( aPosition - m_PolyPoints[0] ); SetOffset( aPosition - m_PolyPoints[0] ); } void LIB_BEZIER::DoMirrorHorizontal( const wxPoint& aCenter ) void LIB_BEZIER::MirrorHorizontal( const wxPoint& aCenter ) { size_t i, imax = m_PolyPoints.size(); Loading @@ -212,7 +211,7 @@ void LIB_BEZIER::DoMirrorHorizontal( const wxPoint& aCenter ) } } void LIB_BEZIER::DoMirrorVertical( const wxPoint& aCenter ) void LIB_BEZIER::MirrorVertical( const wxPoint& aCenter ) { size_t i, imax = m_PolyPoints.size(); Loading @@ -233,7 +232,7 @@ void LIB_BEZIER::DoMirrorVertical( const wxPoint& aCenter ) } } void LIB_BEZIER::DoRotate( const wxPoint& aCenter, bool aRotateCCW ) void LIB_BEZIER::Rotate( const wxPoint& aCenter, bool aRotateCCW ) { int rot_angle = aRotateCCW ? -900 : 900; Loading @@ -253,7 +252,7 @@ void LIB_BEZIER::DoRotate( const wxPoint& aCenter, bool aRotateCCW ) } void LIB_BEZIER::DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ) { wxASSERT( aPlotter != NULL ); Loading
eeschema/lib_bezier.h +61 −17 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or Loading Loading @@ -75,6 +74,11 @@ public: void AddPoint( const wxPoint& aPoint ); /** * @copydoc LIB_ITEM::SetOffset(const wxPoint&) */ virtual void SetOffset( const wxPoint& aOffset ); /** * @return the number of corners */ Loading Loading @@ -102,6 +106,52 @@ public: */ virtual EDA_RECT GetBoundingBox() const; /** * @copydoc LIB_ITEM::Inside() */ virtual bool Inside( EDA_RECT& aRect ) const; /** * @copydoc LIB_ITEM::Move() */ virtual void Move( const wxPoint& aPosition ); /** * @copydoc LIB_ITEM::GetPosition() */ virtual wxPoint GetPosition() const { return m_PolyPoints[0]; } /** * @copydoc LIB_ITEM::MirrorHorizontal() */ virtual void MirrorHorizontal( const wxPoint& aCenter ); /** * @copydoc LIB_ITEM::MirrorVertical() */ virtual void MirrorVertical( const wxPoint& aCenter ); /** * @copydoc LIB_ITEM::Rotate(const wxPoint&,bool) */ virtual void Rotate( const wxPoint& aCenter, bool aRotateCCW = true ); /** * @copydoc LIB_ITEM::Plot() */ virtual void Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ); /** * @copydoc LIB_ITEM::GetWidth() */ virtual int GetWidth() const { return m_Width; } /** * @copydoc LIB_ITEM::SetWidth() */ virtual void SetWidth( int aWidth ) { m_Width = aWidth; } /** * Function GetPenSize * @return the size of the "pen" that be used to draw or plot this item Loading @@ -110,29 +160,23 @@ public: virtual void DisplayInfo( EDA_DRAW_FRAME* aFrame ); protected: private: virtual EDA_ITEM* doClone() const; /** * Provide the bezier curve draw object specific comparison. * Function compare * provides the bezier curve draw object specific comparison. * * The sort order for each bezier curve segment point is as follows: * - Bezier point horizontal (X) point position. * - Bezier point vertical (Y) point position. * * @param aOther A reference to the other #LIB_ITEM to compare the bezier curve against. * @return An integer value less than 0 if the bezier curve is less than \a aOther, zero * if the bezier curve is equal to \a aOther, or greater than 0 if the bezier * curve is greater than \a aOther. */ virtual int DoCompare( const LIB_ITEM& aOther ) const; virtual void DoOffset( const wxPoint& aOffset ); virtual bool DoTestInside( EDA_RECT& aRect ) const; virtual void DoMove( const wxPoint& aPosition ); virtual wxPoint DoGetPosition() const { return m_PolyPoints[0]; } virtual void DoMirrorHorizontal( const wxPoint& aCenter ); virtual void DoMirrorVertical( const wxPoint& aCenter ); virtual void DoRotate( const wxPoint& aCenter, bool aRotateCCW = true ); virtual void DoPlot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, const TRANSFORM& aTransform ); virtual int DoGetWidth() const { return m_Width; } virtual void DoSetWidth( int aWidth ) { m_Width = aWidth; } virtual int compare( const LIB_ITEM& aOther ) const; }; Loading