KiCad PCB EDA Suite
Loading...
Searching...
No Matches
BOARD_EDGES_BOUNDING_ITEM Class Reference

#include <board_edges_bounding_item.h>

Inheritance diagram for BOARD_EDGES_BOUNDING_ITEM:
KIGFX::VIEW_ITEM INSPECTABLE

Public Member Functions

 BOARD_EDGES_BOUNDING_ITEM (BOX2I aBox)
 
 ~BOARD_EDGES_BOUNDING_ITEM () override
 
wxString GetClass () const override
 Return the class name.
 
const BOX2I ViewBBox () const override
 Return the bounding box of the item covering all its layers.
 
std::vector< int > ViewGetLayers () const override
 Return the all the layers within the VIEW the object is painted on.
 
bool IsSCH_ITEM () const
 
bool IsBOARD_ITEM () const
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Draw the parts of the object belonging to layer aLayer.
 
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)
 
bool Set (PROPERTY_BASE *aProperty, wxVariant 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>
T Get (PROPERTY_BASE *aProperty) const
 
template<typename T>
std::optional< TGet (const wxString &aProperty) const
 

Static Protected Member Functions

static double lodScaleForThreshold (const KIGFX::VIEW *aView, 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 Attributes

BOX2I m_box
 
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 29 of file board_edges_bounding_item.h.

Constructor & Destructor Documentation

◆ BOARD_EDGES_BOUNDING_ITEM()

BOARD_EDGES_BOUNDING_ITEM::BOARD_EDGES_BOUNDING_ITEM ( BOX2I aBox)

Definition at line 29 of file board_edges_bounding_item.cpp.

References m_box, and move.

◆ ~BOARD_EDGES_BOUNDING_ITEM()

BOARD_EDGES_BOUNDING_ITEM::~BOARD_EDGES_BOUNDING_ITEM ( )
inlineoverride

Definition at line 33 of file board_edges_bounding_item.h.

Member Function Documentation

◆ 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

◆ GetClass()

wxString BOARD_EDGES_BOUNDING_ITEM::GetClass ( ) const
overridevirtual

Return the class name.

Implements KIGFX::VIEW_ITEM.

Definition at line 35 of file board_edges_bounding_item.cpp.

◆ GetForcedTransparency()

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

◆ IsBOARD_ITEM()

◆ IsSCH_ITEM()

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

◆ lodScaleForThreshold()

double VIEW_ITEM::lodScaleForThreshold ( const KIGFX::VIEW * aView,
int aWhatIu,
int aThresholdIu )
staticprotectedinherited

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 39 of file view_item.cpp.

References KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), KIGFX::RENDER_SETTINGS::IsPrinting(), LOD_HIDE, LOD_SHOW, and VIEW.

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

◆ Set() [1/4]

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

◆ Set() [2/4]

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

◆ Set() [3/4]

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

◆ Set() [4/4]

bool INSPECTABLE::Set ( PROPERTY_BASE * aProperty,
wxVariant aValue,
bool aNotify = true )
inlineinherited

◆ SetForcedTransparency()

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

◆ ViewBBox()

const BOX2I BOARD_EDGES_BOUNDING_ITEM::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 41 of file board_edges_bounding_item.cpp.

References m_box.

Referenced by ZONE_PAINTER::draw().

◆ ViewDraw()

virtual void KIGFX::VIEW_ITEM::ViewDraw ( int aLayer,
VIEW * aView ) const
inlinevirtualinherited

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 in DS_PROXY_VIEW_ITEM, EDIT_POINTS, KIGFX::ANCHOR_DEBUG, KIGFX::CONSTRUCTION_GEOM, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::ARC_ASSISTANT, KIGFX::PREVIEW::BEZIER_ASSISTANT, KIGFX::PREVIEW::RULER_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::SNAP_INDICATOR, KIGFX::VIEW_GROUP, KIGFX::VIEW_OVERLAY, MY_DRAWING, PCB_TUNING_PATTERN, RATSNEST_VIEW_ITEM, RECT_RADIUS_TEXT_ITEM, ROUTER_PREVIEW_ITEM, ROUTER_STATUS_VIEW_ITEM, TUNING_STATUS_VIEW_ITEM, and VIEW_OVERLAY.

Definition at line 127 of file view_item.h.

References VIEW.

Referenced by KIGFX::VIEW::draw(), and KIGFX::VIEW::updateItemGeometry().

◆ ViewGetLayers()

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

Implements KIGFX::VIEW_ITEM.

Definition at line 47 of file board_edges_bounding_item.cpp.

References Edge_Cuts.

◆ 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 FOOTPRINT, GERBER_DRAW_ITEM, PAD, PCB_FIELD, PCB_GROUP, PCB_POINT, PCB_REFERENCE_IMAGE, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, SCH_GROUP, SCH_LINE, and ZONE.

Definition at line 155 of file view_item.h.

References LOD_SHOW, and VIEW.

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

◆ LOD_SHOW

◆ m_box

BOX2I BOARD_EDGES_BOUNDING_ITEM::m_box
private

Definition at line 42 of file board_edges_bounding_item.h.

Referenced by BOARD_EDGES_BOUNDING_ITEM(), and ViewBBox().

◆ 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 GetForcedTransparency(), KIGFX::VIEW::DRAW_ITEM_VISITOR::operator()(), SetForcedTransparency(), and VIEW_ITEM().

◆ m_isBOARD_ITEM

bool KIGFX::VIEW_ITEM::m_isBOARD_ITEM
privateinherited

Definition at line 208 of file view_item.h.

Referenced by IsBOARD_ITEM(), and VIEW_ITEM().

◆ m_isSCH_ITEM

bool KIGFX::VIEW_ITEM::m_isSCH_ITEM
privateinherited

Definition at line 207 of file view_item.h.

Referenced by IsSCH_ITEM(), and VIEW_ITEM().

◆ m_viewPrivData

VIEW_ITEM_DATA* KIGFX::VIEW_ITEM::m_viewPrivData
privateinherited

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