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

OSGDVRMtexLUTShader.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 _OSGDVRMTEXLUTSHADER_H_
00040 #define _OSGDVRMTEXLUTSHADER_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #include <OSGConfig.h>
00046 
00047 #include <OSGDVRMtexLUTShaderBase.h>
00048 
00049 OSG_BEGIN_NAMESPACE
00050 
00051 // forward reference
00052 class DVRRenderSlice;
00053 
00057 class OSG_SYSTEMLIB_DLLMAPPING DVRMtexLUTShader : public DVRMtexLUTShaderBase
00058 {
00059 private:
00060 
00061     typedef DVRMtexLUTShaderBase Inherited;
00062 
00063     /*==========================  PUBLIC  =================================*/
00064 
00065   public:
00066 
00067     /*---------------------------------------------------------------------*/
00071     virtual void changed(BitVector  whichField, 
00072                          UInt32     from);
00073 
00075     /*---------------------------------------------------------------------*/
00079     virtual void dump(      UInt32     uiIndent = 0, 
00080                       const BitVector  bvFlags  = 0) const;
00081 
00083     /*---------------------------------------------------------------------*/
00087     // Callback to set up shader - register textures here
00088     virtual bool initialize       (DVRVolume      *volume, 
00089                                    DrawActionBase *action      );
00090 
00091     // Callback before any slice is rendered - setup per volume
00092     virtual void activate         (DVRVolume      *volume, 
00093                                    DrawActionBase *action      );
00094 
00095     // Callback after all rendering of the volume is done
00096     virtual void deactivate       (DVRVolume      *volume, 
00097                                    DrawActionBase *action      );
00098 
00099     // Callback for rendering slices
00100     virtual void renderSlice      (DVRVolume      *volume, 
00101                                    DrawActionBase *action,
00102                                    Real32         *data, 
00103                                    UInt32          vertices, 
00104                                    UInt32          values      );
00105 
00106     // Callback for rendering slices
00107     virtual void renderSlice      (DVRVolume      *volume, 
00108                                    DrawActionBase *action,
00109                                    DVRRenderSlice *clippedSlice);
00110 
00111     // Callback to clean up shader resources
00112     virtual void cleanup          (DVRVolume      *volume, 
00113                                    DrawActionBase *action      );
00114 
00115     // Returns whether the shader has an implementation of 'renderSlice'
00116     virtual bool hasRenderCallback(void                        );
00117     
00118     // Returns whether the shader requires multitextured slabs instead of
00119     // bricks
00120     virtual bool useMTSlabs       (void                        ); 
00121 
00123     /*=========================  PROTECTED  ===============================*/
00124   
00125   protected:
00126 
00127     // Variables should all be in DVRMtexLUTShaderBase.
00128 
00129     /*---------------------------------------------------------------------*/
00133     DVRMtexLUTShader(void);
00134     DVRMtexLUTShader(const DVRMtexLUTShader &source);
00135 
00137     /*---------------------------------------------------------------------*/
00141     virtual ~DVRMtexLUTShader(void); 
00142 
00145     /*==========================  PRIVATE  ================================*/
00146 
00147   private:
00148 
00149     // extension indices for used extensions;
00150     static UInt32 _arbMultitexture;
00151     static UInt32 _nvRegisterCombiners;
00152     
00153     // extension indices for used fucntions;
00154     static UInt32 _funcMultiTexCoord2dARB;
00155     static UInt32 _funcCombinerParameteriNV;
00156     static UInt32 _funcCombinerParameterfvNV;
00157     static UInt32 _funcCombinerInputNV;
00158     static UInt32 _funcCombinerOutputNV;
00159     static UInt32 _funcFinalCombinerInputNV;
00160 
00162     /*---------------------------------------------------------------------*/
00166     // Set up correct register combiner state
00167     void initCombiners(DrawActionBase *action); 
00168 
00170     /*---------------------------------------------------------------------*/
00171     
00172     friend class FieldContainer;
00173     friend class DVRMtexLUTShaderBase;
00174 
00175     static void initMethod(void);
00176 
00177     // prohibit default functions (move to 'public' if you need one)
00178     void operator =(const DVRMtexLUTShader &source);
00179 };
00180 
00181 typedef DVRMtexLUTShader *DVRMtexLUTShaderP;
00182 
00183 OSG_END_NAMESPACE
00184 
00185 #include <OSGDVRMtexLUTShader.inl>
00186 #include <OSGDVRMtexLUTShaderBase.inl>
00187 
00188 #define OSGDVRMTEXLUTSHADER_HEADER_CVSID "@(#)$Id: $"
00189 
00190 #endif /* _OSGDVRMTEXLUTSHADER_H_ */

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