Added BOARD_[CONNECTED_]ITEM::IsConnected() for checking if a BOARD_ITEM is BOARD_CONNECTED_ITEM as well.

This commit is contained in:
Maciej Suminski 2014-01-28 16:23:08 +01:00
parent c3c7b2e9cc
commit 2b8f9fc621
2 changed files with 16 additions and 0 deletions

View File

@ -93,6 +93,16 @@ public:
virtual void SetPosition( const wxPoint& aPos ) = 0; virtual void SetPosition( const wxPoint& aPos ) = 0;
/**
* Function IsConnected()
* Returns information if the object is derived from BOARD_CONNECTED_ITEM.
* @return True if the object is of BOARD_CONNECTED_ITEM type, false otherwise.
*/
virtual bool IsConnected() const
{
return false;
}
/** /**
* 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.
*/ */

View File

@ -70,6 +70,12 @@ public:
BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem ); BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem );
///> @copydoc BOARD_ITEM::IsConnected()
bool IsConnected() const
{
return true;
}
/** /**
* Function GetNet * Function GetNet
* @return int - the net code. * @return int - the net code.