glc_selectionset.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00023
00024 #ifndef GLC_SELECTIONSET_H_
00025 #define GLC_SELECTIONSET_H_
00026
00027 #include <QHash>
00028 #include <QList>
00029 #include <QSet>
00030
00031 #include "glc_structoccurence.h"
00032 #include "../glc_global.h"
00033
00034 #include "../glc_config.h"
00035
00036 class GLC_WorldHandle;
00037
00040
00041
00042 class GLC_LIB_EXPORT GLC_SelectionSet
00043 {
00045
00047
00048
00049 public:
00051 GLC_SelectionSet(GLC_WorldHandle* pWorld);
00052 virtual ~GLC_SelectionSet();
00053
00055
00057
00059
00060 public:
00061
00063 bool isEmpty() const;
00064
00066 inline int size() const
00067 {return count();}
00068
00070 int count() const;
00071
00073 QList<GLC_StructOccurence*> occurencesList() const;
00074
00076 QList<GLC_StructOccurence*> occurencesListWithSelectedPrimitive() const;
00077
00079 QSet<GLC_uint> selectedPrimitivesId(GLC_uint instanceId) const;
00080
00082 bool hasPrimitiveSelected(GLC_uint instanceId) const;
00083
00085 bool contains(const GLC_StructOccurence* pOccurence) const
00086 {return contains(pOccurence->id());}
00087
00089 bool contains(GLC_uint occurenceId) const
00090 {return m_OccurenceHash.contains(occurenceId);}
00091
00093
00094
00096
00097 public:
00099
00100 bool insert(GLC_StructOccurence* pOccurence);
00101
00103
00104 bool insert(GLC_uint occurenceId);
00105
00107
00108 bool remove(GLC_StructOccurence* pOccurence);
00109
00111
00112 bool remove(GLC_uint occurenceId);
00113
00115 void clear();
00116
00118
00119 bool insertPrimitiveId(GLC_StructOccurence* pOccurence, GLC_uint primitiveId);
00120
00122
00123 bool insertPrimitiveId(GLC_uint occurenceId, GLC_uint primitiveId);
00124
00126
00127 void insertSetOfPrimitivesId(GLC_StructOccurence* pOccurence, const QSet<GLC_uint>& setOfPrimitivesId);
00128
00130
00131 void insertSetOfPrimitivesId(GLC_uint occurenceId, const QSet<GLC_uint>& setOfPrimitivesId);
00132
00134
00138 bool removePrimitiveId(GLC_StructOccurence* pOccurence, GLC_uint primitiveId);
00139
00141
00145 bool removePrimitiveId(GLC_uint occurenceId, GLC_uint primitiveId);
00146
00147
00149
00151
00153 private:
00155 GLC_WorldHandle* m_pWorldHandle;
00156
00158 QHash<GLC_uint, GLC_StructOccurence*> m_OccurenceHash;
00159
00161 QHash<GLC_uint, QSet<GLC_uint> > m_InstanceToPrimitiveId;
00162
00163 };
00164
00165 #endif