KiCad PCB EDA Suite
KIGFX::VIEW_OVERLAY Class Reference

#include <view_overlay.h>

Inheritance diagram for KIGFX::VIEW_OVERLAY:
KIGFX::VIEW_ITEM INSPECTABLE PNS_LOG_VIEWER_OVERLAY

Classes

struct  COMMAND
 
struct  COMMAND_ARC
 
struct  COMMAND_BITMAP_TEXT
 
struct  COMMAND_CIRCLE
 
struct  COMMAND_GLYPH_SIZE
 
struct  COMMAND_LINE
 
struct  COMMAND_POINT_POLYGON
 
struct  COMMAND_POLY_POLYGON
 
struct  COMMAND_POLYGON
 
struct  COMMAND_RECTANGLE
 
struct  COMMAND_SET_COLOR
 
struct  COMMAND_SET_FILL
 
struct  COMMAND_SET_STROKE
 
struct  COMMAND_SET_WIDTH
 

Public Member Functions

 VIEW_OVERLAY ()
 
virtual ~VIEW_OVERLAY ()
 
void Clear ()
 
virtual const BOX2I ViewBBox () const override
 Return the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const override
 Draw the parts of the object belonging to layer aLayer. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Return the all the layers within the VIEW the object is painted on. More...
 
void Line (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
 
void Line (const SEG &aSeg)
 
void Segment (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
 
void Circle (const VECTOR2D &aCenterPoint, double aRadius)
 
void Arc (const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle)
 
void Rectangle (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
 
void Cross (const VECTOR2D &aP, int aSize)
 
void Polygon (const std::deque< VECTOR2D > &aPointList)
 
void Polygon (const SHAPE_POLY_SET &aPolySet)
 
void Polyline (const SHAPE_LINE_CHAIN &aPolyLine)
 
void Polygon (const VECTOR2D aPointList[], int aListSize)
 
void BitmapText (const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
 
void SetIsFill (bool aIsFillEnabled)
 
void SetIsStroke (bool aIsStrokeEnabled)
 
void SetFillColor (const COLOR4D &aColor)
 
void SetStrokeColor (const COLOR4D &aColor)
 
void SetGlyphSize (const VECTOR2D &aSize)
 
void SetLineWidth (double aLineWidth)
 
const COLOR4DGetStrokeColor () const
 
const COLOR4DGetFillColor () const
 
virtual double ViewGetLOD (int aLayer, VIEW *aView) const
 Return the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATAviewPrivData () const
 
void ClearViewPrivData ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty)
 
template<typename T >
Get (PROPERTY_BASE *aProperty)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 

Private Member Functions

void releaseCommands ()
 

Private Attributes

COLOR4D m_strokeColor
 
COLOR4D m_fillColor
 
std::vector< COMMAND * > m_commands
 

Detailed Description

Definition at line 44 of file view_overlay.h.

Constructor & Destructor Documentation

◆ VIEW_OVERLAY()

KIGFX::VIEW_OVERLAY::VIEW_OVERLAY ( )

Definition at line 263 of file view_overlay.cpp.

264 {
265 }

◆ ~VIEW_OVERLAY()

KIGFX::VIEW_OVERLAY::~VIEW_OVERLAY ( )
virtual

Definition at line 268 of file view_overlay.cpp.

269 {
270  releaseCommands();
271 }

References releaseCommands().

Member Function Documentation

◆ Arc()

void KIGFX::VIEW_OVERLAY::Arc ( const VECTOR2D aCenterPoint,
double  aRadius,
double  aStartAngle,
double  aEndAngle 
)

Definition at line 365 of file view_overlay.cpp.

367 {
368  m_commands.push_back( new COMMAND_ARC( aCenterPoint, aRadius, aStartAngle, aEndAngle ) );
369 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

Referenced by PNS_LOG_VIEWER_OVERLAY::Arc().

◆ BitmapText()

void KIGFX::VIEW_OVERLAY::BitmapText ( const wxString &  aText,
const VECTOR2D aPosition,
double  aRotationAngle 
)

Definition at line 390 of file view_overlay.cpp.

392 {
393  m_commands.push_back( new COMMAND_BITMAP_TEXT( aText, aPosition, aRotationAngle ) );
394 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

Referenced by LABEL_MANAGER::Redraw().

◆ Circle()

void KIGFX::VIEW_OVERLAY::Circle ( const VECTOR2D aCenterPoint,
double  aRadius 
)

Definition at line 359 of file view_overlay.cpp.

360 {
361  m_commands.push_back( new COMMAND_CIRCLE( aCenterPoint, aRadius ) );
362 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

◆ Clear()

void KIGFX::VIEW_OVERLAY::Clear ( )

Definition at line 283 of file view_overlay.cpp.

284 {
285  releaseCommands();
286 }

References releaseCommands().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 143 of file view_item.h.

144  {
145  m_viewPrivData = nullptr;
146  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:151

References KIGFX::VIEW_ITEM::m_viewPrivData.

Referenced by KIGFX::VIEW::OnDestroy().

◆ Cross()

void KIGFX::VIEW_OVERLAY::Cross ( const VECTOR2D aP,
int  aSize 
)

Definition at line 421 of file view_overlay.cpp.

422 {
423  Line( aP + VECTOR2D( -aSize, -aSize ), aP + VECTOR2D( aSize, aSize ) );
424  Line( aP + VECTOR2D( aSize, -aSize ), aP + VECTOR2D( -aSize, aSize ) );
425 }
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
VECTOR2< double > VECTOR2D
Definition: vector2d.h:621

References Line().

◆ Get() [1/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 86 of file inspectable.h.

87  {
89  TYPE_ID thisType = TYPE_HASH( *this );
90  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
91  return object ? aProperty->getter( object ) : wxAny();
92  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual wxAny getter(void *aObject) const =0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by BOOST_AUTO_TEST_CASE(), CLASS_D_DESC::CLASS_D_DESC(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [2/3]

template<typename T >
T INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 95 of file inspectable.h.

96  {
98  TYPE_ID thisType = TYPE_HASH( *this );
99  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
100  return object ? aProperty->get<T>( object ) : T();
101  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
T get(void *aObject)
Definition: property.h:268
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Get() [3/3]

template<typename T >
boost::optional<T> INSPECTABLE::Get ( const wxString &  aProperty)
inlineinherited

Definition at line 104 of file inspectable.h.

105  {
107  TYPE_ID thisType = TYPE_HASH( *this );
108  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
109  boost::optional<T> ret = T();
110 
111  if( prop )
112  {
113  void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
114 
115  if( object )
116  ret = prop->get<T>( object );
117  }
118 
119  return ret;
120  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
T get(void *aObject)
Definition: property.h:268
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ GetFillColor()

const COLOR4D& KIGFX::VIEW_OVERLAY::GetFillColor ( ) const
inline

Definition at line 104 of file view_overlay.h.

104 { return m_fillColor; }

References m_fillColor.

◆ GetStrokeColor()

const COLOR4D& KIGFX::VIEW_OVERLAY::GetStrokeColor ( ) const
inline

Definition at line 103 of file view_overlay.h.

103 { return m_strokeColor; }

References m_strokeColor.

Referenced by PNS_LOG_VIEWER_OVERLAY::AnnotatedPolyline(), and PNS_LOG_VIEWER_OVERLAY::Arc().

◆ Line() [1/2]

void KIGFX::VIEW_OVERLAY::Line ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint 
)

Definition at line 312 of file view_overlay.cpp.

313 {
314  m_commands.push_back( new COMMAND_LINE( aStartPoint, aEndPoint ) );
315 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

Referenced by PNS_LOG_VIEWER_OVERLAY::AnnotatedPoint(), Cross(), Line(), Polyline(), LABEL_MANAGER::Redraw(), and Segment().

◆ Line() [2/2]

void KIGFX::VIEW_OVERLAY::Line ( const SEG aSeg)

Definition at line 318 of file view_overlay.cpp.

319 {
320  Line( aSeg.A, aSeg.B );
321 }
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
VECTOR2I A
Definition: seg.h:48
VECTOR2I B
Definition: seg.h:49

References SEG::A, SEG::B, and Line().

◆ Polygon() [1/3]

void KIGFX::VIEW_OVERLAY::Polygon ( const std::deque< VECTOR2D > &  aPointList)

Definition at line 347 of file view_overlay.cpp.

348 {
349  m_commands.push_back( new COMMAND_POLYGON( aPointList ) );
350 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

◆ Polygon() [2/3]

void KIGFX::VIEW_OVERLAY::Polygon ( const SHAPE_POLY_SET aPolySet)

Definition at line 341 of file view_overlay.cpp.

342 {
343  m_commands.push_back( new COMMAND_POLY_POLYGON( aPolySet ) );
344 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

◆ Polygon() [3/3]

void KIGFX::VIEW_OVERLAY::Polygon ( const VECTOR2D  aPointList[],
int  aListSize 
)

Definition at line 353 of file view_overlay.cpp.

354 {
355  m_commands.push_back( new COMMAND_POINT_POLYGON( aPointList, aListSize ) );
356 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

◆ Polyline()

void KIGFX::VIEW_OVERLAY::Polyline ( const SHAPE_LINE_CHAIN aPolyLine)

Definition at line 331 of file view_overlay.cpp.

332 {
333  SetIsStroke( true );
334  SetIsFill( false );
335 
336  for( int i = 0; i < aPolyLine.SegmentCount(); i++ )
337  Line( aPolyLine.CSegment( i ) );
338 }
void SetIsStroke(bool aIsStrokeEnabled)
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
int SegmentCount() const
Return the number of segments in this line chain.
void SetIsFill(bool aIsFillEnabled)
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.

References SHAPE_LINE_CHAIN::CSegment(), Line(), SHAPE_LINE_CHAIN::SegmentCount(), SetIsFill(), and SetIsStroke().

Referenced by PNS_LOG_VIEWER_OVERLAY::AnnotatedPolyline().

◆ Rectangle()

void KIGFX::VIEW_OVERLAY::Rectangle ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint 
)

Definition at line 372 of file view_overlay.cpp.

373 {
374  m_commands.push_back( new COMMAND_RECTANGLE( aStartPoint, aEndPoint ) );
375 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

Referenced by LABEL_MANAGER::Redraw().

◆ releaseCommands()

void KIGFX::VIEW_OVERLAY::releaseCommands ( )
private

Definition at line 274 of file view_overlay.cpp.

275 {
276  for( VIEW_OVERLAY::COMMAND* cmd : m_commands )
277  delete cmd;
278 
279  m_commands.clear();
280 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

Referenced by Clear(), and ~VIEW_OVERLAY().

◆ Segment()

void KIGFX::VIEW_OVERLAY::Segment ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint,
double  aWidth 
)

Definition at line 324 of file view_overlay.cpp.

325 {
326  SetLineWidth( aWidth );
327  Line( aStartPoint, aEndPoint );
328 }
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
void SetLineWidth(double aLineWidth)

References Line(), and SetLineWidth().

◆ Set() [1/3]

bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
wxAny &  aValue 
)
inlineinherited

Definition at line 42 of file inspectable.h.

43  {
45  TYPE_ID thisType = TYPE_HASH( *this );
46  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
47 
48  if( object )
49  aProperty->setter( object, aValue );
50 
51  return object != nullptr;
52  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [2/3]

template<typename T >
bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
aValue 
)
inlineinherited

Definition at line 55 of file inspectable.h.

56  {
58  TYPE_ID thisType = TYPE_HASH( *this );
59  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
60 
61  if( object )
62  aProperty->set<T>( object, aValue );
63 
64  return object != nullptr;
65  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
void set(void *aObject, T aValue)
Definition: property.h:261
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [3/3]

template<typename T >
bool INSPECTABLE::Set ( const wxString &  aProperty,
aValue 
)
inlineinherited

Definition at line 68 of file inspectable.h.

69  {
71  TYPE_ID thisType = TYPE_HASH( *this );
72  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
73  void* object = nullptr;
74 
75  if( prop )
76  {
77  object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
78 
79  if( object )
80  prop->set<T>( object, aValue );
81  }
82 
83  return object != nullptr;
84  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
void set(void *aObject, T aValue)
Definition: property.h:261
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ SetFillColor()

void KIGFX::VIEW_OVERLAY::SetFillColor ( const COLOR4D aColor)

Definition at line 403 of file view_overlay.cpp.

404 {
405  m_fillColor = aColor;
406  m_commands.push_back( new COMMAND_SET_COLOR( false, aColor ) );
407 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands, and m_fillColor.

◆ SetGlyphSize()

void KIGFX::VIEW_OVERLAY::SetGlyphSize ( const VECTOR2D aSize)

Definition at line 384 of file view_overlay.cpp.

385 {
386  m_commands.push_back( new COMMAND_GLYPH_SIZE( aSize ) );
387 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

◆ SetIsFill()

void KIGFX::VIEW_OVERLAY::SetIsFill ( bool  aIsFillEnabled)

Definition at line 378 of file view_overlay.cpp.

379 {
380  m_commands.push_back( new COMMAND_SET_FILL( aIsFillEnabled ) );
381 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

Referenced by Polyline(), and LABEL_MANAGER::Redraw().

◆ SetIsStroke()

void KIGFX::VIEW_OVERLAY::SetIsStroke ( bool  aIsStrokeEnabled)

Definition at line 397 of file view_overlay.cpp.

398 {
399  m_commands.push_back( new COMMAND_SET_STROKE( aIsStrokeEnabled ) );
400 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

Referenced by Polyline(), and LABEL_MANAGER::Redraw().

◆ SetLineWidth()

void KIGFX::VIEW_OVERLAY::SetLineWidth ( double  aLineWidth)

Definition at line 416 of file view_overlay.cpp.

417 {
418  m_commands.push_back( new COMMAND_SET_WIDTH( aLineWidth ) );
419 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

Referenced by PNS_LOG_VIEWER_OVERLAY::Arc(), LABEL_MANAGER::Redraw(), and Segment().

◆ SetStrokeColor()

void KIGFX::VIEW_OVERLAY::SetStrokeColor ( const COLOR4D aColor)

Definition at line 410 of file view_overlay.cpp.

411 {
412  m_strokeColor = aColor;
413  m_commands.push_back( new COMMAND_SET_COLOR( true, aColor ) );
414 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands, and m_strokeColor.

Referenced by PNS_LOG_VIEWER_OVERLAY::Arc(), and LABEL_MANAGER::Redraw().

◆ ViewBBox()

const BOX2I KIGFX::VIEW_OVERLAY::ViewBBox ( ) const
overridevirtual

Return the bounding box of the item covering all its layers.

Returns
the current bounding box.

Implements KIGFX::VIEW_ITEM.

Definition at line 289 of file view_overlay.cpp.

290 {
291  BOX2I maxBox;
292 
293  maxBox.SetMaximum();
294  return maxBox;
295 }
void SetMaximum()
Definition: box2.h:57

References BOX2< Vec >::SetMaximum().

◆ ViewDraw()

void KIGFX::VIEW_OVERLAY::ViewDraw ( int  aLayer,
VIEW aView 
) const
overridevirtual

Draw the parts of the object belonging to layer aLayer.

An alternative way for drawing objects if there is no #PAINTER assigned for the view or if the PAINTER doesn't know how to paint this particular implementation of VIEW_ITEM. The preferred way of drawing is to design an appropriate PAINTER object, the method below is intended only for quick hacks and debugging purposes.

Parameters
aLayeris the current drawing layer.
aViewis a pointer to the VIEW device we are drawing on.

Reimplemented from KIGFX::VIEW_ITEM.

Definition at line 298 of file view_overlay.cpp.

299 {
300  for( const VIEW_OVERLAY::COMMAND* cmd : m_commands )
301  cmd->Execute( aView );
302 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

◆ ViewGetLayers()

void KIGFX::VIEW_OVERLAY::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtual

Return the all the layers within the VIEW the object is painted on.

For instance, a PAD spans zero or more copper layers and a few technical layers. ViewDraw() or PAINTER::Draw() is repeatedly called for each of the layers returned by ViewGetLayers(), depending on the rendering order.

Parameters
aLayers[]is the output layer index array.
aCountis the number of layer indices in aLayers[].

Implements KIGFX::VIEW_ITEM.

Definition at line 305 of file view_overlay.cpp.

306 {
307  aLayers[0] = LAYER_GP_OVERLAY;
308  aCount = 1;
309 }
general purpose overlay
Definition: layer_ids.h:214

References LAYER_GP_OVERLAY.

◆ ViewGetLOD()

virtual double KIGFX::VIEW_ITEM::ViewGetLOD ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Return the level of detail (LOD) of the item.

A level of detail is the minimal VIEW scale that is sufficient for an item to be shown on a given layer.

Parameters
aLayeris the current drawing layer.
aViewis a pointer to the VIEW device we are drawing on.
Returns
the level of detail. 0 always show the item, because the actual zoom level (or VIEW scale) is always > 0

Reimplemented in FP_ZONE, PAD, FOOTPRINT, PCB_VIA, GERBER_DRAW_ITEM, FP_TEXT, PCB_TRACK, ZONE, PCB_GROUP, and FP_SHAPE.

Definition at line 132 of file view_item.h.

133  {
134  // By default always show the item
135  return 0.0;
136  }

Referenced by PNS_KICAD_IFACE::IsItemVisible(), KIGFX::VIEW::DRAW_ITEM_VISITOR::operator()(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), and PCB_SELECTION_TOOL::Selectable().

◆ viewPrivData()

Member Data Documentation

◆ m_commands

std::vector<COMMAND*> KIGFX::VIEW_OVERLAY::m_commands
private

◆ m_fillColor

COLOR4D KIGFX::VIEW_OVERLAY::m_fillColor
private

Definition at line 110 of file view_overlay.h.

Referenced by GetFillColor(), and SetFillColor().

◆ m_strokeColor

COLOR4D KIGFX::VIEW_OVERLAY::m_strokeColor
private

Definition at line 109 of file view_overlay.h.

Referenced by GetStrokeColor(), and SetStrokeColor().


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