diff --git a/pcbnew/class_drawsegment.h b/pcbnew/class_drawsegment.h index 7316b4e554..3c5667ebd6 100644 --- a/pcbnew/class_drawsegment.h +++ b/pcbnew/class_drawsegment.h @@ -69,6 +69,11 @@ public: /// skip the linked list stuff, and parent const DRAWSEGMENT& operator = ( const DRAWSEGMENT& rhs ); + static inline bool ClassOf( const EDA_ITEM *aItem ) + { + return aItem && PCB_LINE_T == aItem->Type(); + } + void SetWidth( int aWidth ) { m_Width = aWidth; } int GetWidth() const { return m_Width; } diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index c68596bd29..339b4dc65b 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -94,6 +94,11 @@ public: ///< used for edge board connectors static LSET UnplatedHoleMask(); ///< layer set for a mechanical unplated through hole pad + static inline bool ClassOf( const EDA_ITEM *aItem ) + { + return aItem && PCB_PAD_T == aItem->Type(); + } + void Copy( D_PAD* source ); D_PAD* Next() const { return static_cast( Pnext ); } diff --git a/pcbnew/class_pcb_text.h b/pcbnew/class_pcb_text.h index 7a6d853704..9bdcd2a720 100644 --- a/pcbnew/class_pcb_text.h +++ b/pcbnew/class_pcb_text.h @@ -49,6 +49,11 @@ public: ~TEXTE_PCB(); + static inline bool ClassOf( const EDA_ITEM *aItem ) + { + return aItem && PCB_TEXT_T == aItem->Type(); + } + virtual const wxPoint& GetPosition() const { return m_Pos;