28using namespace std::placeholders;
43 typedef std::numeric_limits<int> coord_limits;
44 double pos = coord_limits::lowest() + coord_limits::epsilon();
45 double size =
static_cast<double>( coord_limits::max() - coord_limits::epsilon() )
46 -
static_cast<double>( coord_limits::min() + coord_limits::epsilon() );
66 RECURSE_MODE::NO_RECURSE );
83 RECURSE_MODE::NO_RECURSE );
108 RECURSE_MODE::NO_RECURSE );
123 std::initializer_list<KICAD_T> aTypes )
130 BOARD_ITEM* item = static_cast<BOARD_ITEM*>( aItem );
132 if( item->IsType( aTypes ) )
134 BOX2I itemBBox = item->GetBoundingBox();
136 for( const BOX2I& bbox : aStaleAreas )
138 if( itemBBox.Intersects( bbox ) )
139 return KIGFX::REPAINT;
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const
Invoke a function on all children.
BOARD_ITEM_CONTAINER * GetParent() const
constexpr void SetOrigin(const Vec &pos)
constexpr void SetSize(const SizeVec &size)
KICAD_T Type() const
Returns the type of object.
Contains methods for drawing PCB-specific items.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
void LoadDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
Load settings related to display options (high-contrast mode, full or outline modes for vias/pads/tra...
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
void UpdateCollidingItems(const std::vector< BOX2I > &aStaleAreas, std::initializer_list< KICAD_T > aTypes)
Sets the KIGFX::REPAINT on all items matching aTypes which intersect aStaleAreas.
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
An abstract base class for deriving all objects that can be added to a VIEW.
bool IsBOARD_ITEM() const
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
The Cairo implementation of the graphics abstraction layer.
@ ALL
All except INITIAL_ADD.
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint