Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglGroup.hpp

00001 /*****************************************************************************
00002  * SGL: A Scene Graph Library
00003  *
00004  * Copyright (C) 1997-2001  Scott McMillan   All Rights Reserved.
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the Free
00018  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  *****************************************************************************
00020  *     File: sglGroup.hpp
00021  *  Created: 30 December 1997
00022  *  Summary: Base class for all scene graph internal node types
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    // See sglNode::intersect(f) for details.
00147    virtual sglBound::IntersectResultEnum intersect(
00148       sglIntersectf &isector) const;
00149 
00150    // See sglNode::intersect(d) for details.
00151    virtual sglBound::IntersectResultEnum intersect(
00152       sglIntersectd &isector) const;
00153 
00154    // See sglNode::pick(f) for details.
00155    virtual void pick(sglPickf &pick_state, unsigned int cull_flags) const;
00156 
00157    // See sglNode::pick(d) for details.
00158    virtual void pick(sglPickd &pick_state, unsigned int cull_flags) const;
00159 
00160    // See sglNode::preDraw() for details.
00161    virtual void preDraw(const PreDrawStruct &trav_state);
00162 
00163    // See sglNode::clone() for details.
00164    virtual sglNode *clone(unsigned int mode) const;
00165 
00166    // See sglObject::printInfo() for details.
00167    virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00168 
00169 protected:
00170    // compute the bounding sphere
00171    virtual void computeBound();
00172    virtual void computeBoundsRecursiveDown();
00173 
00174    // See sglNode::cull(f) for details
00175    virtual void cull(sglCull<float> &trav_state,
00176                      unsigned int cull_flags) const;
00177 
00178    // See sglNode::cull(d) for details
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:  // not implemented
00185    sglGroup(const sglGroup &);
00186    sglGroup &operator=(const sglGroup &);
00187 
00188 protected:
00189     vector<sglNode*> m_child_list;
00190 };
00191 
00192 #endif

Generated at Mon Jul 1 18:00:04 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001