Commit 89849cdf authored by Maciej Suminski's avatar Maciej Suminski

Unified Set/GetPosition() for BOARD_ITEMs.

parent edea2f91
...@@ -90,6 +90,10 @@ public: ...@@ -90,6 +90,10 @@ public:
// Do not create a copy constructor. The one generated by the compiler is adequate. // 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. * A value of wxPoint(0,0) which can be passed to the Draw() functions.
*/ */
......
...@@ -123,9 +123,22 @@ BOARD::~BOARD() ...@@ -123,9 +123,22 @@ BOARD::~BOARD()
} }
void BOARD::Move( const wxPoint& aMoveVector ) // overload 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") );
} }
......
...@@ -308,6 +308,10 @@ public: ...@@ -308,6 +308,10 @@ public:
BOARD(); BOARD();
~BOARD(); ~BOARD();
virtual const wxPoint& GetPosition() const;
virtual void SetPosition( const wxPoint& aPos );
bool IsEmpty() const bool IsEmpty() const
{ {
return m_Drawings.GetCount() == 0 && m_Modules.GetCount() == 0 && return m_Drawings.GetCount() == 0 && m_Modules.GetCount() == 0 &&
......
...@@ -49,6 +49,16 @@ public: ...@@ -49,6 +49,16 @@ public:
~TEXTE_PCB(); ~TEXTE_PCB();
virtual const wxPoint& GetPosition() const
{
return m_Pos;
}
virtual void SetPosition( const wxPoint& aPos )
{
m_Pos = aPos;
}
void Move( const wxPoint& aMoveVector ) void Move( const wxPoint& aMoveVector )
{ {
m_Pos += aMoveVector; m_Pos += aMoveVector;
......
...@@ -79,6 +79,16 @@ public: ...@@ -79,6 +79,16 @@ public:
~TEXTE_MODULE(); ~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* Next() const { return (TEXTE_MODULE*) Pnext; }
TEXTE_MODULE* Back() const { return (TEXTE_MODULE*) Pback; } TEXTE_MODULE* Back() const { return (TEXTE_MODULE*) Pback; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment