60 using namespace KIGFX;
121 const COLOR4D lightLabel( 0.8, 0.8, 0.8, 0.7 );
136 bool aShowPageLimits )
228 const EDA_ITEM* item = dynamic_cast<const EDA_ITEM*>( aItem );
231 int originalLayer = aLayer;
241 const PAD*
pad = dynamic_cast<const PAD*>( item );
242 const PCB_VIA*
via = dynamic_cast<const PCB_VIA*>( item );
243 int holeLayer = aLayer;
304 netColor = ii->second;
311 netColor = jj->second;
346 switch( originalLayer )
349 if( !static_cast<const PAD*>( item )->FlashLayer( primary ) )
357 if( static_cast<const PCB_VIA*>( item )->GetLayerSet().
test( primary ) == 0 )
363 if( !static_cast<const PCB_VIA*>( item )->FlashLayer( primary ) )
383 if( static_cast<const PCB_VIA*>( item )->GetLayerSet().
test( primary ) == 0 )
425 m_maxError( ARC_HIGH_DEF ),
426 m_holePlatingThickness( 0 )
436 if( aActualThickness == 0 )
439 return aActualThickness;
463 const BOARD_ITEM* item = dynamic_cast<const BOARD_ITEM*>( aItem );
481 switch( item->
Type() )
484 draw( static_cast<const PCB_TRACK*>( item ), aLayer );
488 draw( static_cast<const PCB_ARC*>( item ), aLayer );
492 draw( static_cast<const PCB_VIA*>( item ), aLayer );
496 draw( static_cast<const PAD*>( item ), aLayer );
501 draw( static_cast<const PCB_SHAPE*>( item ), aLayer );
505 draw( static_cast<const PCB_TEXT*>( item ), aLayer );
509 draw( static_cast<const FP_TEXT*>( item ), aLayer );
513 draw( static_cast<const FOOTPRINT*>( item ), aLayer );
517 draw( static_cast<const PCB_GROUP*>( item ), aLayer );
521 draw( static_cast<const ZONE*>( item ), aLayer );
525 draw( static_cast<const ZONE*>( item ), aLayer );
532 draw( static_cast<const PCB_DIMENSION_BASE*>( item ), aLayer );
536 draw( static_cast<const PCB_TARGET*>( item ) );
540 draw( static_cast<const PCB_MARKER*>( item ), aLayer );
575 const FOOTPRINT* fp = static_cast<const FOOTPRINT*>( item );
609 if( length < 10 * width )
613 double textSize = width;
614 double penWidth = width / 12.0;
615 VECTOR2D textPosition = start + line / 2.0;
616 double textOrientation;
618 if( end.y == start.y )
621 textPosition.
y += penWidth;
623 else if( end.x == start.x )
625 textOrientation = M_PI / 2;
626 textPosition.
x += penWidth;
630 textOrientation = -atan( line.
y / line.
x );
631 textPosition.
x += penWidth / 1.4;
632 textPosition.
y += penWidth / 1.4;
750 for(
int idx = 1; idx < arcSpine.PointCount(); idx++ )
794 tsize = std::min( tsize, size );
820 bool sketchMode =
false;
827 default: wxASSERT(
false );
break;
859 aVia->
LayerPair( &layerTop, &layerBottom );
861 double radius = aVia->
GetWidth() / 2.0;
866 m_gal->
DrawArc( center, radius, M_PI * -0.375, M_PI * 0.375 );
867 m_gal->
DrawArc( center, radius, M_PI * 0.625, M_PI * 1.375 );
874 m_gal->
DrawArc( center, radius, M_PI * 1.375, M_PI * 1.625 );
881 m_gal->
DrawArc( center, radius, M_PI * 0.375, M_PI * 0.625 );
927 if( pinType == wxT(
"no_connect" ) || pinType.EndsWith( wxT(
"+no_connect" ) ) )
928 netname = wxT(
"x" );
929 else if( pinType == wxT(
"free" ) )
930 netname = wxT(
"*" );
933 if( netname.IsEmpty() && padNumber.IsEmpty() )
943 double limit = std::min( aPad->
GetSize().x, aPad->
GetSize().y ) * 1.1;
945 if( padsize.
x > limit && padsize.
y > limit )
953 double size = padsize.
y;
959 if( padsize.
x < padsize.
y )
963 std::swap( padsize.
x, padsize.
y );
987 if( !netname.IsEmpty() && !padNumber.IsEmpty() )
990 textpos.
y = size / 1.7;
993 if( !netname.IsEmpty() )
997 tsize = std::min( tsize, size );
1008 if( !padNumber.IsEmpty() )
1010 textpos.
y = -textpos.
y;
1014 tsize = std::min( tsize, size );
1018 tsize = std::min( tsize, size );
1075 wxSize pad_size = aPad->
GetSize();
1091 margin.x = margin.y = 0;
1095 std::unique_ptr<PAD> dummyPad;
1096 std::shared_ptr<SHAPE_COMPOUND> shapes;
1112 if( pad_size.x + 2 * margin.x <= 0 || pad_size.y + 2 * margin.y <= 0 )
1115 dummyPad.reset( static_cast<PAD*>( aPad->
Duplicate() ) );
1116 int initial_radius = dummyPad->GetRoundRectCornerRadius();
1118 dummyPad->SetSize( pad_size + margin + margin );
1124 int radius_margin = std::max( margin.x, margin.y );
1125 dummyPad->SetRoundRectCornerRadius( std::max( initial_radius + radius_margin, 0 ) );
1128 shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( dummyPad->GetEffectiveShape() );
1129 margin.x = margin.y = 0;
1133 shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->
GetEffectiveShape() );
1140 simpleShapes =
false;
1143 for(
const SHAPE* shape : shapes->Shapes() )
1148 switch( shape->Type() )
1159 simpleShapes =
false;
1167 for(
const SHAPE* shape : shapes->Shapes() )
1169 switch( shape->Type() )
1174 int effectiveWidth = seg->
GetWidth() + 2 * margin.x;
1176 if( effectiveWidth > 0 )
1185 int effectiveRadius = circle->
GetRadius() + margin.x;
1187 if( effectiveRadius > 0 )
1199 if( effectiveMargin.
x < 0 )
1202 VECTOR2I effectiveSize =
r->GetSize() + effectiveMargin;
1204 if( effectiveSize.
x > 0 && effectiveSize.
y > 0 )
1207 else if( effectiveMargin.
x > 0 )
1215 effectiveMargin.
x * 2 );
1218 effectiveMargin.
x * 2 );
1221 effectiveMargin.
x * 2 );
1224 effectiveMargin.
x * 2 );
1236 const SHAPE_SIMPLE* poly = static_cast<const SHAPE_SIMPLE*>( shape );
1244 for(
int ii = 0; ii < poly->
PointCount(); ++ii )
1247 outline.
Deflate( -margin.x, numSegs );
1299 bool flashActiveLayer =
true;
1302 flashActiveLayer = aPad->
FlashLayer( activeLayer );
1313 if( flashActiveLayer && clearance > 0 )
1315 auto shape = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->
GetEffectiveShape() );
1317 if( shape && shape->Size() == 1 && shape->Shapes()[0]->Type() ==
SH_SEGMENT )
1323 else if( shape && shape->Size() == 1 && shape->Shapes()[0]->Type() ==
SH_CIRCLE )
1413 for(
const wxPoint& pt : pts )
1465 SHAPE_POLY_SET& shape = const_cast<PCB_SHAPE*>( aShape )->GetPolyShape();
1471 if( parentFootprint )
1513 if( parentFootprint )
1522 std::vector<VECTOR2D> output;
1523 std::vector<VECTOR2D> pointCtrl;
1525 pointCtrl.push_back( aShape->
GetStart() );
1528 pointCtrl.push_back( aShape->
GetEnd() );
1531 converter.
GetPoly( output, thickness );
1533 for(
unsigned ii = 0; ii + 1 < output.size(); ++ii )
1562 if( shownText.Length() == 0 )
1591 if( shownText.Length() == 0 )
1673 wxPoint width = wxPoint( bbox.
GetWidth(), 0 );
1674 wxPoint height = wxPoint( 0, bbox.
GetHeight() );
1677 m_gal->
DrawLine( topLeft + width, topLeft + width + height );
1678 m_gal->
DrawLine( topLeft + width + height, topLeft + height );
1683 if(
name.IsEmpty() )
1688 int unscaledSize = Mils2iu( ptSize );
1691 int textSize = ( scaledSize + ( unscaledSize * 2 ) ) / 3;
1692 int penWidth = textSize / 10;
1693 wxPoint textOffset = wxPoint( width.x / 2, -
KiROUND( textSize * 0.5 ) );
1694 wxPoint titleHeight = wxPoint( 0,
KiROUND( textSize * 2.0 ) );
1699 m_gal->
DrawLine( topLeft - titleHeight, topLeft + width - titleHeight );
1700 m_gal->
DrawLine( topLeft + width - titleHeight, topLeft + width );
1732 std::deque<VECTOR2D> corners;
1757 int holes_count = outline->
HoleCount( 0 );
1759 for(
int ii = 0; ii < holes_count; ++ii )
1778 int outline_thickness = 0;
1824 for(
const std::shared_ptr<SHAPE>& shape : aDimension->
GetShapes() )
1826 switch( shape->Type() )
1830 const SEG& seg = static_cast<const SHAPE_SEGMENT*>( shape.get() )->GetSeg();
1837 int radius = static_cast<const SHAPE_CIRCLE*>( shape.get() )->GetRadius();
1871 double size, radius;
1885 size = 2.0 * aTarget->
GetSize() / 3.0;
1886 radius = aTarget->
GetSize() / 2.0;
1891 size = aTarget->
GetSize() / 2.0;
1892 radius = aTarget->
GetSize() / 3.0;
1909 if( isShadow && aMarker->
GetBoard()
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
virtual const SEG GetSegment(int aIndex) const override
virtual void DrawPolyline(const std::deque< VECTOR2D > &aPointList)
Draw a polyline.
virtual wxPoint GetCenter() const override
This defaults to the center of the bounding box if not overridden.
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a rectangle.
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
virtual void LoadColors(const COLOR_SETTINGS *aSettings) override
class PCB_DIM_LEADER, a leader dimension (graphic item)
const VECTOR2I & CPoint(int aIndex) const
Return a const reference to a given point in the polygon.
int OutlineCount() const
Return the number of vertices in a given outline/hole.
class FP_TEXT, text in a footprint
COLOR4D Inverted() const
Returns an inverted color, alpha remains the same.
The Cairo implementation of the graphics abstraction layer.
COLOR4D & Brighten(double aFactor)
Makes the color brighter by a given factor.
bool FlashLayer(int aLayer) const
Checks to see whether the via should have a pad on the specific layer.
const wxPoint & GetEnd() const
const MATRIX3x3D & GetScreenWorldMatrix() const
Get the screen <-> world transformation matrix.
virtual void BitmapText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a text using a bitmap font.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
double m_zoneOpacity
Opacity override for filled zones.
COLOR4D m_layerColorsHi[LAYER_ID_COUNT]
const wxPoint & GetStart() const
Return the starting point of the graphic.
COLOR4D m_layerColors[LAYER_ID_COUNT]
class PCB_GROUP, a set of BOARD_ITEMs
VIATYPE GetViaType() const
double m_TrackOpacity
Opacity override for all tracks.
A set of BOARD_ITEMs (i.e., without duplicates).
void GetPoly(std::vector< wxPoint > &aOutput, int aMinSegLen=0)
Convert a Bezier curve to a polygon.
bool IsFlippedX() const
Return true if flip flag for the X axis is set.
virtual void SetTextAttributes(const EDA_TEXT *aText)
Loads attributes of the given text (bold/italic/underline/mirrored and so on).
int GetHolePlatingThickness() const
Pad & via drills are finish size.
class PCB_DIM_CENTER, a center point marking (graphic item)
virtual void DrawArc(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle)
Draw an arc.
bool m_sketchMode[GAL_LAYER_ID_END]
SHAPE_POLY_SET * Outline()
int m_DisplayNetNamesMode
double m_ViaOpacity
Opacity override for all types of via.
Additional netnames layers (not associated with a PCB layer)
void SetFontBold(bool aBold)
Set bold property of current font.
Net/netclass colors are shown on all net copper.
Net/netclass colors are shown on ratsnest lines only.
int m_holePlatingThickness
class PCB_TEXT, text on a layer
anchor of items having an anchor point (texts, footprints)
void CalcArcAngles(double &aStartAngle, double &aEndAngle) const
Calc arc start and end angles such that aStartAngle < aEndAngle.
class PCB_ARC, an arc track segment on a copper layer
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
const std::vector< std::shared_ptr< SHAPE > > & GetShapes() const
const SHAPE_SEGMENT * GetEffectiveHoleShape() const
Return a SHAPE object representing the pad's hole.
wxString GetNetname() const
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
bool IsBrightened() const
class FP_SHAPE, a footprint edge
class PAD, a pad in a footprint
const SHAPE_POLY_SET & GetFilledPolysList(PCB_LAYER_ID aLayer) const
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
const VECTOR2I GetCenter() const
PCB_RENDER_SETTINGS m_pcbSettings
const EDA_RECT GetBoundingBox() const override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
virtual wxPoint GetPosition() const
An abstract base class for deriving all objects that can be added to a VIEW.
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
to draw via holes (pad holes do not use this layer)
bool IsTriangulationUpToDate() const
virtual wxString GetNetClassName() const
Returns the netclass of the zone.
std::set< unsigned int > m_highContrastLayers
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
const SEG & GetSeg() const
class PCB_TRACK, a track segment (segment on a copper layer)
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void Rotate(double aAngle)
Rotate the context.
Ratsnest lines are drawn to items on all layers (default)
TRACE_CLEARANCE_DISPLAY_MODE_T m_ShowTrackClearanceMode
How trace clearances are displayed.
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
virtual VECTOR2D getDrillSize(const PAD *aPad) const
Return drill size for a pad (internal units).
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
to draw usual through hole vias
std::map< wxString, KIGFX::COLOR4D > m_netclassColors
Overrides for specific net colors, stored as netcodes for the ratsnest to access easily.
wxPoint GetPosition() const override
NET_COLOR_MODE m_netColorMode
Overrides for specific netclass colors.
const wxPoint & GetBezierC1() const
std::vector< wxPoint > GetRectCorners() const
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
const wxPoint GetEnd() const
bool IsNetCopperLayer(LAYER_NUM aLayer)
Checks if the given layer is "net copper", meaning it is eligible for net coloring.
RATSNEST_MODE m_RatsnestMode
Ratsnest draw mode (all layers vs only visible layers)
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
const wxSize & GetDrillSize() const
Container for display options like enable/disable some optional drawings.
bool IsHoleLayer(LAYER_NUM aLayer)
Contains all the knowledge about how to draw graphical object onto any particular output device.
const wxPoint & GetEnd() const
Return the ending point of the graphic.
bool FlashLayer(int aLayer) const
Check to see whether the pad should be flashed on the specific layer.
int getLineThickness(int aActualThickness) const
Get the thickness to draw for a line (e.g.
handle color for not plated holes (holes, not pads)
double GetDrawRotationRadians() const
bool GetDrawIndividualViaLayers() const
COLOR4D m_layerColorsDark[LAYER_ID_COUNT]
int GetMinThickness() const
virtual void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
Draw a rounded segment.
void ResetTextAttributes()
Reset text attributes to default styling.
const std::vector< SEG > & GetHatchLines() const
wxString GetShortNetname() const
VECTOR2< double > VECTOR2D
static const double MAX_FONT_SIZE
< Maximum font size for netnames (and other dynamically shown strings)
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
bool m_hiContrastEnabled
Parameters for display modes.
virtual void update()
Precalculates extra colors for layers (e.g.
double GetArcAngleStart() const
int PrintableCharCount(const wxString &aString)
Return the number of printable (ie: non-formatting) chars.
Represent a set of closed polygons.
static const COLOR4D CLEAR
SHAPE_LINE_CHAIN & Outline(int aIndex)
const wxPoint GetOrigin() const
virtual void StrokeText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a vector type text using preloaded Newstroke font.
const wxPoint GetPosition() const
void SetBackgroundColor(const COLOR4D &aColor) override
Set the background color.
const wxSize & GetSize() const
wxPoint GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Inactive layers are shown normally (no high-contrast mode)
const wxPoint & GetBezierC2() const
void Deflate(int aAmount, int aCircleSegmentsCount, CORNER_STRATEGY aCornerStrategy=ROUND_ALL_CORNERS)
const EDA_RECT GetBoundingBox() const override
The bounding box is cached, so this will be efficient most of the time.
const wxString & GetNumber() const
Virtual layers for stacking zones and tracks on a given copper layer.
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...
RATSNEST_MODE m_ratsnestDisplayMode
const wxString & GetPinType() const
PAD_SHAPE GetShape() const
const SHAPE_LINE_CHAIN & Vertices() const
Return the list of vertices defining this simple polygon.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
double GetZoomFactor() const
Get the zoom factor.
virtual bool IsOpenGlEngine()
Return true if the GAL engine is a OpenGL based type.
a few functions useful in geometry calculations.
Handle a list of polygons defining a copper zone.
class ZONE, a copper pour area
An abstract shape on 2D plane.
bool m_DisplayPcbTrackFill
double m_viaOpacity
Opacity override for all types of via.
bool m_DisplayGraphicsFill
void SetVerticalJustify(const EDA_TEXT_VJUSTIFY_T aVerticalJustify)
Set the vertical justify for text drawing.
void SetFontItalic(bool aItalic)
Set italic property of current font.
GAL_LAYER_ID GetColorLayer() const
int NewOutline()
Creates a new hole in a given outline.
int HoleCount(int aOutline) const
Return the reference to aIndex-th outline in the set.
int SegmentCount() const
Return the number of segments in this line chain.
bool m_curvedRatsnestlines
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
wxString UnescapeString(const wxString &aSource)
double m_ZoneOpacity
Opacity override for filled zone areas.
void SetGlyphSize(const VECTOR2D &aSize)
Set the font glyph size.
bool m_ShowGlobalRatsnest
class PCB_TARGET, a target (graphic item)
int m_clearanceDisplayFlags
How to display nets and netclasses with color overrides.
class FOOTPRINT, a footprint
show a marker on pads with no nets
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
int GetSolderMaskMargin() const
void ShapeToPolygon(SHAPE_LINE_CHAIN &aPolygon, int aScale=-1) const
Return the shape polygon in internal units in a SHAPE_LINE_CHAIN the coordinates are relatives to the...
virtual size_t GetSegmentCount() const override
double GetTextAngleRadians() const
void SetTextMirrored(bool aMirrored)
Set a mirrored property of text.
static LSET PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
int MarkerScale() const
The scaling factor to convert polygonal shape coordinates to internal units.
COLOR4D GetColor(int aLayer) const
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aMaxError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
Bezier curves to polygon converter.
SEG Segment(int aIndex)
Return a copy of the aIndex-th segment in the line chain.
double m_trackOpacity
Opacity override for all tracks.
COLOR4D m_backgroundColor
double m_PadOpacity
Opacity override for SMD pads and PTHs.
class PCB_MARKER, a marker used to show something
virtual void Restore()
Restore the context.
std::map< int, KIGFX::COLOR4D > m_netColors
Set of net codes that should not have their ratsnest displayed.
virtual void DrawPolygon(const std::deque< VECTOR2D > &aPointList)
Draw a polygon.
void SetFontUnderlined(bool aUnderlined)
multilayer pads, usually with holes
to draw blind/buried vias
wxSize GetSolderPasteMargin() const
Usually < 0 (mask shape smaller than pad)because the margin can be dependent on the pad size,...
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
FOOTPRINT * GetParentFootprint() const
Return the parent footprint or NULL if PCB_SHAPE does not belong to a footprint.
double DEG2RAD(double deg)
PAD_DRILL_SHAPE_T GetDrillShape() const
Information pertinent to a Pcbnew printed circuit board.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
PCB_LAYER_ID
A quick note on layer IDs:
COLOR4D & Darken(double aFactor)
Makes the color darker by a given factor.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
void LoadDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions, bool aShowPageLimits)
Load settings related to display options (high-contrast mode, full or outline modes for vias/pads/tra...
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
virtual 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...
class ZONE, managed by a footprint
int PointCount() const
Return the number of points (vertices) in this polygon.
Handle the component boundary box.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
double DECIDEG2RAD(double deg)
ZONE_DISPLAY_MODE m_ZoneDisplayMode
HIGH_CONTRAST_MODE m_contrastModeDisplay
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
A base class for most all the KiCad significant classes used in schematics and boards.
PCB_LAYER_ID GetActiveLayer() const
virtual bool Draw(const VIEW_ITEM *aItem, int aLayer) override
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Return an item's "own" clearance in internal units.
Color settings are a bit different than most of the settings objects in that there can be more than o...
double m_padOpacity
Opacity override for SMD pads and PTHs.
const wxPoint & GetTextPos() const
void TransformArcToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aStart, const wxPoint &aMid, const wxPoint &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc)
Convert arc to multiple straight segments.
to draw pad holes (plated)
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
void CacheTriangulation(bool aPartition=true)
Build a polygon triangulation, needed to draw a polygon on OpenGL and in some other calculations.
bool IsZoneLayer(LAYER_NUM aLayer)
class PCB_VIA, a via (like a track segment on a copper layer)
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
Inactive layers are hidden.
PCB_LAYER_ID GetPrimaryHighContrastLayer() const
Return the board layer which is in high-contrast mode.
virtual void Save()
Save the context.
void SetHorizontalJustify(const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
Set the horizontal justify for text drawing.
virtual const EDA_RECT GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
virtual int getDrillShape(const PAD *aPad) const
Return drill shape of a pad.
bool m_DisplayRatsnestLinesCurved
double GetWorldScale() const
Get the world scale.
BOARD_ITEM_CONTAINER * GetParent() const
virtual void Translate(const VECTOR2D &aTranslation)
Translate the context.
virtual void DrawCurve(const VECTOR2D &startPoint, const VECTOR2D &controlPointA, const VECTOR2D &controlPointB, const VECTOR2D &endPoint, double aFilterValue=0.0)
Draw a cubic bezier spline.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
virtual wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
class PCB_SHAPE, a segment not on copper layers
wxPoint GetPosition() const override
static constexpr int Millimeter2iu(double mm)
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
static const int UNCONNECTED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
std::set< int > m_highlightNetcodes
Definition of PCB_DISPLAY_OPTIONS class.
const wxPoint & GetMid() const
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
ZONE_DISPLAY_MODE m_zoneDisplayMode
PCB_LAYER_ID ToLAYER_ID(int aLayer)
int GetLineThickness() const
void draw(const PCB_TRACK *aTrack, int aLayer)
bool m_DisplayPadClearance
virtual void DrawArcSegment(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth, double aMaxError)
Draw an arc segment.
const wxPoint & GetStart() const
COLOR4D m_layerColorsSel[LAYER_ID_COUNT]
const wxSize GetSize() const
virtual BOARD_ITEM * Duplicate() const
Create a copy of this BOARD_ITEM.
NET_COLOR_MODE m_NetColorMode
How to use color overrides on specific nets and netclasses.
KICAD_T Type() const
Returns the type of object.
Abstract interface for drawing on a 2D-surface.
bool GetFilledPolysUseThickness() const
bool m_globalRatsnestlines
Container for design settings for a BOARD object.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Add a new vertex to the contour indexed by aOutline and aHole (defaults to the outline of the last po...
A color representation with 4 components: red, green, blue, alpha.