![]() |
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=NULL) | |
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) |
template<typename T > | |
T | Get (PROPERTY_BASE *aProperty) |
template<typename T > | |
boost::optional< T > | Get (const wxString &aProperty) |
Protected Types | |
typedef std::vector< VIEW_ITEM * > | ITEMS |
Protected Member Functions | |
virtual const ITEMS | updateDrawList () const |
Layer on which the group is drawn. More... | |
Protected Attributes | |
int | m_layer |
Container for storing VIEW_ITEMs. More... | |
ITEMS | m_groupItems |
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.
|
protected |
Definition at line 119 of file view_group.h.
Definition at line 43 of file view_group.cpp.
|
virtual |
Definition at line 50 of file view_group.cpp.
|
virtual |
Add an item to the group.
aItem | is the item to be added. |
Definition at line 56 of file view_group.cpp.
References m_groupItems.
Referenced by PNS_PCBNEW_DEBUG_DECORATOR::AddLine(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PNS_KICAD_IFACE::DisplayItem(), PNS_KICAD_IFACE::DisplayRatline(), PCB_TOOL_BASE::doInteractiveItemPlacement(), PCB_SELECTION_TOOL::EnterGroup(), and BOARD_EDITOR_CONTROL::PlaceTarget().
|
virtual |
Remove all the stored items from the group.
Reimplemented in SELECTION.
Definition at line 75 of file view_group.cpp.
References m_groupItems.
Referenced by PCB_SELECTION_TOOL::ExitGroup(), FreeItems(), BOARD_EDITOR_CONTROL::PlaceTarget(), and PCB_SELECTION_TOOL::RebuildSelection().
|
inlineinherited |
Definition at line 148 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 197 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 84 of file inspectable.h.
References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
Referenced by CLASS_D_DESC::CLASS_D_DESC(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().
|
inlineinherited |
Definition at line 93 of file inspectable.h.
References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
|
inlineinherited |
Definition at line 102 of file inspectable.h.
References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
|
virtual |
Reimplemented in SELECTION.
Definition at line 87 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 81 of file view_group.cpp.
References m_groupItems.
Referenced by KIGFX::VIEW::draw(), and FreeItems().
|
virtual |
Remove an item from the group.
aItem | is the item to be removed. |
Definition at line 62 of file view_group.cpp.
References m_groupItems.
Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), and BOARD_EDITOR_CONTROL::PlaceTarget().
|
inlineinherited |
Definition at line 40 of file inspectable.h.
References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
|
inlineinherited |
Definition at line 53 of file inspectable.h.
References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
|
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().
|
inlinevirtual |
Set layer used to draw the group.
aLayer | is the layer used for drawing. |
Definition at line 108 of file view_group.h.
References m_layer.
Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), PNS_KICAD_IFACE::SetView(), and PNS_PCBNEW_DEBUG_DECORATOR::SetView().
|
protectedvirtual |
Layer on which the group is drawn.
Reimplemented in SELECTION, and PCB_SELECTION.
Definition at line 206 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 SELECTION, and GERBVIEW_SELECTION.
Definition at line 93 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 113 of file view_group.cpp.
References KIGFX::GAL::AdvanceDepth(), KIGFX::PAINTER::Draw(), KIGFX::VIEW::GetGAL(), KIGFX::VIEW::GetPainter(), KIGFX::VIEW::IsLayerVisible(), LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PADS_PLATEDHOLES, LAYER_PADS_TH, LAYER_SELECT_OVERLAY, 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 189 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 FP_ZONE, PAD, FOOTPRINT, VIA, GERBER_DRAW_ITEM, FP_TEXT, TRACK, ZONE, PCB_GROUP, and FP_SHAPE.
Definition at line 137 of file view_item.h.
Referenced by PNS_KICAD_IFACE::IsItemVisible(), KIGFX::VIEW::drawItem::operator()(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), and PCB_SELECTION_TOOL::Selectable().
|
inlineinherited |
Definition at line 143 of file view_item.h.
References KIGFX::VIEW_ITEM::m_viewPrivData.
Referenced by KIGFX::VIEW::Add(), KIGFX::VIEW::drawItem::deferredDraw(), KIGFX::VIEW::draw(), KIGFX::VIEW::Hide(), KIGFX::VIEW::invalidateItem(), KIGFX::VIEW::IsVisible(), KIGFX::VIEW::OnDestroy(), KIGFX::queryVisitor< Container >::operator()(), KIGFX::VIEW::updateItemsColor::operator()(), KIGFX::VIEW::changeItemsDepth::operator()(), KIGFX::VIEW::drawItem::operator()(), KIGFX::VIEW::recacheItem::operator()(), KIGFX::VIEW::clearLayerCache::operator()(), KIGFX::VIEW::Remove(), KIGFX::VIEW::SetVisible(), KIGFX::VIEW::Update(), KIGFX::VIEW::updateItemColor(), KIGFX::VIEW::updateItemGeometry(), and KIGFX::VIEW::updateLayers().
|
protected |
Definition at line 127 of file view_group.h.
Referenced by Add(), Clear(), GetItem(), GetSize(), Remove(), updateDrawList(), and ViewBBox().
|
protected |
Container for storing VIEW_ITEMs.
Definition at line 124 of file view_group.h.
Referenced by SetLayer(), ViewDraw(), and ViewGetLayers().