44 std::vector<PCB_SHAPE> shortestPathShapes1, shortestPathShapes2;
49 sh.SetStroke(
false );
50 sh.SetFilled(
false );
51 sh.SetLineColor(
WHITE );
52 shortestPathShapes1.push_back( sh );
55 sh.SetFillColor( errorColor.
WithAlpha( 0.5 ) );
56 sh.SetWidth( aLength / 10 );
57 shortestPathShapes2.push_back( sh );
60 if( shortestPathShapes1.size() > 0 )
65 VECTOR2I V1 = shortestPathShapes1[0].GetStart() - shortestPathShapes1[0].GetEnd();
74 VECTOR2I V2 = shortestPathShapes1.back().GetStart() - shortestPathShapes1.back().GetEnd();
82 shortestPathShapes1.push_back( s1 );
83 shortestPathShapes1.push_back( s2 );
86 return [shortestPathShapes1, shortestPathShapes2](
PCB_MARKER* aMarker )
91 aMarker->SetShapes1( std::move( shortestPathShapes1 ) );
92 aMarker->SetShapes2( std::move( shortestPathShapes2 ) );
109 if( aShape1->NearestPoints( aShape2.get(), ptA, ptB ) )
111 PCB_SHAPE ptAShape(
nullptr, SHAPE_T::SEGMENT );
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
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)
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.
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.
COLOR_SETTINGS * GetColorSettings(const wxString &aName)