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 254 of file view_overlay.cpp.

255 {
256 }

◆ ~VIEW_OVERLAY()

KIGFX::VIEW_OVERLAY::~VIEW_OVERLAY ( )
virtual

Definition at line 259 of file view_overlay.cpp.

260 {
261  releaseCommands();
262 }

References releaseCommands().

Member Function Documentation

◆ Arc()

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

Definition at line 357 of file view_overlay.cpp.

359 {
360  m_commands.push_back( new COMMAND_ARC( aCenterPoint, aRadius, aStartAngle, aEndAngle ) );
361 }
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 382 of file view_overlay.cpp.

384 {
385  m_commands.push_back( new COMMAND_BITMAP_TEXT( aText, aPosition, aRotationAngle ) );
386 }
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 351 of file view_overlay.cpp.

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

References m_commands.

◆ Clear()

void KIGFX::VIEW_OVERLAY::Clear ( )

Definition at line 274 of file view_overlay.cpp.

275 {
276  releaseCommands();
277 }

References releaseCommands().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 148 of file view_item.h.

149  {
150  m_viewPrivData = nullptr;
151  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:156

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 413 of file view_overlay.cpp.

414 {
415  Line( aP + VECTOR2D( -aSize, -aSize ), aP + VECTOR2D( aSize, aSize ) );
416  Line( aP + VECTOR2D( aSize, -aSize ), aP + VECTOR2D( -aSize, aSize ) );
417 }
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622

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 303 of file view_overlay.cpp.

304 {
305  m_commands.push_back( new COMMAND_LINE( aStartPoint, aEndPoint ) );
306 }
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 309 of file view_overlay.cpp.

310 {
311  Line( aSeg.A, aSeg.B );
312 }
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 339 of file view_overlay.cpp.

340 {
341  m_commands.push_back( new COMMAND_POLYGON( aPointList ) );
342 }
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 333 of file view_overlay.cpp.

334 {
335  m_commands.push_back( new COMMAND_POLY_POLYGON( aPolySet ) );
336 }
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 345 of file view_overlay.cpp.

346 {
347  m_commands.push_back( new COMMAND_POINT_POLYGON( aPointList, aListSize ) );
348 }
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 322 of file view_overlay.cpp.

323 {
324  SetIsStroke( true );
325  SetIsFill( false );
326  for( int i = 0; i < aPolyLine.SegmentCount(); i++ )
327  {
328  Line( aPolyLine.CSegment( i ) );
329  }
330 }
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 364 of file view_overlay.cpp.

365 {
366  m_commands.push_back( new COMMAND_RECTANGLE( aStartPoint, aEndPoint ) );
367 }
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 265 of file view_overlay.cpp.

266 {
267  for( auto cmd : m_commands )
268  delete cmd;
269 
270  m_commands.clear();
271 }
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 315 of file view_overlay.cpp.

316 {
317  SetLineWidth( aWidth );
318  Line( aStartPoint, aEndPoint );
319 }
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 395 of file view_overlay.cpp.

396 {
397  m_fillColor = aColor;
398  m_commands.push_back( new COMMAND_SET_COLOR( false, aColor ) );
399 }
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 376 of file view_overlay.cpp.

377 {
378  m_commands.push_back( new COMMAND_GLYPH_SIZE( aSize ) );
379 }
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:112

References m_commands.

◆ SetIsFill()

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

Definition at line 370 of file view_overlay.cpp.

371 {
372  m_commands.push_back( new COMMAND_SET_FILL( aIsFillEnabled ) );
373 }
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 389 of file view_overlay.cpp.

390 {
391  m_commands.push_back( new COMMAND_SET_STROKE( aIsStrokeEnabled ) );
392 }
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 408 of file view_overlay.cpp.

409 {
410  m_commands.push_back( new COMMAND_SET_WIDTH( aLineWidth ) );
411 }
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 402 of file view_overlay.cpp.

403 {
404  m_strokeColor = aColor;
405  m_commands.push_back( new COMMAND_SET_COLOR( true, aColor ) );
406 }
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 280 of file view_overlay.cpp.

281 {
282  BOX2I maxBox;
283 
284  maxBox.SetMaximum();
285  return maxBox;
286 }
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 289 of file view_overlay.cpp.

290 {
291  for( const auto& cmd : m_commands )
292  cmd->Execute( aView );
293 }
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 296 of file view_overlay.cpp.

297 {
298  aLayers[0] = LAYER_GP_OVERLAY;
299  aCount = 1;
300 }
general purpose overlay
Definition: layer_ids.h:213

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 137 of file view_item.h.

138  {
139  // By default always show the item
140  return 0.0;
141  }

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: