111 if(
const PNS::LINE* l = dyn_cast<const PNS::LINE*>( aItem ) )
113 if( !l->SegmentCount() )
116 else if(
const PNS::VIA* v = dyn_cast<const PNS::VIA*>( aItem ) )
129 switch( aItem->
Kind() )
237 for(
size_t s = 0; lineChain && s < lineChain->
ArcCount(); s++ )
253 bool holeDrawn =
false;
255 switch( aShape->
Type() )
378 std::deque<VECTOR2D> polygon = std::deque<VECTOR2D>();
382 polygon.push_back( c->
CDPoint( i ) );
393 polygon.push_back( c->
CDPoint( 0 ) );
430 wxFAIL_MSG( wxT(
"Router preview item: nested compound shapes not supported" ) );
434 wxFAIL_MSG( wxT(
"Router preview item: SHAPE_POLY_SET not supported" ) );
441 if(
m_hole && !holeDrawn )
483 std::vector<const SHAPE*> subshapes;
486 for(
const SHAPE* shape : subshapes )
505 return color.Saturate( 1.0 );
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.
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
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.
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...
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
static constexpr int VIEW_MAX_LAYERS
Rendering order modifier for layers that are marked as top layers.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
const SHAPE * Shape() const override
Return the geometrical shape of the item.
Base class for PNS router board items.
PnsKind Kind() const
Return the type (kind) of the item.
virtual const SHAPE * Shape() const
Return the geometrical shape of the item.
const LAYER_RANGE & Layers() const
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,...
const KIGFX::COLOR4D assignColor(int aStyle) const
ROUTER_PREVIEW_ITEM(const SHAPE &aShape, KIGFX::VIEW *aView=nullptr)
void Update(const PNS::ITEM *aItem)
const KIGFX::COLOR4D getLayerColor(int aLayer) const
static const int PathOverlayDepth
virtual void ViewDraw(int aLayer, KIGFX::VIEW *aView) const override
Draw the parts of the object belonging to layer aLayer.
static const int ClearanceOverlayDepth
static const int ViaOverlayDepth
static const int BaseOverlayDepth
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
EDA_ANGLE GetCentralAngle() const
EDA_ANGLE GetStartAngle() 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