Unified Set/GetPosition() for BOARD_ITEMs.

This commit is contained in:
Maciej Suminski 2013-08-29 12:06:06 +02:00
parent edea2f9112
commit 89849cdfa7
5 changed files with 42 additions and 1 deletions

View File

@ -90,6 +90,10 @@ public:
// Do not create a copy constructor. The one generated by the compiler is adequate.
virtual const wxPoint& GetPosition() const = 0;
virtual void SetPosition( const wxPoint& aPos ) = 0;
/**
* A value of wxPoint(0,0) which can be passed to the Draw() functions.
*/

View File

@ -123,9 +123,22 @@ BOARD::~BOARD()
}
const wxPoint& BOARD::GetPosition() const
{
wxLogWarning( wxT( "This should not be called on the BOARD object") );
return ZeroOffset;
}
void BOARD::SetPosition( const wxPoint& aPos )
{
wxLogWarning( wxT( "This should not be called on the BOARD object") );
}
void BOARD::Move( const wxPoint& aMoveVector ) // overload
{
wxLogWarning( wxT( "This should not be called on the BOARD object") );
}

View File

@ -308,6 +308,10 @@ public:
BOARD();
~BOARD();
virtual const wxPoint& GetPosition() const;
virtual void SetPosition( const wxPoint& aPos );
bool IsEmpty() const
{
return m_Drawings.GetCount() == 0 && m_Modules.GetCount() == 0 &&

View File

@ -49,6 +49,16 @@ public:
~TEXTE_PCB();
virtual const wxPoint& GetPosition() const
{
return m_Pos;
}
virtual void SetPosition( const wxPoint& aPos )
{
m_Pos = aPos;
}
void Move( const wxPoint& aMoveVector )
{
m_Pos += aMoveVector;

View File

@ -79,6 +79,16 @@ public:
~TEXTE_MODULE();
virtual const wxPoint& GetPosition() const
{
return m_Pos;
}
virtual void SetPosition( const wxPoint& aPos )
{
m_Pos = aPos;
}
TEXTE_MODULE* Next() const { return (TEXTE_MODULE*) Pnext; }
TEXTE_MODULE* Back() const { return (TEXTE_MODULE*) Pback; }