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. | |
virtual void | Add (VIEW_ITEM *aItem) |
Add an item to the group. | |
virtual void | Remove (VIEW_ITEM *aItem) |
Remove an item from the group. | |
virtual void | Clear () |
Remove all the stored items from the group. | |
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. | |
virtual void | ViewDraw (int aLayer, VIEW *aView) const override |
Draw all the stored items in the group on the given layer. | |
virtual void | ViewGetLayers (int aLayers[], int &aCount) const override |
Return all the layers used by the stored items. | |
virtual void | SetLayer (int aLayer) |
Set layer used to draw the group. | |
void | FreeItems () |
Free all the items that were added to the group. | |
bool | IsSCH_ITEM () const |
bool | IsBOARD_ITEM () const |
virtual double | ViewGetLOD (int aLayer, 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) |
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< 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 | |
bool | m_isSCH_ITEM |
bool | m_isBOARD_ITEM |
VIEW_ITEM_DATA * | m_viewPrivData |
double | m_forcedTransparency |
Additional transparency for diff'ing items. | |
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 47 of file view_group.h.
VIEW_GROUP::VIEW_GROUP | ( | VIEW * | aView = nullptr | ) |
Definition at line 45 of file view_group.cpp.
|
virtual |
Definition at line 52 of file view_group.cpp.
|
virtual |
Add an item to the group.
Definition at line 58 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 70 of file view_group.cpp.
References m_groupItems.
Referenced by PCB_SELECTION_TOOL::ExitGroup(), FreeItems(), and PCB_SELECTION_TOOL::RebuildSelection().
void VIEW_GROUP::FreeItems | ( | ) |
Free all the items that were added to the group.
Definition at line 199 of file view_group.cpp.
References Clear(), GetItem(), and GetSize().
Referenced by PNS_PCBNEW_DEBUG_DECORATOR::Clear(), PNS_KICAD_IFACE::EraseView(), PCB_POINT_EDITOR::OnSelectionChange(), DRAWING_TOOL::PlaceTuningPattern(), PNS_KICAD_IFACE::SetView(), PCB_POINT_EDITOR::updateItem(), and PNS_KICAD_IFACE::~PNS_KICAD_IFACE().
|
inlineinherited |
Definition at line 119 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 99 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(), PROPERTIES_PANEL::getItemValue(), PCBEXPR_VAR_REF::GetValue(), and SCHEMATIC::SCHEMATIC().
|
inlineinherited |
Definition at line 107 of file inspectable.h.
References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
|
inlineinherited |
Definition at line 161 of file view_item.h.
Referenced by KIGFX::SCH_PAINTER::draw(), EDA_ITEM::EDA_ITEM(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), and EDA_ITEM::operator=().
|
virtual |
Reimplemented in SELECTION.
Definition at line 82 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 76 of file view_group.cpp.
References m_groupItems.
Referenced by KIGFX::VIEW::draw(), and FreeItems().
|
inlineinherited |
Definition at line 100 of file view_item.h.
Referenced by KIGFX::PCB_VIEW::Add(), PCB_BASE_EDIT_FRAME::ClearListAndDeleteItems(), CONVERT_TOOL::CreatePolys(), EDIT_TOOL::doMoveSelection(), KIGFX::PCB_PAINTER::Draw(), PCB_SELECTION_TOOL::highlightInternal(), PCB_TEST_SELECTION_TOOL::highlightInternal(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), BOARD_COMMIT::MakeImage(), BOARD::Move(), DRAWING_TOOL::PlaceImportedGraphics(), EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), KIGFX::PCB_VIEW::Remove(), EDIT_TOOL::removeNonRootItems(), BOARD_COMMIT::Revert(), PCB_EDIT_FRAME::SetActiveLayer(), PCB_BASE_FRAME::SetPlotSettings(), PCB_EDIT_FRAME::ShowBoardSetupDialog(), EDIT_TOOL::Swap(), PCB_SELECTION_TOOL::unhighlightInternal(), PCB_TEST_SELECTION_TOOL::unhighlightInternal(), KIGFX::PCB_VIEW::Update(), EDIT_TOOL::updateModificationPoint(), and DIALOG_POSITION_RELATIVE::UpdatePickedItem().
|
inlineinherited |
Definition at line 99 of file view_item.h.
|
virtual |
Remove an item from the group.
Definition at line 64 of file view_group.cpp.
References alg::delete_matching(), and m_groupItems.
|
inlineinherited |
Definition at line 76 of file inspectable.h.
References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_MANAGER::PropertyChanged(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
|
inlineinherited |
Definition at line 59 of file inspectable.h.
References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_MANAGER::PropertyChanged(), 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_MANAGER::PropertyChanged(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().
Referenced by SCH_PROPERTIES_PANEL::valueChanged(), and PCB_PROPERTIES_PANEL::valueChanged().
|
inlineinherited |
Definition at line 156 of file view_item.h.
Referenced by EDA_ITEM::EDA_ITEM(), SYMBOL_DIFF_WIDGET::onSlider(), FOOTPRINT_DIFF_WIDGET::onSlider(), and EDA_ITEM::operator=().
|
inlinevirtual |
Set layer used to draw the group.
Definition at line 99 of file view_group.h.
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 208 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 88 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 108 of file view_group.cpp.
References KIGFX::GAL::AdvanceDepth(), KIGFX::PAINTER::Draw(), KIGFX::VIEW::GetGAL(), KIGFX::VIEW::GetPainter(), KIGFX::VIEW::IsHiddenOnOverlay(), KIGFX::VIEW::IsLayerVisible(), IsZoneFillLayer(), KIGFX::GAL_SCOPED_ATTRS::LAYER_DEPTH, LAYER_ID_COUNT, LAYER_PAD_HOLEWALLS, LAYER_PAD_PLATEDHOLES, LAYER_SELECT_OVERLAY, LAYER_ZONE_START, m_layer, 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 191 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, FOOTPRINT, PAD, PCB_FIELD, PCB_GROUP, PCB_REFERENCE_IMAGE, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, and ZONE.
Definition at line 145 of file view_item.h.
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().
|
inlineinherited |
Definition at line 151 of file view_item.h.
Referenced by KIGFX::VIEW::Add(), KIGFX::VIEW::draw(), KIGFX::VIEW::HasItem(), KIGFX::VIEW::Hide(), KIGFX::VIEW::invalidateItem(), KIGFX::VIEW::IsHiddenOnOverlay(), KIGFX::VIEW::IsVisible(), 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::SetVisible(), KIGFX::VIEW::Update(), KIGFX::VIEW::updateItemColor(), KIGFX::VIEW::updateItemGeometry(), and KIGFX::VIEW::updateLayers().
|
privateinherited |
Additional transparency for diff'ing items.
Definition at line 172 of file view_item.h.
Referenced by KIGFX::VIEW::DRAW_ITEM_VISITOR::operator()().
|
protected |
Definition at line 114 of file view_group.h.
Referenced by Add(), Clear(), GetItem(), GetSize(), Remove(), updateDrawList(), and ViewBBox().
|
privateinherited |
Definition at line 170 of file view_item.h.
|
privateinherited |
Definition at line 169 of file view_item.h.
|
protected |
Definition at line 113 of file view_group.h.
Referenced by ViewDraw(), and ViewGetLayers().
|
privateinherited |
Definition at line 171 of file view_item.h.
Referenced by KIGFX::VIEW::Add(), KIGFX::VIEW::OnDestroy(), KIGFX::VIEW::Remove(), KIGFX::VIEW::updateBbox(), KIGFX::VIEW::updateLayers(), and KIGFX::VIEW_ITEM::~VIEW_ITEM().