65 if(
gvconfig()->m_Display.m_ForceOpacityMode )
201 if( aActualThickness == 0 )
204 return aActualThickness;
214 draw( gbrItem, aLayer );
229 bool isFilled =
true;
246 codeText.Printf( wxT(
"D%d" ), aItem->
m_DCode );
285 if( isNegative && !isFilled )
298 for(
auto& pt : pts )
361 if( startAngle > endAngle )
365 if( arcStart == arcEnd )
415 if( isNegative && !isFilled )
438 wxASSERT_MSG(
false, wxT(
"GERBER_DRAW_ITEM shape is unknown!" ) );
457 bool aFilled,
bool aShift )
472 if( !
gvconfig()->m_Display.m_DisplayPolygonsFill )
486 wxASSERT_MSG( code, wxT(
"drawFlashedShape: Item has no D_CODE!" ) );
499 int radius = code->
m_Size.
x >> 1;
521 codeStart.
x = aShapePos.
x - code->
m_Size.
x / 2;
522 codeStart.
y = aShapePos.
y - code->
m_Size.
y / 2;
592 wxASSERT_MSG(
false, wxT(
"Unknown Gerber flashed shape!" ) );
609 if( !
gvconfig()->m_Display.m_DisplayPolygonsFill )
constexpr EDA_IU_SCALE gerbIUScale
Support the "aperture macro" defined within standard RS274X.
SHAPE_POLY_SET * GetApertureMacroShape(const GERBER_DRAW_ITEM *aParent, const VECTOR2I &aShapePos)
Calculate the primitive shape for flashed items.
constexpr const Vec GetEnd() const
constexpr const Vec & GetOrigin() const
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
A gerber DCODE (also called Aperture) definition.
APERTURE_MACRO * GetMacro() const
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command).
int m_Num_Dcode
D code value ( >= 10 )
VECTOR2I m_Size
Horizontal and vertical dimensions.
APERTURE_T m_ApertType
Aperture type ( Line, rectangle, circle, oval poly, macro )
APERTURE_DEF_HOLETYPE m_DrillShape
shape of the hole (0 = no hole, round = 1, rect = 2).
void ConvertShapeToPolygon(const GERBER_DRAW_ITEM *aParent)
Convert a shape to an equivalent polygon.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
bool IsBrightened() const
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
double m_OpacityModeAlphaValue
the alpha channel (opacity) value in opacity forced mode
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
bool GetTextD_CodePrms(int &aSize, VECTOR2I &aPos, EDA_ANGLE &aOrientation)
Return the best size and orientation to display the D_Code on screen.
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
VECTOR2I GetABPosition(const VECTOR2I &aXYPosition) const
Return the image position of aPosition for this object.
SHAPE_POLY_SET m_ShapeAsPolygon
bool GetLayerPolarity() const
void ConvertSegmentToPolygon()
Convert a line to an equivalent polygon.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
GBR_BASIC_SHAPE_TYPE m_ShapeType
GERBER_FILE_IMAGE * m_GerberImageFile
SHAPE_POLY_SET m_AbsolutePolygon
virtual const BOX2I ViewBBox() const override
const GBR_NETLIST_METADATA & GetNetAttributes() const
bool m_ImageNegative
true = Negative image
GBR_DISPLAY_OPTIONS m_Display
A color representation with 4 components: red, green, blue, alpha.
COLOR4D Darkened(double aFactor) const
Return a color that is darker by a given factor, without modifying object.
static const COLOR4D WHITE
COLOR4D Brightened(double aFactor) const
Return a color that is brighter by a given factor, without modifying object.
static const COLOR4D BLACK
Abstract interface for drawing on a 2D-surface.
virtual void DrawPolygon(const std::deque< VECTOR2D > &aPointList)
Draw a polygon.
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a rectangle.
void SetVerticalJustify(const GR_TEXT_V_ALIGN_T aVerticalJustify)
void SetFontBold(const bool aBold)
void SetFontUnderlined(bool aUnderlined)
void SetHorizontalJustify(const GR_TEXT_H_ALIGN_T aHorizontalJustify)
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 bool IsOpenGlEngine()
Return true if the GAL engine is a OpenGL based type.
virtual void SetLineWidth(float aLineWidth)
Set the line width.
void SetTextMirrored(const bool aMirrored)
virtual void DrawPolyline(const std::deque< VECTOR2D > &aPointList)
Draw a polyline.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
virtual void DrawArcSegment(const VECTOR2D &aCenterPoint, double aRadius, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle, double aWidth, double aMaxError)
Draw an arc segment.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
void SetGlyphSize(const VECTOR2I aSize)
virtual void SetNegativeDrawMode(bool aSetting)
Set negative draw mode in the renderer.
void SetFontItalic(bool aItalic)
virtual void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
Draw a rounded segment.
virtual void BitmapText(const wxString &aText, const VECTOR2I &aPosition, const EDA_ANGLE &aAngle)
Draw a text using a bitmap font.
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.
GERBVIEW_PAINTER(GAL *aGal)
void drawPolygon(GERBER_DRAW_ITEM *aParent, const SHAPE_POLY_SET &aPolygon, bool aFilled, bool aShift=false)
Helper routine to draw a polygon.
virtual GERBVIEW_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
int getLineThickness(int aActualThickness) const
Get the thickness to draw for a line (e.g.
void draw(GERBER_DRAW_ITEM *aVia, int aLayer)
void drawApertureMacro(GERBER_DRAW_ITEM *aParent, bool aFilled)
Helper to draw an aperture macro shape.
GERBVIEW_RENDER_SETTINGS m_gerbviewSettings
void drawFlashedShape(GERBER_DRAW_ITEM *aItem, bool aFilled)
Helper to draw a flashed shape (aka spot)
wxString m_attributeHighlightString
If set to anything but an empty string, will highlight items with matching attribute.
void LoadColors(const COLOR_SETTINGS *aSettings) override
wxString m_componentHighlightString
If set to anything but an empty string, will highlight items with matching component.
void ClearHighlightSelections()
Clear all highlight selections (dcode, net, component, attribute selection)
int m_dcodeHighlightValue
If set to anything but >0 (in fact 10 the min dcode value), will highlight items with matching dcode.
static const double MAX_FONT_SIZE
Maximum font size for D-Codes and other strings.
GERBVIEW_RENDER_SETTINGS()
wxString m_netHighlightString
If set to anything but an empty string, will highlight items with matching net.
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...
bool GetShowPageLimits() const override
Contains all the knowledge about how to draw graphical object onto any particular output device.
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
COLOR4D m_backgroundColor
std::map< int, COLOR4D > m_layerColorsHi
virtual void update()
Precalculates extra colors for layers (e.g.
std::map< int, COLOR4D > m_hiContrastColor
std::map< int, COLOR4D > m_layerColorsDark
std::map< int, COLOR4D > m_layerColorsSel
std::set< int > m_highContrastLayers
std::map< int, COLOR4D > m_layerColors
bool m_hiContrastEnabled
Parameters for display modes.
An abstract base class for deriving all objects that can be added to a VIEW.
virtual SETTINGS_MANAGER & GetSettingsManager() const
T * GetAppSettings(const wxString &aFilename)
Returns a handle to the a given settings by type If the settings have already been loaded,...
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
int PointCount() const
Return the number of points (vertices) in this line chain.
const std::vector< VECTOR2I > & CPoints() const
Represent a set of closed polygons.
bool IsTriangulationUpToDate() const
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
virtual void CacheTriangulation(bool aPartition=true, bool aSimplify=false)
Build a polygon triangulation, needed to draw a polygon on OpenGL and in some other calculations.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
int NewOutline()
Creates a new empty polygon in the set and returns its index.
int OutlineCount() const
Return the number of outlines in the set.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
double Distance(const VECTOR2< extended_type > &aVector) const
Compute the distance between two vectors.
static constexpr EDA_ANGLE ANGLE_360
GERBVIEW_SETTINGS * gvconfig()
@ LAYER_GERBVIEW_DRAWINGSHEET
@ GERBVIEW_LAYER_ID_START
bool IsDCodeLayer(int aLayer)
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
#define GERBER_DRAWLAYERS_COUNT
The Cairo implementation of the graphics abstraction layer.
PGM_BASE & Pgm()
The global Program "get" accessor.
constexpr int mmToIU(double mm) const
bool show_negative_objects
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D