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

OSGDVRVolume.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000,2001 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 _OSGDVRVOLUME_H_
00040 #define _OSGDVRVOLUME_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #undef OSG_INCLUDE_SOVOLUME
00046 
00047 
00048 #include <OSGConfig.h>
00049 
00050 #include <OSGDVRVolumeBase.h>
00051 #include <OSGAction.h>
00052 #include <OSGDrawAction.h>
00053 #include <OSGTextureManager.h>
00054 #include <OSGDVRClipper.h>
00055 
00056 
00058 
00059 #define DVRVOLUME_PARAMETER(volume, class) \
00060 class##Ptr::dcast(volume->findParameter(class::getClassType()))
00061 
00062 
00063 
00064 #ifdef OSG_INCLUDE_SOVOLUME
00065 class SoVolume;
00066 #endif
00067 
00068 OSG_BEGIN_NAMESPACE
00069 
00073 class OSG_SYSTEMLIB_DLLMAPPING DVRVolume : public DVRVolumeBase
00074 {
00075   private:
00076 
00077     typedef DVRVolumeBase Inherited;
00078 
00079     /*==========================  PUBLIC  =================================*/
00080 
00081   public:
00082 
00083     /*---------------------------------------------------------------------*/
00087      void setAppearance    (const DVRAppearancePtr &value);
00088      void setGeometry      (const DVRGeometryPtr   &value);
00089      void setShader        (const DVRShaderPtr     &value);
00090      void setRenderMaterial(const MaterialPtr      &value);
00091      void setTextureStorage(const ChunkMaterialPtr &value);
00092 
00094     /*---------------------------------------------------------------------*/
00098     virtual void changed(BitVector  whichField, 
00099                          UInt32     from);
00100 
00102     /*---------------------------------------------------------------------*/
00106     virtual void dump(      UInt32     uiIndent = 0, 
00107                       const BitVector  bvFlags  = 0) const;
00108 
00110     /*---------------------------------------------------------------------*/
00113     // execute the OpenGL commands to draw the geometry 
00114     Action::ResultE doDraw(Action         *action);
00115     
00116     // low-level OpenGL calls, ignoring materials   
00117     Action::ResultE draw  (DrawActionBase *action);
00118 
00119     // generate draw tree
00120     Action::ResultE render(Action         *action);
00121 
00123     /*---------------------------------------------------------------------*/
00126     AttachmentPtr findParameter(const FieldContainerType &type,
00127                                       UInt16              binding = 0);
00128 
00129     AttachmentPtr findParameter(      UInt32              groupId, 
00130                                       UInt16              binding = 0);
00131 
00133     /*---------------------------------------------------------------------*/
00136     void          buildDrawStyleList   (      Window         *win = NULL    );
00137 
00139     void          initializeClipObjects(      DrawActionBase *action, 
00140                                         const Matrix          &volumeToWorld);
00141 
00142 
00144     /*---------------------------------------------------------------------*/
00147     TextureManager              &getTextureManager(void          );
00148 
00149     TextureManager::TextureMode  getTextureMode   (Window *window);
00150 
00153 
00154     // updates the texture color table
00155     void reload(void);
00156     
00158     /*=========================  PROTECTED  ===============================*/
00159 
00160   protected:
00161 
00162     /*---------------------------------------------------------------------*/
00166     DVRVolume(void);
00167     DVRVolume(const DVRVolume &source);
00168 
00170     /*---------------------------------------------------------------------*/
00174     virtual ~DVRVolume(void); 
00175 
00177     /*---------------------------------------------------------------------*/
00181     virtual void adjustVolume(Volume &volume);
00182 
00184     /*---------------------------------------------------------------------*/
00188     // extension indices for used extensions;
00189     static UInt32 _extTex3D;
00190     
00192     /*==========================  PRIVATE  ================================*/
00193 
00194   private:
00195 
00196     friend class FieldContainer;
00197     friend class DVRVolumeBase;
00198     
00199     static void initMethod(void);
00200 
00201     // prohibit default functions (move to 'public' if you need one)
00202 
00203     void operator =(const DVRVolume &source);
00204 
00208     void commonConstructor( void );
00209 
00210     // intersect action: ray test
00211     Action::ResultE intersect(Action * action);
00212 
00213     /*---------------------------------------------------------------------*/
00217 #ifdef OSG_INCLUDE_SOVOLUME
00218     SoVolume       *volumeImpl;
00219     UInt32          nextDrawStyle;
00220 #endif
00221     bool            drawStyleListValid;
00222     TextureManager  textureManager;
00223     bool            shadingInitialized;
00224 
00225     DVRClipper      clipper;
00226     
00229 
00230     friend class TextureManager;
00231 };
00232 
00233 typedef DVRVolume *DVRVolumeP;
00234 
00235 OSG_END_NAMESPACE
00236 
00237 #include <OSGDVRVolume.inl>
00238 #include <OSGDVRVolumeBase.inl>
00239 
00240 #define OSGDVRVOLUME_HEADER_CVSID "@(#)$Id: $"
00241 
00242 #endif /* _OSGDVRVOLUME_H_ */

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