63 if(
pad->IsAperturePad() ||
pad->IsNPTHWithNoCopper() )
101 bool aUseClearanceEpsilon =
true )
override
121 const bool sameNet = aA && aB && aA->
Net() && aA->
Net() == aB->
Net();
124 for(
int layer = layers.
Start(); layer <= layers.
End(); ++layer )
126 if( !sameNet && !freePad )
178 if( ( sameNet || freePad ) && rv == 0 )
202 return wxEmptyString;
235 default:
return false;
240 aConstraint->
m_Type = aType;
247 *aConstraint = it->second;
263 return a == other.
a &&
b == other.
b &&
type == other.
type;
272 else if (
a == other.
a )
276 else if (
b == other.
b )
287 const PNS::ITEM* aCollidingItem )
override
338 int aFlags = 0 )
override {};
430 hop =
static_cast<PCB_VIA*
>( item );
433 BOOST_REQUIRE_MESSAGE( hop,
"the stack must have built at least one microvia" );
435 m_iface->SetBoard( &board );
437 std::unique_ptr<PNS::VIA> synced = m_iface->TestSyncVia( hop );
440 BOOST_CHECK_MESSAGE( synced->IsRoutable(),
"a stack hop must be a valid route anchor" );
441 BOOST_CHECK_MESSAGE( synced->IsLocked(),
"a stack hop must still be locked against shoving" );
464 m_iface->SetBoard( &board );
466 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
467 world->SetMaxClearance( 10000000 );
468 world->SetRuleResolver( &m_ruleResolver );
477 std::unique_ptr<PNS::VIA> synced = m_iface->TestSyncVia(
static_cast<PCB_VIA*
>( item ) );
479 world->AddRaw( synced.release() );
483 BOOST_REQUIRE_EQUAL( hops, 2 );
487 world->AddRaw( intruder );
489 m_ruleResolver.m_defaultClearance = 200000;
492 world->QueryColliding( intruder, obstacles );
494 BOOST_CHECK_MESSAGE( obstacles.size() > 0,
"a stack hop must obstruct a foreign-net via" );
503 obs.m_head, obs.m_head->KindStr().c_str(),
504 obs.m_item, obs.m_item->KindStr().c_str(),
514 std::unique_ptr<PNS::NODE> world (
new PNS::NODE );
519 world->SetMaxClearance( 10000000 );
520 world->SetRuleResolver( &m_ruleResolver );
528 int count = world->QueryColliding(
v1, obstacles );
537 m_ruleResolver.m_defaultClearance = 1000000;
538 world->QueryColliding(
v1, obstacles );
542 const auto& first = *obstacles.begin();
552 m_ruleResolver.m_defaultClearance = 200000;
553 m_ruleResolver.m_defaultHole2Hole = 1000000;
555 world->QueryColliding(
v1, obstacles );
559 auto iter = obstacles.begin();
560 const auto& first = *iter++;
570 m_ruleResolver.m_defaultHole2Hole = 220000;
571 m_ruleResolver.m_defaultHole2Copper = 1000000;
573 world->QueryColliding(
v1, obstacles );
577 auto iter = obstacles.begin();
578 const auto& first = *iter++;
581 BOOST_CHECK( ( first.m_head ==
v1 && first.m_item ==
v2->Hole() )
582 || ( first.m_head ==
v1->Hole() && first.m_item ==
v2 ) );
595 via.SetSecondaryDrill( std::optional<int>( 12000 ) );
600 std::unique_ptr<PNS::VIA> viaClone(
via.Clone() );
602 auto checkVia = [&](
const PNS::VIA& candidate )
606 BOOST_CHECK( candidate.HolePostMachining().has_value() );
608 BOOST_CHECK( candidate.SecondaryDrill().has_value() );
610 BOOST_CHECK( candidate.SecondaryHoleLayers().has_value() );
612 via.SecondaryHoleLayers()->Start() );
614 via.SecondaryHoleLayers()->End() );
615 BOOST_CHECK( candidate.SecondaryHolePostMachining().has_value() );
618 if( candidate.SecondaryHolePostMachining().has_value() )
619 BOOST_CHECK( candidate.SecondaryHolePostMachining().value() ==
via.SecondaryHolePostMachining().value() );
623 checkVia( *viaClone );
632 via.SetPrimaryDrillStartLayer(
F_Cu );
633 via.SetPrimaryDrillEndLayer(
B_Cu );
635 via.SetSecondaryDrillSize( std::optional<int>( 15000 ) );
636 via.SetSecondaryDrillStartLayer(
F_Cu );
640 via.SetTertiaryDrillSize( std::optional<int>( 8000 ) );
641 via.SetTertiaryDrillStartLayer(
B_Cu );
645 std::unique_ptr<PCB_VIA> viaClone(
static_cast<PCB_VIA*
>(
via.Clone() ) );
647 auto checkVia = [&](
const PCB_VIA& candidate )
651 BOOST_CHECK( candidate.GetFrontPostMachining().has_value() );
652 BOOST_CHECK_EQUAL(
static_cast<int>( candidate.GetFrontPostMachining().value() ),
653 static_cast<int>(
via.GetFrontPostMachining().value() ) );
654 BOOST_CHECK( candidate.GetSecondaryDrillSize().has_value() );
656 via.GetSecondaryDrillSize().value() );
658 via.GetSecondaryDrillStartLayer() );
660 via.GetSecondaryDrillEndLayer() );
662 BOOST_CHECK( candidate.GetBackPostMachining().has_value() );
664 static_cast<int>(
via.GetBackPostMachining().value() ) );
665 BOOST_CHECK( candidate.GetTertiaryDrillSize().has_value() );
667 via.GetTertiaryDrillSize().value() );
669 via.GetTertiaryDrillStartLayer() );
671 via.GetTertiaryDrillEndLayer() );
675 checkVia( *viaClone );
699 BOOST_CHECK( innerLayersRange2Layer.
Overlaps( 0 ) );
700 BOOST_CHECK( innerLayersRange2Layer.
Overlaps( 1 ) );
707 BOOST_CHECK( !innerLayersRange4Layer.
Overlaps( 0 ) );
708 BOOST_CHECK( innerLayersRange4Layer.
Overlaps( 1 ) );
709 BOOST_CHECK( innerLayersRange4Layer.
Overlaps( 2 ) );
710 BOOST_CHECK( !innerLayersRange4Layer.
Overlaps( 3 ) );
723 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
724 world->SetMaxClearance( 10000000 );
725 world->SetRuleResolver( &m_ruleResolver );
738 BOOST_CHECK( lockedSeg->
IsLocked() );
740 world->AddRaw( lockedSeg );
743 std::unique_ptr<PNS::SEGMENT> clone1(
PNS::Clone( *lockedSeg ) );
744 std::unique_ptr<PNS::SEGMENT> clone2(
PNS::Clone( *lockedSeg ) );
746 clone1->SetEnds( segStart, splitPt );
747 clone2->SetEnds( splitPt, segEnd );
749 BOOST_CHECK_MESSAGE( clone1->IsLocked(),
750 "First half of split locked segment must retain locked state" );
751 BOOST_CHECK_MESSAGE( clone2->IsLocked(),
752 "Second half of split locked segment must retain locked state" );
767 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
768 world->SetMaxClearance( 10000000 );
769 world->SetRuleResolver( &m_ruleResolver );
777 pad->SetPos( padPos );
780 world->AddRaw(
pad );
783 int narrowWidth = 250000;
787 world->AddRaw( narrowSeg );
790 int wideWidth = 500000;
794 world->AddRaw( wideSeg );
799 BOOST_CHECK( m_iface->TestInheritTrackWidth(
pad, &inherited ) );
804 BOOST_CHECK( m_iface->TestInheritTrackWidth(
pad, &inherited,
VECTOR2I( 2000000, 0 ) ) );
809 BOOST_CHECK( m_iface->TestInheritTrackWidth(
pad, &inherited,
VECTOR2I( 0, -2000000 ) ) );
814 BOOST_CHECK( m_iface->TestInheritTrackWidth(
pad, &inherited,
VECTOR2I( 100000, 50000 ) ) );
819 BOOST_CHECK( m_iface->TestInheritTrackWidth(
pad, &inherited,
VECTOR2I( 50000, -100000 ) ) );
835 auto compileAndCheck = [&](
const wxString& aExpr,
bool aExpectGeometry )
840 bool ok = compiler.
Compile( aExpr.ToUTF8().data(), &ucode, &ctx );
841 BOOST_CHECK_MESSAGE( ok,
"Failed to compile: " + aExpr );
846 wxString::Format(
"Expression '%s': expected geometry=%s, got %s",
848 aExpectGeometry ?
"true" :
"false",
850 ?
"true" :
"false" ) );
855 compileAndCheck( wxT(
"A.NetClass == 'Power'" ),
false );
856 compileAndCheck( wxT(
"A.Type == 'via'" ),
false );
857 compileAndCheck( wxT(
"A.NetName == '/VCC'" ),
false );
860 compileAndCheck( wxT(
"A.intersectsCourtyard('U1')" ),
true );
861 compileAndCheck( wxT(
"A.intersectsArea('Zone1')" ),
true );
862 compileAndCheck( wxT(
"A.enclosedByArea('Zone1')" ),
true );
863 compileAndCheck( wxT(
"A.intersectsFrontCourtyard('U1')" ),
true );
864 compileAndCheck( wxT(
"A.intersectsBackCourtyard('U1')" ),
true );
867 compileAndCheck( wxT(
"A.insideCourtyard('U1')" ),
true );
868 compileAndCheck( wxT(
"A.insideArea('Zone1')" ),
true );
882 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
883 world->SetMaxClearance( 10000000 );
884 world->SetRuleResolver( &m_ruleResolver );
901 world->AddRaw( solid1 );
902 world->AddRaw( solid2 );
906 int count = world->QueryColliding( solid1, obstacles );
907 BOOST_CHECK( count > 0 );
915 nullShapeSolid.
SetNet( net2 );
917 bool collided = solid1->
Collide( &nullShapeSolid, world.get(),
F_Cu,
nullptr );
918 BOOST_CHECK( !collided );
932 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
933 world->SetMaxClearance( 10000000 );
934 world->SetRuleResolver( &m_ruleResolver );
947 VECTOR2I traceEnd( 2500000, 2500000 );
952 world->AddRaw( pad1 );
953 world->AddRaw( trace );
959 itemsToDrag.
Add( pad1 );
961 bool started = dragger.
Start( pad1Pos, itemsToDrag );
973 for(
const VECTOR2I& pos : dragPositions )
975 bool dragOk = dragger.
Drag( pos );
976 BOOST_CHECK( dragOk );
979 BOOST_CHECK( currentNode !=
nullptr );
984 BOOST_CHECK( traces.
Size() > 0 );
987 world->KillChildren();
1000 chain.SetWidth( 250000 );
1001 chain.Append( arc );
1009 double oldRadius = line.
CLine().
CArcs()[0].GetRadius();
1017 BOOST_CHECK( line.
CLine().
CArcs()[0].GetRadius() != oldRadius );
1028 chain.SetWidth( 250000 );
1029 chain.Append( arc );
1051 m_router->LoadSettings( &settings );
1065 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1066 world->SetMaxClearance( 10000000 );
1067 world->SetRuleResolver( &m_ruleResolver );
1070 world->AddRaw( arc );
1079 m_router->SetFailureReason( wxEmptyString );
1080 BOOST_CHECK( dragger.
Start( arc->
Anchor( 0 ), items ) );
1081 BOOST_CHECK( m_router->FailureReason().IsEmpty() );
1083 world->KillChildren();
1088 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1089 world->SetMaxClearance( 10000000 );
1090 world->SetRuleResolver( &m_ruleResolver );
1093 world->AddRaw( arc );
1102 m_router->SetFailureReason( wxEmptyString );
1103 BOOST_CHECK( !dragger.
Start( arc->
Anchor( 0 ), items ) );
1104 BOOST_CHECK( !m_router->FailureReason().IsEmpty() );
1106 world->KillChildren();
1112 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1113 world->SetMaxClearance( 10000000 );
1114 world->SetRuleResolver( &m_ruleResolver );
1117 world->AddRaw( arc );
1126 m_router->SetFailureReason( wxEmptyString );
1127 BOOST_CHECK( !dragger.
Start( arc->
Anchor( 0 ), items ) );
1128 BOOST_CHECK( !m_router->FailureReason().IsEmpty() );
1130 world->KillChildren();
1140 int NetCode(
PNS::NET_HANDLE aNet )
override {
return aNet ? 1 : -1; }
1150 BOOST_REQUIRE( topo.NearestUnconnectedAnchorPoint( &aTrack, anchorPoint, anchorLayers,
1173 VECTOR2I( 12000000, 10000000 ) ), net );
1260 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1261 world->SetMaxClearance( 10000000 );
1262 world->SetRuleResolver( &m_ruleResolver );
1266 world->AddRaw(
v1 );
1267 world->AddRaw(
v2 );
1269 m_ruleResolver.m_defaultClearance = 1000000;
1272 world->QueryColliding(
v1, obstacles );
1274 BOOST_CHECK_GE( obstacles.size(), (
size_t) 1 );
1281 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1282 world->SetMaxClearance( 10000000 );
1283 world->SetRuleResolver( &m_ruleResolver );
1286 world->AddRaw( makeVia(
VECTOR2I( 0, 0 ), net ) );
1288 world->AddRaw(
v1 );
1290 m_ruleResolver.m_hasUserPhysicalRules =
false;
1291 m_ruleResolver.m_defaultClearance = 1000000;
1294 world->QueryColliding(
v1, obstacles );
1304 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1305 world->SetMaxClearance( 10000000 );
1306 world->SetRuleResolver( &m_ruleResolver );
1309 world->AddRaw( makeVia(
VECTOR2I( 0, 0 ), net ) );
1311 world->AddRaw(
v1 );
1313 m_ruleResolver.m_hasUserPhysicalRules =
true;
1314 m_ruleResolver.m_defaultPhysicalClearance = 1000000;
1317 world->QueryColliding(
v1, obstacles );
1319 BOOST_CHECK_GE( obstacles.size(), (
size_t) 1 );
1320 if( !obstacles.empty() )
1328 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1329 world->SetMaxClearance( 10000000 );
1330 world->SetRuleResolver( &m_ruleResolver );
1334 world->AddRaw( freePad );
1337 m_ruleResolver.m_hasUserPhysicalRules =
false;
1338 m_ruleResolver.m_defaultClearance = 1000000;
1341 world->QueryColliding( v, obstacles );
1352 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1353 world->SetMaxClearance( 10000000 );
1354 world->SetRuleResolver( &m_ruleResolver );
1358 world->AddRaw( freePad );
1361 m_ruleResolver.m_hasUserPhysicalRules =
true;
1362 m_ruleResolver.m_defaultPhysicalClearance = 0;
1363 m_ruleResolver.m_defaultClearance = 1000000;
1366 world->QueryColliding( v, obstacles );
1375 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1376 world->SetMaxClearance( 10000000 );
1377 world->SetRuleResolver( &m_ruleResolver );
1381 world->AddRaw( freePad );
1384 m_ruleResolver.m_hasUserPhysicalRules =
true;
1385 m_ruleResolver.m_defaultPhysicalClearance = 1000000;
1388 world->QueryColliding( v, obstacles );
1390 BOOST_CHECK_GE( obstacles.size(), (
size_t) 1 );
1398 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1399 world->SetMaxClearance( 10000000 );
1400 world->SetRuleResolver( &m_ruleResolver );
1405 world->AddRaw(
pad );
1406 world->AddRaw(
via );
1408 m_ruleResolver.m_hasUserPhysicalRules =
true;
1409 m_ruleResolver.m_defaultPhysicalHoleClearance = 1000000;
1412 world->QueryColliding(
via, obstacles );
1414 BOOST_CHECK_GE( obstacles.size(), (
size_t) 1 );
1420 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1421 world->SetMaxClearance( 10000000 );
1422 world->SetRuleResolver( &m_ruleResolver );
1425 world->AddRaw( makeVia(
VECTOR2I( 0, 0 ), net ) );
1427 world->AddRaw(
v1 );
1429 m_ruleResolver.m_hasUserPhysicalRules =
true;
1430 m_ruleResolver.m_defaultPhysicalClearance = 0;
1433 world->QueryColliding(
v1, obstacles );
1443 std::unique_ptr<PNS::NODE> world(
new PNS::NODE );
1444 world->SetMaxClearance( 10000000 );
1445 world->SetRuleResolver( &m_ruleResolver );
1450 world->AddRaw(
pad );
1451 world->AddRaw(
via );
1453 m_ruleResolver.m_hasUserPhysicalRules =
true;
1454 m_ruleResolver.m_defaultPhysicalClearance = 100000;
1455 m_ruleResolver.m_defaultPhysicalHoleClearance = 2000000;
1458 world->QueryColliding(
via, obstacles );
1460 BOOST_CHECK_GE( obstacles.size(), (
size_t) 1 );
1465 int maxClearance = 0;
1467 maxClearance = std::max( maxClearance, obs.m_clearance );
1519 PADSTACK_VIA_IFACE( PNS_TEST_FIXTURE* aFixture ) :
1520 MOCK_PNS_KICAD_IFACE( aFixture )
1524 void SyncWorld( PNS::NODE* aWorld )
override
1529 auto via = std::make_unique<PNS::VIA>(
VECTOR2I( 0, 0 ), PNS_LAYER_RANGE( 0, 5 ), 400000, 100000,
1532 via->SetDiameter( 0, 400000 );
1533 via->SetDiameter( 1, 450000 );
1534 via->SetDiameter( 5, 400000 );
1536 aWorld->
Add( std::move(
via ) );
1539 void DisplayItem(
const PNS::ITEM* aItem,
int aClearance,
bool aEdit =
false,
int aFlags = 0 )
override
1546 if( !aItem->
Shape( -1 ) )
1550 int m_viasDisplayed = 0;
1551 int m_nullShapes = 0;
1558 PADSTACK_VIA_IFACE iface(
this );
1562 m_router->SetInterface( &iface );
1563 m_router->LoadSettings( &settings );
1568 m_router->UpdateSizes( sizes );
1570 m_router->SyncWorld();
1574 BOOST_REQUIRE_MESSAGE( iface.m_viasDisplayed > 0,
"Via was not highlighted as a violation" );
1575 BOOST_CHECK_MESSAGE( iface.m_nullShapes == 0,
"Highlighted front/inner/back via has no resolvable shape" );
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
void SetCopperLayerCount(int aCount)
void SetEnabledLayers(const LSET &aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
KICAD_T Type() const
Returns the type of object.
bool Compile(const wxString &aString, UCODE *aCode, CONTEXT *aPreflightContext)
static const LSET & AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
std::unique_ptr< PNS::VIA > TestSyncVia(PCB_VIA *aVia)
PNS::RULE_RESOLVER * GetRuleResolver() override
void DisplayItem(const PNS::ITEM *aItem, int aClearance, bool aEdit=false, int aFlags=0) override
void HideItem(PNS::ITEM *aItem) override
~MOCK_PNS_KICAD_IFACE() override
MOCK_PNS_KICAD_IFACE(PNS_TEST_FIXTURE *aFixture)
PNS_TEST_FIXTURE * m_testFixture
bool TestInheritTrackWidth(PNS::ITEM *aItem, int *aInheritedWidth, const VECTOR2I &aStartPosition=VECTOR2I())
virtual int NetCode(PNS::NET_HANDLE aNet) override
bool IsNetTieExclusion(const PNS::ITEM *aItem, const VECTOR2I &aCollisionPos, const PNS::ITEM *aCollidingItem) override
bool IsKeepout(const PNS::ITEM *aObstacle, const PNS::ITEM *aItem, bool *aEnforce) override
int m_defaultPhysicalHoleClearance
virtual int Clearance(const PNS::ITEM *aA, const PNS::ITEM *aB, bool aUseClearanceEpsilon=true) override
virtual bool QueryConstraint(PNS::CONSTRAINT_TYPE aType, const PNS::ITEM *aItemA, const PNS::ITEM *aItemB, int aLayer, PNS::CONSTRAINT *aConstraint) override
int m_defaultPhysicalClearance
bool IsInNetTie(const PNS::ITEM *aA) override
std::map< ITEM_KEY, PNS::CONSTRAINT > m_ruleMap
virtual PNS::NET_HANDLE DpCoupledNet(PNS::NET_HANDLE aNet) override
bool IsDrilledHole(const PNS::ITEM *aItem) override
void AddMockRule(PNS::CONSTRAINT_TYPE aType, const PNS::ITEM *aItemA, const PNS::ITEM *aItemB, PNS::CONSTRAINT &aConstraint)
bool IsNonPlatedSlot(const PNS::ITEM *aItem) override
bool HasUserDefinedPhysicalConstraint() override
virtual bool DpNetPair(const PNS::ITEM *aItem, PNS::NET_HANDLE &aNetP, PNS::NET_HANDLE &aNetN) override
virtual wxString NetName(PNS::NET_HANDLE aNet) override
virtual ~MOCK_RULE_RESOLVER()
bool m_hasUserPhysicalRules
int ClearanceEpsilon() const override
virtual int DpNetPolarity(PNS::NET_HANDLE aNet) override
bool HasGeometryDependentFunctions() const
void SetPosition(const VECTOR2I &aPos) override
std::unordered_set< BOARD_ITEM * > GetBoardItems() const
A microvia stack: several single hop microvias, plus connecting traces for staggered stacks,...
void Regenerate(BOARD *aBoard, BOARD_COMMIT *aCommit)
Rebuild the member vias (and, for a staggered stack, the connecting traces) from the current stack se...
void SetStartLayer(PCB_LAYER_ID aLayer)
void SetViaSize(int aSize)
void SetViaDrill(int aDrill)
void SetEndLayer(PCB_LAYER_ID aLayer)
virtual VECTOR2I Anchor(int n) const override
const ITEM_SET Traces() override
Function Traces()
NODE * CurrentNode() const override
Function CurrentNode()
bool Start(const VECTOR2I &aP, ITEM_SET &aPrimitives) override
Function Start()
bool Drag(const VECTOR2I &aP) override
Function Drag()
virtual bool Start(const VECTOR2I &aP, ITEM_SET &aPrimitives) override
Function Start()
void SetMode(PNS::DRAG_MODE aDragMode) override
virtual void SetWorld(NODE *aWorld)
Function SetWorld()
void Add(const LINE &aLine)
Base class for PNS router board items.
BOARD_ITEM * Parent() const
void SetLayers(const PNS_LAYER_RANGE &aLayers)
void SetIsFreePad(bool aIsFreePad=true)
virtual const SHAPE * Shape(int aLayer) const
Return the geometrical shape of the item.
const PNS_LAYER_RANGE & Layers() const
virtual NET_HANDLE Net() const
void SetNet(NET_HANDLE aNet)
virtual int Layer() const
bool Collide(const ITEM *aHead, const NODE *aNode, int aLayer, COLLISION_SEARCH_CONTEXT *aCtx=nullptr) const
Check for a collision (clearance violation) with between us and item aOther.
bool OfKind(int aKindMask) const
virtual void Mark(int aMarker) const
virtual BOARD_ITEM * BoardItem() const
void SetRoutable(bool aRoutable)
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
void DragArc(const VECTOR2I &aP, int aIndex)
const SHAPE_LINE_CHAIN & CLine() const
SHAPE_LINE_CHAIN & Line()
void SetWidth(int aWidth)
Return line width.
Keep the router "world" - i.e.
void SetMaxClearance(int aClearance)
Assign a clearance resolution function object.
void AddRaw(ITEM *aItem, bool aAllowRedundant=false)
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
std::set< OBSTACLE > OBSTACLES
void SetRuleResolver(RULE_RESOLVER *aFunc)
Contain all persistent settings of the router, such as the mode, optimization effort,...
int Width() const override
void SetWidth(int aWidth) override
The actual Push and Shove algorithm.
void SetShovePolicy(const LINKED_ITEM *aItem, int aPolicy)
void SetTrackWidth(int aWidth)
void SetBoardMinTrackWidth(int aWidth)
void SetDiffPairViaGapSameAsTraceGap(bool aEnable)
void SetDiffPairCopperToHole(int aCopperToHole)
int GetDiffPairCopperToHole() const
void SetViaDrill(int aDrill)
void SetDiffPairViaGap(int aGap)
void SetDiffPairHoleToHole(int aHoleToHole)
void SetViaDiameter(int aDiameter)
int EffectiveDiffPairViaGap() const
void SetPos(const VECTOR2I &aCenter)
void SetShape(SHAPE *shape)
bool inheritTrackWidthAndDpGap(PNS::ITEM *aItem, const VECTOR2I &aStartPosition, int *aInheritedWidth, int *aInheritedGap)
std::unique_ptr< PNS::VIA > syncVia(PCB_VIA *aVia)
Represent a contiguous set of PCB layers.
bool Overlaps(const PNS_LAYER_RANGE &aOther) const
PNS_LAYER_RANGE Intersection(const PNS_LAYER_RANGE &aOther) const
Shortcut for comparisons/overlap tests.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const std::vector< SHAPE_ARC > & CArcs() const
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
static FILENAME_RESOLVER * resolver
constexpr PCB_LAYER_ID PCBNEW_LAYER_ID_START
@ CT_PHYSICAL_HOLE_CLEARANCE
std::unique_ptr< typename std::remove_const< T >::type > Clone(const T &aItem)
PNS::CONSTRAINT_TYPE type
bool operator<(const ITEM_KEY &other) const
bool operator==(const ITEM_KEY &other) const
An abstract function object, returning a design rule (clearance, diff pair gap, etc) required between...
Hold an object colliding with another object, along with some useful data about the collision.
SETTINGS_MANAGER m_settingsManager
MOCK_RULE_RESOLVER m_ruleResolver
MOCK_PNS_KICAD_IFACE * m_iface
static PCB_SHAPE makeArc(const VECTOR2I &aCenter, const VECTOR2I &aStart, double aAngle, PCB_LAYER_ID aLayer=Dwgs_User)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
static bool isEdge(const PNS::ITEM *aItem)
static bool isHole(const PNS::ITEM *aItem)
static void dumpObstacles(const PNS::NODE::OBSTACLES &obstacles)
static bool isCopper(const PNS::ITEM *aItem)
BOOST_AUTO_TEST_CASE(PCBViaBackdrillCloneRetainsData)
BOOST_FIXTURE_TEST_CASE(PNSShoveOwnsRootLineHistory, PNS_TEST_FIXTURE)
const SHAPE_LINE_CHAIN chain
BOOST_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
BOOST_CHECK_EQUAL(result, "25.4")
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_PAD_T
class PAD, a pad in a footprint
VECTOR2< int32_t > VECTOR2I