glc_worldhandle.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
00022
00023
00024
00025 #ifndef GLC_WORLDHANDLE_H_
00026 #define GLC_WORLDHANDLE_H_
00027
00028 #include "glc_3dviewcollection.h"
00029 #include "glc_structoccurence.h"
00030
00031 #include <QHash>
00032
00033 #include "../glc_config.h"
00034
00037
00038
00039 class GLC_LIB_EXPORT GLC_WorldHandle
00040 {
00042
00044
00045 public:
00047 GLC_WorldHandle();
00048
00050 ~GLC_WorldHandle();
00052
00054
00056
00057 public:
00059 inline GLC_3DViewCollection* collection()
00060 {return &m_Collection;}
00061
00063 inline int numberOfWorld() const
00064 {return m_NumberOfWorld;}
00065
00067 inline bool isOrphan() const
00068 {return m_NumberOfWorld == 0;}
00069
00071 inline bool contains(GLC_uint id) const
00072 {return m_OccurenceHash.contains(id);}
00073
00075
00076 inline GLC_StructOccurence* getOccurence(GLC_uint id) const
00077 {
00078 Q_ASSERT(m_OccurenceHash.contains(id));
00079 return m_OccurenceHash.value(id);
00080 }
00081
00083 inline QList<GLC_StructOccurence*> occurences() const
00084 {return m_OccurenceHash.values();}
00085
00087 inline int numberOfOccurence() const
00088 {return m_OccurenceHash.size();}
00089
00091 QList<GLC_StructInstance*> instances() const;
00092
00094 QList<GLC_StructReference*> references() const;
00095
00097 int numberOfBody() const;
00098
00100 inline GLC_Vector3d upVector() const
00101 {return m_UpVector;}
00102
00104
00106
00108
00109 public:
00111 inline void increment()
00112 {++m_NumberOfWorld;}
00113
00115 inline void decrement()
00116 {--m_NumberOfWorld;}
00117
00119 void addOccurence(GLC_StructOccurence* pOccurence, bool isSelected= false, GLuint shaderId= 0);
00120
00122 void removeOccurence(GLC_StructOccurence* pOccurence);
00123
00125 inline void removeAllOccurences()
00126 {
00127 m_OccurenceHash.clear();
00128 }
00129
00131 inline void setUpVector(const GLC_Vector3d& vect)
00132 {m_UpVector= vect;}
00133
00134
00136
00138
00140 private:
00142 GLC_3DViewCollection m_Collection;
00143
00145 int m_NumberOfWorld;
00146
00148 QHash<GLC_uint, GLC_StructOccurence*> m_OccurenceHash;
00149
00151 GLC_Vector3d m_UpVector;
00152 };
00153
00154 #endif