From 2b8f9fc62158369a2bf55ed4b417a864206d4704 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 28 Jan 2014 16:23:08 +0100 Subject: [PATCH] Added BOARD_[CONNECTED_]ITEM::IsConnected() for checking if a BOARD_ITEM is BOARD_CONNECTED_ITEM as well. --- include/class_board_item.h | 10 ++++++++++ pcbnew/class_board_connected_item.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/include/class_board_item.h b/include/class_board_item.h index b6e5e905a6..ceb428af5e 100644 --- a/include/class_board_item.h +++ b/include/class_board_item.h @@ -93,6 +93,16 @@ public: 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. */ diff --git a/pcbnew/class_board_connected_item.h b/pcbnew/class_board_connected_item.h index b7a059c9f4..eab6d310fd 100644 --- a/pcbnew/class_board_connected_item.h +++ b/pcbnew/class_board_connected_item.h @@ -70,6 +70,12 @@ public: BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem ); + ///> @copydoc BOARD_ITEM::IsConnected() + bool IsConnected() const + { + return true; + } + /** * Function GetNet * @return int - the net code.