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 _OSGDVRSHADER_H_ 00040 #define _OSGDVRSHADER_H_ 00041 #ifdef __sgi 00042 #pragma once 00043 #endif 00044 00045 #include <OSGConfig.h> 00046 00047 #include <OSGDVRShaderBase.h> 00048 00049 #include <OSGDrawActionBase.h> 00050 #include <OSGGL.h> 00051 00052 OSG_BEGIN_NAMESPACE 00053 00055 class DVRVolume; 00056 class DVRRenderSlice; 00057 class Brick; 00058 00063 class OSG_SYSTEMLIB_DLLMAPPING DVRShader : public DVRShaderBase 00064 { 00065 private: 00066 00067 typedef DVRShaderBase Inherited; 00068 00069 /*========================== PUBLIC =================================*/ 00070 00071 public: 00072 00073 /*---------------------------------------------------------------------*/ 00077 virtual void changed(BitVector whichField, 00078 UInt32 from); 00079 00081 /*---------------------------------------------------------------------*/ 00085 virtual void dump( UInt32 uiIndent = 0, 00086 const BitVector bvFlags = 0) const; 00087 00089 /*---------------------------------------------------------------------*/ 00093 // Callback to set up shader - register textures here 00094 virtual bool initialize (DVRVolume *volume, 00095 DrawActionBase *action ); 00096 00097 // Callback before any slice is rendered - setup per volume 00098 virtual void activate (DVRVolume *volume, 00099 DrawActionBase *action ); 00100 00101 // Callback before any brick - state setup per brick 00102 virtual void brickActivate (DVRVolume *volume, 00103 DrawActionBase *action, 00104 Brick *brick ); 00105 00106 // Callback after all rendering of the volume is done 00107 virtual void deactivate (DVRVolume *volume, 00108 DrawActionBase *action ); 00109 00110 // Callback for rendering non-clipped slices 00111 virtual void renderSlice (DVRVolume *volume, 00112 DrawActionBase *action, 00113 Real32 *data, 00114 UInt32 vertices, 00115 UInt32 values ); 00116 00117 // Callback for rendering clipped slices 00118 virtual void renderSlice (DVRVolume *volume, 00119 DrawActionBase *action, 00120 DVRRenderSlice *clippedSlice); 00121 00122 // Returns whether the shader has an implementation of 'renderSlice' 00123 virtual bool hasRenderCallback(void ); 00124 00125 // Returns whether the shader requires multitextured slabs instead 00126 // of bricks 00127 virtual bool useMTSlabs (void ); 00128 00129 00131 /*========================= PROTECTED ===============================*/ 00132 00133 protected: 00134 00135 // Variables should all be in DVRShaderBase. 00136 00137 /*---------------------------------------------------------------------*/ 00141 DVRShader(void); 00142 DVRShader(const DVRShader &source); 00143 00146 /*---------------------------------------------------------------------*/ 00150 virtual ~DVRShader(void); 00151 00154 /*========================== PRIVATE ================================*/ 00155 00156 private: 00157 00158 friend class FieldContainer; 00159 friend class DVRShaderBase; 00160 00161 static void initMethod(void); 00162 00163 // prohibit default functions (move to 'public' if you need one) 00164 00165 void operator =(const DVRShader &source); 00166 }; 00167 00168 OSG_END_NAMESPACE 00169 00170 #include <OSGDVRShader.inl> 00171 #include <OSGDVRShaderBase.inl> 00172 00173 #define OSGDVRSHADER_HEADER_CVSID "@(#)$Id: $" 00174 00175 #endif /* _OSGDVRSHADER_H_ */
1.6.1