49 if( i ==
m_items.end() || *i > aItem )
64 if( !( i ==
m_items.end() || *i > aItem ) )
88 return !( i ==
m_items.end() || *i > aItem );
95 bool hasOnlyText =
true;
103 if( !item->IsType( { SCH_TEXT_T, SCH_LABEL_LOCATE_ANY_T } ) )
117 center += item->GetPosition();
119 center = center /
static_cast<int>(
m_items.size() );
120 return static_cast<VECTOR2I>( center );
126 bbox.
Merge( item->GetBoundingBox() );
129 return static_cast<VECTOR2I>( bbox.GetCenter() );
138 bbox.
Merge( item->GetBoundingBox() );
148 if( item->IsType( { aType } ) )
162 if( item->IsType( { aType } ) )
172 std::vector<VIEW_ITEM*> items;
175 items.push_back( item );
186 return r->Type() == m_items.front()->Type();
196 return r->IsType( aList );
203 using pairedIterators =
207 std::vector<pairedIterators> pairs;
211 for( ; item !=
m_items.end(); ++item, ++order )
212 pairs.emplace_back( make_pair( item, order ) );
215 std::sort( pairs.begin(), pairs.end(),
216 []( pairedIterators
const& a, pairedIterators
const& b )
218 return *a.second < *b.second;
222 std::vector<EDA_ITEM*> sortedItems;
224 for( pairedIterators sortedItem : pairs )
225 sortedItems.emplace_back( *sortedItem.first );
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
A base class for most all the KiCad significant classes used in schematics and boards.
An abstract base class for deriving all objects that can be added to a VIEW.
std::deque< EDA_ITEM * > m_items
virtual void Add(EDA_ITEM *aItem)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
const std::vector< EDA_ITEM * > GetItemsSortedBySelectionOrder() const
std::deque< int > m_itemsOrders
std::deque< EDA_ITEM * >::const_iterator CITER
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
virtual void Remove(EDA_ITEM *aItem)
bool AreAllItemsIdentical() const
Checks if all items in the selection are the same KICAD_T type.
bool HasType(KICAD_T aType) const
Checks if there is at least one item of requested kind.
std::deque< EDA_ITEM * >::iterator ITER
bool OnlyContains(std::vector< KICAD_T > aList) const
Checks if all items in the selection have a type in aList.
EDA_ITEM * m_lastAddedItem
bool operator==(const SELECTION &aOther)
size_t CountType(KICAD_T aType) const
bool Contains(EDA_ITEM *aItem) const
virtual BOX2I GetBoundingBox() const
virtual const std::vector< KIGFX::VIEW_ITEM * > updateDrawList() const override
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.