From 4cf44d972581d0764e6b1b363d40bc209eb1bcff Mon Sep 17 00:00:00 2001 From: decimad Date: Mon, 29 Aug 2016 18:11:42 +0200 Subject: [PATCH] Rename pns item kind constants in preparation for renaming pns classes --- pcbnew/router/pns_diff_pair.cpp | 10 +++--- pcbnew/router/pns_diff_pair.h | 10 +++--- pcbnew/router/pns_diff_pair_placer.cpp | 12 +++---- pcbnew/router/pns_dp_meander_placer.cpp | 2 +- pcbnew/router/pns_dragger.cpp | 6 ++-- pcbnew/router/pns_index.h | 8 ++--- pcbnew/router/pns_item.cpp | 12 +++---- pcbnew/router/pns_item.h | 14 ++++----- pcbnew/router/pns_joint.h | 16 +++++----- pcbnew/router/pns_kicad_iface.cpp | 6 ++-- pcbnew/router/pns_line.h | 4 +-- pcbnew/router/pns_line_placer.cpp | 10 +++--- pcbnew/router/pns_logger.cpp | 8 ++--- pcbnew/router/pns_meander_placer.cpp | 2 +- pcbnew/router/pns_meander_skew_placer.cpp | 2 +- pcbnew/router/pns_node.cpp | 38 +++++++++++------------ pcbnew/router/pns_node.h | 12 +++---- pcbnew/router/pns_optimizer.cpp | 18 +++++------ pcbnew/router/pns_router.cpp | 10 +++--- pcbnew/router/pns_segment.h | 8 ++--- pcbnew/router/pns_shove.cpp | 30 +++++++++--------- pcbnew/router/pns_sizes_settings.cpp | 8 ++--- pcbnew/router/pns_solid.h | 4 +-- pcbnew/router/pns_tool_base.cpp | 8 ++--- pcbnew/router/pns_topology.cpp | 6 ++-- pcbnew/router/pns_topology.h | 6 ++-- pcbnew/router/pns_utils.cpp | 4 +-- pcbnew/router/pns_via.cpp | 2 +- pcbnew/router/pns_via.h | 8 ++--- pcbnew/router/pns_walkaround.h | 6 ++-- pcbnew/router/router_preview_item.cpp | 10 +++--- 31 files changed, 150 insertions(+), 150 deletions(-) diff --git a/pcbnew/router/pns_diff_pair.cpp b/pcbnew/router/pns_diff_pair.cpp index 16887f5748..a0088f423c 100644 --- a/pcbnew/router/pns_diff_pair.cpp +++ b/pcbnew/router/pns_diff_pair.cpp @@ -107,13 +107,13 @@ bool PNS_DP_PRIMITIVE_PAIR::Directional() const if( !m_primP ) return false; - return m_primP->OfKind( PNS_ITEM::SEGMENT ); + return m_primP->OfKind( PNS_ITEM::SEGMENT_T ); } DIRECTION_45 PNS_DP_PRIMITIVE_PAIR::anchorDirection( PNS_ITEM* aItem, const VECTOR2I& aP ) const { - if( !aItem->OfKind ( PNS_ITEM::SEGMENT ) ) + if( !aItem->OfKind ( PNS_ITEM::SEGMENT_T ) ) return DIRECTION_45(); PNS_SEGMENT* s = static_cast( aItem ); @@ -130,7 +130,7 @@ void PNS_DP_PRIMITIVE_PAIR::CursorOrientation( const VECTOR2I& aCursorPos, VECTO VECTOR2I aP, aN, dir, midpoint; - if ( m_primP->OfKind( PNS_ITEM::SEGMENT ) && m_primN->OfKind( PNS_ITEM::SEGMENT ) ) + if ( m_primP->OfKind( PNS_ITEM::SEGMENT_T ) && m_primN->OfKind( PNS_ITEM::SEGMENT_T ) ) { aP = m_primP->Anchor( 1 ); aN = m_primN->Anchor( 1 ); @@ -421,7 +421,7 @@ void PNS_DP_GATEWAYS::BuildFromPrimitivePair( PNS_DP_PRIMITIVE_PAIR aPair, bool return; } - const int pvMask = PNS_ITEM::SOLID | PNS_ITEM::VIA; + const int pvMask = PNS_ITEM::SOLID_T | PNS_ITEM::VIA_T; if( aPair.PrimP()->OfKind( pvMask ) && aPair.PrimN()->OfKind( pvMask ) ) { @@ -430,7 +430,7 @@ void PNS_DP_GATEWAYS::BuildFromPrimitivePair( PNS_DP_PRIMITIVE_PAIR aPair, bool shP = aPair.PrimP()->Shape(); } - else if( aPair.PrimP()->OfKind( PNS_ITEM::SEGMENT ) && aPair.PrimN()->OfKind( PNS_ITEM::SEGMENT ) ) + else if( aPair.PrimP()->OfKind( PNS_ITEM::SEGMENT_T ) && aPair.PrimN()->OfKind( PNS_ITEM::SEGMENT_T ) ) { buildDpContinuation( aPair, aPreferDiagonal ); diff --git a/pcbnew/router/pns_diff_pair.h b/pcbnew/router/pns_diff_pair.h index f5248de581..902bf20fd1 100644 --- a/pcbnew/router/pns_diff_pair.h +++ b/pcbnew/router/pns_diff_pair.h @@ -286,7 +286,7 @@ public: typedef std::vector COUPLED_SEGMENTS_VEC; - PNS_DIFF_PAIR() : PNS_ITEM( DIFF_PAIR ), m_hasVias( false ) + PNS_DIFF_PAIR() : PNS_ITEM( DIFF_PAIR_T ), m_hasVias( false ) { // Initialize some members, to avoid uninitialized variables. m_net_p = 0; @@ -299,7 +299,7 @@ public: } PNS_DIFF_PAIR( int aGap ) : - PNS_ITEM( DIFF_PAIR ), + PNS_ITEM( DIFF_PAIR_T ), m_hasVias( false ) { m_gapConstraint = aGap; @@ -315,7 +315,7 @@ public: } PNS_DIFF_PAIR( const SHAPE_LINE_CHAIN &aP, const SHAPE_LINE_CHAIN& aN, int aGap = 0 ): - PNS_ITEM( DIFF_PAIR ), + PNS_ITEM( DIFF_PAIR_T ), m_n( aN ), m_p( aP ), m_hasVias( false ) @@ -333,7 +333,7 @@ public: } PNS_DIFF_PAIR( const PNS_LINE &aLineP, const PNS_LINE &aLineN, int aGap = 0 ): - PNS_ITEM( DIFF_PAIR ), + PNS_ITEM( DIFF_PAIR_T ), m_line_p( aLineP ), m_line_n( aLineN ), m_hasVias( false ) @@ -354,7 +354,7 @@ public: static inline bool ClassOf( const PNS_ITEM* aItem ) { - return aItem && DIFF_PAIR == aItem->Kind(); + return aItem && DIFF_PAIR_T == aItem->Kind(); } PNS_DIFF_PAIR* Clone() const { assert( false ); return NULL; } diff --git a/pcbnew/router/pns_diff_pair_placer.cpp b/pcbnew/router/pns_diff_pair_placer.cpp index dd1692e6bf..0cfb493959 100644 --- a/pcbnew/router/pns_diff_pair_placer.cpp +++ b/pcbnew/router/pns_diff_pair_placer.cpp @@ -181,7 +181,7 @@ bool PNS_DIFF_PAIR_PLACER::attemptWalk( PNS_NODE* aNode, PNS_DIFF_PAIR* aCurrent bool currentIsP = aPFirst; - int mask = aSolidsOnly ? PNS_ITEM::SOLID : PNS_ITEM::ANY; + int mask = aSolidsOnly ? PNS_ITEM::SOLID_T : PNS_ITEM::ANY_T; do { @@ -392,7 +392,7 @@ bool PNS_DIFF_PAIR_PLACER::SetLayer( int aLayer ) return false; else if( !m_prevPair ) return false; - else if( m_prevPair->PrimP() || ( m_prevPair->PrimP()->OfKind( PNS_ITEM::VIA ) && + else if( m_prevPair->PrimP() || ( m_prevPair->PrimP()->OfKind( PNS_ITEM::VIA_T ) && m_prevPair->PrimP()->Layers().Overlaps( aLayer ) ) ) { m_currentLayer = aLayer; @@ -444,11 +444,11 @@ OPT_VECTOR2I PNS_DIFF_PAIR_PLACER::getDanglingAnchor( PNS_NODE* aNode, PNS_ITEM* { switch( aItem->Kind() ) { - case PNS_ITEM::VIA: - case PNS_ITEM::SOLID: + case PNS_ITEM::VIA_T: + case PNS_ITEM::SOLID_T: return aItem->Anchor( 0 ); - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: { PNS_SEGMENT* s =static_cast( aItem ); @@ -513,7 +513,7 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI bool shapeMatches = true; - if( item->OfKind( PNS_ITEM::SOLID ) && item->Layers() != aItem->Layers() ) + if( item->OfKind( PNS_ITEM::SOLID_T ) && item->Layers() != aItem->Layers() ) { shapeMatches = false; } diff --git a/pcbnew/router/pns_dp_meander_placer.cpp b/pcbnew/router/pns_dp_meander_placer.cpp index ba9db37b83..59ccee9064 100644 --- a/pcbnew/router/pns_dp_meander_placer.cpp +++ b/pcbnew/router/pns_dp_meander_placer.cpp @@ -72,7 +72,7 @@ bool PNS_DP_MEANDER_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem ) { VECTOR2I p; - if( !aStartItem || !aStartItem->OfKind( PNS_ITEM::SEGMENT ) ) + if( !aStartItem || !aStartItem->OfKind( PNS_ITEM::SEGMENT_T ) ) { Router()->SetFailureReason( _( "Please select a track whose length you want to tune." ) ); return false; diff --git a/pcbnew/router/pns_dragger.cpp b/pcbnew/router/pns_dragger.cpp index 2a7f2c202b..856d016730 100644 --- a/pcbnew/router/pns_dragger.cpp +++ b/pcbnew/router/pns_dragger.cpp @@ -89,7 +89,7 @@ bool PNS_DRAGGER::startDragVia( const VECTOR2D& aP, PNS_VIA* aVia ) for( PNS_ITEM* item : jt->LinkList() ) { - if( item->OfKind( PNS_ITEM::SEGMENT ) ) + if( item->OfKind( PNS_ITEM::SEGMENT_T ) ) { int segIndex; PNS_SEGMENT* seg = ( PNS_SEGMENT*) item; @@ -119,10 +119,10 @@ bool PNS_DRAGGER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem ) switch( aStartItem->Kind() ) { - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: return startDragSegment( aP, static_cast( aStartItem ) ); - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: return startDragVia( aP, static_cast( aStartItem ) ); default: diff --git a/pcbnew/router/pns_index.h b/pcbnew/router/pns_index.h index 15380b2c83..75636cf50f 100644 --- a/pcbnew/router/pns_index.h +++ b/pcbnew/router/pns_index.h @@ -171,11 +171,11 @@ PNS_INDEX::ITEM_SHAPE_INDEX* PNS_INDEX::getSubindex( const PNS_ITEM* aItem ) switch( aItem->Kind() ) { - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: idx_n = SI_Multilayer; break; - case PNS_ITEM::SOLID: + case PNS_ITEM::SOLID_T: { if( l.IsMultilayer() ) idx_n = SI_Multilayer; @@ -186,8 +186,8 @@ PNS_INDEX::ITEM_SHAPE_INDEX* PNS_INDEX::getSubindex( const PNS_ITEM* aItem ) } break; - case PNS_ITEM::SEGMENT: - case PNS_ITEM::LINE: + case PNS_ITEM::SEGMENT_T: + case PNS_ITEM::LINE_T: idx_n = SI_Traces + 2 * l.Start() + SI_SegStraight; break; diff --git a/pcbnew/router/pns_item.cpp b/pcbnew/router/pns_item.cpp index 01d5aa98c8..b060d3181d 100644 --- a/pcbnew/router/pns_item.cpp +++ b/pcbnew/router/pns_item.cpp @@ -48,7 +48,7 @@ bool PNS_ITEM::Collide( const PNS_ITEM* aOther, int aClearance, bool aNeedMTV, return true; // special case for "head" line with a via attached at the end. - if( aOther->m_kind == LINE ) + if( aOther->m_kind == LINE_T ) { const PNS_LINE* line = static_cast( aOther ); @@ -64,19 +64,19 @@ const std::string PNS_ITEM::KindStr() const { switch( m_kind ) { - case LINE: + case LINE_T: return "line"; - case SEGMENT: + case SEGMENT_T: return "segment"; - case VIA: + case VIA_T: return "via"; - case JOINT: + case JOINT_T: return "joint"; - case SOLID: + case SOLID_T: return "solid"; default: diff --git a/pcbnew/router/pns_item.h b/pcbnew/router/pns_item.h index 43a6e46695..6e4aa0a977 100644 --- a/pcbnew/router/pns_item.h +++ b/pcbnew/router/pns_item.h @@ -57,13 +57,13 @@ public: ///> Supported item types enum PnsKind { - SOLID = 1, - LINE = 2, - JOINT = 4, - SEGMENT = 8, - VIA = 16, - DIFF_PAIR = 32, - ANY = 0xff + SOLID_T = 1, + LINE_T = 2, + JOINT_T = 4, + SEGMENT_T = 8, + VIA_T = 16, + DIFF_PAIR_T = 32, + ANY_T = 0xff }; PNS_ITEM( PnsKind aKind ) diff --git a/pcbnew/router/pns_joint.h b/pcbnew/router/pns_joint.h index 50c6afead9..cf41eefd76 100644 --- a/pcbnew/router/pns_joint.h +++ b/pcbnew/router/pns_joint.h @@ -55,10 +55,10 @@ public: }; PNS_JOINT() : - PNS_ITEM( JOINT ), m_locked( false ) {} + PNS_ITEM( JOINT_T ), m_locked( false ) {} PNS_JOINT( const VECTOR2I& aPos, const PNS_LAYERSET& aLayers, int aNet = -1 ) : - PNS_ITEM( JOINT ) + PNS_ITEM( JOINT_T ) { m_tag.pos = aPos; m_tag.net = aNet; @@ -67,7 +67,7 @@ public: } PNS_JOINT( const PNS_JOINT& aB ) : - PNS_ITEM( JOINT ) + PNS_ITEM( JOINT_T ) { m_layers = aB.m_layers; m_tag.pos = aB.m_tag.pos; @@ -87,7 +87,7 @@ public: /// segments of the same net, on the same layer. bool IsLineCorner() const { - if( m_linkedItems.Size() != 2 || m_linkedItems.Count( SEGMENT ) != 2 ) + if( m_linkedItems.Size() != 2 || m_linkedItems.Count( SEGMENT_T ) != 2 ) return false; PNS_SEGMENT* seg1 = static_cast( m_linkedItems[0] ); @@ -99,8 +99,8 @@ public: bool IsNonFanoutVia() const { - int vias = m_linkedItems.Count( VIA ); - int segs = m_linkedItems.Count( SEGMENT ); + int vias = m_linkedItems.Count( VIA_T ); + int segs = m_linkedItems.Count( SEGMENT_T ); return ( m_linkedItems.Size() == 3 && vias == 1 && segs == 2 ); } @@ -110,7 +110,7 @@ public: if( m_linkedItems.Size() != 2 ) return false; - if( m_linkedItems.Count( SEGMENT ) != 2) + if( m_linkedItems.Count( SEGMENT_T ) != 2) return false; PNS_SEGMENT* seg1 = static_cast( m_linkedItems[0] ); @@ -150,7 +150,7 @@ public: { for( PNS_ITEM* item : m_linkedItems.Items() ) { - if( item->OfKind( VIA ) ) + if( item->OfKind( VIA_T ) ) return static_cast( item ); } diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 7c75f41740..17d52ec377 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -156,7 +156,7 @@ int PNS_PCBNEW_RULE_RESOLVER::Clearance( const PNS_ITEM* aA, const PNS_ITEM* aB int net_b = aB->Net(); int cl_b = ( net_b >= 0 ? m_clearanceCache[net_b].clearance : m_defaultClearance ); - bool linesOnly = aA->OfKind( PNS_ITEM::SEGMENT | PNS_ITEM::LINE ) && aB->OfKind( PNS_ITEM::SEGMENT | PNS_ITEM::LINE ); + bool linesOnly = aA->OfKind( PNS_ITEM::SEGMENT_T | PNS_ITEM::LINE_T ) && aB->OfKind( PNS_ITEM::SEGMENT_T | PNS_ITEM::LINE_T ); if( linesOnly && net_a >= 0 && net_b >= 0 && m_clearanceCache[net_a].coupledNet == net_b ) { @@ -826,7 +826,7 @@ void PNS_KICAD_IFACE::AddItem( PNS_ITEM* aItem ) switch( aItem->Kind() ) { - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: { PNS_SEGMENT* seg = static_cast( aItem ); TRACK* track = new TRACK( m_board ); @@ -840,7 +840,7 @@ void PNS_KICAD_IFACE::AddItem( PNS_ITEM* aItem ) break; } - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: { VIA* via_board = new VIA( m_board ); PNS_VIA* via = static_cast( aItem ); diff --git a/pcbnew/router/pns_line.h b/pcbnew/router/pns_line.h index 6a38499db7..6e0b48acf1 100644 --- a/pcbnew/router/pns_line.h +++ b/pcbnew/router/pns_line.h @@ -66,7 +66,7 @@ public: * Constructor * Makes an empty line. */ - PNS_LINE() : PNS_ITEM( LINE ) + PNS_LINE() : PNS_ITEM( LINE_T ) { m_segmentRefs = NULL; m_hasVia = false; @@ -95,7 +95,7 @@ public: static inline bool ClassOf( const PNS_ITEM* aItem ) { - return aItem && LINE == aItem->Kind(); + return aItem && LINE_T == aItem->Kind(); } /// @copydoc PNS_ITEM::Clone() diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index 6a14c81555..98b44aca08 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -249,7 +249,7 @@ bool PNS_LINE_PLACER::reduceTail( const VECTOR2I& aEnd ) PNS_LINE tmp( m_tail, replacement ); - if( m_currentNode->CheckColliding( &tmp, PNS_ITEM::ANY ) ) + if( m_currentNode->CheckColliding( &tmp, PNS_ITEM::ANY_T ) ) break; if( DIRECTION_45( replacement.CSegment( 0 ) ) == dir ) @@ -437,7 +437,7 @@ bool PNS_LINE_PLACER::rhShoveOnly( const VECTOR2I& aP, PNS_LINE& aNewHead ) PNS_WALKAROUND::WALKAROUND_STATUS stat_solids = walkaround.Route( initTrack, walkSolids ); optimizer.SetEffortLevel( PNS_OPTIMIZER::MERGE_SEGMENTS ); - optimizer.SetCollisionMask( PNS_ITEM::SOLID ); + optimizer.SetCollisionMask( PNS_ITEM::SOLID_T ); optimizer.Optimize( &walkSolids ); if( stat_solids == PNS_WALKAROUND::DONE ) @@ -487,7 +487,7 @@ bool PNS_LINE_PLACER::rhShoveOnly( const VECTOR2I& aP, PNS_LINE& aNewHead ) optimizer.SetWorld( m_currentNode ); optimizer.SetEffortLevel( PNS_OPTIMIZER::MERGE_OBTUSE | PNS_OPTIMIZER::SMART_PADS ); - optimizer.SetCollisionMask( PNS_ITEM::ANY ); + optimizer.SetCollisionMask( PNS_ITEM::ANY_T ); optimizer.Optimize( &l2 ); aNewHead = l2; @@ -690,7 +690,7 @@ void PNS_LINE_PLACER::splitAdjacentSegments( PNS_NODE* aNode, PNS_ITEM* aSeg, co if( !aSeg ) return; - if( !aSeg->OfKind( PNS_ITEM::SEGMENT ) ) + if( !aSeg->OfKind( PNS_ITEM::SEGMENT_T ) ) return; PNS_JOINT* jt = aNode->FindJoint( aP, aSeg ); @@ -724,7 +724,7 @@ bool PNS_LINE_PLACER::SetLayer( int aLayer ) { return false; } - else if( !m_startItem || ( m_startItem->OfKind( PNS_ITEM::VIA ) && m_startItem->Layers().Overlaps( aLayer ) ) ) + else if( !m_startItem || ( m_startItem->OfKind( PNS_ITEM::VIA_T ) && m_startItem->Layers().Overlaps( aLayer ) ) ) { m_currentLayer = aLayer; initPlacement(); diff --git a/pcbnew/router/pns_logger.cpp b/pcbnew/router/pns_logger.cpp index 6735e2fc6d..7dcbe63ba5 100644 --- a/pcbnew/router/pns_logger.cpp +++ b/pcbnew/router/pns_logger.cpp @@ -80,7 +80,7 @@ void PNS_LOGGER::Log ( const PNS_ITEM* aItem, int aKind, const std::string aName switch( aItem->Kind() ) { - case PNS_ITEM::LINE: + case PNS_ITEM::LINE_T: { PNS_LINE* l = (PNS_LINE*) aItem; m_theLog << " line "; @@ -90,7 +90,7 @@ void PNS_LOGGER::Log ( const PNS_ITEM* aItem, int aKind, const std::string aName break; } - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: { m_theLog << " via 0 0 "; dumpShape ( aItem->Shape() ); @@ -98,7 +98,7 @@ void PNS_LOGGER::Log ( const PNS_ITEM* aItem, int aKind, const std::string aName break; } - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: { PNS_SEGMENT* s =(PNS_SEGMENT*) aItem; m_theLog << " line "; @@ -107,7 +107,7 @@ void PNS_LOGGER::Log ( const PNS_ITEM* aItem, int aKind, const std::string aName break; } - case PNS_ITEM::SOLID: + case PNS_ITEM::SOLID_T: { PNS_SOLID* s = (PNS_SOLID*) aItem; m_theLog << " solid 0 0 "; diff --git a/pcbnew/router/pns_meander_placer.cpp b/pcbnew/router/pns_meander_placer.cpp index ac0d3fa8cf..633c599007 100644 --- a/pcbnew/router/pns_meander_placer.cpp +++ b/pcbnew/router/pns_meander_placer.cpp @@ -61,7 +61,7 @@ bool PNS_MEANDER_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem ) { VECTOR2I p; - if( !aStartItem || !aStartItem->OfKind( PNS_ITEM::SEGMENT ) ) + if( !aStartItem || !aStartItem->OfKind( PNS_ITEM::SEGMENT_T ) ) { Router()->SetFailureReason( _( "Please select a track whose length you want to tune." ) ); return false; diff --git a/pcbnew/router/pns_meander_skew_placer.cpp b/pcbnew/router/pns_meander_skew_placer.cpp index c125274ee0..916cabc2df 100644 --- a/pcbnew/router/pns_meander_skew_placer.cpp +++ b/pcbnew/router/pns_meander_skew_placer.cpp @@ -48,7 +48,7 @@ bool PNS_MEANDER_SKEW_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem ) { VECTOR2I p; - if( !aStartItem || !aStartItem->OfKind( PNS_ITEM::SEGMENT ) ) + if( !aStartItem || !aStartItem->OfKind( PNS_ITEM::SEGMENT_T ) ) { Router()->SetFailureReason( _( "Please select a differential pair trace you want to tune." ) ); return false; diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index b2f1a2c45a..e945eaa63c 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -155,7 +155,7 @@ PNS_OBSTACLE_VISITOR::PNS_OBSTACLE_VISITOR( const PNS_ITEM* aItem ) : m_override( NULL ), m_extraClearance( 0 ) { - if( aItem && aItem->Kind() == PNS_ITEM::LINE ) + if( aItem && aItem->Kind() == PNS_ITEM::LINE_T ) m_extraClearance += static_cast( aItem )->Width() / 2; } @@ -228,7 +228,7 @@ struct PNS_NODE::DEFAULT_OBSTACLE_VISITOR : public PNS_OBSTACLE_VISITOR int clearance = m_extraClearance + m_node->GetClearance( aCandidate, m_item ); - if( aCandidate->Kind() == PNS_ITEM::LINE ) // this should never happen. + if( aCandidate->Kind() == PNS_ITEM::LINE_T ) // this should never happen. { assert( false ); clearance += static_cast( aCandidate )->Width() / 2; @@ -427,7 +427,7 @@ PNS_NODE::OPT_OBSTACLE PNS_NODE::CheckColliding( const PNS_ITEM* aItemA, int aKi obs.reserve( 100 ); - if( aItemA->Kind() == PNS_ITEM::LINE ) + if( aItemA->Kind() == PNS_ITEM::LINE_T ) { int n = 0; const PNS_LINE* line = static_cast( aItemA ); @@ -467,9 +467,9 @@ bool PNS_NODE::CheckColliding( const PNS_ITEM* aItemA, const PNS_ITEM* aItemB, i clearance = GetClearance( aItemA, aItemB ); // fixme: refactor - if( aItemA->Kind() == PNS_ITEM::LINE ) + if( aItemA->Kind() == PNS_ITEM::LINE_T ) clearance += static_cast( aItemA )->Width() / 2; - if( aItemB->Kind() == PNS_ITEM::LINE ) + if( aItemB->Kind() == PNS_ITEM::LINE_T ) clearance += static_cast( aItemB )->Width() / 2; return aItemA->Collide( aItemB, clearance ); @@ -607,19 +607,19 @@ void PNS_NODE::Add( PNS_ITEM* aItem, bool aAllowRedundant ) switch( aItem->Kind() ) { - case PNS_ITEM::SOLID: + case PNS_ITEM::SOLID_T: addSolid( static_cast( aItem ) ); break; - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: addSegment( static_cast( aItem ), aAllowRedundant ); break; - case PNS_ITEM::LINE: + case PNS_ITEM::LINE_T: addLine( static_cast( aItem ), aAllowRedundant ); break; - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: addVia( static_cast( aItem ) ); break; @@ -732,20 +732,20 @@ void PNS_NODE::Remove( PNS_ITEM* aItem ) { switch( aItem->Kind() ) { - case PNS_ITEM::SOLID: + case PNS_ITEM::SOLID_T: // fixme: this fucks up the joints, but it's only used for marking colliding obstacles for the moment, so we don't care. doRemove( aItem ); break; - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: removeSegment( static_cast( aItem ) ); break; - case PNS_ITEM::LINE: + case PNS_ITEM::LINE_T: removeLine( static_cast( aItem ) ); break; - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: removeVia( static_cast( aItem ) ); break; @@ -879,7 +879,7 @@ void PNS_NODE::MapConnectivity( PNS_JOINT* aStart, std::vector& aFou for( PNS_ITEM* item : current->LinkList() ) { - if( item->OfKind( PNS_ITEM::SEGMENT ) ) + if( item->OfKind( PNS_ITEM::SEGMENT_T ) ) { PNS_SEGMENT* seg = static_cast( item ); PNS_JOINT* a = FindJoint( seg->Seg().A, seg ); @@ -905,7 +905,7 @@ int PNS_NODE::FindLinesBetweenJoints( PNS_JOINT& aA, PNS_JOINT& aB, std::vector< { for( PNS_ITEM* item : aA.LinkList() ) { - if( item->Kind() == PNS_ITEM::SEGMENT ) + if( item->Kind() == PNS_ITEM::SEGMENT_T ) { PNS_SEGMENT* seg = static_cast( item ); PNS_LINE line = AssembleLine( seg ); @@ -1057,7 +1057,7 @@ void PNS_NODE::Dump( bool aLong ) for( i = m_items.begin(); i != m_items.end(); i++ ) { - if( (*i)->GetKind() == PNS_ITEM::SEGMENT ) + if( (*i)->GetKind() == PNS_ITEM::SEGMENT_T ) all_segs.insert( static_cast( *i ) ); } @@ -1065,7 +1065,7 @@ void PNS_NODE::Dump( bool aLong ) { for( i = m_root->m_items.begin(); i != m_root->m_items.end(); i++ ) { - if( (*i)->GetKind() == PNS_ITEM::SEGMENT && !overrides( *i ) ) + if( (*i)->GetKind() == PNS_ITEM::SEGMENT_T && !overrides( *i ) ) all_segs.insert( static_cast(*i) ); } } @@ -1085,7 +1085,7 @@ void PNS_NODE::Dump( bool aLong ) switch( m_item->GetKind() ) { - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: { const PNS_SEGMENT* seg = static_cast( m_item ); wxLogTrace( "PNS", " -> seg %s %s\n", seg->GetSeg().A.Format().c_str(), @@ -1275,7 +1275,7 @@ PNS_SEGMENT* PNS_NODE::findRedundantSegment( PNS_SEGMENT* aSeg ) for( PNS_ITEM* item : jtStart->LinkList() ) { - if( item->OfKind( PNS_ITEM::SEGMENT ) ) + if( item->OfKind( PNS_ITEM::SEGMENT_T ) ) { PNS_SEGMENT* seg2 = (PNS_SEGMENT*) item; diff --git a/pcbnew/router/pns_node.h b/pcbnew/router/pns_node.h index f05803b4ca..b56d67463f 100644 --- a/pcbnew/router/pns_node.h +++ b/pcbnew/router/pns_node.h @@ -193,7 +193,7 @@ public: */ int QueryColliding( const PNS_ITEM* aItem, OBSTACLES& aObstacles, - int aKindMask = PNS_ITEM::ANY, + int aKindMask = PNS_ITEM::ANY_T, int aLimitCount = -1, bool aDifferentNetsOnly = true, int aForceClearance = -1 ); @@ -212,7 +212,7 @@ public: * @return the obstacle, if found, otherwise empty. */ OPT_OBSTACLE NearestObstacle( const PNS_LINE* aItem, - int aKindMask = PNS_ITEM::ANY, + int aKindMask = PNS_ITEM::ANY_T, const std::set* aRestrictedSet = NULL ); /** @@ -225,7 +225,7 @@ public: * @return the obstacle, if found, otherwise empty. */ OPT_OBSTACLE CheckColliding( const PNS_ITEM* aItem, - int aKindMask = PNS_ITEM::ANY ); + int aKindMask = PNS_ITEM::ANY_T ); /** @@ -238,7 +238,7 @@ public: * @return the obstacle, if found, otherwise empty. */ OPT_OBSTACLE CheckColliding( const PNS_ITEMSET& aSet, - int aKindMask = PNS_ITEM::ANY ); + int aKindMask = PNS_ITEM::ANY_T ); /** @@ -253,7 +253,7 @@ public: */ bool CheckColliding( const PNS_ITEM* aItemA, const PNS_ITEM* aItemB, - int aKindMask = PNS_ITEM::ANY, + int aKindMask = PNS_ITEM::ANY_T, int aForceClearance = -1 ); /** @@ -369,7 +369,7 @@ public: void MapConnectivity( PNS_JOINT* aStart, std::vector & aFoundJoints ); PNS_ITEM* NearestUnconnectedItem( PNS_JOINT* aStart, int* aAnchor = NULL, - int aKindMask = PNS_ITEM::ANY); + int aKindMask = PNS_ITEM::ANY_T); #endif diff --git a/pcbnew/router/pns_optimizer.cpp b/pcbnew/router/pns_optimizer.cpp index 8b1f394424..a2af3c157b 100644 --- a/pcbnew/router/pns_optimizer.cpp +++ b/pcbnew/router/pns_optimizer.cpp @@ -125,7 +125,7 @@ bool PNS_COST_ESTIMATOR::IsBetter( PNS_COST_ESTIMATOR& aOther, **/ PNS_OPTIMIZER::PNS_OPTIMIZER( PNS_NODE* aWorld ) : m_world( aWorld ), - m_collisionKindMask( PNS_ITEM::ANY ), + m_collisionKindMask( PNS_ITEM::ANY_T ), m_effortLevel( MERGE_SEGMENTS ), m_keepPostures( false ), m_restrictAreaActive( false ) @@ -200,7 +200,7 @@ void PNS_OPTIMIZER::removeCachedSegments( PNS_LINE* aLine, int aStartVertex, int void PNS_OPTIMIZER::CacheRemove( PNS_ITEM* aItem ) { - if( aItem->Kind() == PNS_ITEM::LINE ) + if( aItem->Kind() == PNS_ITEM::LINE_T ) removeCachedSegments( static_cast( aItem ) ); } @@ -274,7 +274,7 @@ int LINE_RESTRICTIONS::allowedAngles( PNS_NODE* aWorld, const PNS_LINE* aLine, c for( const PNS_ITEM* item : jt->Links().CItems() ) { - if( item->OfKind( PNS_ITEM::VIA ) || item->OfKind( PNS_ITEM::SOLID ) ) + if( item->OfKind( PNS_ITEM::VIA_T ) || item->OfKind( PNS_ITEM::SOLID_T ) ) return 0xff; else if( const PNS_SEGMENT* seg = dyn_cast( item ) ) { @@ -767,13 +767,13 @@ PNS_OPTIMIZER::BREAKOUT_LIST PNS_OPTIMIZER::computeBreakouts( int aWidth, { switch( aItem->Kind() ) { - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: { const PNS_VIA* via = static_cast( aItem ); return circleBreakouts( aWidth, via->Shape(), aPermitDiagonal ); } - case PNS_ITEM::SOLID: + case PNS_ITEM::SOLID_T: { const SHAPE* shape = aItem->Shape(); @@ -817,7 +817,7 @@ PNS_ITEM* PNS_OPTIMIZER::findPadOrVia( int aLayer, int aNet, const VECTOR2I& aP for( PNS_ITEM* item : jt->LinkList() ) { - if( item->OfKind( PNS_ITEM::VIA | PNS_ITEM::SOLID ) ) + if( item->OfKind( PNS_ITEM::VIA_T | PNS_ITEM::SOLID_T ) ) return item; } @@ -985,12 +985,12 @@ bool PNS_OPTIMIZER::fanoutCleanup( PNS_LINE* aLine ) if( !startPad ) return false; - bool startMatch = startPad->OfKind( PNS_ITEM::VIA | PNS_ITEM::SOLID ); + bool startMatch = startPad->OfKind( PNS_ITEM::VIA_T | PNS_ITEM::SOLID_T ); bool endMatch = false; if(endPad) { - endMatch = endPad->OfKind( PNS_ITEM::VIA | PNS_ITEM::SOLID ); + endMatch = endPad->OfKind( PNS_ITEM::VIA_T | PNS_ITEM::SOLID_T ); } else { @@ -1046,7 +1046,7 @@ bool verifyDpBypass( PNS_NODE* aNode, PNS_DIFF_PAIR* aPair, bool aRefIsP, const PNS_LINE refLine ( aRefIsP ? aPair->PLine() : aPair->NLine(), aNewRef ); PNS_LINE coupledLine ( aRefIsP ? aPair->NLine() : aPair->PLine(), aNewCoupled ); - if( aNode->CheckColliding( &refLine, &coupledLine, PNS_ITEM::ANY, aPair->Gap() - 10 ) ) + if( aNode->CheckColliding( &refLine, &coupledLine, PNS_ITEM::ANY_T, aPair->Gap() - 10 ) ) return false; if( aNode->CheckColliding ( &refLine ) ) diff --git a/pcbnew/router/pns_router.cpp b/pcbnew/router/pns_router.cpp index 41a1a0a4b6..c7c18c2da8 100644 --- a/pcbnew/router/pns_router.cpp +++ b/pcbnew/router/pns_router.cpp @@ -143,7 +143,7 @@ const PNS_ITEMSET PNS_ROUTER::QueryHoverItems( const VECTOR2I& aP ) bool PNS_ROUTER::StartDragging( const VECTOR2I& aP, PNS_ITEM* aStartItem ) { - if( !aStartItem || aStartItem->OfKind( PNS_ITEM::SOLID ) ) + if( !aStartItem || aStartItem->OfKind( PNS_ITEM::SOLID_T ) ) return false; m_dragger = new PNS_DRAGGER( this ); @@ -245,16 +245,16 @@ void PNS_ROUTER::markViolations( PNS_NODE* aNode, PNS_ITEMSET& aCurrent, { PNS_NODE::OBSTACLES obstacles; - aNode->QueryColliding( item, obstacles, PNS_ITEM::ANY ); + aNode->QueryColliding( item, obstacles, PNS_ITEM::ANY_T ); - if( item->OfKind( PNS_ITEM::LINE ) ) + if( item->OfKind( PNS_ITEM::LINE_T ) ) { PNS_LINE* l = static_cast( item ); if( l->EndsWithVia() ) { PNS_VIA v( l->Via() ); - aNode->QueryColliding( &v, obstacles, PNS_ITEM::ANY ); + aNode->QueryColliding( &v, obstacles, PNS_ITEM::ANY_T ); } } @@ -312,7 +312,7 @@ void PNS_ROUTER::movePlacing( const VECTOR2I& aP, PNS_ITEM* aEndItem ) for( const PNS_ITEM* item : current.CItems() ) { - if( !item->OfKind( PNS_ITEM::LINE ) ) + if( !item->OfKind( PNS_ITEM::LINE_T ) ) continue; const PNS_LINE* l = static_cast( item ); diff --git a/pcbnew/router/pns_segment.h b/pcbnew/router/pns_segment.h index ed8c93a520..1070ae4a8b 100644 --- a/pcbnew/router/pns_segment.h +++ b/pcbnew/router/pns_segment.h @@ -39,17 +39,17 @@ class PNS_SEGMENT : public PNS_ITEM { public: PNS_SEGMENT() : - PNS_ITEM( SEGMENT ) + PNS_ITEM( SEGMENT_T ) {} PNS_SEGMENT( const SEG& aSeg, int aNet ) : - PNS_ITEM( SEGMENT ), m_seg( aSeg, 0 ) + PNS_ITEM( SEGMENT_T ), m_seg( aSeg, 0 ) { m_net = aNet; } PNS_SEGMENT( const PNS_LINE& aParentLine, const SEG& aSeg ) : - PNS_ITEM( SEGMENT ), + PNS_ITEM( SEGMENT_T ), m_seg( aSeg, aParentLine.Width() ) { m_net = aParentLine.Net(); @@ -60,7 +60,7 @@ public: static inline bool ClassOf( const PNS_ITEM* aItem ) { - return aItem && SEGMENT == aItem->Kind(); + return aItem && SEGMENT_T == aItem->Kind(); } PNS_SEGMENT* Clone() const; diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index 7cd9aab6e2..d173792f25 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -217,7 +217,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::processHullSet( PNS_LINE& aCurrent, PNS_LINE& continue; } - bool colliding = m_currentNode->CheckColliding( &l, &aCurrent, PNS_ITEM::ANY, m_forceClearance ); + bool colliding = m_currentNode->CheckColliding( &l, &aCurrent, PNS_ITEM::ANY_T, m_forceClearance ); if( ( aCurrent.Marker() & MK_HEAD ) && !colliding ) { @@ -416,7 +416,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE& aCurrent, PNS_ITE for( PNS_ITEM* item : jtStart->LinkList() ) { - if( item->OfKind( PNS_ITEM::VIA ) ) + if( item->OfKind( PNS_ITEM::VIA_T ) ) { via = (PNS_VIA*) item; break; @@ -710,7 +710,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingVia( PNS_ITEM* aCurrent, PNS_VIA* VECTOR2I mtvLine, mtvVia, mtv, mtvSolid; int rank = -1; - if( aCurrent->OfKind( PNS_ITEM::LINE ) ) + if( aCurrent->OfKind( PNS_ITEM::LINE_T ) ) { #ifdef DEBUG m_logger.NewGroup( "push-via-by-line", m_iter ); @@ -738,7 +738,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingVia( PNS_ITEM* aCurrent, PNS_VIA* rank = currentLine->Rank(); } - else if( aCurrent->OfKind( PNS_ITEM::SOLID ) ) + else if( aCurrent->OfKind( PNS_ITEM::SOLID_T ) ) { CollideShapes( aObstacleVia->Shape(), aCurrent->Shape(), clearance + PNS_HULL_MARGIN, true, mtvSolid ); @@ -765,7 +765,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onReverseCollidingVia( PNS_LINE& aCurrent, PN for( PNS_ITEM* item : jt->LinkList() ) { - if( item->OfKind( PNS_ITEM::SEGMENT ) && item->LayersOverlap( &aCurrent ) ) + if( item->OfKind( PNS_ITEM::SEGMENT_T ) && item->LayersOverlap( &aCurrent ) ) { PNS_SEGMENT* seg = (PNS_SEGMENT*) item; PNS_LINE head = assembleLine( seg ); @@ -855,9 +855,9 @@ void PNS_SHOVE::unwindStack( PNS_SEGMENT* aSeg ) void PNS_SHOVE::unwindStack( PNS_ITEM* aItem ) { - if( aItem->OfKind( PNS_ITEM::SEGMENT ) ) + if( aItem->OfKind( PNS_ITEM::SEGMENT_T ) ) unwindStack( static_cast( aItem ) ); - else if( aItem->OfKind( PNS_ITEM::LINE ) ) + else if( aItem->OfKind( PNS_ITEM::LINE_T ) ) { PNS_LINE* l = static_cast( aItem ); @@ -924,7 +924,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter ) PNS_NODE::OPT_OBSTACLE nearest; SHOVE_STATUS st = SH_NULL; - PNS_ITEM::PnsKind search_order[] = { PNS_ITEM::SOLID, PNS_ITEM::VIA, PNS_ITEM::SEGMENT }; + PNS_ITEM::PnsKind search_order[] = { PNS_ITEM::SOLID_T, PNS_ITEM::VIA_T, PNS_ITEM::SEGMENT_T }; for( int i = 0; i < 3; i++ ) { @@ -944,11 +944,11 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter ) unwindStack( ni ); - if( !ni->OfKind( PNS_ITEM::SOLID ) && ni->Rank() >= 0 && ni->Rank() > currentLine.Rank() ) + if( !ni->OfKind( PNS_ITEM::SOLID_T ) && ni->Rank() >= 0 && ni->Rank() > currentLine.Rank() ) { switch( ni->Kind() ) { - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: { PNS_VIA* revVia = (PNS_VIA*) ni; wxLogTrace( "PNS", "iter %d: reverse-collide-via", aIter ); @@ -965,7 +965,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter ) break; } - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: { PNS_SEGMENT* seg = (PNS_SEGMENT*) ni; wxLogTrace( "PNS", "iter %d: reverse-collide-segment ", aIter ); @@ -987,7 +987,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter ) { // "forward" collisions switch( ni->Kind() ) { - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: wxLogTrace( "PNS", "iter %d: collide-segment ", aIter ); st = onCollidingSegment( currentLine, (PNS_SEGMENT*) ni ); @@ -998,7 +998,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter ) } break; - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: wxLogTrace( "PNS", "iter %d: shove-via ", aIter ); st = onCollidingVia( ¤tLine, (PNS_VIA*) ni ); @@ -1008,7 +1008,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter ) } break; - case PNS_ITEM::SOLID: + case PNS_ITEM::SOLID_T: wxLogTrace( "PNS", "iter %d: walk-solid ", aIter ); st = onCollidingSolid( currentLine, (PNS_SOLID*) ni ); break; @@ -1364,7 +1364,7 @@ void PNS_SHOVE::runOptimizer( PNS_NODE* aNode ) optFlags |= PNS_OPTIMIZER::SMART_PADS; optimizer.SetEffortLevel( optFlags ); - optimizer.SetCollisionMask( PNS_ITEM::ANY ); + optimizer.SetCollisionMask( PNS_ITEM::ANY_T ); for( int pass = 0; pass < n_passes; pass++ ) { diff --git a/pcbnew/router/pns_sizes_settings.cpp b/pcbnew/router/pns_sizes_settings.cpp index 7b11c8322a..cd604faf6c 100644 --- a/pcbnew/router/pns_sizes_settings.cpp +++ b/pcbnew/router/pns_sizes_settings.cpp @@ -37,15 +37,15 @@ int PNS_SIZES_SETTINGS::inheritTrackWidth( PNS_ITEM* aItem ) switch( aItem->Kind() ) { - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: p = static_cast( aItem )->Pos(); break; - case PNS_ITEM::SOLID: + case PNS_ITEM::SOLID_T: p = static_cast( aItem )->Pos(); break; - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: return static_cast( aItem )->Width(); default: @@ -60,7 +60,7 @@ int PNS_SIZES_SETTINGS::inheritTrackWidth( PNS_ITEM* aItem ) PNS_ITEMSET linkedSegs = jt->Links(); - linkedSegs.ExcludeItem( aItem ).FilterKinds( PNS_ITEM::SEGMENT ); + linkedSegs.ExcludeItem( aItem ).FilterKinds( PNS_ITEM::SEGMENT_T ); for( PNS_ITEM* item : linkedSegs.Items() ) { diff --git a/pcbnew/router/pns_solid.h b/pcbnew/router/pns_solid.h index 5324896872..4bd3c35ffd 100644 --- a/pcbnew/router/pns_solid.h +++ b/pcbnew/router/pns_solid.h @@ -35,7 +35,7 @@ namespace PNS { class PNS_SOLID : public PNS_ITEM { public: - PNS_SOLID() : PNS_ITEM( SOLID ), m_shape( NULL ) + PNS_SOLID() : PNS_ITEM( SOLID_T ), m_shape( NULL ) { m_movable = false; } @@ -54,7 +54,7 @@ public: static inline bool ClassOf( const PNS_ITEM* aItem ) { - return aItem && SOLID == aItem->Kind(); + return aItem && SOLID_T == aItem->Kind(); } PNS_ITEM* Clone() const; diff --git a/pcbnew/router/pns_tool_base.cpp b/pcbnew/router/pns_tool_base.cpp index 55d4e2f45d..6bc30cb2b2 100644 --- a/pcbnew/router/pns_tool_base.cpp +++ b/pcbnew/router/pns_tool_base.cpp @@ -146,7 +146,7 @@ PNS_ITEM* PNS_TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int a if( aNet < 0 || item->Net() == aNet ) { - if( item->OfKind( PNS_ITEM::VIA | PNS_ITEM::SOLID ) ) + if( item->OfKind( PNS_ITEM::VIA_T | PNS_ITEM::SOLID_T ) ) { if( !prioritized[2] ) prioritized[2] = item; @@ -358,17 +358,17 @@ const VECTOR2I PNS_TOOL_BASE::snapToItem( PNS_ITEM* aItem, VECTOR2I aP, bool& aS switch( aItem->Kind() ) { - case PNS_ITEM::SOLID: + case PNS_ITEM::SOLID_T: anchor = static_cast( aItem )->Pos(); aSplitsSegment = false; break; - case PNS_ITEM::VIA: + case PNS_ITEM::VIA_T: anchor = static_cast( aItem )->Pos(); aSplitsSegment = false; break; - case PNS_ITEM::SEGMENT: + case PNS_ITEM::SEGMENT_T: { PNS_SEGMENT* seg = static_cast( aItem ); const SEG& s = seg->Seg(); diff --git a/pcbnew/router/pns_topology.cpp b/pcbnew/router/pns_topology.cpp index dce4dc4a16..a54bbc060a 100644 --- a/pcbnew/router/pns_topology.cpp +++ b/pcbnew/router/pns_topology.cpp @@ -73,7 +73,7 @@ const PNS_TOPOLOGY::JOINT_SET PNS_TOPOLOGY::ConnectedJoints( PNS_JOINT* aStart ) for( PNS_ITEM* item : current->LinkList() ) { - if( item->OfKind( PNS_ITEM::SEGMENT ) ) + if( item->OfKind( PNS_ITEM::SEGMENT_T ) ) { PNS_SEGMENT* seg = static_cast( item ); PNS_JOINT* a = m_world->FindJoint( seg->Seg().A, seg ); @@ -193,7 +193,7 @@ bool PNS_TOPOLOGY::followTrivialPath( PNS_LINE* aLine, bool aLeft, PNS_ITEMSET& for( PNS_ITEM* link : jt->Links().Items() ) { - if( link->OfKind( PNS_ITEM::VIA ) ) + if( link->OfKind( PNS_ITEM::VIA_T ) ) via = link; else if( aVisited.find( link ) == aVisited.end() ) next_seg = static_cast( link ); @@ -371,7 +371,7 @@ const std::set PNS_TOPOLOGY::AssembleCluster( PNS_ITEM* aStart, int a visited.insert( top ); - m_world->QueryColliding( top, obstacles, PNS_ITEM::ANY, -1, false ); + m_world->QueryColliding( top, obstacles, PNS_ITEM::ANY_T, -1, false ); for( PNS_OBSTACLE& obs : obstacles ) { diff --git a/pcbnew/router/pns_topology.h b/pcbnew/router/pns_topology.h index f16e499f84..c4eb435113 100644 --- a/pcbnew/router/pns_topology.h +++ b/pcbnew/router/pns_topology.h @@ -47,12 +47,12 @@ public: ~PNS_TOPOLOGY() {}; bool SimplifyLine( PNS_LINE *aLine ); - PNS_ITEM* NearestUnconnectedItem( PNS_JOINT* aStart, int* aAnchor = NULL, int aKindMask = PNS_ITEM::ANY ); + PNS_ITEM* NearestUnconnectedItem( PNS_JOINT* aStart, int* aAnchor = NULL, int aKindMask = PNS_ITEM::ANY_T ); bool LeadingRatLine( const PNS_LINE* aTrack, SHAPE_LINE_CHAIN& aRatLine ); const JOINT_SET ConnectedJoints( PNS_JOINT* aStart ); - const PNS_ITEMSET ConnectedItems( PNS_JOINT* aStart, int aKindMask = PNS_ITEM::ANY ); - const PNS_ITEMSET ConnectedItems( PNS_ITEM* aStart, int aKindMask = PNS_ITEM::ANY ); + const PNS_ITEMSET ConnectedItems( PNS_JOINT* aStart, int aKindMask = PNS_ITEM::ANY_T ); + const PNS_ITEMSET ConnectedItems( PNS_ITEM* aStart, int aKindMask = PNS_ITEM::ANY_T ); int64_t ShortestConnectionLength( PNS_ITEM* aFrom, PNS_ITEM* aTo ); const PNS_ITEMSET AssembleTrivialPath( PNS_ITEM* aStart ); diff --git a/pcbnew/router/pns_utils.cpp b/pcbnew/router/pns_utils.cpp index cc83c82324..0e3a29d3f1 100644 --- a/pcbnew/router/pns_utils.cpp +++ b/pcbnew/router/pns_utils.cpp @@ -230,14 +230,14 @@ void DrawDebugDirs( VECTOR2D aP, int aMask, int aColor ) OPT_BOX2I ChangedArea( const PNS_ITEM* aItemA, const PNS_ITEM* aItemB ) { - if( aItemA->OfKind( PNS_ITEM::VIA ) && aItemB->OfKind( PNS_ITEM::VIA ) ) + if( aItemA->OfKind( PNS_ITEM::VIA_T ) && aItemB->OfKind( PNS_ITEM::VIA_T ) ) { const PNS_VIA* va = static_cast( aItemA ); const PNS_VIA* vb = static_cast( aItemB ); return va->ChangedArea( vb ); } - else if( aItemA->OfKind( PNS_ITEM::LINE ) && aItemB->OfKind( PNS_ITEM::LINE ) ) + else if( aItemA->OfKind( PNS_ITEM::LINE_T ) && aItemB->OfKind( PNS_ITEM::LINE_T ) ) { const PNS_LINE* la = static_cast ( aItemA ); const PNS_LINE* lb = static_cast ( aItemB ); diff --git a/pcbnew/router/pns_via.cpp b/pcbnew/router/pns_via.cpp index 650cefffbd..6706810f88 100644 --- a/pcbnew/router/pns_via.cpp +++ b/pcbnew/router/pns_via.cpp @@ -38,7 +38,7 @@ bool PNS_VIA::PushoutForce( PNS_NODE* aNode, const VECTOR2I& aDirection, VECTOR2 while( iter < aMaxIterations ) { PNS_NODE::OPT_OBSTACLE obs = aNode->CheckColliding( &mv, - aSolidsOnly ? PNS_ITEM::SOLID : PNS_ITEM::ANY ); + aSolidsOnly ? PNS_ITEM::SOLID_T : PNS_ITEM::ANY_T ); if( !obs ) break; diff --git a/pcbnew/router/pns_via.h b/pcbnew/router/pns_via.h index 5fa39b01a6..96b126b6af 100644 --- a/pcbnew/router/pns_via.h +++ b/pcbnew/router/pns_via.h @@ -37,7 +37,7 @@ class PNS_VIA : public PNS_ITEM { public: PNS_VIA() : - PNS_ITEM( VIA ) + PNS_ITEM( VIA_T ) { m_diameter = 2; // Dummy value m_drill = 0; @@ -46,7 +46,7 @@ public: PNS_VIA( const VECTOR2I& aPos, const PNS_LAYERSET& aLayers, int aDiameter, int aDrill, int aNet = -1, VIATYPE_T aViaType = VIA_THROUGH ) : - PNS_ITEM( VIA ) + PNS_ITEM( VIA_T ) { SetNet( aNet ); SetLayers( aLayers ); @@ -66,7 +66,7 @@ public: PNS_VIA( const PNS_VIA& aB ) : - PNS_ITEM( VIA ) + PNS_ITEM( VIA_T ) { SetNet( aB.Net() ); SetLayers( aB.Layers() ); @@ -81,7 +81,7 @@ public: static inline bool ClassOf( const PNS_ITEM* aItem ) { - return aItem && VIA == aItem->Kind(); + return aItem && VIA_T == aItem->Kind(); } diff --git a/pcbnew/router/pns_walkaround.h b/pcbnew/router/pns_walkaround.h index d6c9c8c427..583595d004 100644 --- a/pcbnew/router/pns_walkaround.h +++ b/pcbnew/router/pns_walkaround.h @@ -46,7 +46,7 @@ public: m_forceLongerPath = false; m_forceWinding = false; m_cursorApproachMode = false; - m_itemMask = PNS_ITEM::ANY; + m_itemMask = PNS_ITEM::ANY_T; // Initialize other members, to avoid uninitialized variables. m_recursiveBlockageCount = 0; @@ -77,9 +77,9 @@ public: void SetSolidsOnly( bool aSolidsOnly ) { if( aSolidsOnly ) - m_itemMask = PNS_ITEM::SOLID; + m_itemMask = PNS_ITEM::SOLID_T; else - m_itemMask = PNS_ITEM::ANY; + m_itemMask = PNS_ITEM::ANY_T; } void SetItemMask( int aMask ) diff --git a/pcbnew/router/router_preview_item.cpp b/pcbnew/router/router_preview_item.cpp index 9b1150bc5a..13dc99b10a 100644 --- a/pcbnew/router/router_preview_item.cpp +++ b/pcbnew/router/router_preview_item.cpp @@ -68,7 +68,7 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS::PNS_ITEM* aItem ) { m_originLayer = aItem->Layers().Start(); - if( aItem->OfKind( PNS::PNS_ITEM::LINE ) ) + if( aItem->OfKind( PNS::PNS_ITEM::LINE_T ) ) { const PNS::PNS_LINE* l = static_cast( aItem ); @@ -86,12 +86,12 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS::PNS_ITEM* aItem ) switch( aItem->Kind() ) { - case PNS::PNS_ITEM::LINE: + case PNS::PNS_ITEM::LINE_T: m_type = PR_SHAPE; m_width = ( (PNS::PNS_LINE*) aItem )->Width(); break; - case PNS::PNS_ITEM::SEGMENT: + case PNS::PNS_ITEM::SEGMENT_T: { PNS::PNS_SEGMENT* seg = (PNS::PNS_SEGMENT*) aItem; m_type = PR_SHAPE; @@ -99,7 +99,7 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS::PNS_ITEM* aItem ) break; } - case PNS::PNS_ITEM::VIA: + case PNS::PNS_ITEM::VIA_T: m_originLayer = m_layer = ITEM_GAL_LAYER( VIAS_VISIBLE ); m_type = PR_SHAPE; m_width = 0; @@ -107,7 +107,7 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS::PNS_ITEM* aItem ) m_depth = ViaOverlayDepth; break; - case PNS::PNS_ITEM::SOLID: + case PNS::PNS_ITEM::SOLID_T: m_type = PR_SHAPE; m_width = 0; break;