Editor API
UnigineEditor public API
Editor::IndexList Class Reference

This class represents a list of indices of selected subitems of a selected node. When an object is selected, some of its surfaces or collision shapes can also be selected, the index list shall contain indices for all of them grouped by type. More...

#include <Selector.h>

Inheritance diagram for Editor::IndexList:
Editor::SelectorNodes::SubItemList

Public Member Functions

 IndexList ()
 
 ~IndexList () override
 
void extend (Constants::SubObjectType stype, int index)
 Extends the list by adding an item of the specified type with the specified index (e.g., you can add the third surface). More...
 
void extend (Constants::SubObjectType stype, int from, int to)
 Extends the list by adding a range of items of the specified type having indices in the specified range (e.g., you can add surfaces with indices from 2 to 6). More...
 
int type () const override
 Returns the type of the index list. More...
 
bool equal (SubItemList *other) const override
 Checks whether the index list is equal to the other list specified. More...
 
void merge (SubItemList *other) override
 Merges the index list with the other list specified. More...
 
void exclude (Constants::SubObjectType stype) override
 Excludes all indices of subitems of the specified type from the list (e.g., remove all joints). More...
 
void exclude (Constants::SubObjectType stype, int index)
 Excludes the specified index of a subitem of the specified type from the list (e.g., remove third joint). More...
 
bool contains (Constants::SubObjectType stype, int index) const
 Checks whether the index list contains the subitem of the specified type having the specified index (e.g., you can check whether the second shape is selected). More...
 
QSet< int > getSubObjectIndexes (Constants::SubObjectType stype) const
 Returns all indices of subitems of the specified type stored in the list (e.g., you can get all surfaces). More...
 
bool empty (Constants::SubObjectType stype) const
 Checks whether the index list does not contain any indices of subitems of the specified type. More...
 
int size (Constants::SubObjectType stype) const
 Returns the number of indices of subitems of the specified type. More...
 
IndexListclone () const override
 Clones the index list. More...
 
- Public Member Functions inherited from Editor::SelectorNodes::SubItemList
 SubItemList ()
 
virtual ~SubItemList ()
 
virtual bool equal (SubItemList *other) const =0
 Checks whether the subitems list is equal to the other list specified. More...
 
virtual void merge (SubItemList *other)=0
 Merges the subitems list with the other list specified. More...
 

Detailed Description

This class represents a list of indices of selected subitems of a selected node. When an object is selected, some of its surfaces or collision shapes can also be selected, the index list shall contain indices for all of them grouped by type.

Constructor & Destructor Documentation

◆ IndexList()

Editor::IndexList::IndexList ( )

◆ ~IndexList()

Editor::IndexList::~IndexList ( )
override

Member Function Documentation

◆ clone()

IndexList* Editor::IndexList::clone ( ) const
overridevirtual

Clones the index list.

Returns
Clone of the index list.

Implements Editor::SelectorNodes::SubItemList.

◆ contains()

bool Editor::IndexList::contains ( Constants::SubObjectType  stype,
int  index 
) const

Checks whether the index list contains the subitem of the specified type having the specified index (e.g., you can check whether the second shape is selected).

Parameters
stypeSubitem type. One of the Constants::SubObjectType enum values.
indexSubitem index.
Returns
true if the list contains the subitem of the specified type having the specified index; otherwise, false.

◆ empty()

bool Editor::IndexList::empty ( Constants::SubObjectType  stype) const

Checks whether the index list does not contain any indices of subitems of the specified type.

Returns
true if the list does not contain any indices of subitems of the specified type; otherwise, false.

◆ equal()

bool Editor::IndexList::equal ( SubItemList other) const
override

Checks whether the index list is equal to the other list specified.

Parameters
otherOther subitems list.
Returns
true if lists are equal; otherwise, false.

◆ exclude() [1/2]

void Editor::IndexList::exclude ( Constants::SubObjectType  stype)
overridevirtual

Excludes all indices of subitems of the specified type from the list (e.g., remove all joints).

Parameters
stypeType of subitems to be excluded from the list (Constants::SubObjectType).

Implements Editor::SelectorNodes::SubItemList.

◆ exclude() [2/2]

void Editor::IndexList::exclude ( Constants::SubObjectType  stype,
int  index 
)

Excludes the specified index of a subitem of the specified type from the list (e.g., remove third joint).

Parameters
stypeType of subitems to be excluded from the list (Constants::SubObjectType).
indexItem index.

◆ extend() [1/2]

void Editor::IndexList::extend ( Constants::SubObjectType  stype,
int  index 
)

Extends the list by adding an item of the specified type with the specified index (e.g., you can add the third surface).

Parameters
stypeType of the item to be added. One of the Constants::SubObjectType enum values.
indexIndex of the item to be added.

◆ extend() [2/2]

void Editor::IndexList::extend ( Constants::SubObjectType  stype,
int  from,
int  to 
)

Extends the list by adding a range of items of the specified type having indices in the specified range (e.g., you can add surfaces with indices from 2 to 6).

Parameters
stypeType of the item to be added. One of the Constants::SubObjectType enum values.
fromIndex of the first item of the range to be added.
toIndex of the last item of the range to be added.

◆ getSubObjectIndexes()

QSet<int> Editor::IndexList::getSubObjectIndexes ( Constants::SubObjectType  stype) const

Returns all indices of subitems of the specified type stored in the list (e.g., you can get all surfaces).

Parameters
stypeSubitem type. One of the Constants::SubObjectType enum values.
Returns
A set of indices of all list subitems of the specified type (if any); otherwise, nullptr.

◆ merge()

void Editor::IndexList::merge ( SubItemList other)
override

Merges the index list with the other list specified.

Parameters
otherOther subitems list.

◆ size()

int Editor::IndexList::size ( Constants::SubObjectType  stype) const

Returns the number of indices of subitems of the specified type.

Parameters
stypeSubitem type. One of the Constants::SubObjectType enum values.
Returns
Number of indices of subitems of the specified type.

◆ type()

int Editor::IndexList::type ( ) const
overridevirtual

Returns the type of the index list.

Returns
SubType::INDEXED.

Implements Editor::SelectorNodes::SubItemList.