84 return A == other.
A &&
B == other.
B &&
Flag == other.
Flag;
95 return hash<const void*>()( k.
A ) ^ hash<const void*>()( k.
B ) ^ hash<int>()( k.
Flag );
108 bool aUseClearanceEpsilon =
true )
override;
110 bool aUseClearanceEpsilon =
true )
override;
112 bool aUseClearanceEpsilon =
true )
override;
121 const PNS::ITEM* aCollidingItem )
override;
126 virtual wxString
NetName(
int aNet )
override;
145 int matchDpSuffix(
const wxString& aNetName, wxString& aComplementNet );
163 m_routerIface( aRouterIface ),
165 m_dummyTracks{ { aBoard }, { aBoard } },
166 m_dummyArcs{ { aBoard }, { aBoard } },
167 m_dummyVias{ { aBoard }, { aBoard } }
172 m_clearanceEpsilon = 0;
188 return pad->GetDrillSize().x / 2;
195 return via->GetDrillValue() / 2;
209 if( aA->
Net() == net_p && aB->
Net() == net_n )
212 if( aB->
Net() == net_p && aA->
Net() == net_n )
224 if( parentFootprint )
225 return static_cast<FOOTPRINT*
>( parentFootprint )->IsNetTie();
235 wxCHECK( aItem && aCollidingItem,
false );
245 if( collidingFp && itemFp && ( collidingFp == itemFp ) && itemFp->
IsNetTie() )
251 if( drcEngine && collidingItem )
254 aCollisionPos, collidingItem );
269 if( !
pad->IsOnCopperLayer() )
280 if(
pad->GetSize().x <=
pad->GetDrillSize().x )
321 default:
return false;
329 if( aItemA && !parentA )
331 switch( aItemA->
Kind() )
347 if( aItemB && !parentB )
349 switch( aItemB->
Kind() )
366 hostConstraint = drcEngine->EvalRules( hostType, parentA, parentB,
ToLAYER_ID( aLayer ) );
368 if( hostConstraint.
IsNull() )
375 aConstraint->
m_Type = aType;
391 aConstraint->
m_Type = aType;
419 bool aUseClearanceEpsilon )
443 for(
int layer = layers.
Start(); layer <= layers.
End(); ++layer )
464 if( aUseClearanceEpsilon && rv > 0 )
473 bool aUseClearanceEpsilon )
493#define HAS_PLATED_HOLE( a ) ( a )->IsRoutable()
503 if( aUseClearanceEpsilon && rv > 0 )
512 bool aUseClearanceEpsilon )
532 if( aUseClearanceEpsilon && rv > 0 )
544 assert( aItem->
Owner() !=
nullptr );
546 auto tryGetTrackWidth =
549 switch( aPnsItem->Kind() )
557 int itemTrackWidth = tryGetTrackWidth( aItem );
559 if( itemTrackWidth > 0 )
561 *aInheritedWidth = itemTrackWidth;
565 switch( aItem->
Kind() )
568 p =
static_cast<PNS::VIA*
>( aItem )->Pos();
581 assert( jt !=
nullptr );
590 int w = tryGetTrackWidth( item );
592 mval = std::min( w, mval );
595 if( mval == INT_MAX )
598 *aInheritedWidth = mval;
643 trackWidth = std::max( trackWidth, constraint.
m_Value.
Opt() );
672 viaDiameter = std::max( viaDiameter, constraint.
m_Value.
Opt() );
678 viaDrill = std::max( viaDrill, constraint.
m_Value.
Opt() );
709 diffPairWidth = std::max( diffPairWidth, constraint.
m_Value.
Opt() );
711 if( diffPairWidth == constraint.
m_Value.
Opt() )
718 diffPairGap = std::max( diffPairGap, constraint.
m_Value.
Opt() );
719 diffPairViaGap = std::max( diffPairViaGap, constraint.
m_Value.
Opt() );
785 for(
auto it = aNetName.rbegin(); it != aNetName.rend() && rv == 0; ++it, ++count )
789 if( ( ch >=
'0' && ch <=
'9' ) || ch ==
'_' )
795 aComplementNet = wxT(
"-" );
800 aComplementNet = wxT(
"+" );
805 aComplementNet = wxT(
"P" );
808 else if ( ch ==
'P' )
810 aComplementNet = wxT(
"N" );
819 if( rv != 0 && count >= 1 )
821 aComplementNet = aNetName.Left( aNetName.length() - count ) + aComplementNet
822 + aNetName.Right( count - 1 );
832 wxString coupledNetName;
875 wxString netNameN, netNameCoupled;
885 netNameN = netNameCoupled;
890 netNameP = netNameCoupled;
896 if( !netInfoP || !netInfoN )
946 const wxString& aName = wxT(
"" ),
954 sh.
Append( aP.
x - aSize, aP.
y - aSize );
955 sh.
Append( aP.
x + aSize, aP.
y + aSize );
957 sh.
Append( aP.
x - aSize, aP.
y + aSize );
958 sh.
Append( aP.
x + aSize, aP.
y - aSize );
965 const wxString& aName = wxT(
"" ),
983 const wxString& aName = wxT(
"" ),
998 AddShape( &l, aColor, aOverrideWidth, aName, aSrcLoc );
1003 const wxString& aName = wxT(
"" ),
1113 bool is_copper =
false;
1135 wxLogTrace( wxT(
"PNS" ), wxT(
"unsupported pad type 0x%x" ), aPad->
GetAttribute() );
1139 std::unique_ptr<PNS::SOLID> solid = std::make_unique<PNS::SOLID>();
1142 solid->SetRoutable(
false );
1144 solid->SetLayers( layers );
1146 solid->SetParent( aPad );
1151 solid->SetIsFreePad();
1160 solid->SetPos(
VECTOR2I( c.
x - offset.
x, c.
y - offset.
y ) );
1161 solid->SetOffset(
VECTOR2I( offset.
x, offset.
y ) );
1171 if( shape->HasIndexableSubshapes() && shape->GetIndexableSubshapeCount() == 1 )
1173 std::vector<const SHAPE*> subshapes;
1174 shape->GetIndexableSubshapes( subshapes );
1176 solid->SetShape( subshapes[0]->
Clone() );
1180 solid->SetShape( shape->Clone() );
1189 auto segment = std::make_unique<PNS::SEGMENT>(
SEG( aTrack->
GetStart(), aTrack->
GetEnd() ),
1192 segment->SetWidth( aTrack->
GetWidth() );
1194 segment->SetParent( aTrack );
1205 auto arc = std::make_unique<PNS::ARC>(
1210 arc->SetParent( aArc );
1231 via->SetParent( aVia );
1269 dlg.ShowDetailedText(
wxString::Format(
_(
"This zone cannot be handled by the router.\n"
1270 "Please verify it is not a self-intersecting "
1278 for(
int layer =
F_Cu; layer <=
B_Cu; layer++ )
1280 if( !layers[ layer ] )
1283 for(
int outline = 0; outline < poly->
OutlineCount(); outline++ )
1297 std::unique_ptr<PNS::SOLID> solid = std::make_unique<PNS::SOLID>();
1299 solid->SetLayer( layer );
1300 solid->SetNet( -1 );
1301 solid->SetParent( aZone );
1302 solid->SetShape( triShape );
1303 solid->SetIsCompoundShapePrimitive();
1304 solid->SetRoutable(
false );
1306 aWorld->
Add( std::move( solid ) );
1320 std::unique_ptr<PNS::SOLID> solid = std::make_unique<PNS::SOLID>();
1322 solid->SetLayer( aLayer );
1323 solid->SetNet( -1 );
1324 solid->SetParent(
dynamic_cast<BOARD_ITEM*
>( aText ) );
1338 for(
int ii = 0; ii < buffer.
Outline(0).PointCount(); ii++ )
1341 rectShape->
Append( point );
1344 solid->SetShape( rectShape );
1349 solid->SetRoutable(
false );
1351 aWorld->
Add( std::move( solid ) );
1384 for(
SHAPE* shape : shapes )
1386 std::unique_ptr<PNS::SOLID> solid = std::make_unique<PNS::SOLID>();
1391 solid->SetLayer( aItem->
GetLayer() );
1395 switch( shape->Type() )
1404 solid->SetNet( -1 );
1405 solid->SetParent( aItem );
1406 solid->SetShape( shape );
1408 if( shapes.size() > 1 )
1409 solid->SetIsCompoundShapePrimitive();
1411 solid->SetRoutable(
false );
1413 aWorld->
Add( std::move( solid ) );
1426 wxLogTrace( wxT(
"PNS" ), wxT(
"m_board = %p" ),
m_board );
1435 for(
int i = aLayer.
Start(); i <= aLayer.
End(); i++ )
1486 bool isOnVisibleLayer =
true;
1513 wxLogTrace( wxT(
"PNS" ), wxT(
"No board attached, aborting sync." ) );
1537 boardOutline = &buffer;
1541 syncZone( aWorld, zone, boardOutline );
1546 for(
PAD*
pad : footprint->Pads() )
1548 if( std::unique_ptr<PNS::SOLID> solid =
syncPad(
pad ) )
1549 aWorld->
Add( std::move( solid ) );
1551 worstClearance = std::max( worstClearance,
pad->GetLocalClearance() );
1555 std::unique_ptr<SHAPE> hole;
1556 hole.reset(
pad->GetEffectiveHoleShape()->Clone() );
1561 syncTextItem( aWorld, &footprint->Reference(), footprint->Reference().GetLayer() );
1562 syncTextItem( aWorld, &footprint->Value(), footprint->Value().GetLayer() );
1564 for(
FP_ZONE* zone : footprint->Zones() )
1565 syncZone( aWorld, zone, boardOutline );
1567 for(
BOARD_ITEM* mgitem : footprint->GraphicalItems() )
1587 aWorld->
Add( std::move( segment ) );
1592 aWorld->
Add( std::move( arc ) );
1597 aWorld->
Add( std::move(
via ) );
1646 if( aClearance >= 0 )
1652 switch( settings->m_Display.m_TrackClearance )
1691 if( aImportance >= 1 )
1693 else if( aImportance == 0 )
1717 const std::map<int, wxString>& ncMap = connectivity->GetNetclassMap();
1719 if( colorByNet && netColors.count( aNetCode ) )
1720 color = netColors.at( aNetCode );
1721 else if( colorByNet && ncMap.count( aNetCode ) && ncColors.count( ncMap.at( aNetCode ) ) )
1722 color = ncColors.at( ncMap.at( aNetCode ) );
1724 color = defaultColor;
1726 if(
color == COLOR4D::UNSPECIFIED )
1727 color = defaultColor;
1729 pitem->
SetColor(
color.Brightened( 0.5 ).WithAlpha( std::min( 1.0,
color.a + 0.4 ) ) );
1787 switch( aItem->
Kind() )
1805 const SEG& s = seg->
Seg();
1853 switch( aItem->
Kind() )
1870 const SEG& s = seg->
Seg();
1922 std::set<FOOTPRINT*> processedFootprints;
1926 for(
const std::pair<const PAD*, OFFSET>& fpOffset :
m_fpOffsets )
1928 VECTOR2I offset = fpOffset.second.p_new - fpOffset.second.p_old;
1933 if( processedFootprints.find( footprint ) != processedFootprints.end() )
1936 processedFootprints.insert( footprint );
1956 wxLogTrace( wxT(
"PNS" ), wxT(
"SetView %p" ), aView );
1985 wxLogTrace( wxT(
"PNS" ), wxT(
"Update-net %d" ), aNetCode );
constexpr EDA_IU_SCALE pcbIUScale
@ OFF
Net (and netclass) colors are not shown.
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,...
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
Container for design settings for a BOARD object.
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
int GetDRCEpsilon() const
int GetBiggestClearanceValue() 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.
virtual bool IsConnected() const
Returns information if the object is derived from BOARD_CONNECTED_ITEM.
virtual bool IsKnockout() const
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
virtual bool IsLocked() const
BOARD_ITEM_CONTAINER * GetParentFootprint() const
virtual bool IsOnLayer(PCB_LAYER_ID aLayer, bool aIncludeCourtyards=false) const
Test to see if this object is on the given layer.
BOARD_ITEM_CONTAINER * GetParent() 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.
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
FOOTPRINTS & Footprints()
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
const Vec & GetOrigin() const
const Vec & GetSize() const
SEVERITY GetSeverity() const
const MINOPTMAX< int > & GetValue() const
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.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
void TransformBoundingBoxToPolygon(SHAPE_POLY_SET *aBuffer, int aClearance) const
Convert the text bounding box to a rectangular polygon depending on the text orientation,...
const TEXT_ATTRIBUTES & GetAttributes() const
std::shared_ptr< SHAPE_COMPOUND > GetEffectiveTextShape(bool aTriangulate=true, bool aUseTextRotation=true) const
build a list of segments (SHAPE_SEGMENT) to describe a text shape.
A specialization of ZONE for use in footprints.
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()
std::map< wxString, KIGFX::COLOR4D > & GetNetclassColorMap()
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.
Represent a contiguous set of PCB layers.
bool IsMultilayer() const
LAYER_RANGE Intersection(const LAYER_RANGE &aOther) const
Shortcut for comparisons/overlap tests.
bool Overlaps(const LAYER_RANGE &aOther) const
LSET is a set of PCB_LAYER_IDs.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Handle the data for a net.
const wxString & GetNetname() const
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
const VECTOR2I & GetDrillSize() const
PAD_ATTRIB GetAttribute() const
const VECTOR2I & GetOffset() const
VECTOR2I ShapePos() const
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING flashPTHPads=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
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
void SetWidth(int aWidth)
void SetEnd(const VECTOR2I &aEnd)
void SetStart(const VECTOR2I &aStart)
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
bool GetIsFree() const
Checks 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
void SetDrill(int aDrill)
Function SetDrill sets 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)
Function SetLayerPair For a via m_layer contains the top layer, the other layer is in m_bottomLayer.
void SetViaType(VIATYPE aViaType)
PCB_LAYER_ID TopLayer() const
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
VIATYPE GetViaType() const
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Function LayerPair Return the 2 layers used by the via (the via actually uses all layers between thes...
int Width() const override
const SHAPE * Shape() const override
Return the geometrical shape of the item.
void SetDebugEnabled(bool aEnabled)
ITEM_SET & ExcludeItem(const ITEM *aItem)
ITEM_SET & FilterKinds(int aKindMask, bool aInvert=false)
Base class for PNS router board items.
BOARD_ITEM * Parent() const
PnsKind Kind() const
Return the type (kind) of the item.
NODE * Owner() const
Return the owner of this item, or NULL if there's none.
virtual int Layer() const
void SetParent(BOARD_ITEM *aParent)
const LAYER_RANGE & Layers() const
bool OfKind(int aKindMask) const
Return true if the item's type matches the mask aKindMask.
A 2D point on a given set of layers and belonging to a certain net, that links together a number of b...
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)
int Width() const override
void SetTrackWidth(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
bool ImportSizes(PNS::SIZES_SETTINGS &aSizes, PNS::ITEM *aStartItem, int aNet) override
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)
std::unique_ptr< PNS::ARC > syncArc(PCB_ARC *aArc)
void RemoveItem(PNS::ITEM *aItem) override
bool syncTextItem(PNS::NODE *aWorld, EDA_TEXT *aText, PCB_LAYER_ID aLayer)
PNS::RULE_RESOLVER * GetRuleResolver() override
bool IsFlashedOnLayer(const PNS::ITEM *aItem, int aLayer) const override
std::unique_ptr< PNS::SOLID > syncPad(PAD *aPad)
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
std::unique_ptr< PNS::VIA > syncVia(PCB_VIA *aVia)
void UpdateItem(PNS::ITEM *aItem) override
void SetView(KIGFX::VIEW *aView)
void DisplayRatline(const SHAPE_LINE_CHAIN &aRatline, int aNetCode) override
void RemoveItem(PNS::ITEM *aItem) override
void AddItem(PNS::ITEM *aItem) override
void UpdateItem(PNS::ITEM *aItem) override
std::map< PAD *, OFFSET > m_fpOffsets
void SetHostTool(PCB_TOOL_BASE *aTool)
std::unique_ptr< BOARD_COMMIT > m_commit
void UpdateNet(int aNetCode) override
void EraseView() override
void HideItem(PNS::ITEM *aItem) override
void DisplayPathLine(const SHAPE_LINE_CHAIN &aLine, int aImportance) override
bool IsItemVisible(const PNS::ITEM *aItem) const override
void DisplayItem(const PNS::ITEM *aItem, int aClearance, bool aEdit=false, bool aIsHeadTrace=false) override
std::unordered_set< BOARD_ITEM * > m_hiddenItems
EDA_UNITS GetUnits() const override
bool IsAnyLayerVisible(const LAYER_RANGE &aLayer) const override
KIGFX::VIEW_GROUP * m_previewItems
~PNS_PCBNEW_DEBUG_DECORATOR()
void AddPoint(const VECTOR2I &aP, const KIGFX::COLOR4D &aColor, int aSize, const wxString &aName=wxT(""), const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
PNS_PCBNEW_DEBUG_DECORATOR(KIGFX::VIEW *aView=nullptr)
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
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
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
virtual int HoleToHoleClearance(const PNS::ITEM *aA, const PNS::ITEM *aB, bool aUseClearanceEpsilon=true) override
std::unordered_map< CLEARANCE_CACHE_KEY, int > m_holeToHoleClearanceCache
virtual ~PNS_PCBNEW_RULE_RESOLVER()
PNS_PCBNEW_RULE_RESOLVER(BOARD *aBoard, PNS::ROUTER_IFACE *aRouterIface)
void ClearCaches() override
virtual bool QueryConstraint(PNS::CONSTRAINT_TYPE aType, const PNS::ITEM *aItemA, const PNS::ITEM *aItemB, int aLayer, PNS::CONSTRAINT *aConstraint) override
int ClearanceEpsilon() const
virtual wxString NetName(int aNet) override
std::unordered_map< CLEARANCE_CACHE_KEY, int > m_holeClearanceCache
virtual int Clearance(const PNS::ITEM *aA, const PNS::ITEM *aB, bool aUseClearanceEpsilon=true) override
int matchDpSuffix(const wxString &aNetName, wxString &aComplementNet)
Checks for netnamed differential pairs.
void ClearCacheForItem(const PNS::ITEM *aItem) override
virtual int DpCoupledNet(int aNet) override
virtual bool DpNetPair(const PNS::ITEM *aItem, int &aNetP, int &aNetN) override
int holeRadius(const PNS::ITEM *aItem) const
std::unordered_map< CLEARANCE_CACHE_KEY, int > m_clearanceCache
virtual bool IsNetTieExclusion(const PNS::ITEM *aItem, const VECTOR2I &aCollisionPos, const PNS::ITEM *aCollidingItem) override
PCB_TRACK m_dummyTracks[2]
virtual bool IsInNetTie(const PNS::ITEM *aA) override
virtual int DpNetPolarity(int aNet) override
virtual bool IsDiffPair(const PNS::ITEM *aA, const PNS::ITEM *aB) override
PNS::ROUTER_IFACE * m_routerIface
virtual int HoleClearance(const PNS::ITEM *aA, const PNS::ITEM *aB, bool aUseClearanceEpsilon=true) override
void SetWidth(double aWidth)
void SetClearance(int aClearance)
void SetColor(const KIGFX::COLOR4D &aColor)
void SetIsHeadTrace(bool aIsHead)
void Update(const PNS::ITEM *aItem)
static const int PathOverlayDepth
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.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
void SetWidth(int aWidth)
Set the width of all segments in the chain.
size_t GetTriangleCount() const
void GetTriangle(int index, VECTOR2I &a, VECTOR2I &b, VECTOR2I &c) const
Represent a set of closed polygons.
bool IsTriangulationUpToDate() const
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)
const TRIANGULATED_POLYGON * TriangulatedPolygon(int aIndex) const
int OutlineCount() const
Return the number of vertices in a given outline/hole.
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.
VECTOR2_TRAITS< int >::extended_type extended_type
Handle a list of polygons defining a copper zone.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
bool GetDoNotAllowTracks() const
SHAPE_POLY_SET * Outline()
wxString GetZoneName() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
This file is part of the common library.
@ VIA_DIAMETER_CONSTRAINT
@ DIFF_PAIR_GAP_CONSTRAINT
@ EDGE_CLEARANCE_CONSTRAINT
@ HOLE_CLEARANCE_CONSTRAINT
@ HOLE_TO_HOLE_CONSTRAINT
int GetKnockoutTextMargin(const VECTOR2I &aSize, int aThickness)
Returns the margin for knocking out text.
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
@ LAYER_SELECT_OVERLAY
currently selected items overlay
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID ToLAYER_ID(int aLayer)
This file contains miscellaneous commonly used macros and functions.
@ APPEARANCE
Visibility flag has changed.
void SetWidth(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aWidth, const wxString &aActualConversion)
Push and Shove diff pair dimensions (gap) settings dialog.
CONSTRAINT_TYPE
An abstract function object, returning a design rule (clearance, diff pair gap, etc) required between...
std::unique_ptr< typename std::remove_const< T >::type > Clone(const T &aItem)
@ NPTH
like PAD_PTH, but not plated
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
@ CONN
Like smd, does not appear on the solder paste layer (default)
@ CASTELLATED
a pad with a castellated through hole
@ SHOW_WITH_VIA_WHILE_ROUTING_OR_DRAGGING
@ SHOW_WITH_VIA_WHILE_ROUTING
#define HAS_PLATED_HOLE(a)
bool isEdge(const PNS::ITEM *aItem)
bool isCopper(const PNS::ITEM *aItem)
VECTOR2I::extended_type ecoord
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
@ SH_LINE_CHAIN
line chain (polyline)
bool operator==(const CLEARANCE_CACHE_KEY &other) const
std::size_t operator()(const CLEARANCE_CACHE_KEY &k) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
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_FP_SHAPE_T
class FP_SHAPE, a footprint edge
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_FP_TEXTBOX_T
class FP_TEXTBOX, wrapped text in a footprint
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_FP_TEXT_T
class FP_TEXT, text 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)