KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::VIEW_ITEM Class Referenceabstract

An abstract base class for deriving all objects that can be added to a VIEW. More...

#include <view_item.h>

Inheritance diagram for KIGFX::VIEW_ITEM:
INSPECTABLE BOARD_EDGES_BOUNDING_ITEM EDA_ITEM KIGFX::VIEW_GROUP KIGFX::VIEW_OVERLAY BASE_SCREEN BOARD_ITEM DS_DRAW_ITEM_BASE DS_PROXY_UNDO_ITEM DS_PROXY_VIEW_ITEM EDIT_POINTS GBR_LAYOUT GERBER_DRAW_ITEM GERBER_FILE_IMAGE KIGFX::ORIGIN_VIEWITEM KIGFX::PREVIEW::ARC_ASSISTANT KIGFX::PREVIEW::RULER_ITEM KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM KIGFX::PREVIEW::TWO_POINT_ASSISTANT LIB_ITEM LIB_SYMBOL MY_DRAWING RATSNEST_VIEW_ITEM ROUTER_PREVIEW_ITEM ROUTER_STATUS_VIEW_ITEM SCHEMATIC SCH_ITEM TUNING_STATUS_VIEW_ITEM SELECTION PNS_LOG_VIEWER_OVERLAY

Public Member Functions

 VIEW_ITEM ()
 
virtual ~VIEW_ITEM ()
 
 VIEW_ITEM (const VIEW_ITEM &aOther)=delete
 
VIEW_ITEMoperator= (const VIEW_ITEM &aOther)=delete
 
virtual const BOX2I ViewBBox () const =0
 Return the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Draw the parts of the object belonging to layer aLayer. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const =0
 Return the all the layers within the VIEW the object is painted on. More...
 
virtual double ViewGetLOD (int aLayer, VIEW *aView) const
 Return the level of detail (LOD) of the item. More...
 
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 Attributes

VIEW_ITEM_DATAm_viewPrivData
 
double m_forcedTransparency
 Additional transparency for diff'ing items. More...
 

Friends

class VIEW
 

Detailed Description

An abstract base class for deriving all objects that can be added to a VIEW.

Its role is to:

  • communicate geometry, appearance and visibility updates to the associated dynamic VIEW,
  • provide a bounding box for redraw area calculation,
  • (optional) draw the object using the #GAL API functions for #PAINTER-less implementations.

VIEW_ITEM objects are never owned by a VIEW. A single VIEW_ITEM can belong to any number of static VIEWs, but only one dynamic VIEW due to storage of only one VIEW reference.

Definition at line 83 of file view_item.h.

Constructor & Destructor Documentation

◆ VIEW_ITEM() [1/2]

KIGFX::VIEW_ITEM::VIEW_ITEM ( )
inline

Definition at line 86 of file view_item.h.

◆ ~VIEW_ITEM()

VIEW_ITEM::~VIEW_ITEM ( )
virtual

Definition at line 31 of file view_item.cpp.

References m_viewPrivData, and KIGFX::VIEW::OnDestroy().

◆ VIEW_ITEM() [2/2]

KIGFX::VIEW_ITEM::VIEW_ITEM ( const VIEW_ITEM aOther)
delete

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

◆ GetForcedTransparency()

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

◆ operator=()

VIEW_ITEM & KIGFX::VIEW_ITEM::operator= ( const VIEW_ITEM aOther)
delete

◆ 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

◆ SetForcedTransparency()

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

◆ ViewBBox()

◆ ViewDraw()

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

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

Definition at line 115 of file view_item.h.

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

◆ ViewGetLayers()

virtual void KIGFX::VIEW_ITEM::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
pure virtual

◆ ViewGetLOD()

virtual double KIGFX::VIEW_ITEM::ViewGetLOD ( int  aLayer,
VIEW aView 
) const
inlinevirtual

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

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

◆ viewPrivData()

Friends And Related Function Documentation

◆ VIEW

friend class VIEW
friend

Definition at line 163 of file view_item.h.

Member Data Documentation

◆ m_forcedTransparency

double KIGFX::VIEW_ITEM::m_forcedTransparency
private

Additional transparency for diff'ing items.

Definition at line 166 of file view_item.h.

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

◆ m_viewPrivData

VIEW_ITEM_DATA* KIGFX::VIEW_ITEM::m_viewPrivData
private

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