KiCad PCB EDA Suite
PNS_LOG_VIEWER_OVERLAY Class Reference

#include <pns_log_viewer_frame.h>

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

Public Member Functions

 PNS_LOG_VIEWER_OVERLAY (KIGFX::GAL *aGal)
 
void AnnotatedPolyline (const SHAPE_LINE_CHAIN &aL, std::string name, bool aShowVertexNumbers=false)
 
void AnnotatedPoint (const VECTOR2I p, int size, std::string name="", bool aShowVertexNumbers=false)
 
void Arc (const SHAPE_ARC &arc)
 
void DrawAnnotations ()
 
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, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &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 Polygon (const VECTOR2D aPointList[], int aListSize)
 
void Polyline (const SHAPE_LINE_CHAIN &aPolyLine)
 
void BitmapText (const wxString &aText, const VECTOR2I &aPosition, const EDA_ANGLE &aAngle)
 
void SetIsFill (bool aIsFillEnabled)
 
void SetIsStroke (bool aIsStrokeEnabled)
 
void SetFillColor (const COLOR4D &aColor)
 
void SetStrokeColor (const COLOR4D &aColor)
 
void SetGlyphSize (const VECTOR2I &aSize)
 
void SetLineWidth (double aLineWidth)
 
const COLOR4D & GetStrokeColor () const
 
const COLOR4D & GetFillColor () const
 
virtual double ViewGetLOD (int aLayer, VIEW *aView) const
 Return the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () 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) const
 
template<typename T >
Get (PROPERTY_BASE *aProperty) const
 
template<typename T >
std::optional< T > Get (const wxString &aProperty) const
 

Private Member Functions

void releaseCommands ()
 

Private Attributes

std::unique_ptr< LABEL_MANAGERm_labelMgr
 
COLOR4D m_strokeColor
 
COLOR4D m_fillColor
 
std::vector< COMMAND * > m_commands
 
VIEW_ITEM_DATA * m_viewPrivData
 

Detailed Description

Definition at line 97 of file pns_log_viewer_frame.h.

Constructor & Destructor Documentation

◆ PNS_LOG_VIEWER_OVERLAY()

PNS_LOG_VIEWER_OVERLAY::PNS_LOG_VIEWER_OVERLAY ( KIGFX::GAL aGal)

Definition at line 57 of file pns_log_viewer_frame.cpp.

58{
59 m_labelMgr.reset( new LABEL_MANAGER( aGal ) );
60}
std::unique_ptr< LABEL_MANAGER > m_labelMgr

References m_labelMgr.

Member Function Documentation

◆ AnnotatedPoint()

void PNS_LOG_VIEWER_OVERLAY::AnnotatedPoint ( const VECTOR2I  p,
int  size,
std::string  name = "",
bool  aShowVertexNumbers = false 
)

Definition at line 79 of file pns_log_viewer_frame.cpp.

80{
81 Line( p + VECTOR2D( size, size ), p - VECTOR2D( size, size ) );
82 Line( p + VECTOR2D( -size, size ), p - VECTOR2D( -size, size ) );
83
84 if( name.length() > 0 )
85 m_labelMgr->Add( p, name, GetStrokeColor() );
86}
const char * name
Definition: DXF_plotter.cpp:56
const COLOR4D & GetStrokeColor() const
Definition: view_overlay.h:104
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
VECTOR2< double > VECTOR2D
Definition: vector2d.h:617

References KIGFX::VIEW_OVERLAY::GetStrokeColor(), KIGFX::VIEW_OVERLAY::Line(), m_labelMgr, and name.

◆ AnnotatedPolyline()

void PNS_LOG_VIEWER_OVERLAY::AnnotatedPolyline ( const SHAPE_LINE_CHAIN aL,
std::string  name,
bool  aShowVertexNumbers = false 
)

Definition at line 63 of file pns_log_viewer_frame.cpp.

65{
66 Polyline( aL );
67
68 if( name.length() > 0 && aL.PointCount() > 0 )
69 m_labelMgr->Add( aL.CPoint( -1 ), name, GetStrokeColor() );
70
71 if( aShowVertexNumbers )
72 {
73 for( int i = 0; i < aL.PointCount(); i++ )
74 m_labelMgr->Add( aL.CPoint(i), wxString::Format("%d", i ), GetStrokeColor() );
75 }
76}
void Polyline(const SHAPE_LINE_CHAIN &aPolyLine)
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References SHAPE_LINE_CHAIN::CPoint(), Format(), KIGFX::VIEW_OVERLAY::GetStrokeColor(), m_labelMgr, name, SHAPE_LINE_CHAIN::PointCount(), and KIGFX::VIEW_OVERLAY::Polyline().

◆ Arc() [1/2]

void PNS_LOG_VIEWER_OVERLAY::Arc ( const SHAPE_ARC arc)

Definition at line 89 of file pns_log_viewer_frame.cpp.

90{
91 double radius = arc.GetRadius();
92 EDA_ANGLE start_angle = arc.GetStartAngle();
94
96 KIGFX::VIEW_OVERLAY::Arc( arc.GetCenter(), radius, start_angle, start_angle + angle );
97
99 COLOR4D lightStrokeCol = prevStrokeCol.WithAlpha(0.5);
100 KIGFX::VIEW_OVERLAY::SetStrokeColor( lightStrokeCol );
101
103 KIGFX::VIEW_OVERLAY::Arc( arc.GetCenter(), radius, start_angle, start_angle + angle );
104
106}
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
Definition: color4d.h:321
void SetLineWidth(double aLineWidth)
void Arc(const VECTOR2D &aCenterPoint, double aRadius, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aEndAngle)
void SetStrokeColor(const COLOR4D &aColor)
EDA_ANGLE GetCentralAngle() const
Definition: shape_arc.cpp:448
int GetWidth() const
Definition: shape_arc.h:157
double GetRadius() const
Definition: shape_arc.cpp:458
EDA_ANGLE GetStartAngle() const
Definition: shape_arc.cpp:419
VECTOR2I GetCenter() const
Definition: shape_arc.cpp:433
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)

References PNS::angle(), KIGFX::VIEW_OVERLAY::Arc(), SHAPE_ARC::GetCenter(), SHAPE_ARC::GetCentralAngle(), SHAPE_ARC::GetRadius(), SHAPE_ARC::GetStartAngle(), KIGFX::VIEW_OVERLAY::GetStrokeColor(), SHAPE_ARC::GetWidth(), KIGFX::VIEW_OVERLAY::SetLineWidth(), KIGFX::VIEW_OVERLAY::SetStrokeColor(), and KIGFX::COLOR4D::WithAlpha().

◆ Arc() [2/2]

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

Definition at line 373 of file view_overlay.cpp.

375{
376 m_commands.push_back( new COMMAND_ARC( aCenterPoint, aRadius, aStartAngle, aEndAngle ) );
377}
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:113

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by Arc().

◆ BitmapText()

void KIGFX::VIEW_OVERLAY::BitmapText ( const wxString &  aText,
const VECTOR2I aPosition,
const EDA_ANGLE aAngle 
)
inherited

Definition at line 398 of file view_overlay.cpp.

400{
401 m_commands.push_back( new COMMAND_BITMAP_TEXT( aText, aPosition, aAngle ) );
402}

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by LABEL_MANAGER::Redraw().

◆ Circle()

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

Definition at line 367 of file view_overlay.cpp.

368{
369 m_commands.push_back( new COMMAND_CIRCLE( aCenterPoint, aRadius ) );
370}

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Clear()

void KIGFX::VIEW_OVERLAY::Clear ( )
inherited

Definition at line 285 of file view_overlay.cpp.

286{
288}

References KIGFX::VIEW_OVERLAY::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 
)
inherited

Definition at line 429 of file view_overlay.cpp.

430{
431 Line( aP + VECTOR2D( -aSize, -aSize ), aP + VECTOR2D( aSize, aSize ) );
432 Line( aP + VECTOR2D( aSize, -aSize ), aP + VECTOR2D( -aSize, aSize ) );
433}

References KIGFX::VIEW_OVERLAY::Line().

◆ DrawAnnotations()

void PNS_LOG_VIEWER_OVERLAY::DrawAnnotations ( )

Definition at line 108 of file pns_log_viewer_frame.cpp.

109{
110 m_labelMgr->Redraw( this );
111}

References m_labelMgr.

◆ Get() [1/3]

template<typename T >
std::optional< T > INSPECTABLE::Get ( const wxString &  aProperty) const
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 std::optional<T> ret;
110
111 if( prop )
112 {
113 const void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
114
115 if( object )
116 ret = prop->get<T>( object );
117 }
118
119 return ret;
120 }
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.
T get(const void *aObject) const
Definition: property.h:275
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:64
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:66
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
#define TYPE_HASH(x)
Definition: property.h:61
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:43

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

◆ Get() [2/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty) const
inlineinherited

Definition at line 84 of file inspectable.h.

85 {
87 const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
88 return object ? aProperty->getter( object ) : wxAny();
89 }
virtual wxAny getter(const void *aObject) const =0

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(), EDA_SHAPE_DESC::EDA_SHAPE_DESC(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [3/3]

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

Definition at line 92 of file inspectable.h.

93 {
95 const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
96
97 if( !object )
98 throw std::runtime_error( "Could not cast INSPECTABLE to the requested type" );
99
100 return aProperty->get<T>( object );
101 }

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

◆ GetFillColor()

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

Definition at line 105 of file view_overlay.h.

105{ return m_fillColor; }

References KIGFX::VIEW_OVERLAY::m_fillColor.

◆ GetStrokeColor()

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

Definition at line 104 of file view_overlay.h.

104{ return m_strokeColor; }

References KIGFX::VIEW_OVERLAY::m_strokeColor.

Referenced by AnnotatedPoint(), AnnotatedPolyline(), and Arc().

◆ Line() [1/2]

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

Definition at line 326 of file view_overlay.cpp.

327{
328 Line( aSeg.A, aSeg.B );
329}
VECTOR2I A
Definition: seg.h:49
VECTOR2I B
Definition: seg.h:50

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

◆ Line() [2/2]

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

Definition at line 320 of file view_overlay.cpp.

321{
322 m_commands.push_back( new COMMAND_LINE( aStartPoint, aEndPoint ) );
323}

References KIGFX::VIEW_OVERLAY::m_commands.

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

◆ Polygon() [1/3]

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

Definition at line 349 of file view_overlay.cpp.

350{
351 m_commands.push_back( new COMMAND_POLY_POLYGON( aPolySet ) );
352}

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Polygon() [2/3]

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

Definition at line 355 of file view_overlay.cpp.

356{
357 m_commands.push_back( new COMMAND_POLYGON( aPointList ) );
358}

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Polygon() [3/3]

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

Definition at line 361 of file view_overlay.cpp.

362{
363 m_commands.push_back( new COMMAND_POINT_POLYGON( aPointList, aListSize ) );
364}

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Polyline()

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

Definition at line 339 of file view_overlay.cpp.

340{
341 SetIsStroke( true );
342 SetIsFill( false );
343
344 for( int i = 0; i < aPolyLine.SegmentCount(); i++ )
345 Line( aPolyLine.CSegment( i ) );
346}
void SetIsFill(bool aIsFillEnabled)
void SetIsStroke(bool aIsStrokeEnabled)
int SegmentCount() const
Return the number of segments in this line chain.
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.

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

Referenced by AnnotatedPolyline().

◆ Rectangle()

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

Definition at line 380 of file view_overlay.cpp.

381{
382 m_commands.push_back( new COMMAND_RECTANGLE( aStartPoint, aEndPoint ) );
383}

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by LABEL_MANAGER::Redraw().

◆ releaseCommands()

void KIGFX::VIEW_OVERLAY::releaseCommands ( )
privateinherited

Definition at line 276 of file view_overlay.cpp.

277{
278 for( VIEW_OVERLAY::COMMAND* cmd : m_commands )
279 delete cmd;
280
281 m_commands.clear();
282}

References KIGFX::VIEW_OVERLAY::m_commands.

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

◆ Segment()

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

Definition at line 332 of file view_overlay.cpp.

333{
334 SetLineWidth( aWidth );
335 Line( aStartPoint, aEndPoint );
336}

References KIGFX::VIEW_OVERLAY::Line(), and KIGFX::VIEW_OVERLAY::SetLineWidth().

◆ Set() [1/3]

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

Definition at line 66 of file inspectable.h.

67 {
69 TYPE_ID thisType = TYPE_HASH( *this );
70 PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
71 void* object = nullptr;
72
73 if( prop )
74 {
75 object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
76
77 if( object )
78 prop->set<T>( object, aValue );
79 }
80
81 return object != nullptr;
82 }
void set(void *aObject, T aValue)
Definition: property.h:268

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

◆ Set() [2/3]

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

Definition at line 54 of file inspectable.h.

55 {
57 void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
58
59 if( object )
60 aProperty->set<T>( object, aValue );
61
62 return object != nullptr;
63 }

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

◆ Set() [3/3]

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

Definition at line 42 of file inspectable.h.

43 {
45 void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
46
47 if( object )
48 aProperty->setter( object, aValue );
49
50 return object != nullptr;
51 }
virtual void setter(void *aObject, wxAny &aValue)=0

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

Referenced by PCB_PROPERTIES_PANEL::valueChanged().

◆ SetFillColor()

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

Definition at line 411 of file view_overlay.cpp.

412{
413 m_fillColor = aColor;
414 m_commands.push_back( new COMMAND_SET_COLOR( false, aColor ) );
415}

References KIGFX::VIEW_OVERLAY::m_commands, and KIGFX::VIEW_OVERLAY::m_fillColor.

◆ SetGlyphSize()

void KIGFX::VIEW_OVERLAY::SetGlyphSize ( const VECTOR2I aSize)
inherited

Definition at line 392 of file view_overlay.cpp.

393{
394 m_commands.push_back( new COMMAND_GLYPH_SIZE( aSize ) );
395}

References KIGFX::VIEW_OVERLAY::m_commands.

◆ SetIsFill()

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

Definition at line 386 of file view_overlay.cpp.

387{
388 m_commands.push_back( new COMMAND_SET_FILL( aIsFillEnabled ) );
389}

References KIGFX::VIEW_OVERLAY::m_commands.

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

◆ SetIsStroke()

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

Definition at line 405 of file view_overlay.cpp.

406{
407 m_commands.push_back( new COMMAND_SET_STROKE( aIsStrokeEnabled ) );
408}

References KIGFX::VIEW_OVERLAY::m_commands.

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

◆ SetLineWidth()

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

Definition at line 424 of file view_overlay.cpp.

425{
426 m_commands.push_back( new COMMAND_SET_WIDTH( aLineWidth ) );
427}

References KIGFX::VIEW_OVERLAY::m_commands.

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

◆ SetStrokeColor()

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

Definition at line 418 of file view_overlay.cpp.

419{
420 m_strokeColor = aColor;
421 m_commands.push_back( new COMMAND_SET_COLOR( true, aColor ) );
422}

References KIGFX::VIEW_OVERLAY::m_commands, and KIGFX::VIEW_OVERLAY::m_strokeColor.

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

◆ ViewBBox()

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

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

Returns
the current bounding box.

Implements KIGFX::VIEW_ITEM.

Definition at line 291 of file view_overlay.cpp.

292{
293 BOX2I maxBox;
294
295 maxBox.SetMaximum();
296 return maxBox;
297}
void SetMaximum()
Definition: box2.h:63

References BOX2< Vec >::SetMaximum().

◆ ViewDraw()

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

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

301{
302 auto gal = aView->GetGAL();
303 gal->PushDepth();
304 gal->SetLayerDepth( gal->GetMinDepth() );
305
306 for( const VIEW_OVERLAY::COMMAND* cmd : m_commands )
307 cmd->Execute( aView );
308
309 gal->PopDepth();
310}

References KIGFX::VIEW::GetGAL(), KIGFX::VIEW_OVERLAY::m_commands, and KIGFX::GAL::PushDepth().

◆ ViewGetLayers()

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

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

314{
315 aLayers[0] = LAYER_GP_OVERLAY;
316 aCount = 1;
317}
@ LAYER_GP_OVERLAY
general purpose overlay
Definition: layer_ids.h:218

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 GERBER_DRAW_ITEM, PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, ZONE, and FP_ZONE.

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(), and PCB_GRID_HELPER::queryVisible().

◆ viewPrivData()

Member Data Documentation

◆ m_commands

◆ m_fillColor

COLOR4D KIGFX::VIEW_OVERLAY::m_fillColor
privateinherited

◆ m_labelMgr

std::unique_ptr<LABEL_MANAGER> PNS_LOG_VIEWER_OVERLAY::m_labelMgr
private

◆ m_strokeColor

COLOR4D KIGFX::VIEW_OVERLAY::m_strokeColor
privateinherited

◆ m_viewPrivData

VIEW_ITEM_DATA* KIGFX::VIEW_ITEM::m_viewPrivData
privateinherited

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