KiCad PCB EDA Suite
KIGFX::PCB_PRINT_PAINTER Class Reference

Special flavor of PCB_PAINTER that contains modifications to handle printing options. More...

#include <pcbnew_printout.h>

Inheritance diagram for KIGFX::PCB_PRINT_PAINTER:
KIGFX::PCB_PAINTER KIGFX::PAINTER

Public Member Functions

 PCB_PRINT_PAINTER (GAL *aGal)
 
void SetDrillMarks (bool aRealSize, unsigned int aSize=0)
 Set drill marks visibility and options. More...
 
virtual PCB_RENDER_SETTINGSGetSettings () override
 Return a pointer to current settings that are going to be used when drawing items. More...
 
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. More...
 
void SetGAL (GAL *aGal)
 Changes Graphics Abstraction Layer used for drawing items for a new one. More...
 

Protected Member Functions

int getDrillShape (const PAD *aPad) const override
 Return drill shape of a pad. More...
 
VECTOR2D getDrillSize (const PAD *aPad) const override
 Return drill size for a pad (internal units). More...
 
int getDrillSize (const PCB_VIA *aVia) const override
 Flag deciding whether use the actual hole size or user-specified size for drill marks. More...
 
void draw (const PCB_TRACK *aTrack, int aLayer)
 
void draw (const PCB_ARC *aArc, int aLayer)
 
void draw (const PCB_VIA *aVia, int aLayer)
 
void draw (const PAD *aPad, int aLayer)
 
void draw (const PCB_SHAPE *aSegment, int aLayer)
 
void draw (const PCB_TEXT *aText, int aLayer)
 
void draw (const FP_TEXT *aText, int aLayer)
 
void draw (const FOOTPRINT *aFootprint, int aLayer)
 
void draw (const PCB_GROUP *aGroup, int aLayer)
 
void draw (const ZONE *aZone, int aLayer)
 
void draw (const PCB_DIMENSION_BASE *aDimension, int aLayer)
 
void draw (const PCB_TARGET *aTarget)
 
void draw (const PCB_MARKER *aMarker, int aLayer)
 
int getLineThickness (int aActualThickness) const
 Get the thickness to draw for a line (e.g. More...
 

Protected Attributes

bool m_drillMarkReal
 User-specified size for drill marks (expressed in internal units) More...
 
int m_drillMarkSize
 
PCB_RENDER_SETTINGS m_pcbSettings
 
GALm_gal
 Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg. More...
 

Detailed Description

Special flavor of PCB_PAINTER that contains modifications to handle printing options.

Definition at line 85 of file pcbnew_printout.h.

Constructor & Destructor Documentation

◆ PCB_PRINT_PAINTER()

KIGFX::PCB_PRINT_PAINTER::PCB_PRINT_PAINTER ( GAL aGal)

Definition at line 289 of file pcbnew_printout.cpp.

289  :
290  PCB_PAINTER( aGal ),
291  m_drillMarkReal( false ),
292  m_drillMarkSize( 0 )
293 {
295 }
void EnableZoneOutlines(bool aEnabled)
Turn on/off drawing outline and hatched lines for zones.
Definition: pcb_painter.h:136
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
bool m_drillMarkReal
User-specified size for drill marks (expressed in internal units)
PCB_PAINTER(GAL *aGal)

References KIGFX::PCB_RENDER_SETTINGS::EnableZoneOutlines(), and KIGFX::PCB_PAINTER::m_pcbSettings.

Member Function Documentation

◆ Draw()

bool PCB_PAINTER::Draw ( const VIEW_ITEM aItem,
int  aLayer 
)
overridevirtualinherited

Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.

Parameters
aItemis an item to be drawn.
aLayertells which layer is currently rendered so that draw functions may know what to draw (eg. for pads there are separate layers for holes, because they have other dimensions then the pad itself.

Implements KIGFX::PAINTER.

Definition at line 454 of file pcb_painter.cpp.

455 {
456  const EDA_ITEM* item = dynamic_cast<const EDA_ITEM*>( aItem );
457 
458  if( !item )
459  return false;
460 
461  if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
462  {
463  // Show bounding boxes of painted objects for debugging.
464  EDA_RECT box = item->GetBoundingBox();
465  m_gal->SetIsFill( false );
466  m_gal->SetIsStroke( true );
467  m_gal->SetStrokeColor( item->IsSelected() ? COLOR4D( 1.0, 0.2, 0.2, 1 ) :
468  COLOR4D( 0.2, 0.2, 0.2, 1 ) );
469  m_gal->SetLineWidth( Mils2iu( 3 ) );
470  m_gal->DrawRectangle( box.GetOrigin(), box.GetEnd() );
471  }
472 
473  // the "cast" applied in here clarifies which overloaded draw() is called
474  switch( item->Type() )
475  {
476  case PCB_TRACE_T:
477  draw( static_cast<const PCB_TRACK*>( item ), aLayer );
478  break;
479 
480  case PCB_ARC_T:
481  draw( static_cast<const PCB_ARC*>( item ), aLayer );
482  break;
483 
484  case PCB_VIA_T:
485  draw( static_cast<const PCB_VIA*>( item ), aLayer );
486  break;
487 
488  case PCB_PAD_T:
489  draw( static_cast<const PAD*>( item ), aLayer );
490  break;
491 
492  case PCB_SHAPE_T:
493  case PCB_FP_SHAPE_T:
494  draw( static_cast<const PCB_SHAPE*>( item ), aLayer );
495  break;
496 
497  case PCB_TEXT_T:
498  draw( static_cast<const PCB_TEXT*>( item ), aLayer );
499  break;
500 
501  case PCB_FP_TEXT_T:
502  draw( static_cast<const FP_TEXT*>( item ), aLayer );
503  break;
504 
505  case PCB_FOOTPRINT_T:
506  draw( static_cast<const FOOTPRINT*>( item ), aLayer );
507  break;
508 
509  case PCB_GROUP_T:
510  draw( static_cast<const PCB_GROUP*>( item ), aLayer );
511  break;
512 
513  case PCB_ZONE_T:
514  draw( static_cast<const ZONE*>( item ), aLayer );
515  break;
516 
517  case PCB_FP_ZONE_T:
518  draw( static_cast<const ZONE*>( item ), aLayer );
519  break;
520 
521  case PCB_DIM_ALIGNED_T:
522  case PCB_DIM_CENTER_T:
524  case PCB_DIM_LEADER_T:
525  draw( static_cast<const PCB_DIMENSION_BASE*>( item ), aLayer );
526  break;
527 
528  case PCB_TARGET_T:
529  draw( static_cast<const PCB_TARGET*>( item ) );
530  break;
531 
532  case PCB_MARKER_T:
533  draw( static_cast<const PCB_MARKER*>( item ), aLayer );
534  break;
535 
536  default:
537  // Painter does not know how to draw the object
538  return false;
539  }
540 
541  return true;
542 }
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a rectangle.
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:100
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
class FP_TEXT, text in a footprint
Definition: typeinfo.h:92
bool IsSelected() const
Definition: eda_item.h:123
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:108
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:102
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
class PAD, a pad in a footprint
Definition: typeinfo.h:89
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
virtual void SetLineWidth(float aLineWidth)
Set the line width.
const wxPoint GetEnd() const
Definition: eda_rect.h:103
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
const wxPoint GetOrigin() const
Definition: eda_rect.h:101
class ZONE, a copper pour area
Definition: typeinfo.h:105
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:104
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
class PCB_MARKER, a marker used to show something
Definition: typeinfo.h:98
class ZONE, managed by a footprint
Definition: typeinfo.h:94
Handle the component boundary box.
Definition: eda_rect.h:42
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:103
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
virtual const EDA_RECT GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:75
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:90
void draw(const PCB_TRACK *aTrack, int aLayer)
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References KIGFX::PCB_PAINTER::draw(), KIGFX::GAL::DrawRectangle(), EDA_ITEM::GetBoundingBox(), ADVANCED_CFG::GetCfg(), EDA_RECT::GetEnd(), EDA_RECT::GetOrigin(), EDA_ITEM::IsSelected(), KIGFX::PAINTER::m_gal, PCB_ARC_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_FOOTPRINT_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_T, PCB_FP_ZONE_T, PCB_GROUP_T, PCB_MARKER_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), and EDA_ITEM::Type().

◆ draw() [1/13]

void PCB_PAINTER::draw ( const PCB_TRACK aTrack,
int  aLayer 
)
protectedinherited

Definition at line 545 of file pcb_painter.cpp.

546 {
547  VECTOR2D start( aTrack->GetStart() );
548  VECTOR2D end( aTrack->GetEnd() );
549  int width = aTrack->GetWidth();
550  COLOR4D color = m_pcbSettings.GetColor( aTrack, aLayer );
551 
552  if( IsNetnameLayer( aLayer ) )
553  {
555  return;
556 
557  if( aTrack->GetNetCode() <= NETINFO_LIST::UNCONNECTED )
558  return;
559 
560  VECTOR2D line = ( end - start );
561  double length = line.EuclideanNorm();
562 
563  // Check if the track is long enough to have a netname displayed
564  if( length < 10 * width )
565  return;
566 
567  const wxString& netName = UnescapeString( aTrack->GetShortNetname() );
568  double textSize = width;
569  double penWidth = width / 12.0;
570  VECTOR2D textPosition = start + line / 2.0; // center of the track
571  double textOrientation;
572 
573  if( end.y == start.y ) // horizontal
574  {
575  textOrientation = 0;
576  textPosition.y += penWidth;
577  }
578  else if( end.x == start.x ) // vertical
579  {
580  textOrientation = M_PI / 2;
581  textPosition.x += penWidth;
582  }
583  else
584  {
585  textOrientation = -atan( line.y / line.x );
586  textPosition.x += penWidth / 1.4;
587  textPosition.y += penWidth / 1.4;
588  }
589 
590 
591  m_gal->SetIsStroke( true );
592  m_gal->SetIsFill( false );
594  m_gal->SetLineWidth( penWidth );
595  m_gal->SetFontBold( false );
596  m_gal->SetFontItalic( false );
597  m_gal->SetFontUnderlined( false );
598  m_gal->SetTextMirrored( false );
599  m_gal->SetGlyphSize( VECTOR2D( textSize * 0.55, textSize * 0.55 ) );
602  m_gal->BitmapText( netName, textPosition, textOrientation );
603 
604  return;
605  }
606  else if( IsCopperLayer( aLayer ) )
607  {
608  // Draw a regular track
609  bool outline_mode = m_pcbSettings.m_sketchMode[LAYER_TRACKS];
612  m_gal->SetIsStroke( outline_mode );
613  m_gal->SetIsFill( not outline_mode );
615 
616  m_gal->DrawSegment( start, end, width );
617  }
618 
619  // Clearance lines
620  constexpr int clearanceFlags = PCB_RENDER_SETTINGS::CL_EXISTING
622 
623  if( ( m_pcbSettings.m_clearanceDisplayFlags & clearanceFlags ) == clearanceFlags )
624  {
625  int clearance = aTrack->GetOwnClearance( m_pcbSettings.GetActiveLayer() );
626 
628  m_gal->SetIsFill( false );
629  m_gal->SetIsStroke( true );
631  m_gal->DrawSegment( start, end, width + clearance * 2 );
632  }
633 }
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
const wxPoint & GetEnd() const
Definition: pcb_track.h:105
virtual void BitmapText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a text using a bitmap font.
bool m_sketchMode[GAL_LAYER_ID_END]
Definition: pcb_painter.h:196
int color
Definition: DXF_plotter.cpp:60
Define a general 2D-vector/point.
Definition: vector2d.h:61
void SetFontBold(bool aBold)
Set bold property of current font.
int GetWidth() const
Definition: pcb_track.h:102
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
Draw a rounded segment.
wxString GetShortNetname() const
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
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.
void SetGlyphSize(const VECTOR2D &aSize)
Set the font glyph size.
int m_clearanceDisplayFlags
How to display nets and netclasses with color overrides.
Definition: pcb_painter.h:216
void SetTextMirrored(bool aMirrored)
Set a mirrored property of text.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
void SetFontUnderlined(bool aUnderlined)
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:214
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...
PCB_LAYER_ID GetActiveLayer() const
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Return an item's "own" clearance in internal units.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
Definition: vector2d.h:293
void SetHorizontalJustify(const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
Set the horizontal justify for text drawing.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
static const int UNCONNECTED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
Definition: netinfo.h:365
const wxPoint & GetStart() const
Definition: pcb_track.h:108
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References KIGFX::GAL::BitmapText(), KIGFX::PCB_RENDER_SETTINGS::CL_EXISTING, KIGFX::PCB_RENDER_SETTINGS::CL_TRACKS, color, KIGFX::GAL::DrawSegment(), VECTOR2< T >::EuclideanNorm(), KIGFX::RENDER_SETTINGS::GetActiveLayer(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), PCB_TRACK::GetEnd(), BOARD_CONNECTED_ITEM::GetNetCode(), BOARD_CONNECTED_ITEM::GetOwnClearance(), BOARD_CONNECTED_ITEM::GetShortNetname(), PCB_TRACK::GetStart(), PCB_TRACK::GetWidth(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, IsCopperLayer(), IsNetnameLayer(), LAYER_TRACKS, KIGFX::PCB_RENDER_SETTINGS::m_clearanceDisplayFlags, KIGFX::PAINTER::m_gal, KIGFX::PCB_RENDER_SETTINGS::m_netNamesOnTracks, KIGFX::RENDER_SETTINGS::m_outlineWidth, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::PCB_RENDER_SETTINGS::m_sketchMode, KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetFontBold(), KIGFX::GAL::SetFontItalic(), KIGFX::GAL::SetFontUnderlined(), KIGFX::GAL::SetGlyphSize(), KIGFX::GAL::SetHorizontalJustify(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), KIGFX::GAL::SetTextMirrored(), KIGFX::GAL::SetVerticalJustify(), NETINFO_LIST::UNCONNECTED, UnescapeString(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by KIGFX::PCB_PAINTER::Draw().

◆ draw() [2/13]

void PCB_PAINTER::draw ( const PCB_ARC aArc,
int  aLayer 
)
protectedinherited

Definition at line 636 of file pcb_painter.cpp.

637 {
638  VECTOR2D center( aArc->GetCenter() );
639  int width = aArc->GetWidth();
640  COLOR4D color = m_pcbSettings.GetColor( aArc, aLayer );
641  double radius = aArc->GetRadius();
642  double start_angle = DECIDEG2RAD( aArc->GetArcAngleStart() );
643  double angle = DECIDEG2RAD( aArc->GetAngle() );
644 
645  if( IsNetnameLayer( aLayer ) )
646  {
647  // Ummm, yeah. Anyone fancy implementing text on a path?
648  return;
649  }
650  else if( IsCopperLayer( aLayer ) )
651  {
652  // Draw a regular track
653  bool outline_mode = m_pcbSettings.m_sketchMode[LAYER_TRACKS];
656  m_gal->SetIsStroke( outline_mode );
657  m_gal->SetIsFill( not outline_mode );
659 
660  m_gal->DrawArcSegment( center, radius, start_angle, start_angle + angle, width );
661  }
662 
663  // Clearance lines
664  constexpr int clearanceFlags = PCB_RENDER_SETTINGS::CL_EXISTING
666 
667  if( ( m_pcbSettings.m_clearanceDisplayFlags & clearanceFlags ) == clearanceFlags )
668  {
669  int clearance = aArc->GetOwnClearance( m_pcbSettings.GetActiveLayer() );
670 
672  m_gal->SetIsFill( false );
673  m_gal->SetIsStroke( true );
675 
676  m_gal->DrawArcSegment( center, radius, start_angle, start_angle + angle,
677  width + clearance * 2 );
678  }
679 }
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
virtual wxPoint GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition: pcb_track.h:282
bool m_sketchMode[GAL_LAYER_ID_END]
Definition: pcb_painter.h:196
int color
Definition: DXF_plotter.cpp:60
Define a general 2D-vector/point.
Definition: vector2d.h:61
int GetWidth() const
Definition: pcb_track.h:102
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
double GetArcAngleStart() const
Definition: pcb_track.cpp:988
double GetRadius() const
Definition: pcb_track.cpp:970
int m_clearanceDisplayFlags
How to display nets and netclasses with color overrides.
Definition: pcb_painter.h:216
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
double GetAngle() const
Definition: pcb_track.cpp:976
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...
double DECIDEG2RAD(double deg)
Definition: trigo.h:235
PCB_LAYER_ID GetActiveLayer() const
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Return an item's "own" clearance in internal units.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
virtual void DrawArcSegment(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth)
Draw an arc segment.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References PNS::angle(), KIGFX::PCB_RENDER_SETTINGS::CL_EXISTING, KIGFX::PCB_RENDER_SETTINGS::CL_TRACKS, color, DECIDEG2RAD(), KIGFX::GAL::DrawArcSegment(), KIGFX::RENDER_SETTINGS::GetActiveLayer(), PCB_ARC::GetAngle(), PCB_ARC::GetArcAngleStart(), PCB_ARC::GetCenter(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), BOARD_CONNECTED_ITEM::GetOwnClearance(), PCB_ARC::GetRadius(), PCB_TRACK::GetWidth(), IsCopperLayer(), IsNetnameLayer(), LAYER_TRACKS, KIGFX::PCB_RENDER_SETTINGS::m_clearanceDisplayFlags, KIGFX::PAINTER::m_gal, KIGFX::RENDER_SETTINGS::m_outlineWidth, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::PCB_RENDER_SETTINGS::m_sketchMode, KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), and KIGFX::GAL::SetStrokeColor().

◆ draw() [3/13]

void PCB_PAINTER::draw ( const PCB_VIA aVia,
int  aLayer 
)
protectedinherited

Definition at line 682 of file pcb_painter.cpp.

683 {
684  BOARD* board = aVia->GetBoard();
686  COLOR4D color = m_pcbSettings.GetColor( aVia, aLayer );
687  VECTOR2D center( aVia->GetStart() );
688 
689  if( color == COLOR4D::CLEAR )
690  return;
691 
692  // Draw description layer
693  if( IsNetnameLayer( aLayer ) )
694  {
695  VECTOR2D position( center );
696 
697  // Is anything that we can display enabled?
698  if( !m_pcbSettings.m_netNamesOnVias || aVia->GetNetname().empty() )
699  return;
700 
701  double maxSize = PCB_RENDER_SETTINGS::MAX_FONT_SIZE;
702  double size = aVia->GetWidth();
703 
704  // Font size limits
705  if( size > maxSize )
706  size = maxSize;
707 
708  m_gal->Save();
709  m_gal->Translate( position );
710 
711  // Default font settings
714 
715  // Set the text position to the pad shape position (the pad position is not the best place)
716  VECTOR2D textpos( 0.0, 0.0 );
717 
718  wxString netname = UnescapeString( aVia->GetShortNetname() );
719  // calculate the size of net name text:
720  double tsize = 1.5 * size / netname.Length();
721  tsize = std::min( tsize, size );
722  // Use a smaller text size to handle interline, pen size..
723  tsize *= 0.7;
724  VECTOR2D namesize( tsize, tsize );
725 
726  m_gal->SetGlyphSize( namesize );
727  m_gal->SetLineWidth( namesize.x / 12.0 );
728  m_gal->BitmapText( netname, textpos, 0.0 );
729 
730  m_gal->Restore();
731 
732  return;
733  }
734  else if( aLayer == LAYER_VIA_HOLEWALLS )
735  {
736  int platingThickness = bds.GetHolePlatingThickness();
737 
738  m_gal->SetIsFill( false );
739  m_gal->SetIsStroke( true );
741  m_gal->SetLineWidth( platingThickness );
742 
743  m_gal->DrawCircle( center, ( getDrillSize( aVia ) + platingThickness ) / 2.0 );
744 
745  return;
746  }
747 
748  bool sketchMode = false;
749 
750  switch( aVia->GetViaType() )
751  {
755  default: wxASSERT( false ); break;
756  }
757 
758  if( sketchMode )
759  {
760  // Outline mode
761  m_gal->SetIsStroke( true );
762  m_gal->SetIsFill( false );
765  }
766  else
767  {
768  // Filled mode
769  m_gal->SetIsFill( true );
770  m_gal->SetIsStroke( false );
772  }
773 
774  if( aLayer == LAYER_VIA_HOLES )
775  {
776  m_gal->DrawCircle( center, getDrillSize( aVia ) / 2.0 );
777  }
779  {
780  m_gal->DrawCircle( center, aVia->GetWidth() / 2.0 );
781  }
782  else if( aLayer == LAYER_VIA_BBLIND || aLayer == LAYER_VIA_MICROVIA )
783  {
784  // Outer circles of blind/buried and micro-vias are drawn in a special way to indicate the
785  // top and bottom layers
786  PCB_LAYER_ID layerTop, layerBottom;
787  aVia->LayerPair( &layerTop, &layerBottom );
788 
789  double radius = aVia->GetWidth() / 2.0;
790 
791  if( !sketchMode )
792  m_gal->SetLineWidth( ( aVia->GetWidth() - aVia->GetDrillValue() ) / 2.0 );
793 
794  m_gal->DrawArc( center, radius, M_PI / 2.0, M_PI );
795  m_gal->DrawArc( center, radius, 3.0 * M_PI / 2.0, 2.0 * M_PI );
796 
797  if( sketchMode )
798  m_gal->SetStrokeColor( m_pcbSettings.GetColor( aVia, layerTop ) );
799  else
800  m_gal->SetFillColor( m_pcbSettings.GetColor( aVia, layerTop ) );
801 
802  m_gal->DrawArc( center, radius, 0.0, M_PI / 2.0 );
803 
804  if( sketchMode )
805  m_gal->SetStrokeColor( m_pcbSettings.GetColor( aVia, layerBottom ) );
806  else
807  m_gal->SetFillColor( m_pcbSettings.GetColor( aVia, layerBottom ) );
808 
809  m_gal->DrawArc( center, radius, M_PI, 3.0 * M_PI / 2.0 );
810  }
811 
812  // Clearance lines
813  constexpr int clearanceFlags = PCB_RENDER_SETTINGS::CL_EXISTING | PCB_RENDER_SETTINGS::CL_VIAS;
814 
815  if( ( m_pcbSettings.m_clearanceDisplayFlags & clearanceFlags ) == clearanceFlags
816  && aLayer != LAYER_VIA_HOLES )
817  {
818  PCB_LAYER_ID activeLayer = m_pcbSettings.GetActiveLayer();
819  double radius;
820 
821  if( aVia->FlashLayer( activeLayer ) )
822  radius = aVia->GetWidth() / 2.0;
823  else
824  radius = getDrillSize( aVia ) / 2.0 + bds.GetHolePlatingThickness();
825 
827  m_gal->SetIsFill( false );
828  m_gal->SetIsStroke( true );
830  m_gal->DrawCircle( center, radius + aVia->GetOwnClearance( activeLayer ) );
831  }
832 }
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
to draw blind/buried vias
bool FlashLayer(int aLayer) const
Checks to see whether the via should have a pad on the specific layer.
Definition: pcb_track.cpp:520
virtual void BitmapText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a text using a bitmap font.
VIATYPE GetViaType() const
Definition: pcb_track.h:354
to draw via holes (pad holes do not use this layer)
int GetHolePlatingThickness() const
Pad & via drills are finish size.
virtual void DrawArc(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle)
Draw an arc.
bool m_sketchMode[GAL_LAYER_ID_END]
Definition: pcb_painter.h:196
int color
Definition: DXF_plotter.cpp:60
Define a general 2D-vector/point.
Definition: vector2d.h:61
int GetWidth() const
Definition: pcb_track.h:102
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:588
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual VECTOR2D getDrillSize(const PAD *aPad) const
Return drill size for a pad (internal units).
PCB_LAYER_ID
A quick note on layer IDs:
bool GetDrawIndividualViaLayers() const
Definition: pcb_painter.h:174
void ResetTextAttributes()
Reset text attributes to default styling.
wxString GetShortNetname() const
#define NULL
static const double MAX_FONT_SIZE
< Maximum font size for netnames (and other dynamically shown strings)
Definition: pcb_painter.h:194
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
static const COLOR4D CLEAR
Definition: color4d.h:374
to draw usual through hole vias
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:50
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...
Definition: pcb_track.cpp:461
void SetGlyphSize(const VECTOR2D &aSize)
Set the font glyph size.
int m_clearanceDisplayFlags
How to display nets and netclasses with color overrides.
Definition: pcb_painter.h:216
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
virtual void Restore()
Restore the context.
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:214
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...
PCB_LAYER_ID GetActiveLayer() const
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Return an item's "own" clearance in internal units.
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Definition: pcb_track.cpp:193
virtual void Save()
Save the context.
virtual void Translate(const VECTOR2D &aTranslation)
Translate the context.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
const wxPoint & GetStart() const
Definition: pcb_track.h:108
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
Container for design settings for a BOARD object.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References KIGFX::GAL::BitmapText(), BLIND_BURIED, KIGFX::PCB_RENDER_SETTINGS::CL_EXISTING, KIGFX::PCB_RENDER_SETTINGS::CL_VIAS, KIGFX::COLOR4D::CLEAR, color, KIGFX::GAL::DrawArc(), KIGFX::GAL::DrawCircle(), PCB_VIA::FlashLayer(), KIGFX::RENDER_SETTINGS::GetActiveLayer(), BOARD_ITEM::GetBoard(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), BOARD::GetDesignSettings(), KIGFX::PCB_RENDER_SETTINGS::GetDrawIndividualViaLayers(), KIGFX::PCB_PAINTER::getDrillSize(), PCB_VIA::GetDrillValue(), BOARD_DESIGN_SETTINGS::GetHolePlatingThickness(), BOARD_CONNECTED_ITEM::GetNetname(), BOARD_CONNECTED_ITEM::GetOwnClearance(), BOARD_CONNECTED_ITEM::GetShortNetname(), PCB_TRACK::GetStart(), PCB_VIA::GetViaType(), PCB_TRACK::GetWidth(), IsNetnameLayer(), LAYER_VIA_BBLIND, LAYER_VIA_HOLES, LAYER_VIA_HOLEWALLS, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, PCB_VIA::LayerPair(), KIGFX::PCB_RENDER_SETTINGS::m_clearanceDisplayFlags, KIGFX::PAINTER::m_gal, KIGFX::PCB_RENDER_SETTINGS::m_netNamesOnVias, KIGFX::RENDER_SETTINGS::m_outlineWidth, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::PCB_RENDER_SETTINGS::m_sketchMode, KIGFX::PCB_RENDER_SETTINGS::MAX_FONT_SIZE, MICROVIA, NULL, KIGFX::GAL::ResetTextAttributes(), KIGFX::GAL::Restore(), KIGFX::GAL::Save(), KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetGlyphSize(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), THROUGH, KIGFX::GAL::Translate(), UnescapeString(), and VECTOR2< T >::x.

◆ draw() [4/13]

void PCB_PAINTER::draw ( const PAD aPad,
int  aLayer 
)
protectedinherited

Definition at line 835 of file pcb_painter.cpp.

836 {
837  BOARD* board = aPad->GetBoard();
839  COLOR4D color = m_pcbSettings.GetColor( aPad, aLayer );
840 
841  if( IsNetnameLayer( aLayer ) )
842  {
843  // Is anything that we can display enabled?
845  {
846  bool displayNetname = ( m_pcbSettings.m_netNamesOnPads && !aPad->GetNetname().empty() );
847  EDA_RECT padBBox = aPad->GetBoundingBox();
848  VECTOR2D position = padBBox.Centre();
849  VECTOR2D padsize = VECTOR2D( padBBox.GetSize() );
850 
851  if( aPad->GetShape() != PAD_SHAPE::CUSTOM )
852  {
853  // Don't allow a 45ยบ rotation to bloat a pad's bounding box unnecessarily
854  double limit = std::min( aPad->GetSize().x, aPad->GetSize().y ) * 1.1;
855 
856  if( padsize.x > limit && padsize.y > limit )
857  {
858  padsize.x = limit;
859  padsize.y = limit;
860  }
861  }
862 
863  double maxSize = PCB_RENDER_SETTINGS::MAX_FONT_SIZE;
864  double size = padsize.y;
865 
866  m_gal->Save();
867  m_gal->Translate( position );
868 
869  // Keep the size ratio for the font, but make it smaller
870  if( padsize.x < padsize.y )
871  {
872  m_gal->Rotate( DECIDEG2RAD( -900.0 ) );
873  size = padsize.x;
874  std::swap( padsize.x, padsize.y );
875  }
876 
877  // Font size limits
878  if( size > maxSize )
879  size = maxSize;
880 
881  // Default font settings
884  m_gal->SetFontBold( false );
885  m_gal->SetFontItalic( false );
886  m_gal->SetFontUnderlined( false );
887  m_gal->SetTextMirrored( false );
888  m_gal->SetStrokeColor( m_pcbSettings.GetColor( aPad, aLayer ) );
889  m_gal->SetIsStroke( true );
890  m_gal->SetIsFill( false );
891 
892  // We have already translated the GAL to be centered at the center of the pad's
893  // bounding box
894  VECTOR2D textpos( 0.0, 0.0 );
895 
896  // Divide the space, to display both pad numbers and netnames and set the Y text
897  // position to display 2 lines
898  if( displayNetname && m_pcbSettings.m_padNumbers )
899  {
900  size = size / 2.0;
901  textpos.y = size / 2.0;
902  }
903 
904  if( displayNetname )
905  {
906  wxString netname = UnescapeString( aPad->GetShortNetname() );
907  wxString pinType = aPad->GetPinType();
908 
909  if( pinType == wxT( "no_connect" ) || pinType.EndsWith( wxT( "+no_connect" ) ) )
910  netname = "x";
911  else if( pinType == wxT( "free" ) && netname.StartsWith( wxT( "unconnected-(" ) ) )
912  netname = "*";
913 
914  // calculate the size of net name text:
915  double tsize = 1.5 * padsize.x / netname.Length();
916  tsize = std::min( tsize, size );
917  // Use a smaller text size to handle interline, pen size..
918  tsize *= 0.7;
919  VECTOR2D namesize( tsize, tsize );
920 
921  m_gal->SetGlyphSize( namesize );
922  m_gal->SetLineWidth( namesize.x / 12.0 );
923  m_gal->BitmapText( netname, textpos, 0.0 );
924  }
925 
927  {
928  const wxString& padName = aPad->GetName();
929  textpos.y = -textpos.y;
930  double tsize = 1.5 * padsize.x / padName.Length();
931  tsize = std::min( tsize, size );
932  // Use a smaller text size to handle interline, pen size..
933  tsize *= 0.7;
934  tsize = std::min( tsize, size );
935  VECTOR2D numsize( tsize, tsize );
936 
937  m_gal->SetGlyphSize( numsize );
938  m_gal->SetLineWidth( numsize.x / 12.0 );
939  m_gal->BitmapText( padName, textpos, 0.0 );
940  }
941 
942  m_gal->Restore();
943  }
944  return;
945  }
946  else if( aLayer == LAYER_PAD_HOLEWALLS )
947  {
948  int platingThickness = bds.GetHolePlatingThickness();
949 
950  m_gal->SetIsFill( false );
951  m_gal->SetIsStroke( true );
952  m_gal->SetLineWidth( platingThickness );
954 
955  const SHAPE_SEGMENT* seg = aPad->GetEffectiveHoleShape();
956  int holeSize = seg->GetWidth() + platingThickness;
957 
958  if( seg->GetSeg().A == seg->GetSeg().B ) // Circular hole
959  m_gal->DrawCircle( seg->GetSeg().A, holeSize / 2 );
960  else
961  m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B, holeSize );
962 
963  return;
964  }
965 
967  {
968  // Outline mode
969  m_gal->SetIsFill( false );
970  m_gal->SetIsStroke( true );
973  }
974  else
975  {
976  // Filled mode
977  m_gal->SetIsFill( true );
978  m_gal->SetIsStroke( false );
980  }
981 
982  if( aLayer == LAYER_PAD_PLATEDHOLES || aLayer == LAYER_NON_PLATEDHOLES )
983  {
984  const SHAPE_SEGMENT* seg = aPad->GetEffectiveHoleShape();
985 
986  if( seg->GetSeg().A == seg->GetSeg().B ) // Circular hole
987  m_gal->DrawCircle( seg->GetSeg().A, getDrillSize( aPad ).x / 2 );
988  else
989  m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B, seg->GetWidth() );
990  }
991  else
992  {
993  wxSize pad_size = aPad->GetSize();
994  wxSize margin;
995 
996  switch( aLayer )
997  {
998  case F_Mask:
999  case B_Mask:
1000  margin.x = margin.y = aPad->GetSolderMaskMargin();
1001  break;
1002 
1003  case F_Paste:
1004  case B_Paste:
1005  margin = aPad->GetSolderPasteMargin();
1006  break;
1007 
1008  default:
1009  margin.x = margin.y = 0;
1010  break;
1011  }
1012 
1013  std::unique_ptr<PAD> dummyPad;
1014  std::shared_ptr<SHAPE_COMPOUND> shapes;
1015  bool simpleShapes = true;
1016 
1017  if( ( margin.x != margin.y && aPad->GetShape() != PAD_SHAPE::CUSTOM )
1018  || ( aPad->GetShape() == PAD_SHAPE::ROUNDRECT && ( margin.x < 0 || margin.y < 0 ) ) )
1019  {
1020  // Our algorithms below (polygon inflation in particular) can't handle differential
1021  // inflation along separate axes. So for those cases we build a dummy pad instead,
1022  // and inflate it.
1023 
1024  // Margin is added to both sides. If the total margin is larger than the pad
1025  // then don't display this layer
1026  if( pad_size.x + 2 * margin.x <= 0 || pad_size.y + 2 * margin.y <= 0 )
1027  return;
1028 
1029  dummyPad.reset( static_cast<PAD*>( aPad->Duplicate() ) );
1030  int initial_radius = dummyPad->GetRoundRectCornerRadius();
1031 
1032  dummyPad->SetSize( pad_size + margin + margin );
1033 
1034  if( dummyPad->GetShape() == PAD_SHAPE::ROUNDRECT )
1035  {
1036  // To keep the right margin around the corners, we need to modify the corner radius.
1037  // We must have only one radius correction, so use the smallest absolute margin.
1038  int radius_margin = std::max( margin.x, margin.y ); // radius_margin is < 0
1039  dummyPad->SetRoundRectCornerRadius( std::max( initial_radius + radius_margin, 0 ) );
1040  }
1041 
1042  shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( dummyPad->GetEffectiveShape() );
1043  margin.x = margin.y = 0;
1044  }
1045  else
1046  {
1047  shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
1048  }
1049 
1050  if( aPad->GetShape() == PAD_SHAPE::CUSTOM && ( margin.x || margin.y ) )
1051  {
1052  // We can't draw as shapes because we don't know which edges are internal and which
1053  // are external (so we don't know when to apply the margin and when not to).
1054  simpleShapes = false;
1055  }
1056 
1057  for( const SHAPE* shape : shapes->Shapes() )
1058  {
1059  // Drawing components of compound shapes in outline mode produces a mess.
1061  simpleShapes = false;
1062 
1063  if( !simpleShapes )
1064  break;
1065 
1066  switch( shape->Type() )
1067  {
1068  case SH_SEGMENT:
1069  case SH_CIRCLE:
1070  case SH_RECT:
1071  case SH_SIMPLE:
1072  // OK so far
1073  break;
1074 
1075  default:
1076  // Not OK
1077  simpleShapes = false;
1078  break;
1079  }
1080  }
1081 
1082  if( simpleShapes )
1083  {
1084  for( const SHAPE* shape : shapes->Shapes() )
1085  {
1086  switch( shape->Type() )
1087  {
1088  case SH_SEGMENT:
1089  {
1090  const SHAPE_SEGMENT* seg = (const SHAPE_SEGMENT*) shape;
1091  int effectiveWidth = seg->GetWidth() + 2 * margin.x;
1092 
1093  if( effectiveWidth > 0 )
1094  m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B, effectiveWidth );
1095  }
1096  break;
1097 
1098  case SH_CIRCLE:
1099  {
1100  const SHAPE_CIRCLE* circle = (const SHAPE_CIRCLE*) shape;
1101  int effectiveRadius = circle->GetRadius() + margin.x;
1102 
1103  if( effectiveRadius > 0 )
1104  m_gal->DrawCircle( circle->GetCenter(), effectiveRadius );
1105  }
1106  break;
1107 
1108  case SH_RECT:
1109  {
1110  const SHAPE_RECT* r = (const SHAPE_RECT*) shape;
1111  VECTOR2I pos = r->GetPosition();
1112  VECTOR2I effectiveMargin = margin;
1113 
1114  if( effectiveMargin.x < 0 )
1115  {
1116  // A negative margin just produces a smaller rect.
1117  VECTOR2I effectiveSize = r->GetSize() + effectiveMargin;
1118 
1119  if( effectiveSize.x > 0 && effectiveSize.y > 0 )
1120  m_gal->DrawRectangle( pos - effectiveMargin, pos + effectiveSize );
1121  }
1122  else if( effectiveMargin.x > 0 )
1123  {
1124  // A positive margin produces a larger rect, but with rounded corners
1125 
1126  m_gal->DrawRectangle( r->GetPosition(), r->GetPosition() + r->GetSize() );
1127 
1128  // Use segments to produce the margin with rounded corners
1129  m_gal->DrawSegment( pos,
1130  pos + VECTOR2I( r->GetWidth(), 0 ),
1131  effectiveMargin.x * 2 );
1132  m_gal->DrawSegment( pos + VECTOR2I( r->GetWidth(), 0 ),
1133  pos + r->GetSize(),
1134  effectiveMargin.x * 2 );
1135  m_gal->DrawSegment( pos + r->GetSize(),
1136  pos + VECTOR2I( 0, r->GetHeight() ),
1137  effectiveMargin.x * 2 );
1138  m_gal->DrawSegment( pos + VECTOR2I( 0, r->GetHeight() ),
1139  pos,
1140  effectiveMargin.x * 2 );
1141  }
1142  else
1143  {
1144  m_gal->DrawRectangle( r->GetPosition(), r->GetPosition() + r->GetSize() );
1145  }
1146  }
1147  break;
1148 
1149  case SH_SIMPLE:
1150  {
1151  const SHAPE_SIMPLE* poly = static_cast<const SHAPE_SIMPLE*>( shape );
1152 
1153  if( margin.x < 0 ) // The poly shape must be deflated
1154  {
1155  int maxError = bds.m_MaxError;
1156  int numSegs = GetArcToSegmentCount( -margin.x, maxError, 360.0 );
1157  SHAPE_POLY_SET outline;
1158  outline.NewOutline();
1159 
1160  for( int ii = 0; ii < poly->PointCount(); ++ii )
1161  outline.Append( poly->CPoint( ii ) );
1162 
1163  outline.Deflate( -margin.x, numSegs );
1164 
1165  m_gal->DrawPolygon( outline );
1166  }
1167 
1168  else
1169  m_gal->DrawPolygon( poly->Vertices() );
1170 
1171  // Now add on a rounded margin (using segments) if the margin > 0
1172  if( margin.x > 0 )
1173  {
1174  for( size_t ii = 0; ii < poly->GetSegmentCount(); ++ii )
1175  {
1176  SEG seg = poly->GetSegment( ii );
1177  m_gal->DrawSegment( seg.A, seg.B, margin.x * 2 );
1178  }
1179  }
1180  }
1181  break;
1182 
1183  default:
1184  // Better not get here; we already pre-flighted the shapes...
1185  break;
1186  }
1187  }
1188  }
1189  else
1190  {
1191  // This is expensive. Avoid if possible.
1192 
1193  SHAPE_POLY_SET polySet;
1194  aPad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ), margin.x,
1195  bds.m_MaxError, ERROR_INSIDE );
1196  m_gal->DrawPolygon( polySet );
1197  }
1198  }
1199 
1200  constexpr int clearanceFlags = PCB_RENDER_SETTINGS::CL_PADS;
1201 
1202  if( ( m_pcbSettings.m_clearanceDisplayFlags & clearanceFlags ) == clearanceFlags
1203  && ( aLayer == LAYER_PAD_FR || aLayer == LAYER_PAD_BK || aLayer == LAYER_PADS_TH ) )
1204  {
1205  /* Showing the clearance area is not obvious.
1206  * - A pad can be removed from some copper layers.
1207  * - For non copper layers, what is the clearance area?
1208  * So for copper layers, the clearance area is the shape if the pad is flashed on this
1209  * layer and the hole clearance area for other copper layers.
1210  * For other layers, use the pad shape, although one can use an other criteria,
1211  * depending on the non copper layer.
1212  */
1213  int activeLayer = m_pcbSettings.GetActiveLayer();
1214  bool flashActiveLayer = IsCopperLayer( activeLayer ) ?
1215  aPad->FlashLayer( activeLayer ) : true;
1216 
1217  if( flashActiveLayer || aPad->GetDrillSize().x )
1218  {
1220  m_gal->SetIsStroke( true );
1221  m_gal->SetIsFill( false );
1223 
1224  int clearance = aPad->GetOwnClearance( m_pcbSettings.GetActiveLayer() );
1225 
1226  if( flashActiveLayer && clearance > 0 )
1227  {
1228  auto shape = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
1229 
1230  if( shape && shape->Size() == 1 && shape->Shapes()[0]->Type() == SH_SEGMENT )
1231  {
1232  const SHAPE_SEGMENT* seg = (SHAPE_SEGMENT*) shape->Shapes()[0];
1233  m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B,
1234  seg->GetWidth() + 2 * clearance );
1235  }
1236  else if( shape && shape->Size() == 1 && shape->Shapes()[0]->Type() == SH_CIRCLE )
1237  {
1238  const SHAPE_CIRCLE* circle = (SHAPE_CIRCLE*) shape->Shapes()[0];
1239  m_gal->DrawCircle( circle->GetCenter(), circle->GetRadius() + clearance );
1240  }
1241  else
1242  {
1243  SHAPE_POLY_SET polySet;
1244 
1245  // Use ERROR_INSIDE because it avoids Clipper and is therefore much faster.
1246  aPad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ),
1247  clearance,
1248  bds.m_MaxError, ERROR_INSIDE );
1249  m_gal->DrawPolygon( polySet );
1250  }
1251  }
1252  else if( aPad->GetEffectiveHoleShape() && clearance > 0 )
1253  {
1254  clearance += bds.GetHolePlatingThickness();
1255 
1256  const SHAPE_SEGMENT* seg = aPad->GetEffectiveHoleShape();
1257  m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B,
1258  seg->GetWidth() + 2 * clearance );
1259  }
1260  }
1261  }
1262 }
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
virtual const SEG GetSegment(int aIndex) const override
Definition: shape_simple.h:185
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a rectangle.
SHAPE_SIMPLE.
Definition: shape_simple.h:43
const VECTOR2I & CPoint(int aIndex) const
Function Point()
Definition: shape_simple.h:107
int GetRadius() const
Definition: shape_circle.h:107
multilayer pads, usually with holes
virtual void BitmapText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a text using a bitmap font.
handle color for not plated holes (holes, not pads)
int GetHolePlatingThickness() const
Pad & via drills are finish size.
bool m_sketchMode[GAL_LAYER_ID_END]
Definition: pcb_painter.h:196
int color
Definition: DXF_plotter.cpp:60
Define a general 2D-vector/point.
Definition: vector2d.h:61
void SetFontBold(bool aBold)
Set bold property of current font.
const SHAPE_SEGMENT * GetEffectiveHoleShape() const
Return a SHAPE object representing the pad's hole.
Definition: pad.cpp:289
const VECTOR2I GetCenter() const
Definition: shape_circle.h:112
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:588
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
const SEG & GetSeg() const
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void Rotate(double aAngle)
Rotate the context.
virtual VECTOR2D getDrillSize(const PAD *aPad) const
Return drill size for a pad (internal units).
const VECTOR2I GetSize() const
Definition: shape_rect.h:124
const wxSize & GetDrillSize() const
Definition: pad.h:239
bool FlashLayer(int aLayer) const
Check to see whether the pad should be flashed on the specific layer.
Definition: pad.cpp:206
virtual void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
Draw a rounded segment.
wxString GetShortNetname() const
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
static const double MAX_FONT_SIZE
< Maximum font size for netnames (and other dynamically shown strings)
Definition: pcb_painter.h:194
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
Represent a set of closed polygons.
const VECTOR2I & GetPosition() const
Definition: shape_rect.h:116
const wxSize & GetSize() const
Definition: pad.h:229
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:50
const wxString & GetName() const
Definition: pad.h:130
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.
Definition: pad.cpp:521
const wxString & GetPinType() const
Definition: pad.h:142
PAD_SHAPE GetShape() const
Definition: pad.h:166
const SHAPE_LINE_CHAIN & Vertices() const
Function Vertices()
Definition: shape_simple.h:133
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: pad.cpp:280
An abstract shape on 2D plane.
Definition: shape.h:116
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.
int NewOutline()
Creates a new hole in a given outline.
circle
Definition: shape.h:46
void SetGlyphSize(const VECTOR2D &aSize)
Set the font glyph size.
int m_clearanceDisplayFlags
How to display nets and netclasses with color overrides.
Definition: pcb_painter.h:216
int GetSolderMaskMargin() const
Definition: pad.cpp:700
Definition: seg.h:40
virtual size_t GetSegmentCount() const override
Definition: shape_simple.h:187
void SetTextMirrored(bool aMirrored)
Set a mirrored property of text.
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.
smd pads, front layer
virtual void Restore()
Restore the context.
virtual void DrawPolygon(const std::deque< VECTOR2D > &aPointList)
Draw a polygon.
void SetFontUnderlined(bool aUnderlined)
wxSize GetSolderPasteMargin() const
Usually < 0 (mask shape smaller than pad)because the margin can be dependent on the pad size,...
Definition: pad.cpp:745
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:214
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...
VECTOR2I A
Definition: seg.h:48
int PointCount() const
Function PointCount()
Definition: shape_simple.h:93
Handle the component boundary box.
Definition: eda_rect.h:42
double DECIDEG2RAD(double deg)
Definition: trigo.h:235
PCB_LAYER_ID GetActiveLayer() const
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Return an item's "own" clearance in internal units.
wxPoint Centre() const
Definition: eda_rect.h:55
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
virtual BOARD_ITEM * Duplicate() const
Create a copy of this BOARD_ITEM.
Definition: board_item.h:200
const int GetHeight() const
Definition: shape_rect.h:140
axis-aligned rectangle
Definition: shape.h:43
virtual void Save()
Save the context.
void SetHorizontalJustify(const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
Set the horizontal justify for text drawing.
const int GetWidth() const
Definition: shape_rect.h:132
virtual void Translate(const VECTOR2D &aTranslation)
Translate the context.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
int GetWidth() const
simple polygon
Definition: shape.h:47
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:905
const wxSize GetSize() const
Definition: eda_rect.h:91
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
line segment
Definition: shape.h:44
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.
Definition: color4d.h:103
VECTOR2I B
Definition: seg.h:49

References SEG::A, SHAPE_POLY_SET::Append(), SEG::B, B_Mask, B_Paste, KIGFX::GAL::BitmapText(), EDA_RECT::Centre(), KIGFX::PCB_RENDER_SETTINGS::CL_PADS, color, SHAPE_SIMPLE::CPoint(), CUSTOM, DECIDEG2RAD(), SHAPE_POLY_SET::Deflate(), KIGFX::GAL::DrawCircle(), KIGFX::GAL::DrawPolygon(), KIGFX::GAL::DrawRectangle(), KIGFX::GAL::DrawSegment(), BOARD_ITEM::Duplicate(), ERROR_INSIDE, F_Mask, F_Paste, PAD::FlashLayer(), KIGFX::RENDER_SETTINGS::GetActiveLayer(), GetArcToSegmentCount(), BOARD_ITEM::GetBoard(), PAD::GetBoundingBox(), SHAPE_CIRCLE::GetCenter(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), BOARD::GetDesignSettings(), PAD::GetDrillSize(), KIGFX::PCB_PAINTER::getDrillSize(), PAD::GetEffectiveHoleShape(), PAD::GetEffectiveShape(), SHAPE_RECT::GetHeight(), BOARD_DESIGN_SETTINGS::GetHolePlatingThickness(), PAD::GetName(), BOARD_CONNECTED_ITEM::GetNetname(), BOARD_CONNECTED_ITEM::GetOwnClearance(), PAD::GetPinType(), SHAPE_RECT::GetPosition(), SHAPE_CIRCLE::GetRadius(), SHAPE_SEGMENT::GetSeg(), SHAPE_SIMPLE::GetSegment(), SHAPE_SIMPLE::GetSegmentCount(), PAD::GetShape(), BOARD_CONNECTED_ITEM::GetShortNetname(), EDA_RECT::GetSize(), SHAPE_RECT::GetSize(), PAD::GetSize(), PAD::GetSolderMaskMargin(), PAD::GetSolderPasteMargin(), SHAPE_RECT::GetWidth(), SHAPE_SEGMENT::GetWidth(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, IsCopperLayer(), IsNetnameLayer(), LAYER_NON_PLATEDHOLES, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PAD_HOLEWALLS, LAYER_PAD_PLATEDHOLES, LAYER_PADS_TH, KIGFX::PCB_RENDER_SETTINGS::m_clearanceDisplayFlags, KIGFX::PAINTER::m_gal, BOARD_DESIGN_SETTINGS::m_MaxError, KIGFX::PCB_RENDER_SETTINGS::m_netNamesOnPads, KIGFX::RENDER_SETTINGS::m_outlineWidth, KIGFX::PCB_RENDER_SETTINGS::m_padNumbers, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::PCB_RENDER_SETTINGS::m_sketchMode, KIGFX::PCB_RENDER_SETTINGS::MAX_FONT_SIZE, SHAPE_POLY_SET::NewOutline(), SHAPE_SIMPLE::PointCount(), KIGFX::GAL::Restore(), KIGFX::GAL::Rotate(), ROUNDRECT, KIGFX::GAL::Save(), KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetFontBold(), KIGFX::GAL::SetFontItalic(), KIGFX::GAL::SetFontUnderlined(), KIGFX::GAL::SetGlyphSize(), KIGFX::GAL::SetHorizontalJustify(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), KIGFX::GAL::SetTextMirrored(), KIGFX::GAL::SetVerticalJustify(), SH_CIRCLE, SH_RECT, SH_SEGMENT, SH_SIMPLE, ToLAYER_ID(), PAD::TransformShapeWithClearanceToPolygon(), KIGFX::GAL::Translate(), UnescapeString(), SHAPE_SIMPLE::Vertices(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ draw() [5/13]

void PCB_PAINTER::draw ( const PCB_SHAPE aSegment,
int  aLayer 
)
protectedinherited

Definition at line 1265 of file pcb_painter.cpp.

1266 {
1267  const COLOR4D& color = m_pcbSettings.GetColor( aShape, aShape->GetLayer() );
1268  bool sketch = m_pcbSettings.m_sketchGraphics;
1269  int thickness = getLineThickness( aShape->GetWidth() );
1270  VECTOR2D start( aShape->GetStart() );
1271  VECTOR2D end( aShape->GetEnd() );
1272 
1273  if( sketch )
1274  {
1275  m_gal->SetIsFill( false );
1276  m_gal->SetIsStroke( true );
1278  }
1279 
1280  m_gal->SetFillColor( color );
1282 
1283  switch( aShape->GetShape() )
1284  {
1286  if( sketch )
1287  {
1288  m_gal->DrawSegment( start, end, thickness );
1289  }
1290  else
1291  {
1292  m_gal->SetIsFill( true );
1293  m_gal->SetIsStroke( false );
1294 
1295  m_gal->DrawSegment( start, end, thickness );
1296  }
1297  break;
1298 
1299  case PCB_SHAPE_TYPE::RECT:
1300  {
1301  std::vector<wxPoint> pts = aShape->GetRectCorners();
1302 
1303  if( sketch )
1304  {
1305  m_gal->DrawSegment( pts[0], pts[1], thickness );
1306  m_gal->DrawSegment( pts[1], pts[2], thickness );
1307  m_gal->DrawSegment( pts[2], pts[3], thickness );
1308  m_gal->DrawSegment( pts[3], pts[0], thickness );
1309  }
1310  else
1311  {
1312  m_gal->SetIsFill( true );
1313  m_gal->SetIsStroke( false );
1314 
1315  if( thickness > 0 )
1316  {
1317  m_gal->DrawSegment( pts[0], pts[1], thickness );
1318  m_gal->DrawSegment( pts[1], pts[2], thickness );
1319  m_gal->DrawSegment( pts[2], pts[3], thickness );
1320  m_gal->DrawSegment( pts[3], pts[0], thickness );
1321  }
1322 
1323  if( aShape->IsFilled() )
1324  {
1325  SHAPE_POLY_SET poly;
1326  poly.NewOutline();
1327 
1328  for( const wxPoint& pt : pts )
1329  poly.Append( pt );
1330 
1331  m_gal->DrawPolygon( poly );
1332  }
1333  }
1334  }
1335  break;
1336 
1337  case PCB_SHAPE_TYPE::ARC:
1338  if( sketch )
1339  {
1340  m_gal->DrawArcSegment( start, aShape->GetRadius(),
1341  DECIDEG2RAD( aShape->GetArcAngleStart() ),
1342  DECIDEG2RAD( aShape->GetArcAngleStart() + aShape->GetAngle() ), // Change this
1343  thickness );
1344  }
1345  else
1346  {
1347  m_gal->SetIsFill( true );
1348  m_gal->SetIsStroke( false );
1349 
1350  m_gal->DrawArcSegment( start, aShape->GetRadius(),
1351  DECIDEG2RAD( aShape->GetArcAngleStart() ),
1352  DECIDEG2RAD( aShape->GetArcAngleStart() + aShape->GetAngle() ), // Change this
1353  thickness );
1354  }
1355  break;
1356 
1358  if( sketch )
1359  {
1360  m_gal->DrawCircle( start, aShape->GetRadius() - thickness / 2 );
1361  m_gal->DrawCircle( start, aShape->GetRadius() + thickness / 2 );
1362  }
1363  else
1364  {
1365  m_gal->SetIsFill( aShape->IsFilled() );
1366  m_gal->SetIsStroke( thickness > 0 );
1367  m_gal->SetLineWidth( thickness );
1368 
1369  m_gal->DrawCircle( start, aShape->GetRadius() );
1370  }
1371  break;
1372 
1374  {
1375  SHAPE_POLY_SET& shape = const_cast<PCB_SHAPE*>( aShape )->GetPolyShape();
1376  const FOOTPRINT* parentFootprint = aShape->GetParentFootprint();
1377 
1378  if( shape.OutlineCount() == 0 )
1379  break;
1380 
1381  if( parentFootprint )
1382  {
1383  m_gal->Save();
1384  m_gal->Translate( parentFootprint->GetPosition() );
1385  m_gal->Rotate( -parentFootprint->GetOrientationRadians() );
1386  }
1387 
1388  if( sketch )
1389  {
1390  for( int ii = 0; ii < shape.Outline( 0 ).SegmentCount(); ++ii )
1391  {
1392  SEG seg = shape.Outline( 0 ).Segment( ii );
1393  m_gal->DrawSegment( seg.A, seg.B, thickness );
1394  }
1395  }
1396  else
1397  {
1398  m_gal->SetIsFill( true );
1399  m_gal->SetIsStroke( false );
1400 
1401  if( thickness > 0 )
1402  {
1403  for( int ii = 0; ii < shape.Outline( 0 ).SegmentCount(); ++ii )
1404  {
1405  SEG seg = shape.Outline( 0 ).Segment( ii );
1406  m_gal->DrawSegment( seg.A, seg.B, thickness );
1407  }
1408  }
1409 
1410  if( aShape->IsFilled() )
1411  {
1412  // On Opengl, a not convex filled polygon is usually drawn by using triangles
1413  // as primitives. CacheTriangulation() can create basic triangle primitives to
1414  // draw the polygon solid shape on Opengl. GLU tessellation is much slower, so
1415  // currently we are using our tessellation.
1416  if( m_gal->IsOpenGlEngine() && !shape.IsTriangulationUpToDate() )
1417  shape.CacheTriangulation();
1418 
1419  m_gal->DrawPolygon( shape );
1420  }
1421  }
1422 
1423  if( parentFootprint )
1424  m_gal->Restore();
1425  }
1426  break;
1427 
1428  case PCB_SHAPE_TYPE::CURVE:
1429  if( sketch )
1430  {
1431  // Use thickness as filter value to convert the curve to polyline when the curve
1432  // is not supported
1433  m_gal->DrawCurve( VECTOR2D( aShape->GetStart() ),
1434  VECTOR2D( aShape->GetBezControl1() ),
1435  VECTOR2D( aShape->GetBezControl2() ),
1436  VECTOR2D( aShape->GetEnd() ), thickness );
1437  }
1438  else
1439  {
1440  m_gal->SetIsFill( aShape->IsFilled() );
1441  m_gal->SetIsStroke( thickness > 0 );
1442  m_gal->SetLineWidth( thickness );
1443 
1444  // Use thickness as filter value to convert the curve to polyline when the curve
1445  // is not supported
1446  m_gal->DrawCurve( VECTOR2D( aShape->GetStart() ),
1447  VECTOR2D( aShape->GetBezControl1() ),
1448  VECTOR2D( aShape->GetBezControl2() ),
1449  VECTOR2D( aShape->GetEnd() ), thickness );
1450  }
1451  break;
1452 
1453  case PCB_SHAPE_TYPE::LAST:
1454  break;
1455  }
1456 }
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
double GetOrientationRadians() const
Definition: footprint.h:183
int OutlineCount() const
Return the number of vertices in a given outline/hole.
int color
Definition: DXF_plotter.cpp:60
Define a general 2D-vector/point.
Definition: vector2d.h:61
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
bool IsTriangulationUpToDate() const
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void Rotate(double aAngle)
Rotate the context.
polygon (not yet used for tracks, but could be in microwave apps)
int getLineThickness(int aActualThickness) const
Get the thickness to draw for a line (e.g.
virtual void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
Draw a rounded segment.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
Represent a set of closed polygons.
SHAPE_LINE_CHAIN & Outline(int aIndex)
segment with non rounded ends
last value for this list
virtual bool IsOpenGlEngine()
Return true if the GAL engine is a OpenGL based type.
int NewOutline()
Creates a new hole in a given outline.
int SegmentCount() const
Function SegmentCount()
Definition: seg.h:40
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
SEG Segment(int aIndex)
Function Segment()
virtual void Restore()
Restore the context.
virtual void DrawPolygon(const std::deque< VECTOR2D > &aPointList)
Draw a polygon.
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
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...
VECTOR2I A
Definition: seg.h:48
double DECIDEG2RAD(double deg)
Definition: trigo.h:235
usual segment : line with rounded ends
wxPoint GetPosition() const override
Definition: footprint.h:177
virtual void DrawArcSegment(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth)
Draw an arc segment.
void CacheTriangulation(bool aPartition=true)
virtual void Save()
Save the context.
Arcs (with rounded ends)
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.
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.
Definition: color4d.h:103
VECTOR2I B
Definition: seg.h:49

References SEG::A, SHAPE_POLY_SET::Append(), ARC, SEG::B, SHAPE_POLY_SET::CacheTriangulation(), CIRCLE, color, CURVE, DECIDEG2RAD(), KIGFX::GAL::DrawArcSegment(), KIGFX::GAL::DrawCircle(), KIGFX::GAL::DrawCurve(), KIGFX::GAL::DrawPolygon(), KIGFX::GAL::DrawSegment(), PCB_SHAPE::GetAngle(), PCB_SHAPE::GetArcAngleStart(), PCB_SHAPE::GetBezControl1(), PCB_SHAPE::GetBezControl2(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), PCB_SHAPE::GetEnd(), BOARD_ITEM::GetLayer(), KIGFX::PCB_PAINTER::getLineThickness(), FOOTPRINT::GetOrientationRadians(), PCB_SHAPE::GetParentFootprint(), FOOTPRINT::GetPosition(), PCB_SHAPE::GetRadius(), PCB_SHAPE::GetRectCorners(), PCB_SHAPE::GetShape(), PCB_SHAPE::GetStart(), PCB_SHAPE::GetWidth(), PCB_SHAPE::IsFilled(), KIGFX::GAL::IsOpenGlEngine(), SHAPE_POLY_SET::IsTriangulationUpToDate(), LAST, KIGFX::PAINTER::m_gal, KIGFX::RENDER_SETTINGS::m_outlineWidth, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::PCB_RENDER_SETTINGS::m_sketchGraphics, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), POLYGON, RECT, KIGFX::GAL::Restore(), KIGFX::GAL::Rotate(), KIGFX::GAL::Save(), SEGMENT, SHAPE_LINE_CHAIN::Segment(), SHAPE_LINE_CHAIN::SegmentCount(), KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), and KIGFX::GAL::Translate().

◆ draw() [6/13]

void PCB_PAINTER::draw ( const PCB_TEXT aText,
int  aLayer 
)
protectedinherited

Definition at line 1459 of file pcb_painter.cpp.

1460 {
1461  wxString shownText( aText->GetShownText() );
1462 
1463  if( shownText.Length() == 0 )
1464  return;
1465 
1466  const COLOR4D& color = m_pcbSettings.GetColor( aText, aText->GetLayer() );
1467  VECTOR2D position( aText->GetTextPos().x, aText->GetTextPos().y );
1468 
1470  {
1471  // Outline mode
1473  }
1474  else
1475  {
1476  // Filled mode
1478  }
1479 
1481  m_gal->SetIsFill( false );
1482  m_gal->SetIsStroke( true );
1483  m_gal->SetTextAttributes( aText );
1484  m_gal->StrokeText( shownText, position, aText->GetTextAngleRadians() );
1485 }
virtual void SetTextAttributes(const EDA_TEXT *aText)
Loads attributes of the given text (bold/italic/underline/mirrored and so on).
bool m_sketchMode[GAL_LAYER_ID_END]
Definition: pcb_painter.h:196
int color
Definition: DXF_plotter.cpp:60
Define a general 2D-vector/point.
Definition: vector2d.h:61
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
Definition: eda_text.cpp:149
virtual void SetLineWidth(float aLineWidth)
Set the line width.
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: pcb_text.cpp:56
int getLineThickness(int aActualThickness) const
Get the thickness to draw for a line (e.g.
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual void StrokeText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a vector type text using preloaded Newstroke font.
double GetTextAngleRadians() const
Definition: eda_text.h:184
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
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...
const wxPoint & GetTextPos() const
Definition: eda_text.h:254
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:171
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References color, KIGFX::PCB_RENDER_SETTINGS::GetColor(), EDA_TEXT::GetEffectiveTextPenWidth(), BOARD_ITEM::GetLayer(), KIGFX::PCB_PAINTER::getLineThickness(), PCB_TEXT::GetShownText(), EDA_TEXT::GetTextAngleRadians(), EDA_TEXT::GetTextPos(), KIGFX::PAINTER::m_gal, KIGFX::RENDER_SETTINGS::m_outlineWidth, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::PCB_RENDER_SETTINGS::m_sketchMode, KIGFX::PCB_RENDER_SETTINGS::m_sketchText, KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), KIGFX::GAL::SetTextAttributes(), and KIGFX::GAL::StrokeText().

◆ draw() [7/13]

void PCB_PAINTER::draw ( const FP_TEXT aText,
int  aLayer 
)
protectedinherited

Definition at line 1488 of file pcb_painter.cpp.

1489 {
1490  wxString shownText( aText->GetShownText() );
1491 
1492  if( shownText.Length() == 0 )
1493  return;
1494 
1495  const COLOR4D& color = m_pcbSettings.GetColor( aText, aLayer );
1496  VECTOR2D position( aText->GetTextPos().x, aText->GetTextPos().y );
1497 
1499  {
1500  // Outline mode
1502  }
1503  else
1504  {
1505  // Filled mode
1507  }
1508 
1510  m_gal->SetIsFill( false );
1511  m_gal->SetIsStroke( true );
1512  m_gal->SetTextAttributes( aText );
1513  m_gal->StrokeText( shownText, position, aText->GetDrawRotationRadians() );
1514 
1515  // Draw the umbilical line
1516  if( aText->IsSelected() )
1517  {
1520  m_gal->DrawLine( position, aText->GetParent()->GetPosition() );
1521  }
1522 }
bool IsSelected() const
Definition: eda_item.h:123
anchor of items having an anchor point (texts, footprints)
virtual void SetTextAttributes(const EDA_TEXT *aText)
Loads attributes of the given text (bold/italic/underline/mirrored and so on).
int color
Definition: DXF_plotter.cpp:60
Define a general 2D-vector/point.
Definition: vector2d.h:61
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
virtual wxPoint GetPosition() const
Definition: eda_item.h:252
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
Definition: eda_text.cpp:149
virtual void SetLineWidth(float aLineWidth)
Set the line width.
int getLineThickness(int aActualThickness) const
Get the thickness to draw for a line (e.g.
double GetDrawRotationRadians() const
Definition: fp_text.h:175
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual void StrokeText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a vector type text using preloaded Newstroke font.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
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...
const wxPoint & GetTextPos() const
Definition: eda_text.h:254
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:166
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.
Definition: fp_text.cpp:414
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References color, KIGFX::GAL::DrawLine(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), FP_TEXT::GetDrawRotationRadians(), EDA_TEXT::GetEffectiveTextPenWidth(), KIGFX::PCB_PAINTER::getLineThickness(), BOARD_ITEM::GetParent(), EDA_ITEM::GetPosition(), FP_TEXT::GetShownText(), EDA_TEXT::GetTextPos(), EDA_ITEM::IsSelected(), LAYER_ANCHOR, KIGFX::PAINTER::m_gal, KIGFX::RENDER_SETTINGS::m_outlineWidth, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::PCB_RENDER_SETTINGS::m_sketchText, KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), KIGFX::GAL::SetTextAttributes(), and KIGFX::GAL::StrokeText().

◆ draw() [8/13]

void PCB_PAINTER::draw ( const FOOTPRINT aFootprint,
int  aLayer 
)
protectedinherited

Definition at line 1525 of file pcb_painter.cpp.

1526 {
1527  if( aLayer == LAYER_ANCHOR )
1528  {
1529  const COLOR4D color = m_pcbSettings.GetColor( aFootprint, aLayer );
1530 
1531  // Keep the size and width constant, not related to the scale because the anchor
1532  // is just a marker on screen
1533  double anchorSize = 5.0 / m_gal->GetWorldScale(); // 5 pixels size
1534  double anchorThickness = 1.0 / m_gal->GetWorldScale(); // 1 pixels width
1535 
1536  // Draw anchor
1537  m_gal->SetIsFill( false );
1538  m_gal->SetIsStroke( true );
1540  m_gal->SetLineWidth( anchorThickness );
1541 
1542  VECTOR2D center = aFootprint->GetPosition();
1543  m_gal->DrawLine( center - VECTOR2D( anchorSize, 0 ), center + VECTOR2D( anchorSize, 0 ) );
1544  m_gal->DrawLine( center - VECTOR2D( 0, anchorSize ), center + VECTOR2D( 0, anchorSize ) );
1545 
1546 #if 0 // For debug purpose only: draw the footing bounding box
1547  double bboxThickness = 1.0 / m_gal->GetWorldScale();
1548  m_gal->SetLineWidth( bboxThickness );
1549  EDA_RECT rect = aFootprint->GetBoundingBox();
1550  m_gal->DrawRectangle( VECTOR2D( rect.GetOrigin() ), VECTOR2D( rect.GetEnd() ) );
1551 
1552  double bboxThickness = 3.0 / m_gal->GetWorldScale();
1553  m_gal->SetLineWidth( bboxThickness );
1554  SHAPE_POLY_SET convex = aFootprint->GetBoundingHull();
1555 
1556  m_gal->DrawPolyline( convex.COutline( 0 ) );
1557 #endif
1558  }
1559 }
virtual void DrawPolyline(const std::deque< VECTOR2D > &aPointList)
Draw a polyline.
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a rectangle.
SHAPE_POLY_SET GetBoundingHull() const
Return a bounding polygon for the shapes and pads in the footprint.
Definition: footprint.cpp:743
anchor of items having an anchor point (texts, footprints)
int color
Definition: DXF_plotter.cpp:60
Define a general 2D-vector/point.
Definition: vector2d.h:61
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
virtual void SetLineWidth(float aLineWidth)
Set the line width.
const wxPoint GetEnd() const
Definition: eda_rect.h:103
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
Represent a set of closed polygons.
const wxPoint GetOrigin() const
Definition: eda_rect.h:101
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: footprint.cpp:635
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...
Handle the component boundary box.
Definition: eda_rect.h:42
wxPoint GetPosition() const override
Definition: footprint.h:177
double GetWorldScale() const
Get the world scale.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References color, SHAPE_POLY_SET::COutline(), KIGFX::GAL::DrawLine(), KIGFX::GAL::DrawPolyline(), KIGFX::GAL::DrawRectangle(), FOOTPRINT::GetBoundingBox(), FOOTPRINT::GetBoundingHull(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), EDA_RECT::GetEnd(), EDA_RECT::GetOrigin(), FOOTPRINT::GetPosition(), KIGFX::GAL::GetWorldScale(), LAYER_ANCHOR, KIGFX::PAINTER::m_gal, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), and KIGFX::GAL::SetStrokeColor().

◆ draw() [9/13]

void PCB_PAINTER::draw ( const PCB_GROUP aGroup,
int  aLayer 
)
protectedinherited

Definition at line 1562 of file pcb_painter.cpp.

1563 {
1564  if( aLayer == LAYER_ANCHOR )
1565  {
1566  if( aGroup->IsSelected() && !( aGroup->GetParent() && aGroup->GetParent()->IsSelected() ) )
1567  {
1568  // Selected on our own; draw enclosing box
1569  }
1570  else if( aGroup->IsEntered() )
1571  {
1572  // Entered group; draw enclosing box
1573  }
1574  else
1575  {
1576  return;
1577  }
1578 
1579  const COLOR4D color = m_pcbSettings.GetColor( aGroup, LAYER_ANCHOR );
1580 
1581  EDA_RECT bbox = aGroup->GetBoundingBox();
1584  wxPoint topLeft = bbox.GetPosition();
1585  wxPoint width = wxPoint( bbox.GetWidth(), 0 );
1586  wxPoint height = wxPoint( 0, bbox.GetHeight() );
1587 
1588  m_gal->DrawLine( topLeft, topLeft + width );
1589  m_gal->DrawLine( topLeft + width, topLeft + width + height );
1590  m_gal->DrawLine( topLeft + width + height, topLeft + height );
1591  m_gal->DrawLine( topLeft + height, topLeft );
1592 
1593  wxString name = aGroup->GetName();
1594 
1595  int ptSize = 12;
1596  int scaledSize = abs( KiROUND( m_gal->GetScreenWorldMatrix().GetScale().x * ptSize ) );
1597  int unscaledSize = Mils2iu( ptSize );
1598 
1599  // Scale by zoom a bit, but not too much
1600  int textSize = ( scaledSize + ( unscaledSize * 2 ) ) / 3;
1601  int penWidth = textSize / 10;
1602  wxPoint textOffset = wxPoint( width.x / 2, - KiROUND( textSize * 0.5 ) );
1603  wxPoint titleHeight = wxPoint( 0, KiROUND( textSize * 2.0 ) );
1604 
1605  if( !name.IsEmpty() && (int) aGroup->GetName().Length() * textSize < bbox.GetWidth() )
1606  {
1607  m_gal->DrawLine( topLeft, topLeft - titleHeight );
1608  m_gal->DrawLine( topLeft - titleHeight, topLeft + width - titleHeight );
1609  m_gal->DrawLine( topLeft + width - titleHeight, topLeft + width );
1610 
1611  m_gal->SetFontBold( false );
1612  m_gal->SetFontItalic( true );
1613  m_gal->SetFontUnderlined( false );
1617  m_gal->SetIsFill( false );
1618  m_gal->SetGlyphSize( VECTOR2D( textSize, textSize ) );
1619  m_gal->SetLineWidth( penWidth );
1620  m_gal->StrokeText( aGroup->GetName(), topLeft + textOffset, 0.0 );
1621  }
1622  }
1623 }
bool IsSelected() const
Definition: eda_item.h:123
const MATRIX3x3D & GetScreenWorldMatrix() const
Get the screen <-> world transformation matrix.
anchor of items having an anchor point (texts, footprints)
bool IsFlippedX() const
Return true if flip flag for the X axis is set.
int color
Definition: DXF_plotter.cpp:60
void SetFontBold(bool aBold)
Set bold property of current font.
int GetWidth() const
Definition: eda_rect.h:109
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
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...
Definition: pcb_group.cpp:210
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
Definition: matrix3x3.h:269
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
virtual void SetLineWidth(float aLineWidth)
Set the line width.
bool IsEntered() const
Definition: eda_item.h:124
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
wxString GetName() const
Definition: pcb_group.h:65
virtual void StrokeText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a vector type text using preloaded Newstroke font.
const wxPoint GetPosition() const
Definition: eda_rect.h:102
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.
int GetHeight() const
Definition: eda_rect.h:110
void SetGlyphSize(const VECTOR2D &aSize)
Set the font glyph size.
void SetTextMirrored(bool aMirrored)
Set a mirrored property of text.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
void SetFontUnderlined(bool aUnderlined)
const char * name
Definition: DXF_plotter.cpp:59
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...
Handle the component boundary box.
Definition: eda_rect.h:42
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:70
void SetHorizontalJustify(const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
Set the horizontal justify for text drawing.
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:166
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References color, KIGFX::GAL::DrawLine(), PCB_GROUP::GetBoundingBox(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), EDA_RECT::GetHeight(), PCB_GROUP::GetName(), BOARD_ITEM::GetParent(), EDA_RECT::GetPosition(), MATRIX3x3< T >::GetScale(), KIGFX::GAL::GetScreenWorldMatrix(), EDA_RECT::GetWidth(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, EDA_ITEM::IsEntered(), KIGFX::GAL::IsFlippedX(), EDA_ITEM::IsSelected(), KiROUND(), LAYER_ANCHOR, KIGFX::PAINTER::m_gal, KIGFX::RENDER_SETTINGS::m_outlineWidth, KIGFX::PCB_PAINTER::m_pcbSettings, name, KIGFX::GAL::SetFontBold(), KIGFX::GAL::SetFontItalic(), KIGFX::GAL::SetFontUnderlined(), KIGFX::GAL::SetGlyphSize(), KIGFX::GAL::SetHorizontalJustify(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), KIGFX::GAL::SetTextMirrored(), KIGFX::GAL::SetVerticalJustify(), KIGFX::GAL::StrokeText(), and VECTOR2< T >::x.

◆ draw() [10/13]

void PCB_PAINTER::draw ( const ZONE aZone,
int  aLayer 
)
protectedinherited

aLayer will be the virtual zone layer (LAYER_ZONE_START, ... in GAL_LAYER_ID) This is used for draw ordering in the GAL. The color for the zone comes from the associated copper layer ( aLayer - LAYER_ZONE_START ) and the visibility comes from the combination of that copper layer and LAYER_ZONES

Definition at line 1626 of file pcb_painter.cpp.

1627 {
1634  wxASSERT( IsZoneLayer( aLayer ) );
1635  PCB_LAYER_ID layer = static_cast<PCB_LAYER_ID>( aLayer - LAYER_ZONE_START );
1636 
1637  if( !aZone->IsOnLayer( layer ) )
1638  return;
1639 
1640  COLOR4D color = m_pcbSettings.GetColor( aZone, layer );
1641  std::deque<VECTOR2D> corners;
1643 
1644  // Draw the outline
1645  const SHAPE_POLY_SET* outline = aZone->Outline();
1646 
1647  if( m_pcbSettings.m_zoneOutlines && outline && outline->OutlineCount() > 0 )
1648  {
1650  m_gal->SetIsFill( false );
1651  m_gal->SetIsStroke( true );
1653 
1654  // Draw each contour (main contour and holes)
1655 
1656  /* This line:
1657  * m_gal->DrawPolygon( *outline );
1658  * should be enough, but currently does not work to draw holes contours in a complex polygon
1659  * so each contour is draw as a simple polygon
1660  */
1661 
1662  // Draw the main contour
1663  m_gal->DrawPolyline( outline->COutline( 0 ) );
1664 
1665  // Draw holes
1666  int holes_count = outline->HoleCount( 0 );
1667 
1668  for( int ii = 0; ii < holes_count; ++ii )
1669  m_gal->DrawPolyline( outline->CHole( 0, ii ) );
1670 
1671  // Draw hatch lines
1672  for( const SEG& hatchLine : aZone->GetHatchLines() )
1673  m_gal->DrawLine( hatchLine.A, hatchLine.B );
1674  }
1675 
1676  // Draw the filling
1677  if( displayMode == ZONE_DISPLAY_MODE::SHOW_FILLED
1678  || displayMode == ZONE_DISPLAY_MODE::SHOW_FILLED_OUTLINE )
1679  {
1680  const SHAPE_POLY_SET& polySet = aZone->GetFilledPolysList( layer );
1681 
1682  if( polySet.OutlineCount() == 0 ) // Nothing to draw
1683  return;
1684 
1685  // Set up drawing options
1686  int outline_thickness = 0;
1687 
1688  if( aZone->GetFilledPolysUseThickness( layer ) )
1689  outline_thickness = aZone->GetMinThickness();
1690 
1692  m_gal->SetFillColor( color );
1693  m_gal->SetLineWidth( outline_thickness );
1694 
1695  if( displayMode == ZONE_DISPLAY_MODE::SHOW_FILLED )
1696  {
1697  m_gal->SetIsFill( true );
1698  m_gal->SetIsStroke( outline_thickness > 0 );
1699  }
1700  else if( displayMode == ZONE_DISPLAY_MODE::SHOW_FILLED_OUTLINE )
1701  {
1702  m_gal->SetIsFill( false );
1703  m_gal->SetIsStroke( true );
1704  }
1705 
1706  m_gal->DrawPolygon( polySet );
1707  }
1708 }
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
virtual void DrawPolyline(const std::deque< VECTOR2D > &aPointList)
Draw a polyline.
Virtual layers for stacking zones and tracks on a given copper layer.
Filled polygons are shown.
int OutlineCount() const
Return the number of vertices in a given outline/hole.
Outlines of filled polygons are shown.
SHAPE_POLY_SET * Outline()
Definition: zone.h:317
int color
Definition: DXF_plotter.cpp:60
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
Definition: zone.cpp:316
const SHAPE_POLY_SET & GetFilledPolysList(PCB_LAYER_ID aLayer) const
Definition: zone.h:632
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
virtual void SetLineWidth(float aLineWidth)
Set the line width.
PCB_LAYER_ID
A quick note on layer IDs:
int GetMinThickness() const
Definition: zone.h:241
const std::vector< SEG > & GetHatchLines() const
Definition: zone.h:797
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
Represent a set of closed polygons.
bool IsZoneLayer(LAYER_NUM aLayer)
int HoleCount(int aOutline) const
Return the reference to aIndex-th outline in the set.
Definition: seg.h:40
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
virtual void DrawPolygon(const std::deque< VECTOR2D > &aPointList)
Draw a polygon.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
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...
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
ZONE_DISPLAY_MODE m_zoneDisplayMode
Definition: pcb_painter.h:212
bool GetFilledPolysUseThickness() const
Definition: zone.h:686
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References SHAPE_POLY_SET::CHole(), color, SHAPE_POLY_SET::COutline(), KIGFX::GAL::DrawLine(), KIGFX::GAL::DrawPolygon(), KIGFX::GAL::DrawPolyline(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), ZONE::GetFilledPolysList(), ZONE::GetFilledPolysUseThickness(), ZONE::GetHatchLines(), ZONE::GetMinThickness(), SHAPE_POLY_SET::HoleCount(), ZONE::IsOnLayer(), IsZoneLayer(), LAYER_ZONE_START, KIGFX::PAINTER::m_gal, KIGFX::RENDER_SETTINGS::m_outlineWidth, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::PCB_RENDER_SETTINGS::m_zoneDisplayMode, KIGFX::PCB_RENDER_SETTINGS::m_zoneOutlines, ZONE::Outline(), SHAPE_POLY_SET::OutlineCount(), KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), SHOW_FILLED, and SHOW_FILLED_OUTLINE.

◆ draw() [11/13]

void PCB_PAINTER::draw ( const PCB_DIMENSION_BASE aDimension,
int  aLayer 
)
protectedinherited

Definition at line 1711 of file pcb_painter.cpp.

1712 {
1713  const COLOR4D& strokeColor = m_pcbSettings.GetColor( aDimension, aLayer );
1714 
1715  m_gal->SetStrokeColor( strokeColor );
1716  m_gal->SetIsFill( false );
1717  m_gal->SetIsStroke( true );
1718 
1720  {
1721  // Outline mode
1723  }
1724  else
1725  {
1726  // Filled mode
1727  m_gal->SetLineWidth( getLineThickness( aDimension->GetLineThickness() ) );
1728  }
1729 
1730  // Draw dimension shapes
1731  // TODO(JE) lift this out
1732  for( const std::shared_ptr<SHAPE>& shape : aDimension->GetShapes() )
1733  {
1734  switch( shape->Type() )
1735  {
1736  case SH_SEGMENT:
1737  {
1738  const SEG& seg = static_cast<const SHAPE_SEGMENT*>( shape.get() )->GetSeg();
1739  m_gal->DrawLine( seg.A, seg.B );
1740  break;
1741  }
1742 
1743  case SH_CIRCLE:
1744  {
1745  int radius = static_cast<const SHAPE_CIRCLE*>( shape.get() )->GetRadius();
1746  m_gal->DrawCircle( shape->Centre(), radius );
1747  break;
1748  }
1749 
1750  default:
1751  break;
1752  }
1753  }
1754  // Draw text
1755  const PCB_TEXT& text = aDimension->Text();
1756  VECTOR2D position( text.GetTextPos().x, text.GetTextPos().y );
1757 
1759  {
1760  // Outline mode
1762  }
1763  else
1764  {
1765  // Filled mode
1766  m_gal->SetLineWidth( getLineThickness( text.GetEffectiveTextPenWidth() ) );
1767  }
1768 
1769  m_gal->SetTextAttributes( &text );
1770  m_gal->StrokeText( text.GetShownText(), position, text.GetTextAngleRadians() );
1771 }
PCB_TEXT & Text()
virtual void SetTextAttributes(const EDA_TEXT *aText)
Loads attributes of the given text (bold/italic/underline/mirrored and so on).
Define a general 2D-vector/point.
Definition: vector2d.h:61
const std::vector< std::shared_ptr< SHAPE > > & GetShapes() const
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
virtual void SetLineWidth(float aLineWidth)
Set the line width.
int getLineThickness(int aActualThickness) const
Get the thickness to draw for a line (e.g.
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual void StrokeText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a vector type text using preloaded Newstroke font.
circle
Definition: shape.h:46
Definition: seg.h:40
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
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...
VECTOR2I A
Definition: seg.h:48
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
int GetLineThickness() const
line segment
Definition: shape.h:44
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103
VECTOR2I B
Definition: seg.h:49

References SEG::A, SEG::B, KIGFX::GAL::DrawCircle(), KIGFX::GAL::DrawLine(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), PCB_DIMENSION_BASE::GetLineThickness(), KIGFX::PCB_PAINTER::getLineThickness(), PCB_DIMENSION_BASE::GetShapes(), KIGFX::PAINTER::m_gal, KIGFX::RENDER_SETTINGS::m_outlineWidth, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::PCB_RENDER_SETTINGS::m_sketchGraphics, KIGFX::PCB_RENDER_SETTINGS::m_sketchText, KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), KIGFX::GAL::SetTextAttributes(), SH_CIRCLE, SH_SEGMENT, KIGFX::GAL::StrokeText(), PCB_DIMENSION_BASE::Text(), and text.

◆ draw() [12/13]

void PCB_PAINTER::draw ( const PCB_TARGET aTarget)
protectedinherited

Definition at line 1774 of file pcb_painter.cpp.

1775 {
1776  const COLOR4D& strokeColor = m_pcbSettings.GetColor( aTarget, aTarget->GetLayer() );
1777  VECTOR2D position( aTarget->GetPosition() );
1778  double size, radius;
1779 
1780  m_gal->SetLineWidth( getLineThickness( aTarget->GetWidth() ) );
1781  m_gal->SetStrokeColor( strokeColor );
1782  m_gal->SetIsFill( false );
1783  m_gal->SetIsStroke( true );
1784 
1785  m_gal->Save();
1786  m_gal->Translate( position );
1787 
1788  if( aTarget->GetShape() )
1789  {
1790  // shape x
1791  m_gal->Rotate( M_PI / 4.0 );
1792  size = 2.0 * aTarget->GetSize() / 3.0;
1793  radius = aTarget->GetSize() / 2.0;
1794  }
1795  else
1796  {
1797  // shape +
1798  size = aTarget->GetSize() / 2.0;
1799  radius = aTarget->GetSize() / 3.0;
1800  }
1801 
1802  m_gal->DrawLine( VECTOR2D( -size, 0.0 ), VECTOR2D( size, 0.0 ) );
1803  m_gal->DrawLine( VECTOR2D( 0.0, -size ), VECTOR2D( 0.0, size ) );
1804  m_gal->DrawCircle( VECTOR2D( 0.0, 0.0 ), radius );
1805 
1806  m_gal->Restore();
1807 }
int GetSize() const
Definition: pcb_target.h:62
Define a general 2D-vector/point.
Definition: vector2d.h:61
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void Rotate(double aAngle)
Rotate the context.
wxPoint GetPosition() const override
Definition: pcb_target.h:56
int GetWidth() const
Definition: pcb_target.h:65
int getLineThickness(int aActualThickness) const
Get the thickness to draw for a line (e.g.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
virtual void Restore()
Restore the context.
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
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...
int GetShape() const
Definition: pcb_target.h:59
virtual void Save()
Save the context.
virtual void Translate(const VECTOR2D &aTranslation)
Translate the context.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:171
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References KIGFX::GAL::DrawCircle(), KIGFX::GAL::DrawLine(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), BOARD_ITEM::GetLayer(), KIGFX::PCB_PAINTER::getLineThickness(), PCB_TARGET::GetPosition(), PCB_TARGET::GetShape(), PCB_TARGET::GetSize(), PCB_TARGET::GetWidth(), KIGFX::PAINTER::m_gal, KIGFX::PCB_PAINTER::m_pcbSettings, KIGFX::GAL::Restore(), KIGFX::GAL::Rotate(), KIGFX::GAL::Save(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), and KIGFX::GAL::Translate().

◆ draw() [13/13]

void PCB_PAINTER::draw ( const PCB_MARKER aMarker,
int  aLayer 
)
protectedinherited

Definition at line 1810 of file pcb_painter.cpp.

1811 {
1812  bool isShadow = aLayer == LAYER_MARKER_SHADOWS;
1813 
1814  // Don't paint shadows for invisible markers.
1815  // It would be nice to do this through layer dependencies but we can't do an "or" there today
1816  if( isShadow && aMarker->GetBoard()
1817  && !aMarker->GetBoard()->IsElementVisible( aMarker->GetColorLayer() ) )
1818  {
1819  return;
1820  }
1821 
1822  SHAPE_LINE_CHAIN polygon;
1823  aMarker->ShapeToPolygon( polygon );
1824 
1826  : aMarker->GetColorLayer() );
1827 
1828  m_gal->Save();
1829  m_gal->Translate( aMarker->GetPosition() );
1830 
1831  if( isShadow )
1832  {
1834  m_gal->SetIsStroke( true );
1835  m_gal->SetLineWidth( aMarker->MarkerScale() );
1836  }
1837  else
1838  {
1839  m_gal->SetFillColor( color );
1840  m_gal->SetIsFill( true );
1841  }
1842 
1843  m_gal->DrawPolygon( polygon );
1844  m_gal->Restore();
1845 }
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
int color
Definition: DXF_plotter.cpp:60
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:50
GAL_LAYER_ID GetColorLayer() const
Definition: pcb_marker.cpp:180
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:531
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...
int MarkerScale() const
The scaling factor to convert polygonal shape coordinates to internal units.
Definition: marker_base.h:66
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
virtual void Restore()
Restore the context.
virtual void DrawPolygon(const std::deque< VECTOR2D > &aPointList)
Draw a polygon.
SHAPE_LINE_CHAIN.
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...
virtual void Save()
Save the context.
virtual void Translate(const VECTOR2D &aTranslation)
Translate the context.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
wxPoint GetPosition() const override
Definition: pcb_marker.h:67
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References color, KIGFX::GAL::DrawPolygon(), BOARD_ITEM::GetBoard(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), PCB_MARKER::GetColorLayer(), PCB_MARKER::GetPosition(), BOARD::IsElementVisible(), LAYER_MARKER_SHADOWS, KIGFX::PAINTER::m_gal, KIGFX::PCB_PAINTER::m_pcbSettings, MARKER_BASE::MarkerScale(), KIGFX::GAL::Restore(), KIGFX::GAL::Save(), KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), MARKER_BASE::ShapeToPolygon(), and KIGFX::GAL::Translate().

◆ getDrillShape()

int KIGFX::PCB_PRINT_PAINTER::getDrillShape ( const PAD aPad) const
overrideprotectedvirtual

Return drill shape of a pad.

Reimplemented from KIGFX::PCB_PAINTER.

Definition at line 298 of file pcbnew_printout.cpp.

299 {
301 }
bool m_drillMarkReal
User-specified size for drill marks (expressed in internal units)
virtual int getDrillShape(const PAD *aPad) const
Return drill shape of a pad.

References KIGFX::PCB_PAINTER::getDrillShape(), and PAD_DRILL_SHAPE_CIRCLE.

◆ getDrillSize() [1/2]

VECTOR2D KIGFX::PCB_PRINT_PAINTER::getDrillSize ( const PAD aPad) const
overrideprotectedvirtual

Return drill size for a pad (internal units).

Reimplemented from KIGFX::PCB_PAINTER.

Definition at line 304 of file pcbnew_printout.cpp.

305 {
306  // TODO should it depend on the pad size?
309 }
Define a general 2D-vector/point.
Definition: vector2d.h:61
virtual VECTOR2D getDrillSize(const PAD *aPad) const
Return drill size for a pad (internal units).
bool m_drillMarkReal
User-specified size for drill marks (expressed in internal units)

References KIGFX::PCB_PAINTER::getDrillSize().

◆ getDrillSize() [2/2]

int KIGFX::PCB_PRINT_PAINTER::getDrillSize ( const PCB_VIA aVia) const
overrideprotectedvirtual

Flag deciding whether use the actual hole size or user-specified size for drill marks.

Reimplemented from KIGFX::PCB_PAINTER.

Definition at line 312 of file pcbnew_printout.cpp.

313 {
314  // TODO should it depend on the via size?
316 }
virtual VECTOR2D getDrillSize(const PAD *aPad) const
Return drill size for a pad (internal units).
bool m_drillMarkReal
User-specified size for drill marks (expressed in internal units)

References KIGFX::PCB_PAINTER::getDrillSize().

◆ getLineThickness()

int PCB_PAINTER::getLineThickness ( int  aActualThickness) const
protectedinherited

Get the thickness to draw for a line (e.g.

0 thickness lines get a minimum value).

Parameters
aActualThicknessline own thickness
Returns
the thickness to draw

Definition at line 424 of file pcb_painter.cpp.

425 {
426  // if items have 0 thickness, draw them with the outline
427  // width, otherwise respect the set value (which, no matter
428  // how small will produce something)
429  if( aActualThickness == 0 )
431 
432  return aActualThickness;
433 }
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295

References KIGFX::RENDER_SETTINGS::m_outlineWidth, and KIGFX::PCB_PAINTER::m_pcbSettings.

Referenced by KIGFX::PCB_PAINTER::draw().

◆ GetSettings()

virtual PCB_RENDER_SETTINGS* KIGFX::PCB_PAINTER::GetSettings ( )
inlineoverridevirtualinherited

Return a pointer to current settings that are going to be used when drawing items.

Returns
Current rendering settings.

Implements KIGFX::PAINTER.

Definition at line 247 of file pcb_painter.h.

248  {
249  return &m_pcbSettings;
250  }
PCB_RENDER_SETTINGS m_pcbSettings
Definition: pcb_painter.h:295

References KIGFX::PCB_PAINTER::m_pcbSettings.

Referenced by APPEARANCE_CONTROLS::OnLayerAlphaChanged(), PCBNEW_PRINTOUT::setupPainter(), PANEL_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_EDIT_OPTIONS::TransferDataFromWindow(), PCB_TRACK::ViewGetLOD(), PCB_VIA::ViewGetLOD(), and PAD::ViewGetLOD().

◆ SetDrillMarks()

void KIGFX::PCB_PRINT_PAINTER::SetDrillMarks ( bool  aRealSize,
unsigned int  aSize = 0 
)
inline

Set drill marks visibility and options.

Parameters
aRealSizewhen enabled, drill marks represent actual holes. Otherwise aSize parameter is used.
aSizeis drill mark size (internal units), valid only when aRealSize == false.

Definition at line 97 of file pcbnew_printout.h.

98  {
99  m_drillMarkReal = aRealSize;
100  m_drillMarkSize = aSize;
101  }
bool m_drillMarkReal
User-specified size for drill marks (expressed in internal units)

References m_drillMarkReal, and m_drillMarkSize.

Referenced by PCBNEW_PRINTOUT::setupPainter().

◆ SetGAL()

void KIGFX::PAINTER::SetGAL ( GAL aGal)
inlineinherited

Changes Graphics Abstraction Layer used for drawing items for a new one.

Parameters
aGalis the new GAL instance.

Definition at line 75 of file painter.h.

76  {
77  m_gal = aGal;
78  }
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101

References KIGFX::PAINTER::m_gal.

Member Data Documentation

◆ m_drillMarkReal

bool KIGFX::PCB_PRINT_PAINTER::m_drillMarkReal
protected

User-specified size for drill marks (expressed in internal units)

Definition at line 111 of file pcbnew_printout.h.

Referenced by SetDrillMarks().

◆ m_drillMarkSize

int KIGFX::PCB_PRINT_PAINTER::m_drillMarkSize
protected

Definition at line 114 of file pcbnew_printout.h.

Referenced by SetDrillMarks().

◆ m_gal

◆ m_pcbSettings

PCB_RENDER_SETTINGS KIGFX::PCB_PAINTER::m_pcbSettings
protectedinherited

The documentation for this class was generated from the following files: