KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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.
 
virtual void ViewDraw (int aLayer, VIEW *aView) const override
 Draw the parts of the object belonging to layer aLayer.
 
virtual void ViewGetLayers (int aLayers[], int &aCount) 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 Polyline (const SHAPE_LINE_CHAIN &aPolyLine)
 
void Polygon (const VECTOR2D aPointList[], int aListSize)
 
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 COLOR4DGetStrokeColor () const
 
const COLOR4DGetFillColor () const
 
bool IsSCH_ITEM () const
 
bool IsBOARD_ITEM () const
 
virtual double ViewGetLOD (int aLayer, VIEW *aView) const
 Return the level of detail (LOD) of the item.
 
VIEW_ITEM_DATAviewPrivData () 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
 

Private Member Functions

void releaseCommands ()
 

Private Attributes

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

Detailed Description

Definition at line 44 of file view_overlay.h.

Constructor & Destructor Documentation

◆ VIEW_OVERLAY()

KIGFX::VIEW_OVERLAY::VIEW_OVERLAY ( )

Definition at line 264 of file view_overlay.cpp.

◆ ~VIEW_OVERLAY()

KIGFX::VIEW_OVERLAY::~VIEW_OVERLAY ( )
virtual

Definition at line 269 of file view_overlay.cpp.

References releaseCommands().

Member Function Documentation

◆ Arc()

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

Definition at line 372 of file view_overlay.cpp.

References m_commands.

Referenced by PNS_LOG_VIEWER_OVERLAY::Arc().

◆ BitmapText()

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

Definition at line 397 of file view_overlay.cpp.

References m_commands.

Referenced by LABEL_MANAGER::Redraw().

◆ Circle()

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

Definition at line 366 of file view_overlay.cpp.

References m_commands.

◆ Clear()

void KIGFX::VIEW_OVERLAY::Clear ( )

Definition at line 284 of file view_overlay.cpp.

References releaseCommands().

◆ Cross()

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

Definition at line 428 of file view_overlay.cpp.

References Line().

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

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
inline

◆ IsBOARD_ITEM()

◆ IsSCH_ITEM()

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

Definition at line 99 of file view_item.h.

◆ Line() [1/2]

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

Definition at line 325 of file view_overlay.cpp.

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

◆ Line() [2/2]

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

◆ Polygon() [1/3]

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

Definition at line 348 of file view_overlay.cpp.

References m_commands.

◆ Polygon() [2/3]

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

Definition at line 354 of file view_overlay.cpp.

References m_commands.

◆ Polygon() [3/3]

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

Definition at line 360 of file view_overlay.cpp.

References m_commands.

◆ Polyline()

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

◆ Rectangle()

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

Definition at line 379 of file view_overlay.cpp.

References m_commands.

Referenced by LABEL_MANAGER::Redraw().

◆ releaseCommands()

void KIGFX::VIEW_OVERLAY::releaseCommands ( )
private

Definition at line 275 of file view_overlay.cpp.

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

References Line(), and SetLineWidth().

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

Definition at line 410 of file view_overlay.cpp.

References m_commands, and m_fillColor.

◆ SetForcedTransparency()

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

◆ SetGlyphSize()

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

Definition at line 391 of file view_overlay.cpp.

References m_commands.

◆ SetIsFill()

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

Definition at line 385 of file view_overlay.cpp.

References m_commands.

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

◆ SetIsStroke()

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

Definition at line 404 of file view_overlay.cpp.

References m_commands.

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

◆ SetLineWidth()

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

Definition at line 423 of file view_overlay.cpp.

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

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

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

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

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

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 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 145 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

◆ m_commands

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

◆ m_fillColor

COLOR4D KIGFX::VIEW_OVERLAY::m_fillColor
private

Definition at line 111 of file view_overlay.h.

Referenced by SetFillColor().

◆ m_forcedTransparency

double KIGFX::VIEW_ITEM::m_forcedTransparency
privateinherited

Additional transparency for diff'ing items.

Definition at line 172 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 170 of file view_item.h.

◆ m_isSCH_ITEM

bool KIGFX::VIEW_ITEM::m_isSCH_ITEM
privateinherited

Definition at line 169 of file view_item.h.

◆ m_strokeColor

COLOR4D KIGFX::VIEW_OVERLAY::m_strokeColor
private

Definition at line 110 of file view_overlay.h.

Referenced by SetStrokeColor().

◆ m_viewPrivData


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