pcbnew: Adding some missing TypeOf() functions

Missing types were handled by the superclass (in the case of zones)
PCB_CONNECTED_ITEM, which incorrectly returned "true" when testing lines
against zones.

Fixes: lp:1789195
* https://bugs.launchpad.net/kicad/+bug/1789195
This commit is contained in:
Seth Hillbrand 2018-08-28 13:14:47 -07:00
parent b7a321d143
commit d8e276bc4f
4 changed files with 21 additions and 0 deletions

View File

@ -83,6 +83,11 @@ public:
~DIMENSION();
static inline bool ClassOf( const EDA_ITEM* aItem )
{
return aItem && PCB_DIMENSION_T == aItem->Type();
}
void SetValue( int aValue ) { m_Value = aValue; }
int GetValue() const { return m_Value; }

View File

@ -70,6 +70,11 @@ public:
~MARKER_PCB();
static inline bool ClassOf( const EDA_ITEM* aItem )
{
return aItem && PCB_MARKER_T == aItem->Type();
}
void Move(const wxPoint& aMoveVector) override
{
m_Pos += aMoveVector;

View File

@ -58,6 +58,11 @@ public:
~PCB_TARGET();
static inline bool ClassOf( const EDA_ITEM* aItem )
{
return aItem && PCB_TARGET_T == aItem->Type();
}
void SetPosition( const wxPoint& aPos ) override { m_Pos = aPos; }
const wxPoint GetPosition() const override { return m_Pos; }

View File

@ -73,6 +73,12 @@ public:
~ZONE_CONTAINER();
static inline bool ClassOf( const EDA_ITEM* aItem )
{
return aItem && ( ( PCB_ZONE_AREA_T == aItem->Type() ) ||
( PCB_ZONE_T == aItem->Type() ) );
}
/**
* Function GetPosition
*