116 if(
const PNS::LINE* l = dyn_cast<const PNS::LINE*>( aItem ) )
118 if( !l->SegmentCount() )
121 else if(
const PNS::VIA* v = dyn_cast<const PNS::VIA*>( aItem ) )
135 switch( aItem->
Kind() )
165 int largestDiameter = 0;
167 for(
int layer :
via->UniqueShapeLayers() )
169 if(
via->Diameter( layer ) > largestDiameter )
171 largestDiameter =
via->Diameter( layer );
176 if( aItem->
Shape( shapeLayer ) )
263 for(
size_t s = 0; lineChain && s < lineChain->
ArcCount(); s++ )
279 bool holeDrawn =
false;
284 showClearance =
true;
286 switch( aShape->
Type() )
409 std::deque<VECTOR2D> polygon = std::deque<VECTOR2D>();
413 polygon.push_back( c->
CDPoint( i ) );
424 polygon.push_back( c->
CDPoint( 0 ) );
461 wxFAIL_MSG( wxT(
"Router preview item: nested compound shapes not supported" ) );
465 wxFAIL_MSG( wxT(
"Router preview item: SHAPE_POLY_SET not supported" ) );
472 if(
m_hole && !holeDrawn )
518 std::vector<const SHAPE*> subshapes;
521 for(
const SHAPE* shape : subshapes )
539 return color.Saturate( 1.0 );
541 return color.Brightened( 0.7 );
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.
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.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
A base class for most all the KiCad significant classes used in schematics and boards.
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.
Abstract interface for drawing on a 2D-surface.
virtual void DrawPolygon(const std::deque< VECTOR2D > &aPointList)
Draw a polygon.
virtual void SetLayerDepth(double aLayerDepth)
Set the depth of the layer (position on the z-axis)
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a rectangle.
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void DrawPolyline(const std::deque< VECTOR2D > &aPointList)
Draw a polyline.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
virtual void DrawArc(const VECTOR2D &aCenterPoint, double aRadius, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle)
Draw an arc.
virtual void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
Draw a rounded segment.
float GetLineWidth() const
Get the line width.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
const SHAPE * Shape(int aLayer) const override
Return the geometrical shape of the item.
Base class for PNS router board items.
virtual const SHAPE * Shape(int aLayer) const
Return the geometrical shape of the item.
const PNS_LAYER_RANGE & Layers() const
PnsKind Kind() const
Return the type (kind) of the item.
virtual HOLE * Hole() const
virtual BOARD_ITEM * BoardItem() const
virtual int Marker() const
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
virtual PCB_LAYER_ID GetBoardLayerFromPNSLayer(int aLayer) const =0
ROUTER_PREVIEW_ITEM(const SHAPE &aShape, PNS::ROUTER_IFACE *aIface, KIGFX::VIEW *aView)
static constexpr double LayerDepthFactor
We draw this item on a single layer, but we stack up all the layers from the various components that ...
void Update(const PNS::ITEM *aItem)
const KIGFX::COLOR4D getLayerColor(int aLayer) const
virtual void ViewDraw(int aLayer, KIGFX::VIEW *aView) const override
Draw the parts of the object belonging to layer aLayer.
void drawLineChain(const SHAPE_LINE_CHAIN_BASE *aL, KIGFX::GAL *aGal) const
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void drawShape(const SHAPE *aShape, KIGFX::GAL *aGal) const
PNS::ROUTER_IFACE * m_iface
EDA_ANGLE GetCentralAngle() const
EDA_ANGLE GetStartAngle() const
const VECTOR2I & GetCenter() const
virtual void GetIndexableSubshapes(std::vector< const SHAPE * > &aSubshapes) const
virtual bool HasIndexableSubshapes() const
SHAPE_TYPE Type() const
Return the type of the shape.
const VECTOR2I GetCenter() const
virtual size_t GetSegmentCount() const =0
virtual bool IsClosed() const =0
virtual const SEG GetSegment(int aIndex) const =0
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
const std::vector< SHAPE_ARC > & CArcs() const
const VECTOR2I & GetPosition() const
const VECTOR2I GetSize() const
const SEG & GetSeg() const
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
int PointCount() const
Return the number of points (vertices) in this polygon.
const VECTOR2D CDPoint(int aIndex) const
Return a given point as a vector with elements of type double.
An abstract shape on 2D plane.
virtual SHAPE * Clone() const
Return a dynamically allocated copy of the shape.
virtual const BOX2I BBox(int aClearance=0) const =0
Compute a bounding box of the shape, with a margin of aClearance a collision.
@ LAYER_SELECT_OVERLAY
currently selected items overlay
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
The Cairo implementation of the graphics abstraction layer.
@ SH_POLY_SET
set of polygons (with holes, etc.)
@ SH_RECT
axis-aligned rectangle
@ SH_SIMPLE
simple polygon
@ SH_NULL
empty shape (no shape...),
@ SH_POLY_SET_TRIANGLE
a single triangle belonging to a POLY_SET triangulation
@ SH_LINE_CHAIN
line chain (polyline)
@ SH_COMPOUND
compound shape, consisting of multiple simple shapes
@ NOT_USED
the 3d code uses this value
VECTOR2< int32_t > VECTOR2I