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 __SGL_GEODE_HPP
00026 #define __SGL_GEODE_HPP
00027
00028 #include <sgl.h>
00029 #include <vector>
00030
00031 #include <sglNode.hpp>
00032 #include <sglGroup.hpp>
00033
00034 class sglDrawable;
00035
00036
00037
00068 class SGL_DLL_API sglGeode : public sglNode
00069 {
00070 public:
00072 sglGeode();
00074 virtual ~sglGeode();
00075
00080 unsigned int getNumGeometries() const { return m_geometry_list.size(); }
00081
00086 bool addGeometry(sglDrawable *geometry);
00087
00094 bool insertGeometry(unsigned int index, sglDrawable *geometry);
00095
00101 bool removeGeometry(sglDrawable *geometry);
00102
00108 sglDrawable *getGeometry(unsigned int index);
00109
00110
00111 virtual sglBound::IntersectResultEnum intersect(
00112 sglIntersectf &isector) const;
00113
00114
00115 virtual sglBound::IntersectResultEnum intersect(
00116 sglIntersectd &segset) const;
00117
00118
00119 virtual void pick(sglPickf &pick_state, unsigned int cull_flags) const;
00120
00121
00122 virtual void pick(sglPickd &pick_state, unsigned int cull_flags) const;
00123
00124
00125 virtual void preDraw(const PreDrawStruct &trav_state);
00126
00127
00128 virtual sglNode *clone(unsigned int mode) const;
00129
00130
00131 virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00132
00133 protected:
00134
00135 virtual void computeBound();
00136 virtual void computeBoundsRecursiveDown();
00137
00138
00139 virtual void cull(sglCull<float> &trav_state,
00140 unsigned int cull_flags) const;
00141
00142
00143 virtual void cull(sglCull<double> &trav_state,
00144 unsigned int cull_flags) const;
00145
00146 void copyTo(sglGeode *dst, unsigned int mode) const;
00147
00148 private:
00149 int searchGeometries(sglDrawable *geometry);
00150
00151
00152 sglGeode(const sglGeode &);
00153 sglGeode &operator=(const sglGeode &);
00154
00155 protected:
00156 vector<sglDrawable *> m_geometry_list;
00157 };
00158
00159 #endif