86 return A == other.
A &&
B == other.
B &&
Flag == other.
Flag;
97 size_t retval = 0xBADC0FFEE0DDF00D;
98 hash_combine( retval, hash<const void*>()( k.
A ), hash<const void*>()( k.
B ), hash<int>()( k.
Flag ) );
112 bool aUseClearanceEpsilon =
true )
override;
124 const PNS::ITEM* aCollidingItem )
override;
163 m_routerIface( aRouterIface ),
165 m_dummyTracks{ { aBoard }, { aBoard } },
166 m_dummyArcs{ { aBoard }, { aBoard } },
167 m_dummyVias{ { aBoard }, { aBoard } }
172 for(
PCB_ARC& arc : m_dummyArcs )
179 m_clearanceEpsilon = aBoard->GetDesignSettings().GetDRCEpsilon();
181 m_clearanceEpsilon = 0;
202 if( !aItem || !aCollidingItem )
212 if( collidingFp && itemFp && ( collidingFp == itemFp ) && itemFp->
IsNetTie() )
220 return drcEngine->IsNetTieExclusion(
NetCode( aItem->
Net() ),
222 aCollisionPos, collidingItem );
263 *aEnforce = checkKeepout( zone,
265 aObstacle->
Layer() ) ) );
330 return pad->GetAttribute() == PAD_ATTRIB::NPTH
331 &&
pad->GetDrillSizeX() !=
pad->GetDrillSizeY();
343 switch( aItem->
Kind() )
398 default:
return false;
407 if( aItemA && !parentA )
410 if( aItemB && !parentB )
414 hostConstraint = drcEngine->EvalRules( hostType, parentA, parentB, board_layer );
416 if( hostConstraint.
IsNull() )
423 aConstraint->
m_Type = aType;
443 aConstraint->
m_Type = aType;
455 std::set<const PNS::ITEM*> remainingItems( aItems.begin(), aItems.end() );
463 bool dirty = remainingItems.find( it->first.A ) != remainingItems.end();
464 dirty |= remainingItems.find( it->first.B) != remainingItems.end();
474 printf(
"ClearCache : n_pruned %d\n", n_pruned );
493 bool aUseClearanceEpsilon )
525 for(
int layer = layers.
Start(); layer <= layers.
End(); ++layer )
571 if( aUseClearanceEpsilon && rv > 0 )
601 assert( aItem->
Owner() !=
nullptr );
603 auto tryGetTrackWidth =
606 switch( aPnsItem->Kind() )
614 int itemTrackWidth = tryGetTrackWidth( aItem );
616 if( itemTrackWidth > 0 )
618 *aInheritedWidth = itemTrackWidth;
622 switch( aItem->
Kind() )
626 default:
return false;
631 assert( jt !=
nullptr );
640 int w = tryGetTrackWidth( item );
643 mval = std::min( w, mval );
646 if( mval == INT_MAX )
649 *aInheritedWidth = mval;
668 VECTOR2I startPosInt( aStartPosition.
x, aStartPosition.
y );
673 double anchor0Distance = startPosInt.
Distance( aStartItem->
Anchor( 0 ) );
674 double anchor1Distance = startPosInt.
Distance( aStartItem->
Anchor( 1 ) );
676 if( anchor1Distance < anchor0Distance )
683 dummyTrack.
SetEnds( aStartItem->
Anchor( startAnchor ), aStartItem->
Anchor( startAnchor ) );
713 dummyTrack.
SetEnds( aStartItem->
Anchor( startAnchor ), aStartItem->
Anchor( startAnchor ) );
720 trackWidth = std::max( trackWidth, constraint.
m_Value.
Opt() );
758 viaDiameter = std::max( viaDiameter, constraint.
m_Value.
Opt() );
764 viaDrill = std::max( viaDrill, constraint.
m_Value.
Opt() );
808 diffPairWidth = std::max( diffPairWidth, constraint.
m_Value.
Opt() );
810 if( diffPairWidth == constraint.
m_Value.
Opt() )
817 diffPairGap = std::max( diffPairGap, constraint.
m_Value.
Opt() );
818 diffPairViaGap = std::max( diffPairViaGap, constraint.
m_Value.
Opt() );
896 refName = net->GetNetname();
907 if( !aItem || !aItem->
Net() )
910 wxString netNameP =
static_cast<NETINFO_ITEM*
>( aItem->
Net() )->GetNetname();
911 wxString netNameN, netNameCoupled;
921 netNameN = netNameCoupled;
926 netNameP = netNameCoupled;
932 if( !netInfoP || !netInfoN )
978 const wxString& aName = wxT(
"" ),
986 sh.
Append( aP.
x - aSize, aP.
y - aSize );
987 sh.
Append( aP.
x + aSize, aP.
y + aSize );
989 sh.
Append( aP.
x - aSize, aP.
y + aSize );
990 sh.
Append( aP.
x + aSize, aP.
y - aSize );
996 const wxString& aName = wxT(
"" ),
1013 const wxString& aName = wxT(
"" ),
1028 AddShape( &l, aColor, aOverrideWidth, aName, aSrcLoc );
1032 const wxString& aName = wxT(
"" ),
1063 printf(
"PNS: %s\n", msg.c_str().AsChar() );
1131 std::vector<std::unique_ptr<PNS::SOLID>> solids;
1141 case PAD_ATTRIB::PTH:
1142 case PAD_ATTRIB::NPTH:
1145 case PAD_ATTRIB::CONN:
1146 case PAD_ATTRIB::SMD:
1148 bool is_copper =
false;
1150 if( !lmsk.empty() && aPad->
GetAttribute() != PAD_ATTRIB::NPTH )
1163 wxLogTrace( wxT(
"PNS" ), wxT(
"unsupported pad type 0x%x" ), aPad->
GetAttribute() );
1167 auto makeSolidFromPadLayer =
1170 std::unique_ptr<PNS::SOLID> solid = std::make_unique<PNS::SOLID>();
1173 solid->SetRoutable(
false );
1181 if( aLayer ==
F_Cu || aLayer ==
B_Cu )
1188 solid->SetLayers( layers );
1191 solid->SetNet( aPad->
GetNet() );
1192 solid->SetParent( aPad );
1197 solid->SetIsFreePad();
1206 solid->SetPos(
VECTOR2I( c.
x - offset.
x, c.
y - offset.
y ) );
1207 solid->SetOffset(
VECTOR2I( offset.
x, offset.
y ) );
1217 const std::shared_ptr<SHAPE>& shape =
1220 if( shape->HasIndexableSubshapes() && shape->GetIndexableSubshapeCount() == 1 )
1222 std::vector<const SHAPE*> subshapes;
1223 shape->GetIndexableSubshapes( subshapes );
1225 solid->SetShape( subshapes[0]->Clone() );
1231 const std::shared_ptr<SHAPE_POLY_SET>& poly =
1234 if( poly->OutlineCount() )
1235 solid->SetShape(
new SHAPE_SIMPLE( poly->Outline( 0 ) ) );
1238 solids.emplace_back( std::move( solid ) );
1249 auto segment = std::make_unique<PNS::SEGMENT>(
SEG( aTrack->
GetStart(), aTrack->
GetEnd() ),
1252 segment->SetWidth( aTrack->
GetWidth() );
1254 segment->SetParent( aTrack );
1261 if( !generator->HasFlag(
IN_EDIT ) )
1276 arc->SetParent( aArc );
1283 if( !generator->HasFlag(
IN_EDIT ) )
1332 if( aVia->
GetViaType() == VIATYPE::BLIND_BURIED )
1349 via->SetParent( aVia );
1356 if( !generator->HasFlag(
IN_EDIT ) )
1371 static wxString msg;
1388 dlg.ShowDetailedText(
_(
"This zone cannot be handled by the router.\n"
1389 "Please verify it is not a self-intersecting polygon." ) );
1398 if( !layers[ layer ] )
1415 std::unique_ptr<PNS::SOLID> solid = std::make_unique<PNS::SOLID>();
1418 solid->SetNet(
nullptr );
1419 solid->SetParent( aZone );
1420 solid->SetShape( triShape );
1421 solid->SetIsCompoundShapePrimitive();
1422 solid->SetRoutable(
false );
1424 aWorld->
Add( std::move( solid ) );
1438 std::unique_ptr<PNS::SOLID> solid = std::make_unique<PNS::SOLID>();
1442 solid->SetNet(
nullptr );
1443 solid->SetParent( aText );
1444 solid->SetShape( shape );
1445 solid->SetRoutable(
false );
1458 aWorld->
Add( std::move( solid ) );
1472 for(
SHAPE* shape : shapes )
1474 std::unique_ptr<PNS::SOLID> solid = std::make_unique<PNS::SOLID>();
1479 solid->SetRoutable(
false );
1488 switch( shape->Type() )
1498 solid->SetNet( aItem->
GetNet() );
1499 solid->SetParent( aItem );
1500 solid->SetShape( shape );
1502 if( shapes.size() > 1 )
1503 solid->SetIsCompoundShapePrimitive();
1505 aWorld->
Add( std::move( solid ) );
1518 wxLogTrace( wxT(
"PNS" ), wxT(
"m_board = %p" ),
m_board );
1531 return ::IsCopperLayer( aKicadLayer );
1540 for(
int i = aLayer.
Start(); i <= aLayer.
End(); i++ )
1596 for(
int layer =
test.Start(); layer <=
test.End(); ++layer )
1609 for(
int layer =
test.Start(); layer <=
test.End(); ++layer )
1635 bool isOnVisibleLayer =
true;
1662 wxLogTrace( wxT(
"PNS" ), wxT(
"No board attached, aborting sync." ) );
1686 boardOutline = &buffer;
1690 syncZone( aWorld, zone, boardOutline );
1695 for(
PAD*
pad : footprint->Pads() )
1697 std::vector<std::unique_ptr<PNS::SOLID>> solids =
syncPad(
pad );
1699 for( std::unique_ptr<PNS::SOLID>& solid : solids )
1700 aWorld->
Add( std::move( solid ) );
1702 std::optional<int> clearanceOverride =
pad->GetClearanceOverrides(
nullptr );
1704 if( clearanceOverride.has_value() )
1705 worstClearance = std::max( worstClearance, clearanceOverride.value() );
1707 if(
pad->GetProperty() == PAD_PROP::CASTELLATED )
1709 std::unique_ptr<SHAPE> hole;
1710 hole.reset(
pad->GetEffectiveHoleShape()->Clone() );
1715 syncTextItem( aWorld, &footprint->Reference(), footprint->Reference().GetLayer() );
1716 syncTextItem( aWorld, &footprint->Value(), footprint->Value().GetLayer() );
1718 for(
ZONE* zone : footprint->Zones() )
1719 syncZone( aWorld, zone, boardOutline );
1721 for(
PCB_FIELD* field : footprint->Fields() )
1724 for(
BOARD_ITEM* item : footprint->GraphicalItems() )
1743 if( std::unique_ptr<PNS::SEGMENT> segment =
syncTrack( t ) )
1744 aWorld->
Add( std::move( segment ) );
1748 if( std::unique_ptr<PNS::ARC> arc =
syncArc(
static_cast<PCB_ARC*
>( t ) ) )
1749 aWorld->
Add( std::move( arc ) );
1754 aWorld->
Add( std::move(
via ) );
1799 if( zone->GetIsRuleArea() )
1809 if( aClearance >= 0 )
1815 switch( settings->m_Display.m_TrackClearance )
1848 if( aImportance >= 1 )
1850 else if( aImportance == 0 )
1876 netCode = net->GetNetCode();
1879 const NET_SETTINGS* netSettings = connectivity->GetNetSettings();
1881 if( connectivity->HasNetNameForNetCode( netCode ) )
1883 const wxString& netName = connectivity->GetNetNameForNetCode( netCode );
1889 if( colorByNet && netColors.count( netCode ) )
1890 color = netColors.at( netCode );
1894 color = defaultColor;
1896 if(
color == COLOR4D::UNSPECIFIED )
1897 color = defaultColor;
1899 pitem->
SetColor(
color.Brightened( 0.5 ).WithAlpha( std::min( 1.0,
color.a + 0.4 ) ) );
1920 if( td->IsTeardropArea()
1922 && td->Outline()->Collide( aItem->
Shape( td->GetLayer() ) ) )
1966 switch( aItem->
Kind() )
1987 const SEG& s = seg->
Seg();
2053 switch( aItem->
Kind() )
2062 newBoardItem = new_arc;
2070 const SEG& s = seg->
Seg();
2076 newBoardItem = track;
2087 via_board->
SetNet( net );
2092 newBoardItem = via_board;
2117 return newBoardItem;
2137 std::set<FOOTPRINT*> processedFootprints;
2143 VECTOR2I offset = fpOffset.p_new - fpOffset.p_old;
2148 if( processedFootprints.find( footprint ) != processedFootprints.end() )
2151 processedFootprints.insert( footprint );
2171 wxLogTrace( wxT(
"PNS" ), wxT(
"SetView %p" ), aView );
2210 return static_cast<NETINFO_ITEM*
>( aNet )->GetNetname();
2212 return wxEmptyString;
2218 wxLogTrace( wxT(
"PNS" ), wxT(
"Update-net %s" ),
GetNetName( aNet ) );
2244 return PCB_LAYER_ID::UNDEFINED_LAYER;
2252 return static_cast<PCB_LAYER_ID>( ( aLayer + 1 ) * 2 );
2261 if( aLayer ==
F_Cu )
2264 if( aLayer ==
B_Cu )
2267 return ( aLayer / 2 ) - 1;
constexpr EDA_IU_SCALE pcbIUScale
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
void SetNet(NETINFO_ITEM *aNetInfo)
Set a NET_INFO object for the item.
Container for design settings for a BOARD object.
std::shared_ptr< NET_SETTINGS > m_NetSettings
int GetCurrentViaSize() const
std::shared_ptr< DRC_ENGINE > m_DRCEngine
bool m_UseConnectedTrackWidth
bool m_TempOverrideTrackWidth
int GetCurrentDiffPairWidth() const
int GetCurrentDiffPairViaGap() const
int GetCurrentDiffPairGap() const
bool UseNetClassVia() const
Return true if netclass values should be used to obtain appropriate via size.
int GetCurrentTrackWidth() const
BOARD_STACKUP & GetStackupDescriptor()
bool UseNetClassTrack() const
Return true if netclass values should be used to obtain appropriate track width.
bool UseNetClassDiffPair() const
Return true if netclass values should be used to obtain appropriate diff pair dimensions.
bool m_UseHeightForLengthCalcs
Enable inclusion of stackup height in track length measurements and length tuning.
int GetCurrentViaDrill() const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
PCB_GROUP * GetParentGroup() const
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
FOOTPRINT * GetParentFootprint() const
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
virtual bool IsLocked() const
virtual bool HasDrilledHole() const
virtual int BoardCopperLayerCount() const
Return the total number of copper layers for the board that this item resides on.
virtual bool IsOnCopperLayer() const
Manage layers needed to make a physical board.
int GetLayerDistance(PCB_LAYER_ID aFirstLayer, PCB_LAYER_ID aSecondLayer) const
Calculate the distance (height) between the two given copper layers.
Information pertinent to a Pcbnew printed circuit board.
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr, bool aAllowUseArcsInPolygons=false, bool aIncludeNPTHAsOutlines=false)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
NETINFO_ITEM * DpCoupledNet(const NETINFO_ITEM *aNet)
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
const ZONES & Zones() const
int GetMaxClearanceValue() const
Returns the maximum clearance value for any object on the board.
int GetCopperLayerCount() const
int MatchDpSuffix(const wxString &aNetName, wxString &aComplementNet)
Fetch the coupled netname for a given net.
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
const DRAWINGS & Drawings() const
constexpr const Vec & GetOrigin() const
constexpr const SizeVec & GetSize() const
SEVERITY GetSeverity() const
const MINOPTMAX< int > & GetValue() const
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const
Make a set of SHAPE objects representing the EDA_SHAPE.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
A color representation with 4 components: red, green, blue, alpha.
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
double GetMinDepth() const
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
NET_COLOR_MODE GetNetColorMode() const
COLOR4D GetColor(const VIEW_ITEM *aItem, int aLayer) const override
Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer using curr...
std::map< int, KIGFX::COLOR4D > & GetNetColorMap()
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const std::set< int > & GetHighlightNetCodes() const
Return the netcode of currently highlighted net.
PCB_LAYER_ID GetPrimaryHighContrastLayer() const
Return the board layer which is in high-contrast mode.
bool GetHighContrast() const
Extend VIEW_ITEM by possibility of grouping items into a single object.
void FreeItems()
Free all the items that were added to the group.
virtual void SetLayer(int aLayer)
Set layer used to draw the group.
virtual void Add(VIEW_ITEM *aItem)
Add an item to the group.
virtual double ViewGetLOD(int aLayer, VIEW *aView) const
Return the level of detail (LOD) of the item.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
bool IsVisible(const VIEW_ITEM *aItem) const
Return information if the item is visible (or not).
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
A collection of nets and the parameters used to route or test these nets.
COLOR4D GetPcbColor(bool aIsForSave=false) const
Handle the data for a net.
void SetParent(BOARD *aParent)
void SetNetClass(const std::shared_ptr< NETCLASS > &aNetClass)
static NETINFO_ITEM * OrphanedItem()
NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net li...
NET_SETTINGS stores various net-related settings in a project context.
bool HasEffectiveNetClass(const wxString &aNetName) const
Determines if an effective netclass for the given net name has been cached.
std::shared_ptr< NETCLASS > GetCachedEffectiveNetClass(const wxString &aNetName) const
Returns an already cached effective netclass for the given net name.
void ForEachUniqueLayer(const std::function< void(PCB_LAYER_ID)> &aMethod) const
Runs the given callable for each active unique copper layer in this padstack, meaning F_Cu for MODE::...
@ NORMAL
Shape is the same on all layers.
@ CUSTOM
Shapes can be defined on arbitrary layers.
@ FRONT_INNER_BACK
Up to three shapes can be defined (F_Cu, inner copper layers, B_Cu)
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer, FLASHING flashPTHPads=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
const VECTOR2I & GetDrillSize() const
PAD_ATTRIB GetAttribute() const
const PADSTACK & Padstack() const
const VECTOR2I & GetOffset(PCB_LAYER_ID aLayer) const
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon(PCB_LAYER_ID aLayer, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
VECTOR2I ShapePos(PCB_LAYER_ID aLayer) const
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
Return a SHAPE_SEGMENT object representing the pad's hole.
int GetPadToDieLength() const
void SetMid(const VECTOR2I &aMid)
const VECTOR2I & GetMid() const
std::vector< VECTOR2I > GetConnectionPoints() const
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc, bool aIgnoreLineWidth=false) const override
Convert the item shape to a closed polygon.
void SetEnd(const VECTOR2I &aEnd)
void SetStart(const VECTOR2I &aStart)
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
virtual void SetWidth(int aWidth)
virtual int GetWidth() const
bool GetIsFree() const
Check if the via is a free via (as opposed to one created on a track by the router).
PCB_LAYER_ID BottomLayer() const
VECTOR2I GetPosition() const override
const PADSTACK & Padstack() const
void SetDrill(int aDrill)
Set the drill value for vias.
void SetIsFree(bool aFree=true)
void SetPosition(const VECTOR2I &aPoint) override
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
For a via m_layer contains the top layer, the other layer is in m_bottomLayer/.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
int GetWidth() const override
void SetViaType(VIATYPE aViaType)
PCB_LAYER_ID TopLayer() const
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
VIATYPE GetViaType() const
void SetWidth(int aWidth) override
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Return the 2 layers used by the via (the via actually uses all layers between these 2 layers)
int Width() const override
const SHAPE * Shape(int aLayer) const override
Return the geometrical shape of the item.
void SetDebugEnabled(bool aEnabled)
static HOLE * MakeCircularHole(const VECTOR2I &pos, int radius, PNS_LAYER_RANGE aLayers)
ITEM_SET & ExcludeItem(const ITEM *aItem)
ITEM_SET & FilterKinds(int aKindMask, bool aInvert=false)
std::vector< ITEM * > & Items()
Base class for PNS router board items.
BOARD_ITEM * Parent() const
virtual ITEM * ParentPadVia() const
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
PnsKind Kind() const
Return the type (kind) of the item.
void SetNet(NET_HANDLE aNet)
virtual int Layer() const
void SetLayer(int aLayer)
void SetParent(BOARD_ITEM *aParent)
bool OfKind(int aKindMask) const
virtual VECTOR2I Anchor(int n) const
virtual BOARD_ITEM * BoardItem() const
A 2D point on a given set of layers and belonging to a certain net, that links together a number of b...
const ITEM_SET & CLinks() const
Keep the router "world" - i.e.
void SetMaxClearance(int aClearance)
Assign a clearance resolution function object.
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
void SetRuleResolver(RULE_RESOLVER *aFunc)
void AddEdgeExclusion(std::unique_ptr< SHAPE > aShape)
const ITEM_OWNER * Owner() const
Return the owner of this item, or NULL if there's none.
virtual wxString GetNetName(PNS::NET_HANDLE aNet) const =0
virtual int GetNetCode(NET_HANDLE aNet) const =0
virtual PCB_LAYER_ID GetBoardLayerFromPNSLayer(int aLayer) const =0
void SetEnds(const VECTOR2I &a, const VECTOR2I &b)
int Width() const override
void SetTrackWidth(int aWidth)
void SetBoardMinTrackWidth(int aWidth)
void SetDiffPairViaGapSameAsTraceGap(bool aEnable)
void SetDiffPairWidth(int aWidth)
void SetDiffPairWidthSource(const wxString &aSource)
void SetDiffPairGapSource(const wxString &aSource)
void SetDiffPairGap(int aGap)
void SetHoleToHole(int aHoleToHole)
void SetViaDrill(int aDrill)
void SetDiffPairViaGap(int aGap)
void SetDiffPairHoleToHole(int aHoleToHole)
void SetMinClearance(int aClearance)
void SetClearance(int aClearance)
void SetViaDiameter(int aDiameter)
void SetClearanceSource(const wxString &aSource)
void SetWidthSource(const wxString &aSource)
void SetTrackWidthIsExplicit(bool aIsExplicit)
bool syncGraphicalItem(PNS::NODE *aWorld, PCB_SHAPE *aItem)
bool inheritTrackWidth(PNS::ITEM *aItem, int *aInheritedWidth)
void AddItem(PNS::ITEM *aItem) override
virtual EDA_UNITS GetUnits() const
PNS::DEBUG_DECORATOR * m_debugDecorator
void SetDebugDecorator(PNS::DEBUG_DECORATOR *aDec)
bool syncZone(PNS::NODE *aWorld, ZONE *aZone, SHAPE_POLY_SET *aBoardOutline)
void SetBoard(BOARD *aBoard)
~PNS_KICAD_IFACE_BASE() override
std::unique_ptr< PNS::ARC > syncArc(PCB_ARC *aArc)
void RemoveItem(PNS::ITEM *aItem) override
bool IsPNSCopperLayer(int aPNSLayer) const override
PNS::RULE_RESOLVER * GetRuleResolver() override
bool IsKicadCopperLayer(PCB_LAYER_ID aPcbnewLayer) const
std::vector< std::unique_ptr< PNS::SOLID > > syncPad(PAD *aPad)
bool syncTextItem(PNS::NODE *aWorld, PCB_TEXT *aText, PCB_LAYER_ID aLayer)
void SetStartLayerFromPCBNew(PCB_LAYER_ID aLayer)
bool IsFlashedOnLayer(const PNS::ITEM *aItem, int aLayer) const override
PCB_LAYER_ID GetBoardLayerFromPNSLayer(int aLayer) const override
void SyncWorld(PNS::NODE *aWorld) override
int StackupHeight(int aFirstLayer, int aSecondLayer) const override
PNS::DEBUG_DECORATOR * GetDebugDecorator() override
std::unique_ptr< PNS::SEGMENT > syncTrack(PCB_TRACK *aTrack)
PNS_PCBNEW_RULE_RESOLVER * m_ruleResolver
PNS::NET_HANDLE GetOrphanedNetHandle() override
std::unique_ptr< PNS::VIA > syncVia(PCB_VIA *aVia)
int GetPNSLayerFromBoardLayer(PCB_LAYER_ID aLayer) const override
PNS_LAYER_RANGE SetLayersFromPCBNew(PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer)
void UpdateItem(PNS::ITEM *aItem) override
bool ImportSizes(PNS::SIZES_SETTINGS &aSizes, PNS::ITEM *aStartItem, PNS::NET_HANDLE aNet, VECTOR2D aStartPosition) override
void SetView(KIGFX::VIEW *aView)
void RemoveItem(PNS::ITEM *aItem) override
void AddItem(PNS::ITEM *aItem) override
void UpdateItem(PNS::ITEM *aItem) override
std::map< PAD *, OFFSET > m_fpOffsets
int GetNetCode(PNS::NET_HANDLE aNet) const override
virtual void SetHostTool(PCB_TOOL_BASE *aTool)
void DisplayItem(const PNS::ITEM *aItem, int aClearance, bool aEdit=false, int aFlags=0) override
std::unique_ptr< BOARD_COMMIT > m_commit
void EraseView() override
void HideItem(PNS::ITEM *aItem) override
void UpdateNet(PNS::NET_HANDLE aNet) override
BOARD_CONNECTED_ITEM * createBoardItem(PNS::ITEM *aItem)
void DisplayPathLine(const SHAPE_LINE_CHAIN &aLine, int aImportance) override
bool IsItemVisible(const PNS::ITEM *aItem) const override
std::unordered_set< BOARD_ITEM * > m_hiddenItems
EDA_UNITS GetUnits() const override
bool IsAnyLayerVisible(const PNS_LAYER_RANGE &aLayer) const override
void modifyBoardItem(PNS::ITEM *aItem)
KIGFX::VIEW_GROUP * m_previewItems
void DisplayRatline(const SHAPE_LINE_CHAIN &aRatline, PNS::NET_HANDLE aNet) override
wxString GetNetName(PNS::NET_HANDLE aNet) const override
~PNS_KICAD_IFACE() override
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.
~PNS_PCBNEW_DEBUG_DECORATOR()
PNS_PCBNEW_DEBUG_DECORATOR(PNS::ROUTER_IFACE *aIface)
void AddPoint(const VECTOR2I &aP, const KIGFX::COLOR4D &aColor, int aSize, const wxString &aName=wxT(""), const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
KIGFX::VIEW_GROUP * m_items
void AddShape(const BOX2I &aBox, const KIGFX::COLOR4D &aColor, int aOverrideWidth=0, const wxString &aName=wxT(""), const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
PNS::ROUTER_IFACE * m_iface
void AddItem(const PNS::ITEM *aItem, const KIGFX::COLOR4D &aColor, int aOverrideWidth=0, const wxString &aName=wxT(""), const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
virtual void Message(const wxString &msg, const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
void SetView(KIGFX::VIEW *aView)
void AddShape(const SHAPE *aShape, const KIGFX::COLOR4D &aColor, int aOverrideWidth=0, const wxString &aName=wxT(""), const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
int NetCode(PNS::NET_HANDLE aNet) override
virtual ~PNS_PCBNEW_RULE_RESOLVER()
PNS_PCBNEW_RULE_RESOLVER(BOARD *aBoard, PNS::ROUTER_IFACE *aRouterIface)
bool IsDrilledHole(const PNS::ITEM *aItem) override
void ClearCaches() override
void ClearTemporaryCaches() override
bool QueryConstraint(PNS::CONSTRAINT_TYPE aType, const PNS::ITEM *aItemA, const PNS::ITEM *aItemB, int aLayer, PNS::CONSTRAINT *aConstraint) override
int ClearanceEpsilon() const override
BOARD_ITEM * getBoardItem(const PNS::ITEM *aItem, PCB_LAYER_ID aBoardLayer, int aIdx=0)
bool IsKeepout(const PNS::ITEM *aObstacle, const PNS::ITEM *aItem, bool *aEnforce) override
int Clearance(const PNS::ITEM *aA, const PNS::ITEM *aB, bool aUseClearanceEpsilon=true) override
void ClearCacheForItems(std::vector< const PNS::ITEM * > &aItems) override
bool IsNonPlatedSlot(const PNS::ITEM *aItem) override
std::unordered_map< CLEARANCE_CACHE_KEY, int > m_clearanceCache
int DpNetPolarity(PNS::NET_HANDLE aNet) override
std::unordered_map< CLEARANCE_CACHE_KEY, int > m_tempClearanceCache
bool IsNetTieExclusion(const PNS::ITEM *aItem, const VECTOR2I &aCollisionPos, const PNS::ITEM *aCollidingItem) override
PCB_TRACK m_dummyTracks[2]
bool IsInNetTie(const PNS::ITEM *aA) override
PNS::NET_HANDLE DpCoupledNet(PNS::NET_HANDLE aNet) override
bool DpNetPair(const PNS::ITEM *aItem, PNS::NET_HANDLE &aNetP, PNS::NET_HANDLE &aNetN) override
PNS::ROUTER_IFACE * m_routerIface
wxString NetName(PNS::NET_HANDLE aNet) override
void SetWidth(int aWidth)
void SetClearance(int aClearance)
static constexpr double PathOverlayDepth
void SetColor(const KIGFX::COLOR4D &aColor)
double GetOriginDepth() const
void SetDepth(double aDepth)
void ShowClearance(bool aEnabled)
const VECTOR2I & GetArcMid() const
const VECTOR2I & GetP1() const
const VECTOR2I & GetP0() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int Width() const
Get the current width of the segments in the chain.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
void SetWidth(int aWidth)
Set the width of all segments in the chain.
const std::vector< VECTOR2I > & CPoints() const
size_t GetTriangleCount() const
void GetTriangle(int index, VECTOR2I &a, VECTOR2I &b, VECTOR2I &c) const
Represent a set of closed polygons.
bool IsTriangulationUpToDate() const
virtual void CacheTriangulation(bool aPartition=true, bool aSimplify=false)
Build a polygon triangulation, needed to draw a polygon on OpenGL and in some other calculations.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
const TRIANGULATED_POLYGON * TriangulatedPolygon(int aIndex) const
unsigned int TriangulatedPolyCount() const
Return the number of triangulated polygons.
int OutlineCount() const
Return the number of outlines in the set.
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
void Append(int aX, int aY)
Append a new point at the end of the polygon.
An abstract shape on 2D plane.
double Distance(const VECTOR2< extended_type > &aVector) const
Compute the distance between two vectors.
VECTOR2_TRAITS< int32_t >::extended_type extended_type
Handle a list of polygons defining a copper zone.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
bool GetDoNotAllowVias() const
bool GetDoNotAllowPads() const
bool GetDoNotAllowTracks() const
SHAPE_POLY_SET * Outline()
bool GetDoNotAllowFootprints() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
bool HasKeepoutParametersSet() const
Accessor to determine if any keepout parameters are set.
@ VIA_DIAMETER_CONSTRAINT
@ DIFF_PAIR_GAP_CONSTRAINT
@ EDGE_CLEARANCE_CONSTRAINT
@ MAX_UNCOUPLED_CONSTRAINT
@ HOLE_CLEARANCE_CONSTRAINT
@ PHYSICAL_CLEARANCE_CONSTRAINT
@ HOLE_TO_HOLE_CONSTRAINT
#define ROUTER_TRANSIENT
transient items that should NOT be cached
#define IN_EDIT
Item currently edited.
static constexpr void hash_combine(std::size_t &seed)
This is a dummy function to take the final case of hash_combine below.
This file is part of the common library.
constexpr PCB_LAYER_ID PCBNEW_LAYER_ID_START
@ LAYER_SELECT_OVERLAY
currently selected items overlay
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
@ APPEARANCE
Visibility flag has changed.
Push and Shove diff pair dimensions (gap) settings dialog.
@ SHOW_WITH_VIA_WHILE_ROUTING_OR_DRAGGING
@ SHOW_WITH_VIA_WHILE_ROUTING
static bool isEdge(const PNS::ITEM *aItem)
static bool isHole(const PNS::ITEM *aItem)
static bool isCopper(const PNS::ITEM *aItem)
VECTOR2I::extended_type ecoord
@ SH_LINE_CHAIN
line chain (polyline)
bool operator==(const CLEARANCE_CACHE_KEY &other) const
An abstract function object, returning a design rule (clearance, diff pair gap, etc) required between...
std::size_t operator()(const CLEARANCE_CACHE_KEY &k) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
VECTOR2< int32_t > VECTOR2I