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

View File

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

View File

@ -55,6 +55,7 @@ public:
m_drill = 0; m_drill = 0;
m_viaType = VIATYPE::THROUGH; m_viaType = VIATYPE::THROUGH;
m_isFree = false; m_isFree = false;
m_isVirtual = false;
} }
VIA( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aDiameter, int aDrill, 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_hole = SHAPE_CIRCLE( m_pos, aDrill / 2 );
m_viaType = aViaType; m_viaType = aViaType;
m_isFree = false; m_isFree = false;
m_isVirtual = false;
} }
VIA( const VIA& aB ) : VIA( const VIA& aB ) :
@ -86,6 +88,7 @@ public:
m_drill = aB.m_drill; m_drill = aB.m_drill;
m_viaType = aB.m_viaType; m_viaType = aB.m_viaType;
m_isFree = aB.m_isFree; m_isFree = aB.m_isFree;
m_isVirtual = aB.m_isVirtual;
} }
static inline bool ClassOf( const ITEM* aItem ) static inline bool ClassOf( const ITEM* aItem )
@ -154,6 +157,19 @@ private:
SHAPE_CIRCLE m_hole; SHAPE_CIRCLE m_hole;
VIATYPE m_viaType; VIATYPE m_viaType;
bool m_isFree; 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 ) );
}
}; };
} }