KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 AnnotatedPolyset (const SHAPE_POLY_SET &aL, std::string name="", bool aShowVertexNumbers=false)
 
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.
 
virtual void ViewDraw (int aLayer, VIEW *aView) const override
 Draw the parts of the object belonging to layer aLayer.
 
virtual std::vector< int > ViewGetLayers () const override
 Return the all the layers within the VIEW the object is painted on.
 
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
 
bool IsSCH_ITEM () const
 
bool IsBOARD_ITEM () const
 
virtual double ViewGetLOD (int aLayer, const VIEW *aView) const
 Return the level of detail (LOD) of the item.
 
VIEW_ITEM_DATA * viewPrivData () const
 
void SetForcedTransparency (double aForcedTransparency)
 
double GetForcedTransparency () const
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue, bool aNotify=true)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue, bool aNotify=true)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue, bool aNotify=true)
 
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
 

Static Protected Member Functions

static constexpr double lodScaleForThreshold (int aWhatIu, int aThresholdIu)
 Get the scale at which aWhatIu would be drawn at the same size as aThresholdIu on screen.
 

Static Protected Attributes

static constexpr double LOD_HIDE = std::numeric_limits<double>::max()
 Return this constant from ViewGetLOD() to hide the item unconditionally.
 
static constexpr double LOD_SHOW = 0.0
 Return this constant from ViewGetLOD() to show the item unconditionally.
 

Private Member Functions

void releaseCommands ()
 

Private Attributes

std::unique_ptr< LABEL_MANAGERm_labelMgr
 
COLOR4D m_strokeColor
 
COLOR4D m_fillColor
 
std::vector< COMMAND * > m_commands
 
bool m_isSCH_ITEM
 
bool m_isBOARD_ITEM
 
VIEW_ITEM_DATA * m_viewPrivData
 
double m_forcedTransparency
 Additional transparency for diff'ing items.
 

Detailed Description

Definition at line 171 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 62 of file pns_log_viewer_frame.cpp.

References m_labelMgr.

Member Function Documentation

◆ AnnotatedPoint()

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

◆ AnnotatedPolyline()

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

◆ AnnotatedPolyset()

void PNS_LOG_VIEWER_OVERLAY::AnnotatedPolyset ( const SHAPE_POLY_SET aL,
std::string  name = "",
bool  aShowVertexNumbers = false 
)

◆ Arc() [1/2]

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

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

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

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Clear()

void KIGFX::VIEW_OVERLAY::Clear ( )
inherited

Definition at line 285 of file view_overlay.cpp.

References KIGFX::VIEW_OVERLAY::releaseCommands().

◆ Cross()

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

Definition at line 429 of file view_overlay.cpp.

References KIGFX::VIEW_OVERLAY::Line().

◆ DrawAnnotations()

void PNS_LOG_VIEWER_OVERLAY::DrawAnnotations ( )

Definition at line 129 of file pns_log_viewer_frame.cpp.

References m_labelMgr.

◆ Get() [1/3]

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

◆ Get() [2/3]

◆ Get() [3/3]

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

◆ GetFillColor()

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

Definition at line 105 of file view_overlay.h.

◆ GetForcedTransparency()

double KIGFX::VIEW_ITEM::GetForcedTransparency ( ) const
inlineinherited

◆ GetStrokeColor()

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

Definition at line 104 of file view_overlay.h.

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

◆ IsBOARD_ITEM()

◆ IsSCH_ITEM()

bool KIGFX::VIEW_ITEM::IsSCH_ITEM ( ) const
inlineinherited

Definition at line 101 of file view_item.h.

◆ Line() [1/2]

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

Definition at line 324 of file view_overlay.cpp.

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

◆ lodScaleForThreshold()

static constexpr double KIGFX::VIEW_ITEM::lodScaleForThreshold ( int  aWhatIu,
int  aThresholdIu 
)
inlinestaticconstexprprotectedinherited

Get the scale at which aWhatIu would be drawn at the same size as aThresholdIu on screen.

This is useful when a level-of-detail is defined in terms of a threshold size (i.e. 'only draw X when it will be bigger than Y size on screen').

E.g. if aWhatIu is 1000 and aThresholdIu is 100, then the item will be the same size as the threshold at 0.1 scale. Returning that 0.1 as the LoD will hide the item when the scale is less than 0.1 - i.e. smaller than the threshold.

Because even at zoom 1.0, 1mm in KiCad may not be exactly 1mm on a physical screen, the threshold may not be exact in practice.

Definition at line 196 of file view_item.h.

Referenced by SCH_LINE::ViewGetLOD(), GERBER_DRAW_ITEM::ViewGetLOD(), PAD::ViewGetLOD(), and PCB_TRACK::ViewGetLOD().

◆ Polygon() [1/3]

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

Definition at line 347 of file view_overlay.cpp.

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Polygon() [2/3]

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

Definition at line 353 of file view_overlay.cpp.

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Polygon() [3/3]

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

Definition at line 359 of file view_overlay.cpp.

References KIGFX::VIEW_OVERLAY::m_commands.

◆ Polyline()

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

◆ Rectangle()

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

Definition at line 378 of file view_overlay.cpp.

References KIGFX::VIEW_OVERLAY::m_commands.

Referenced by LABEL_MANAGER::Redraw().

◆ releaseCommands()

void KIGFX::VIEW_OVERLAY::releaseCommands ( )
privateinherited

◆ Segment()

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

◆ Set() [1/3]

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

◆ Set() [2/3]

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

◆ Set() [3/3]

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

◆ SetFillColor()

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

◆ SetForcedTransparency()

void KIGFX::VIEW_ITEM::SetForcedTransparency ( double  aForcedTransparency)
inlineinherited

◆ SetGlyphSize()

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

Definition at line 390 of file view_overlay.cpp.

References KIGFX::VIEW_OVERLAY::m_commands.

◆ SetIsFill()

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

◆ SetIsStroke()

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

◆ SetLineWidth()

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

◆ SetStrokeColor()

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

◆ 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.

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.

References KIGFX::VIEW::GetGAL(), KIGFX::GAL::GetMinDepth(), KIGFX::GAL_SCOPED_ATTRS::LAYER_DEPTH, KIGFX::VIEW_OVERLAY::m_commands, and KIGFX::GAL::SetLayerDepth().

◆ ViewGetLayers()

std::vector< int > KIGFX::VIEW_OVERLAY::ViewGetLayers ( ) 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.

Implements KIGFX::VIEW_ITEM.

Definition at line 312 of file view_overlay.cpp.

References LAYER_GP_OVERLAY.

◆ ViewGetLOD()

virtual double KIGFX::VIEW_ITEM::ViewGetLOD ( int  aLayer,
const 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.

Use LOD_HIDE and LOD_SHOW constants to hide or show the item unconditionally.

Use lodScaleForThreshold() to calculate the LOD scale for when the item passes a certain threshold size on screen.

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

Reimplemented in SCH_LINE, GERBER_DRAW_ITEM, FOOTPRINT, PAD, PCB_FIELD, PCB_GROUP, PCB_REFERENCE_IMAGE, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, and ZONE.

Definition at line 149 of file view_item.h.

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

◆ viewPrivData()

Member Data Documentation

◆ LOD_HIDE

constexpr double KIGFX::VIEW_ITEM::LOD_HIDE = std::numeric_limits<double>::max()
staticconstexprprotectedinherited

◆ LOD_SHOW

constexpr double KIGFX::VIEW_ITEM::LOD_SHOW = 0.0
staticconstexprprotectedinherited

◆ m_commands

◆ m_fillColor

COLOR4D KIGFX::VIEW_OVERLAY::m_fillColor
privateinherited

Definition at line 111 of file view_overlay.h.

Referenced by KIGFX::VIEW_OVERLAY::SetFillColor().

◆ m_forcedTransparency

double KIGFX::VIEW_ITEM::m_forcedTransparency
privateinherited

Additional transparency for diff'ing items.

Definition at line 210 of file view_item.h.

Referenced by KIGFX::VIEW::DRAW_ITEM_VISITOR::operator()().

◆ m_isBOARD_ITEM

bool KIGFX::VIEW_ITEM::m_isBOARD_ITEM
privateinherited

Definition at line 208 of file view_item.h.

◆ m_isSCH_ITEM

bool KIGFX::VIEW_ITEM::m_isSCH_ITEM
privateinherited

Definition at line 207 of file view_item.h.

◆ m_labelMgr

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

◆ m_strokeColor

COLOR4D KIGFX::VIEW_OVERLAY::m_strokeColor
privateinherited

Definition at line 110 of file view_overlay.h.

Referenced by KIGFX::VIEW_OVERLAY::SetStrokeColor().

◆ m_viewPrivData

VIEW_ITEM_DATA* KIGFX::VIEW_ITEM::m_viewPrivData
privateinherited

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