router: introduce concept of 'virtual' vias as a base for shoving/dragging joints of lines of different widths.

This commit is contained in:
Tomasz Wlostowski 2021-06-03 22:30:00 +02:00
parent 3dc92da44b
commit 70ed5c1ae8
3 changed files with 25 additions and 0 deletions

View File

@ -80,6 +80,7 @@ public:
m_marker = 0;
m_rank = -1;
m_routable = true;
m_isVirtual = false;
}
ITEM( const ITEM& aOther )
@ -93,6 +94,7 @@ public:
m_marker = aOther.m_marker;
m_rank = aOther.m_rank;
m_routable = aOther.m_routable;
m_isVirtual = aOther.m_isVirtual;
}
virtual ~ITEM();
@ -228,6 +230,11 @@ public:
void SetRoutable( bool aRoutable ) { m_routable = aRoutable; }
bool IsRoutable() const { return m_routable; }
bool IsVirtual() const
{
return m_isVirtual;
}
private:
bool collideSimple( const ITEM* aOther, const NODE* aNode, bool aDifferentNetsOnly ) const;
@ -243,6 +250,7 @@ protected:
mutable int m_marker;
int m_rank;
bool m_routable;
bool m_isVirtual;
};
template<typename T, typename S>

View File

@ -100,6 +100,7 @@ VIA* VIA::Clone() const
v->m_viaType = m_viaType;
v->m_parent = m_parent;
v->m_isFree = m_isFree;
v->m_isVirtual = m_isVirtual;
return v;
}

View File

@ -55,6 +55,7 @@ public:
m_drill = 0;
m_viaType = VIATYPE::THROUGH;
m_isFree = false;
m_isVirtual = false;
}
VIA( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aDiameter, int aDrill,
@ -70,6 +71,7 @@ public:
m_hole = SHAPE_CIRCLE( m_pos, aDrill / 2 );
m_viaType = aViaType;
m_isFree = false;
m_isVirtual = false;
}
VIA( const VIA& aB ) :
@ -86,6 +88,7 @@ public:
m_drill = aB.m_drill;
m_viaType = aB.m_viaType;
m_isFree = aB.m_isFree;
m_isVirtual = aB.m_isVirtual;
}
static inline bool ClassOf( const ITEM* aItem )
@ -154,6 +157,19 @@ private:
SHAPE_CIRCLE m_hole;
VIATYPE m_viaType;
bool m_isFree;
};
class VVIA : public VIA
{
public:
VVIA( const VECTOR2I& aPos, int aLayer, int aDiameter, int aNet ) :
VIA( aPos, LAYER_RANGE( aLayer, aLayer ), aDiameter, aDiameter / 2, aNet )
{
m_isVirtual = true;
SetHole( SHAPE_CIRCLE( Pos(), 1 ) );
}
};
}