GLC_SelectionSet : GLC_StructOccurence and primitive selection set. More...
#include <glc_selectionset.h>
Public Member Functions | |
Constructor / Destructor | |
GLC_SelectionSet (GLC_WorldHandle *pWorld) | |
Construct the selection set associated to the given GLC_WorldHandle. | |
virtual | ~GLC_SelectionSet () |
Get Functions | |
bool | isEmpty () const |
Return true if this selection set is empty. | |
int | size () const |
Return the number of occurence in this selection set. | |
int | count () const |
Return the number of occurence in this selection set. | |
QList< GLC_StructOccurence * > | occurencesList () const |
Return the list of selected occurences. | |
QList< GLC_StructOccurence * > | occurencesListWithSelectedPrimitive () const |
Return the list of occurences with selected primitive. | |
QSet< GLC_uint > | selectedPrimitivesId (GLC_uint instanceId) const |
Return the set of primitive id of the given GLC_StructOccurence/GLC_3DviewInstance id. | |
bool | hasPrimitiveSelected (GLC_uint instanceId) const |
Return true if the given GLC_StructOccurence/GLC_3DviewInstance id has selected primitives. | |
bool | contains (const GLC_StructOccurence *pOccurence) const |
Return true if this selection set contains the given occurence. | |
bool | contains (GLC_uint occurenceId) const |
Return true if this selection set contains the given occurence id. | |
Set Functions | |
bool | insert (GLC_StructOccurence *pOccurence) |
Insert the given Occurence into the selection set and return true on success. | |
bool | insert (GLC_uint occurenceId) |
Insert the given Occurence id into the selection set and return true on success. | |
bool | remove (GLC_StructOccurence *pOccurence) |
Remove the given occurence from the selection set and return true on success. | |
bool | remove (GLC_uint occurenceId) |
Remove the given occurence from the selection set and return true on success. | |
void | clear () |
Clear this selection set. | |
bool | insertPrimitiveId (GLC_StructOccurence *pOccurence, GLC_uint primitiveId) |
Insert the given primitive id to the given Occurence return true on success. | |
bool | insertPrimitiveId (GLC_uint occurenceId, GLC_uint primitiveId) |
Insert the given primitive id to the given Occurence id return true on success. | |
void | insertSetOfPrimitivesId (GLC_StructOccurence *pOccurence, const QSet< GLC_uint > &setOfPrimitivesId) |
Insert the given set of primitive id to the given Occurence. | |
void | insertSetOfPrimitivesId (GLC_uint occurenceId, const QSet< GLC_uint > &setOfPrimitivesId) |
Insert the given set of primitive id to the given Occurence id. | |
bool | removePrimitiveId (GLC_StructOccurence *pOccurence, GLC_uint primitiveId) |
Remove the given primitive id to the given Occurence return true on success. | |
bool | removePrimitiveId (GLC_uint occurenceId, GLC_uint primitiveId) |
Remove the given primitive id to the given Occurence return true on success. | |
Private Attributes | |
GLC_WorldHandle * | m_pWorldHandle |
The worldHandle attached to this selection set. | |
QHash< GLC_uint, GLC_StructOccurence * > | m_OccurenceHash |
Hash table of selected occurence. | |
QHash< GLC_uint, QSet< GLC_uint > > | m_InstanceToPrimitiveId |
Hash table of instance id to set of primitive id. |
GLC_SelectionSet : GLC_StructOccurence and primitive selection set.
Definition at line 42 of file glc_selectionset.h.
GLC_SelectionSet::GLC_SelectionSet | ( | GLC_WorldHandle * | pWorld | ) |
Construct the selection set associated to the given GLC_WorldHandle.
Definition at line 27 of file glc_selectionset.cpp.
References GLC_WorldHandle::collection(), m_pWorldHandle, and GLC_3DViewCollection::selectionSize().
GLC_SelectionSet::~GLC_SelectionSet | ( | ) | [virtual] |
Definition at line 36 of file glc_selectionset.cpp.
void GLC_SelectionSet::clear | ( | void | ) |
Clear this selection set.
Definition at line 135 of file glc_selectionset.cpp.
References m_InstanceToPrimitiveId, and m_OccurenceHash.
Referenced by GLC_WorldHandle::selectAllWith3DViewInstance(), and GLC_WorldHandle::unselectAll().
bool GLC_SelectionSet::contains | ( | GLC_uint | occurenceId | ) | const [inline] |
Return true if this selection set contains the given occurence id.
Definition at line 89 of file glc_selectionset.h.
bool GLC_SelectionSet::contains | ( | const GLC_StructOccurence * | pOccurence | ) | const [inline] |
Return true if this selection set contains the given occurence.
Definition at line 85 of file glc_selectionset.h.
References contains(), and GLC_StructOccurence::id().
Referenced by contains(), GLC_StructOccurence::create3DViewInstance(), insertPrimitiveId(), and removePrimitiveId().
int GLC_SelectionSet::count | ( | ) | const |
Return the number of occurence in this selection set.
Definition at line 51 of file glc_selectionset.cpp.
References m_InstanceToPrimitiveId, and m_OccurenceHash.
bool GLC_SelectionSet::hasPrimitiveSelected | ( | GLC_uint | instanceId | ) | const |
Return true if the given GLC_StructOccurence/GLC_3DviewInstance id has selected primitives.
Definition at line 93 of file glc_selectionset.cpp.
References m_InstanceToPrimitiveId.
bool GLC_SelectionSet::insert | ( | GLC_uint | occurenceId | ) |
Insert the given Occurence id into the selection set and return true on success.
The given occurence id must belongs to this selection set's world
Definition at line 106 of file glc_selectionset.cpp.
References GLC_WorldHandle::containsOccurence(), GLC_WorldHandle::getOccurence(), m_OccurenceHash, and m_pWorldHandle.
bool GLC_SelectionSet::insert | ( | GLC_StructOccurence * | pOccurence | ) |
Insert the given Occurence into the selection set and return true on success.
The given occurence must belongs to this selection set's world
Definition at line 101 of file glc_selectionset.cpp.
References GLC_StructOccurence::id().
Referenced by insertPrimitiveId(), insertSetOfPrimitivesId(), GLC_WorldHandle::select(), and GLC_WorldHandle::selectAllWith3DViewInstance().
Insert the given primitive id to the given Occurence id return true on success.
The given occurence id must belongs to this selection set's world
Definition at line 146 of file glc_selectionset.cpp.
References contains(), insert(), and m_InstanceToPrimitiveId.
bool GLC_SelectionSet::insertPrimitiveId | ( | GLC_StructOccurence * | pOccurence, | |
GLC_uint | primitiveId | |||
) |
Insert the given primitive id to the given Occurence return true on success.
The given occurence must belongs to this selection set's world
Definition at line 141 of file glc_selectionset.cpp.
References GLC_StructOccurence::id().
void GLC_SelectionSet::insertSetOfPrimitivesId | ( | GLC_uint | occurenceId, | |
const QSet< GLC_uint > & | setOfPrimitivesId | |||
) |
Insert the given set of primitive id to the given Occurence id.
The given occurence id must belongs to this selection set's world
Definition at line 176 of file glc_selectionset.cpp.
References insert(), and m_InstanceToPrimitiveId.
void GLC_SelectionSet::insertSetOfPrimitivesId | ( | GLC_StructOccurence * | pOccurence, | |
const QSet< GLC_uint > & | setOfPrimitivesId | |||
) |
Insert the given set of primitive id to the given Occurence.
The given occurence must belongs to this selection set's world
Definition at line 171 of file glc_selectionset.cpp.
References GLC_StructOccurence::id().
bool GLC_SelectionSet::isEmpty | ( | void | ) | const |
Return true if this selection set is empty.
Definition at line 45 of file glc_selectionset.cpp.
References m_OccurenceHash.
QList< GLC_StructOccurence * > GLC_SelectionSet::occurencesList | ( | ) | const |
Return the list of selected occurences.
Definition at line 56 of file glc_selectionset.cpp.
References m_InstanceToPrimitiveId, and m_OccurenceHash.
QList< GLC_StructOccurence * > GLC_SelectionSet::occurencesListWithSelectedPrimitive | ( | ) | const |
Return the list of occurences with selected primitive.
Definition at line 71 of file glc_selectionset.cpp.
References m_InstanceToPrimitiveId, and m_OccurenceHash.
bool GLC_SelectionSet::remove | ( | GLC_uint | occurenceId | ) |
Remove the given occurence from the selection set and return true on success.
The given occurence id must belongs to this selection set's world
Definition at line 123 of file glc_selectionset.cpp.
References GLC_WorldHandle::containsOccurence(), m_InstanceToPrimitiveId, m_OccurenceHash, and m_pWorldHandle.
bool GLC_SelectionSet::remove | ( | GLC_StructOccurence * | pOccurence | ) |
Remove the given occurence from the selection set and return true on success.
The given occurence must belongs to this selection set's world
Definition at line 118 of file glc_selectionset.cpp.
References GLC_StructOccurence::id().
Referenced by GLC_WorldHandle::removeOccurence(), and GLC_WorldHandle::unselect().
Remove the given primitive id to the given Occurence return true on success.
The given occurence must belongs to this selection set's world If the set of primitive only contains the given primitive ID the given occurence is removed from this selection set
Definition at line 194 of file glc_selectionset.cpp.
References contains(), GLC_WorldHandle::containsOccurence(), m_InstanceToPrimitiveId, m_pWorldHandle, and size().
bool GLC_SelectionSet::removePrimitiveId | ( | GLC_StructOccurence * | pOccurence, | |
GLC_uint | primitiveId | |||
) |
Remove the given primitive id to the given Occurence return true on success.
The given occurence must belongs to this selection set's world If the set of primitive only contains the given primitive ID the given occurence is removed from this selection set
Definition at line 189 of file glc_selectionset.cpp.
References GLC_StructOccurence::id().
Return the set of primitive id of the given GLC_StructOccurence/GLC_3DviewInstance id.
Definition at line 83 of file glc_selectionset.cpp.
References m_InstanceToPrimitiveId.
int GLC_SelectionSet::size | ( | void | ) | const [inline] |
Return the number of occurence in this selection set.
Definition at line 66 of file glc_selectionset.h.
Referenced by removePrimitiveId().
QHash<GLC_uint, QSet<GLC_uint> > GLC_SelectionSet::m_InstanceToPrimitiveId [private] |
Hash table of instance id to set of primitive id.
Definition at line 161 of file glc_selectionset.h.
Referenced by clear(), count(), hasPrimitiveSelected(), insertPrimitiveId(), insertSetOfPrimitivesId(), occurencesList(), occurencesListWithSelectedPrimitive(), remove(), removePrimitiveId(), and selectedPrimitivesId().
QHash<GLC_uint, GLC_StructOccurence*> GLC_SelectionSet::m_OccurenceHash [private] |
Hash table of selected occurence.
Definition at line 158 of file glc_selectionset.h.
Referenced by clear(), count(), insert(), isEmpty(), occurencesList(), occurencesListWithSelectedPrimitive(), and remove().
GLC_WorldHandle* GLC_SelectionSet::m_pWorldHandle [private] |
The worldHandle attached to this selection set.
Definition at line 155 of file glc_selectionset.h.
Referenced by GLC_SelectionSet(), insert(), remove(), and removePrimitiveId().