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_GROUP_HPP
00026 #define __SGL_GROUP_HPP
00027
00028 #include <sgl.h>
00029 #include <vector>
00030
00031 #include <sglPolytope.hpp>
00032 #include <sglNode.hpp>
00033
00034
00035
00075
00076
00077 class SGL_DLL_API sglGroup : public sglNode
00078 {
00079 public:
00081 sglGroup();
00083 virtual ~sglGroup();
00084
00088 unsigned int getNumChildren() const { return m_child_list.size(); }
00089
00094 virtual bool addChild(sglNode *child);
00095
00101 virtual bool removeChild(sglNode *child);
00102
00110 virtual bool insertChild(unsigned int index, sglNode *child);
00111
00119 virtual sglNode *replaceChild(unsigned int index, sglNode *child);
00120
00127 virtual sglNode *removeChild(unsigned int index);
00128
00135 sglNode* getChild(unsigned int index);
00136
00144 int searchChild(sglNode *child, unsigned int start = 0) const;
00145
00146
00147 virtual sglBound::IntersectResultEnum intersect(
00148 sglIntersectf &isector) const;
00149
00150
00151 virtual sglBound::IntersectResultEnum intersect(
00152 sglIntersectd &isector) const;
00153
00154
00155 virtual void pick(sglPickf &pick_state, unsigned int cull_flags) const;
00156
00157
00158 virtual void pick(sglPickd &pick_state, unsigned int cull_flags) const;
00159
00160
00161 virtual void preDraw(const PreDrawStruct &trav_state);
00162
00163
00164 virtual sglNode *clone(unsigned int mode) const;
00165
00166
00167 virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00168
00169 protected:
00170
00171 virtual void computeBound();
00172 virtual void computeBoundsRecursiveDown();
00173
00174
00175 virtual void cull(sglCull<float> &trav_state,
00176 unsigned int cull_flags) const;
00177
00178
00179 virtual void cull(sglCull<double> &trav_state,
00180 unsigned int cull_flags) const;
00181
00182 void copyTo(sglGroup *dst, unsigned int mode) const;
00183
00184 private:
00185 sglGroup(const sglGroup &);
00186 sglGroup &operator=(const sglGroup &);
00187
00188 protected:
00189 vector<sglNode*> m_child_list;
00190 };
00191
00192 #endif