59 using ITER = std::deque<EDA_ITEM*>::iterator;
60 using CITER = std::deque<EDA_ITEM*>::const_iterator;
84 if( i ==
m_items.end() || *i > aItem )
92 if( !( i ==
m_items.end() || *i > aItem ) )
118 return !( i ==
m_items.end() || *i > aItem );
142 bool includeLabels =
true;
149 if( !item->IsType( labelTypes ) )
151 includeLabels =
false;
160 if( !item->IsType( labelTypes ) || includeLabels )
161 bbox.
Merge( item->GetBoundingBox() );
164 return static_cast<VECTOR2I>( bbox.
Centre() );
185 bbox.
Merge( item->GetBoundingBox() );
216 auto refType = T(
nullptr ).Type();
220 if( item->Type() == refType )
221 return static_cast<T*> ( item );
237 if( item->Type() == aType )
246 std::vector<VIEW_ITEM*> items;
249 items.push_back( item );
284 return r->Type() ==
m_items.front()->Type();
294 using VIEW_GROUP::Add;
295 using VIEW_GROUP::Remove;
VECTOR2I GetReferencePoint() const
void ClearReferencePoint()
virtual void Clear() override
Remove all the stored items from the group.
void Merge(const EDA_RECT &aRect)
Modify the position and size of the rectangle in order to contain aRect.
std::deque< EDA_ITEM * > & Items()
The Cairo implementation of the graphics abstraction layer.
bool HasType(KICAD_T aType) const
Checks if there is at least one item of requested kind.
VECTOR2I GetPosition() const
Returns the top left point of the selection area bounding box.
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
std::deque< EDA_ITEM * >::const_iterator CITER
bool AreAllItemsIdentical() const
Checks if all items in the selection are the same KICAD_T type.
An abstract base class for deriving all objects that can be added to a VIEW.
OPT< VECTOR2I > m_referencePoint
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
void SetIsHover(bool aIsHover)
virtual void Add(EDA_ITEM *aItem)
void SetReferencePoint(const VECTOR2I &aP)
SELECTION(const SELECTION &aOther)
std::deque< EDA_ITEM * > m_items
virtual EDA_RECT GetBoundingBox() const
bool Contains(EDA_ITEM *aItem) const
const std::deque< EDA_ITEM * > GetItems() const
Extend VIEW_ITEM by possibility of grouping items into a single object.
std::deque< EDA_ITEM * >::iterator ITER
virtual EDA_ITEM * GetTopLeftItem(bool onlyModules=false) const
VIEW_GROUP(VIEW *aView=NULL)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
virtual const VIEW_GROUP::ITEMS updateDrawList() const override
Layer on which the group is drawn.
bool Empty() const
Checks if there is anything selected.
EDA_ITEM * operator[](const size_t aIdx) const
virtual unsigned int GetSize() const override
Return the number of stored items.
bool HasReferencePoint() const
Handle the component boundary box.
int Size() const
Returns the number of selected parts.
A base class for most all the KiCad significant classes used in schematics and boards.
SELECTION & operator=(const SELECTION &aOther)
virtual const BOX2I ViewBBox() const override
Return the bounding box for all stored items covering all its layers.
virtual void Remove(EDA_ITEM *aItem)