KiCad PCB EDA Suite
|
Extend VIEW_ITEM by possibility of grouping items into a single object. More...
#include <view_group.h>
Public Member Functions | |
VIEW_GROUP (VIEW *aView=nullptr) | |
virtual | ~VIEW_GROUP () |
virtual unsigned int | GetSize () const |
Return the number of stored items. More... | |
virtual void | Add (VIEW_ITEM *aItem) |
Add an item to the group. More... | |
virtual void | Remove (VIEW_ITEM *aItem) |
Remove an item from the group. More... | |
virtual void | Clear () |
Remove all the stored items from the group. More... | |
virtual VIEW_ITEM * | GetItem (unsigned int aIdx) const |
virtual const BOX2I | ViewBBox () const override |
Return the bounding box for all stored items covering all its layers. More... | |
virtual void | ViewDraw (int aLayer, VIEW *aView) const override |
Draw all the stored items in the group on the given layer. More... | |
virtual void | ViewGetLayers (int aLayers[], int &aCount) const override |
Return all the layers used by the stored items. More... | |
virtual void | SetLayer (int aLayer) |
Set layer used to draw the group. More... | |
void | FreeItems () |
Free all the items that were added to the group. More... | |
virtual double | ViewGetLOD (int aLayer, VIEW *aView) const |
Return the level of detail (LOD) of the item. More... | |
VIEW_ITEM_DATA * | viewPrivData () const |
void | ClearViewPrivData () |
bool | Set (PROPERTY_BASE *aProperty, wxAny &aValue) |
template<typename T > | |
bool | Set (PROPERTY_BASE *aProperty, T aValue) |
template<typename T > | |
bool | Set (const wxString &aProperty, T aValue) |
wxAny | Get (PROPERTY_BASE *aProperty) const |
template<typename T > | |
T | Get (PROPERTY_BASE *aProperty) const |
template<typename T > | |
std::optional< T > | Get (const wxString &aProperty) const |
Protected Member Functions | |
virtual const std::vector< VIEW_ITEM * > | updateDrawList () const |
Protected Attributes | |
int | m_layer |
std::vector< VIEW_ITEM * > | m_groupItems |
Private Attributes | |
VIEW_ITEM_DATA * | m_viewPrivData |
Extend VIEW_ITEM by possibility of grouping items into a single object.
VIEW_GROUP does not take over ownership of the held items. The main purpose of this class is to group items and draw them on a single layer (in particular the overlay).
Definition at line 46 of file view_group.h.
VIEW_GROUP::VIEW_GROUP | ( | VIEW * | aView = nullptr | ) |
Definition at line 44 of file view_group.cpp.
|
virtual |
Definition at line 51 of file view_group.cpp.
|
virtual |
Add an item to the group.
Definition at line 57 of file view_group.cpp.
References m_groupItems.
Referenced by PNS_PCBNEW_DEBUG_DECORATOR::AddItem(), PNS_PCBNEW_DEBUG_DECORATOR::AddShape(), PNS_KICAD_IFACE::DisplayItem(), PNS_KICAD_IFACE::DisplayPathLine(), PNS_KICAD_IFACE::DisplayRatline(), PCB_TOOL_BASE::doInteractiveItemPlacement(), and PCB_SELECTION_TOOL::EnterGroup().
|
virtual |
Remove all the stored items from the group.
Reimplemented in SELECTION.
Definition at line 69 of file view_group.cpp.
References m_groupItems.
Referenced by PCB_SELECTION_TOOL::ExitGroup(), FreeItems(), and PCB_SELECTION_TOOL::RebuildSelection().
|
inlineinherited |
Definition at line 143 of file view_item.h.
References KIGFX::VIEW_ITEM::m_viewPrivData.
Referenced by KIGFX::VIEW::OnDestroy().
void VIEW_GROUP::FreeItems | ( | ) |
Free all the items that were added to the group.
Definition at line 191 of file view_group.cpp.
References Clear(), GetItem(), and GetSize().
Referenced by PNS_PCBNEW_DEBUG_DECORATOR::Clear(), PNS_KICAD_IFACE::EraseView(), PNS_KICAD_IFACE::SetView(), and PNS_KICAD_IFACE::~PNS_KICAD_IFACE().
|
inlineinherited |
Definition at line 104 of file inspectable.h.
References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
|
inlineinherited |
Definition at line 84 of file inspectable.h.
References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
Referenced by BOOST_AUTO_TEST_CASE(), CLASS_D_DESC::CLASS_D_DESC(), EDA_SHAPE_DESC::EDA_SHAPE_DESC(), PROPERTIES_PANEL::getItemValue(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().
|
inlineinherited |
Definition at line 92 of file inspectable.h.
References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
|
virtual |
Reimplemented in SELECTION.
Definition at line 81 of file view_group.cpp.
References m_groupItems.
Referenced by KIGFX::VIEW::draw(), and FreeItems().
|
virtual |
Return the number of stored items.
Reimplemented in SELECTION.
Definition at line 75 of file view_group.cpp.
References m_groupItems.
Referenced by KIGFX::VIEW::draw(), and FreeItems().
|
virtual |
Remove an item from the group.
Definition at line 63 of file view_group.cpp.
References alg::delete_matching(), and m_groupItems.
|
inlineinherited |
Definition at line 66 of file inspectable.h.
References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
|
inlineinherited |
Definition at line 54 of file inspectable.h.
References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
|
inlineinherited |
Definition at line 42 of file inspectable.h.
References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
Referenced by PCB_PROPERTIES_PANEL::valueChanged().
|
inlinevirtual |
Set layer used to draw the group.
Definition at line 98 of file view_group.h.
References m_layer.
Referenced by SELECTION_TOOL::doSelectionMenu(), PNS_PCBNEW_DEBUG_DECORATOR::SetView(), and PNS_KICAD_IFACE::SetView().
|
protectedvirtual |
Reimplemented in EE_SELECTION, SELECTION, and PCB_SELECTION.
Definition at line 200 of file view_group.cpp.
References m_groupItems.
Referenced by ViewDraw().
|
overridevirtual |
Return the bounding box for all stored items covering all its layers.
Implements KIGFX::VIEW_ITEM.
Reimplemented in GERBVIEW_SELECTION, and SELECTION.
Definition at line 87 of file view_group.cpp.
References m_groupItems, BOX2< Vec >::Merge(), and BOX2< Vec >::SetMaximum().
|
overridevirtual |
Draw all the stored items in the group on the given layer.
aLayer | is the layer which should be drawn. |
aView | is the VIEW that should be used for drawing. |
Reimplemented from KIGFX::VIEW_ITEM.
Definition at line 107 of file view_group.cpp.
References KIGFX::GAL::AdvanceDepth(), KIGFX::PAINTER::Draw(), KIGFX::VIEW::GetGAL(), KIGFX::VIEW::GetPainter(), KIGFX::VIEW::IsLayerVisible(), IsZoneFillLayer(), LAYER_ID_COUNT, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PAD_HOLEWALLS, LAYER_PAD_PLATEDHOLES, LAYER_PADS_TH, LAYER_SELECT_OVERLAY, LAYER_ZONE_START, m_layer, KIGFX::GAL::PopDepth(), KIGFX::GAL::PushDepth(), KIGFX::VIEW::SortLayers(), updateDrawList(), and KIGFX::VIEW::VIEW_MAX_LAYERS.
|
overridevirtual |
Return all the layers used by the stored items.
aLayers[] | is the output layer index array. |
aCount | is the number of layer indices in aLayers[]. |
Implements KIGFX::VIEW_ITEM.
Definition at line 183 of file view_group.cpp.
References m_layer.
|
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.
aLayer | is the current drawing layer. |
aView | is a pointer to the VIEW device we are drawing on. |
Reimplemented in SCH_LINE, GERBER_DRAW_ITEM, PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, ZONE, and FP_ZONE.
Definition at line 132 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().
|
inlineinherited |
Definition at line 138 of file view_item.h.
References KIGFX::VIEW_ITEM::m_viewPrivData.
Referenced by KIGFX::VIEW::Add(), KIGFX::VIEW::draw(), KIGFX::VIEW::HasItem(), KIGFX::VIEW::Hide(), KIGFX::VIEW::invalidateItem(), KIGFX::VIEW::IsVisible(), KIGFX::VIEW::OnDestroy(), KIGFX::QUERY_VISITOR< CONTAINER >::operator()(), KIGFX::VIEW::UPDATE_COLOR_VISITOR::operator()(), KIGFX::VIEW::UPDATE_DEPTH_VISITOR::operator()(), KIGFX::VIEW::DRAW_ITEM_VISITOR::operator()(), KIGFX::VIEW::RECACHE_ITEM_VISITOR::operator()(), KIGFX::VIEW::CLEAR_LAYER_CACHE_VISITOR::operator()(), KIGFX::VIEW::Remove(), KIGFX::VIEW::SetVisible(), KIGFX::VIEW::Update(), KIGFX::VIEW::updateItemColor(), KIGFX::VIEW::updateItemGeometry(), and KIGFX::VIEW::updateLayers().
|
protected |
Definition at line 113 of file view_group.h.
Referenced by Add(), Clear(), GetItem(), GetSize(), Remove(), updateDrawList(), and ViewBBox().
|
protected |
Definition at line 112 of file view_group.h.
Referenced by SetLayer(), ViewDraw(), and ViewGetLayers().
|
privateinherited |
Definition at line 151 of file view_item.h.
Referenced by KIGFX::VIEW::Add(), KIGFX::VIEW_ITEM::ClearViewPrivData(), KIGFX::VIEW_ITEM::viewPrivData(), and KIGFX::VIEW_ITEM::~VIEW_ITEM().