Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGDrawTreeNode.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef _OSGDRAWTREENODE_H_
00040 #define _OSGDRAWTREENODE_H_
00041 
00042 #ifdef __sgi
00043 #pragma once
00044 #endif
00045 
00046 #include <OSGBaseTypes.h>
00047 #include <OSGSystemDef.h>
00048 #include <OSGMemoryObject.h>
00049 #include <OSGRenderAction.h>
00050 #include <OSGMaterial.h>
00051 
00052 OSG_BEGIN_NAMESPACE
00053 
00054 class Geometry;
00055 class State;
00056 class DrawTreeNodeFactory;
00057 
00061 class OSG_SYSTEMLIB_DLLMAPPING DrawTreeNode : public MemoryObject
00062 {
00063     /*==========================  PUBLIC  =================================*/
00064   public:
00065 
00066     /*---------------------------------------------------------------------*/
00070     static Int32 _iCreateCount;
00071     static Int32 _iDeleteCount;
00072 
00074     /*---------------------------------------------------------------------*/
00078     static const UInt8 MultiPass;
00079     static const UInt8 LastMultiPass;
00080     static const UInt8 NoStateSorting;
00081 
00083     /*---------------------------------------------------------------------*/
00087     DrawTreeNode *getFirstChild   (void                           );
00088     DrawTreeNode *getLastChild    (void                           );
00089 
00090     void          addChild        (DrawTreeNode *pChild           );
00091     void          insertFirstChild(DrawTreeNode *pChild           );
00092     void          insertChildAfter(DrawTreeNode *pCurrent, 
00093                                    DrawTreeNode *pChild           );
00094 
00095     DrawTreeNode *getBrother      (void);
00096     void          setBrother      (DrawTreeNode *pBrother         );
00097 
00098     void          setGeometry     (Geometry *pGeo                 );
00099     Geometry     *getGeometry     (void                           );
00100 
00101     void          setFunctor      (Material::DrawFunctor &func    );
00102     Material::DrawFunctor &getFunctor(void                        );
00103     bool          hasFunctor      (void                           );
00104     
00105     void          setState        (State    *pState               );
00106     State        *getState        (void                           );
00107     
00108     void          setNode         (NodePtr   pNode                );
00109     NodePtr       getNode         (void                           );
00110 
00111     void          setMatrixStore  (const RenderAction::MatrixStore &oMatrixStore);
00112     RenderAction::MatrixStore  &getMatrixStore  (void                           );        
00113 
00114     void          setScalar       (Real32 rScalar                 );
00115     Real32        getScalar       (void                           );
00116 
00117     void          setLightsState  (UInt64 state                   );
00118     UInt64        getLightsState  (void                           );
00119 
00120     void          setMultiPass    (void                           );
00121     void          setLastMultiPass(void                           );
00122     bool          isMultiPass     (void                           );
00123     bool          isLastMultiPass (void                           );
00124 
00125     void          setNoStateSorting(void                           );
00126     bool          isNoStateSorting (void                           );
00127 
00128     void          reset           (void                           );
00129 
00131     /*=========================  PROTECTED  ===============================*/
00132   protected:
00133 
00134     typedef MemoryObject Inherited;
00135 
00136     /*---------------------------------------------------------------------*/
00140     DrawTreeNode              *_pFirstChild;
00141     DrawTreeNode              *_pLastChild;
00142 
00143     DrawTreeNode              *_pBrother;
00144 
00145     NodePtr                    _pNode;
00146 
00147     State                     *_pState;
00148     Geometry                  *_pGeo;
00149     Material::DrawFunctor      _functor;
00150     bool                       _hasFunctor;
00151     
00152     RenderAction::MatrixStore  _oMatrixStore;        
00153 
00154     Real32                     _rScalarVal;
00155 
00156     UInt64                     _lightsState;
00157 
00158     Int8                       _flags;
00159 
00161     /*---------------------------------------------------------------------*/
00165     DrawTreeNode(void);
00166 
00168     /*---------------------------------------------------------------------*/
00172     virtual ~DrawTreeNode(void); 
00173 
00175     /*==========================  PRIVATE  ================================*/
00176   private:
00177 
00178     friend class DrawTreeNodeFactory;
00179 
00181     DrawTreeNode(const DrawTreeNode &source);
00183     void operator =(const DrawTreeNode &source);
00184 };
00185 
00186 OSG_END_NAMESPACE
00187 
00188 #include <OSGDrawTreeNode.inl>
00189 
00190 #define OSGDRAWTREENODE_HEADER_CVSID "@(#)$Id: $"
00191 
00192 #endif /* _OSGDRAWTREENODE_H_ */

Generated on Thu Aug 25 04:03:08 2005 for OpenSG by  doxygen 1.4.3