45 std::vector<PCB_SHAPE> shortestPathShapes1, shortestPathShapes2;
50 sh.SetStroke(
false );
51 sh.SetFilled(
false );
52 sh.SetLineColor(
WHITE );
53 shortestPathShapes1.push_back( sh );
56 sh.SetFillColor( errorColor.
WithAlpha( 0.5 ) );
57 sh.SetWidth( aLength / 10 );
58 shortestPathShapes2.push_back( sh );
61 if( shortestPathShapes1.size() > 0 )
66 VECTOR2I V1 = shortestPathShapes1[0].GetStart() - shortestPathShapes1[0].GetEnd();
75 VECTOR2I V2 = shortestPathShapes1.back().GetStart() - shortestPathShapes1.back().GetEnd();
83 shortestPathShapes1.push_back( s1 );
84 shortestPathShapes1.push_back( s2 );
87 return [shortestPathShapes1, shortestPathShapes2](
PCB_MARKER* aMarker )
92 aMarker->SetShapes1( std::move( shortestPathShapes1 ) );
93 aMarker->SetShapes2( std::move( shortestPathShapes2 ) );
99 std::shared_ptr<DRC_ITEM>& aDrce,
const VECTOR2I& aMarkerPos,
int aMarkerLayer,
115 double minValue = aDistance * 2;
118 for( std::shared_ptr<GRAPH_CONNECTION> gc : graph.
m_connections )
120 if( ( gc->m_path.weight < minValue ) && ( gc->m_path.weight > 0 ) )
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
void Addshape(const SHAPE &aShape, std::shared_ptr< GRAPH_NODE > &aConnectTo, BOARD_ITEM *aParent=nullptr)
std::shared_ptr< GRAPH_NODE > AddNodeVirtual()
void GeneratePaths(double aMaxWeight, PCB_LAYER_ID aLayer, bool aClearance)
std::vector< std::shared_ptr< GRAPH_CONNECTION > > m_connections
DRC_CUSTOM_MARKER_HANDLER GetGraphicsHandler(const std::vector< PCB_SHAPE > &aShapes, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aLength)
void ReportAndShowPathCuToCu(std::shared_ptr< DRC_ITEM > &aDrce, const VECTOR2I &aMarkerPos, int aMarkerLayer, const BOARD_ITEM *aItem1, const BOARD_ITEM *aItem2, PCB_LAYER_ID layer, int aDistance)
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer, DRC_CUSTOM_MARKER_HANDLER *aCustomHandler=nullptr)
virtual void SetFilled(bool aFlag)
void SetStart(const VECTOR2I &aStart)
void SetLineColor(const COLOR4D &aColor)
void SetEnd(const VECTOR2I &aEnd)
void SetWidth(int aWidth)
std::vector< PCB_SHAPE > GetShapes()
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.
Container for data for KiCad programs.
virtual SETTINGS_MANAGER & GetSettingsManager() const
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieve a color settings object that applications can read colors from.
constexpr VECTOR2< T > Perpendicular() const
Compute the perpendicular vector.
VECTOR2< T > Resize(T aNewLength) const
Return a vector of the same direction, but length specified in aNewLength.
std::function< void(PCB_MARKER *aMarker)> DRC_CUSTOM_MARKER_HANDLER
@ LAYER_DRC_ERROR
Layer for DRC markers with #SEVERITY_ERROR.
PCB_LAYER_ID
A quick note on layer IDs:
PGM_BASE * PgmOrNull()
Return a reference that can be nullptr when running a shared lib from a script, not from a kicad app.