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

osg::DVRIsoShader Class Reference

*put brief class description here* More...

#include <OSGDVRIsoShader.h>

Inheritance diagram for osg::DVRIsoShader:

osg::DVRIsoShaderBase osg::DVRShader osg::DVRShaderBase osg::FieldContainer List of all members.

Public Types

typedef DVRIsoShaderPtr Ptr
enum  { ShadeModeFieldId = Inherited::NextFieldId, ActiveShadeModeFieldId = ShadeModeFieldId + 1, NextFieldId = ActiveShadeModeFieldId + 1 }

Public Member Functions

virtual bool initialize (DVRVolume *volume, DrawActionBase *action)
virtual void activate (DVRVolume *volume, DrawActionBase *action)
virtual void brickActivate (DVRVolume *volume, DrawActionBase *action, Brick *brick)
virtual void deactivate (DVRVolume *volume, DrawActionBase *action)
virtual void cleanup (DVRVolume *volume, DrawActionBase *action)
virtual void renderSlice (DVRVolume *volume, DrawActionBase *action, Real32 *data, UInt32 vertices, UInt32 values)
virtual void renderSlice (DVRVolume *volume, DrawActionBase *action, DVRRenderSlice *clippedSlice)
virtual bool hasRenderCallback (void)
virtual bool useMTSlabs (void)
Sync
*virtual void changed (BitVector whichField, UInt32 origin)
 react to field changes
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
 output the instance for debug purposes
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Binary Access
*virtual UInt32 getBinSize (const BitVector &whichField)
virtual void copyToBin (BinaryDataHandler &pMem, const BitVector &whichField)
virtual void copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField)
Copy
*virtual FieldContainerPtr shallowCopy (void) const

Static Public Member Functions

Class Get
*static FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction
*static DVRIsoShaderPtr create (void)
 create a new instance of the class
static DVRIsoShaderPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype

Static Public Attributes

static const osg::BitVector ShadeModeFieldMask
static const osg::BitVector ActiveShadeModeFieldMask
static const osg::BitVector MTInfluenceMask
static const BitVector NextFieldMask
CoredNodePtr helper
static const bool isNodeCore = false
CoredNodePtr helper
static const bool isNodeCore = false

Protected Types

typedef std::vector< DirLightDirLightList
enum  ShadingMode {
  SM_AUTO = 0, SM_COLORMATRIX_2D, SM_COLORMATRIX_3D, SM_REGISTER_COMBINERS_2D,
  SM_REGISTER_COMBINERS_MULTI2D, SM_REGISTER_COMBINERS_3D, SM_FRAGMENT_PROGRAM_2D, SM_FRAGMENT_PROGRAM_3D,
  SM_NONE
}

Protected Member Functions

ImagePtr createGradientImage (DVRVolumeTexturePtr volTex)
bool checkGLVersion (GLfloat version)
bool isModeSupported (DVRVolume *volume, DrawActionBase *action, UInt8 mode)
 Checks whether the selected mode is supported.
UInt8 selectMode (DVRVolume *volume, DrawActionBase *action)
 Automatically select a shading mode.
bool tryMode (DVRVolume *volume, DrawActionBase *action, UInt8 mode)
 Checks whether the selected mode is supported.
void getLightSources (DirLightList &diffuseLights, DirLightList &specularLights, Color4f &ambientLight)
void getCoveredScreenRect (DVRVolume *volume, DrawActionBase *action, GLfloat screenRect[4])
void activate_ColorMatrixShading (DVRVolume *volume, DrawActionBase *action)
void deactivate_ColorMatrixShading (DVRVolume *volume, DrawActionBase *action)
void activate_NVRegisterCombinerShading (DVRVolume *volume, DrawActionBase *action)
void deactivate_NVRegisterCombinerShading (DVRVolume *volume, DrawActionBase *action)
void activate_FragmentProgramShading (DVRVolume *volume, DrawActionBase *action)
void deactivate_FragmentProgramShading (DVRVolume *volume, DrawActionBase *action)
void renderSlice_NVRegisterCombinerShading (DVRVolume *volume, DrawActionBase *action, Real32 *data, UInt32 vertices, UInt32 values)
void renderSlice_NVRegisterCombinerShading (DVRVolume *volume, DrawActionBase *action, DVRRenderSlice *clippedSlice)
void renderSlice_FragmentProgramShading (DVRVolume *volume, DrawActionBase *action, Real32 *data, UInt32 vertices, UInt32 values)
void renderSlice_FragmentProgramShading (DVRVolume *volume, DrawActionBase *action, DVRRenderSlice *clippedSlice)
void setupCombinerParametersDiffuse (DVRVolume *volume, DrawActionBase *action)
void setupCombinerParametersSpecular (DVRVolume *volume, DrawActionBase *action)
void initCombiners_IsoSurfaceDiffuse (DrawActionBase *action)
void initCombiners_Diffuse2Combiners (DrawActionBase *action)
void initCombiners_DiffuseMultiCombiners (DrawActionBase *action)
void initCombiners_IsoSurfaceSpecular (DrawActionBase *action)
void initCombiners_Specular2Combiners (DrawActionBase *action)
void initCombiners_SpecularMultiCombiners (DrawActionBase *action)
Constructors
DVRIsoShader (void)
 Constructor.
 DVRIsoShader (const DVRIsoShader &source)
 Copy Constructor.
Destructors
*virtual ~DVRIsoShader (void)
 Destructor.
Field Get
*SFInt8getSFShadeMode (void)
 Get the DVRIsoShader::_sfShadeMode field.
SFInt8getSFActiveShadeMode (void)
 Get the DVRIsoShader::_sfActiveShadeMode field.
Int8getShadeMode (void)
 Get the value of the DVRIsoShader::_sfShadeMode field.
const Int8getShadeMode (void) const
 Get the value of the DVRIsoShader::_sfShadeMode field.
Int8getActiveShadeMode (void)
 Get the value of the DVRIsoShader::_sfActiveShadeMode field.
const Int8getActiveShadeMode (void) const
 Get the value of the DVRIsoShader::_sfActiveShadeMode field.
Field Set
*void setShadeMode (const Int8 &value)
 Set the value of the DVRIsoShader::_sfShadeMode field.
void setActiveShadeMode (const Int8 &value)
 Set the value of the DVRIsoShader::_sfActiveShadeMode field.
Sync
*void executeSyncImpl (DVRIsoShaderBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (DVRShaderBase *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)
MT Destruction
*virtual void onDestroy (void)

Protected Attributes

ImagePtr m_gradientImage
bool m_hasPerStageConstants
GLint m_maxCombiners
UInt8 m_shadingMode
FragmentProgramChunkPtr m_pFragProg
Int32 m_textureId
GLint m_colorWriteMask [4]
Fields
*SFInt8 _sfShadeMode
SFInt8 _sfActiveShadeMode

Static Protected Attributes

static char _fragProg2D []
static char _fragProg3D []
static UInt32 _ARB_multitexture = Window::invalidExtensionID
static UInt32 _EXT_texture3D = Window::invalidExtensionID
static UInt32 _EXT_secondary_color = Window::invalidExtensionID
static UInt32 _NV_register_combiners = Window::invalidExtensionID
static UInt32 _NV_register_combiners2 = Window::invalidExtensionID
static UInt32 _SGI_color_matrix = Window::invalidExtensionID
static UInt32 _ARB_fragment_program = Window::invalidExtensionID
static UInt32 _funcActiveTextureARB
static UInt32 _funcMultiTexCoord2dARB
static UInt32 _funcTexImage3DEXT
static UInt32 _funcCombinerParameteriNV
static UInt32 _funcCombinerParameterfvNV
static UInt32 _funcCombinerStageParameterfvNV
static UInt32 _funcCombinerInputNV
static UInt32 _funcCombinerOutputNV
static UInt32 _funcFinalCombinerInputNV
static UInt32 _funcSecondaryColor3fEXT
static UInt32 _funcSecondaryColor3fvEXT

Private Types

typedef DVRIsoShaderBase Inherited

Private Member Functions

void operator= (const DVRIsoShader &source)

Static Private Member Functions

static void initMethod (void)
 initialize the static features of the class, e.g. action callbacks

Friends

class FieldContainer
class DVRIsoShaderBase

Classes

struct  DirLight

Detailed Description

Simple iso surface shader

Definition at line 67 of file OSGDVRIsoShader.h.


Member Typedef Documentation

typedef DVRIsoShaderBase osg::DVRIsoShader::Inherited [private]
 

Reimplemented from osg::DVRIsoShaderBase.

Definition at line 71 of file OSGDVRIsoShader.h.

typedef std::vector<DirLight> osg::DVRIsoShader::DirLightList [protected]
 

Definition at line 156 of file OSGDVRIsoShader.h.

typedef DVRIsoShaderPtr osg::DVRIsoShaderBase::Ptr [inherited]
 

Reimplemented from osg::DVRShaderBase.

Definition at line 91 of file OSGDVRIsoShaderBase.h.


Member Enumeration Documentation

enum osg::DVRIsoShader::ShadingMode [protected]
 

Enumerator:
SM_AUTO 
SM_COLORMATRIX_2D 
SM_COLORMATRIX_3D 
SM_REGISTER_COMBINERS_2D 
SM_REGISTER_COMBINERS_MULTI2D 
SM_REGISTER_COMBINERS_3D 
SM_FRAGMENT_PROGRAM_2D 
SM_FRAGMENT_PROGRAM_3D 
SM_NONE 

Definition at line 137 of file OSGDVRIsoShader.h.

anonymous enum [inherited]
 

Enumerator:
ShadeModeFieldId 
ActiveShadeModeFieldId 
NextFieldId 

Reimplemented from osg::FieldContainer.

Definition at line 93 of file OSGDVRIsoShaderBase.h.

00094     {
00095         ShadeModeFieldId       = Inherited::NextFieldId,
00096         ActiveShadeModeFieldId = ShadeModeFieldId       + 1,
00097         NextFieldId            = ActiveShadeModeFieldId + 1
00098     };


Constructor & Destructor Documentation

DVRIsoShader::DVRIsoShader void   )  [protected]
 

Definition at line 109 of file OSGDVRIsoShader.cpp.

References _ARB_fragment_program, _ARB_multitexture, _EXT_secondary_color, _EXT_texture3D, _funcActiveTextureARB, _funcCombinerInputNV, _funcCombinerOutputNV, _funcCombinerParameterfvNV, _funcCombinerParameteriNV, _funcCombinerStageParameterfvNV, _funcFinalCombinerInputNV, _funcMultiTexCoord2dARB, _funcSecondaryColor3fEXT, _funcSecondaryColor3fvEXT, _funcTexImage3DEXT, _NV_register_combiners, _NV_register_combiners2, _SGI_color_matrix, m_gradientImage, m_pFragProg, m_shadingMode, m_textureId, osg::NullFC, OSG_DLSYM_UNDERSCORE, osg::Window::registerExtension(), osg::Window::registerFunction(), and SM_NONE.

00109                                :
00110     Inherited()
00111 {
00112     m_gradientImage = NullFC;
00113     m_shadingMode   = SM_NONE;
00114     m_pFragProg     = NullFC;
00115     m_textureId     = -1;
00116 
00117     // Do this here, will change in future for OpenSG as a whole
00118     _ARB_multitexture       = 
00119         Window::registerExtension("GL_ARB_multitexture"      );
00120 
00121     _EXT_texture3D          = 
00122         Window::registerExtension("GL_EXT_texture3D"         );
00123 
00124     _EXT_secondary_color     = 
00125         Window::registerExtension("GL_EXT_secondary_color"   );
00126 
00127     _NV_register_combiners  = 
00128         Window::registerExtension("GL_NV_register_combiners" );
00129 
00130     _NV_register_combiners2 = 
00131         Window::registerExtension("GL_NV_register_combiners2");
00132 
00133     _SGI_color_matrix       = 
00134         Window::registerExtension("GL_SGI_color_matrix"      );
00135 
00136     _ARB_fragment_program   = 
00137         Window::registerExtension("GL_ARB_fragment_program"  );
00138 
00139 
00140     _funcActiveTextureARB            =  
00141        Window::registerFunction(OSG_DLSYM_UNDERSCORE"glActiveTextureARB",    
00142                                 _ARB_multitexture);
00143 
00144     _funcMultiTexCoord2dARB          = 
00145        Window::registerFunction(OSG_DLSYM_UNDERSCORE"glMultiTexCoord2dARB",    
00146                                 _ARB_multitexture);
00147 
00148     _funcTexImage3DEXT               = 
00149        Window::registerFunction(OSG_DLSYM_UNDERSCORE"glTexImage3DEXT",    
00150                                 _ARB_multitexture);
00151 
00152     _funcCombinerParameteriNV        = 
00153        Window::registerFunction(OSG_DLSYM_UNDERSCORE"glCombinerParameteriNV",    
00154                                 _NV_register_combiners);
00155     
00156     _funcCombinerParameterfvNV       = 
00157        Window::registerFunction(OSG_DLSYM_UNDERSCORE"glCombinerParameterfvNV",    
00158                                 _NV_register_combiners);
00159 
00160     _funcCombinerStageParameterfvNV  = 
00161        Window::registerFunction(
00162            OSG_DLSYM_UNDERSCORE"glCombinerStageParameterfvNV",    
00163                                 _NV_register_combiners);
00164 
00165     _funcSecondaryColor3fEXT         = 
00166        Window::registerFunction(OSG_DLSYM_UNDERSCORE"glSecondaryColor3fEXT",    
00167                                 _EXT_secondary_color);
00168 
00169     _funcSecondaryColor3fvEXT        = 
00170        Window::registerFunction(OSG_DLSYM_UNDERSCORE"glSecondaryColor3fvEXT",    
00171                                 _EXT_secondary_color);
00172 
00173     _funcCombinerInputNV             = 
00174        Window::registerFunction(OSG_DLSYM_UNDERSCORE"glCombinerInputNV",    
00175                                 _NV_register_combiners);
00176 
00177     _funcCombinerOutputNV            = 
00178        Window::registerFunction(OSG_DLSYM_UNDERSCORE"glCombinerOutputNV",    
00179                                 _NV_register_combiners);
00180 
00181     _funcFinalCombinerInputNV        = 
00182        Window::registerFunction(OSG_DLSYM_UNDERSCORE"glFinalCombinerInputNV",    
00183                                 _NV_register_combiners);
00184 
00185 }

DVRIsoShader::DVRIsoShader const DVRIsoShader source  )  [protected]
 

Definition at line 188 of file OSGDVRIsoShader.cpp.

References m_gradientImage, m_pFragProg, m_shadingMode, m_textureId, osg::NullFC, and SM_NONE.

00188                                                      :
00189     Inherited(source)
00190 {  
00191     m_gradientImage = NullFC;
00192     m_shadingMode = SM_NONE;
00193     m_pFragProg = NullFC;
00194     m_textureId = -1;
00195 }

DVRIsoShader::~DVRIsoShader void   )  [protected, virtual]
 

Definition at line 198 of file OSGDVRIsoShader.cpp.

References m_gradientImage, m_pFragProg, m_textureId, osg::NullFC, and osg::subRefCP().

00199 {
00200     if(m_pFragProg != NullFC) 
00201     {
00202         subRefCP(m_pFragProg);
00203 
00204         m_pFragProg = NullFC;
00205     }
00206 
00207     if(m_gradientImage != NullFC) 
00208     {
00209         subRefCP(m_gradientImage);
00210 
00211         m_gradientImage = NullFC;
00212     }
00213 
00214     m_textureId = -1;
00215 }


Member Function Documentation

bool DVRIsoShader::initialize DVRVolume volume,
DrawActionBase action
[virtual]
 

Reimplemented from osg::DVRShader.

Definition at line 243 of file OSGDVRIsoShader.cpp.

References osg::addRefCP(), createGradientImage(), DVRVOLUME_PARAMETER, osg::DVRIsoShaderBase::getShadeMode(), osg::DVRVolume::getTextureManager(), GLenum, m_gradientImage, m_shadingMode, m_textureId, osg::NullFC, osg::TextureManager::registerTexture(), SM_FRAGMENT_PROGRAM_2D, SM_REGISTER_COMBINERS_MULTI2D, osg::subRefCP(), SWARNING, and tryMode().

Referenced by activate().

00244 {  
00245 
00246     DVRVolumeTexturePtr vol = DVRVOLUME_PARAMETER(volume, DVRVolumeTexture);
00247   
00248     if((volume == NULL) || (vol == NullFC)) 
00249     {
00250         SWARNING << "DVRIsoShader - NO Volume" << std::endl;
00251         return false;
00252     }
00253 
00254     // Determine shading mechanism
00255     tryMode(volume, action, getShadeMode());
00256 
00257     GLenum nInternalFormat = GL_RGBA;
00258     GLenum nExternalFormat = GL_RGBA;
00259 
00260     // create gradient texture
00261     if(m_gradientImage != NullFC)
00262         subRefCP(m_gradientImage);
00263 
00264     m_gradientImage = createGradientImage(vol);
00265 
00266     addRefCP(m_gradientImage);
00267   
00268     if((m_shadingMode == SM_REGISTER_COMBINERS_MULTI2D) || 
00269        (m_shadingMode == SM_FRAGMENT_PROGRAM_2D       )  )
00270     {
00271         // init multitexture 
00272         m_textureId = volume->getTextureManager().registerTexture(
00273             m_gradientImage, 
00274             nInternalFormat, 
00275             nExternalFormat,                      
00276             true,
00277             0,
00278             1);
00279     }
00280     else
00281     {
00282         // init single texture
00283         m_textureId = volume->getTextureManager().registerTexture(
00284             m_gradientImage, 
00285             nInternalFormat, 
00286             nExternalFormat,
00287             true,
00288             0,
00289             -1);
00290     }
00291     
00292     if( m_textureId < 0)
00293     {
00294         SWARNING << "DVRIsoShader - Could not register texture: "
00295                  << m_textureId 
00296                  << std::endl; 
00297 
00298         subRefCP(m_gradientImage);
00299 
00300         return false;
00301     }
00302     
00303     return true;
00304 }

void DVRIsoShader::activate DVRVolume volume,
DrawActionBase action
[virtual]
 

Reimplemented from osg::DVRShader.

Definition at line 308 of file OSGDVRIsoShader.cpp.

References activate_ColorMatrixShading(), activate_FragmentProgramShading(), activate_NVRegisterCombinerShading(), osg::beginEditCP(), cleanup(), osg::endEditCP(), osg::DVRIsoShaderBase::getActiveShadeMode(), initialize(), m_shadingMode, osg::DVRVolumeBase::ShaderFieldMask, SM_AUTO, SM_COLORMATRIX_2D, SM_COLORMATRIX_3D, SM_FRAGMENT_PROGRAM_2D, SM_FRAGMENT_PROGRAM_3D, SM_NONE, SM_REGISTER_COMBINERS_2D, SM_REGISTER_COMBINERS_3D, and SM_REGISTER_COMBINERS_MULTI2D.

00309 {
00310     // reinitialize if hardware mode has not yet been chosen or mode 
00311     // has changed
00312 
00313     if(getActiveShadeMode() == SM_AUTO) 
00314     {
00315         cleanup   (volume, action);
00316         initialize(volume, action);
00317         
00318         // notify volume about shader changed
00319         beginEditCP(DVRVolumePtr(volume), DVRVolume::ShaderFieldMask);
00320         endEditCP(DVRVolumePtr  (volume), DVRVolume::ShaderFieldMask);
00321     }
00322 
00323     switch(m_shadingMode)
00324     {
00325         case SM_COLORMATRIX_2D:
00326         case SM_COLORMATRIX_3D:
00327             activate_ColorMatrixShading(volume, action);
00328             break;
00329 
00330         case SM_REGISTER_COMBINERS_2D:
00331         case SM_REGISTER_COMBINERS_MULTI2D:
00332         case SM_REGISTER_COMBINERS_3D: 
00333             activate_NVRegisterCombinerShading(volume, action);
00334             break;
00335 
00336         case SM_FRAGMENT_PROGRAM_2D: 
00337         case SM_FRAGMENT_PROGRAM_3D:
00338             activate_FragmentProgramShading(volume, action);
00339             break;
00340 
00341         case SM_NONE:
00342         default:
00343             break;
00344     }
00345 }

void DVRIsoShader::brickActivate DVRVolume volume,
DrawActionBase action,
Brick brick
[virtual]
 

Reimplemented from osg::DVRShader.

Definition at line 349 of file OSGDVRIsoShader.cpp.

References FDEBUG.

00350 {
00351     FDEBUG(("DVRIsoShader::brickActivate - nothing to do\n"));  
00352 }

void DVRIsoShader::deactivate DVRVolume volume,
DrawActionBase action
[virtual]
 

Reimplemented from osg::DVRShader.

Definition at line 356 of file OSGDVRIsoShader.cpp.

References deactivate_ColorMatrixShading(), deactivate_FragmentProgramShading(), deactivate_NVRegisterCombinerShading(), m_shadingMode, SM_COLORMATRIX_2D, SM_COLORMATRIX_3D, SM_FRAGMENT_PROGRAM_2D, SM_FRAGMENT_PROGRAM_3D, SM_NONE, SM_REGISTER_COMBINERS_2D, SM_REGISTER_COMBINERS_3D, and SM_REGISTER_COMBINERS_MULTI2D.

00357 {
00358     switch(m_shadingMode)
00359     {
00360         case SM_COLORMATRIX_2D:
00361         case SM_COLORMATRIX_3D:
00362             deactivate_ColorMatrixShading(volume, action);
00363             break;
00364 
00365         case SM_REGISTER_COMBINERS_2D:
00366         case SM_REGISTER_COMBINERS_MULTI2D:
00367         case SM_REGISTER_COMBINERS_3D:
00368             deactivate_NVRegisterCombinerShading(volume, action);
00369             break;
00370 
00371         case SM_FRAGMENT_PROGRAM_2D: 
00372         case SM_FRAGMENT_PROGRAM_3D:
00373             deactivate_FragmentProgramShading(volume, action);
00374             break;
00375 
00376         case SM_NONE:
00377         default:
00378             break;
00379     }
00380 }

void DVRIsoShader::cleanup DVRVolume volume,
DrawActionBase action
[virtual]
 

Definition at line 384 of file OSGDVRIsoShader.cpp.

References osg::DVRVolume::getTextureManager(), m_gradientImage, m_pFragProg, m_textureId, osg::NullFC, osg::subRefCP(), and osg::TextureManager::unregisterTexture().

Referenced by activate().

00385 {
00386     if(m_pFragProg != NullFC) 
00387     {
00388         subRefCP(m_pFragProg);
00389 
00390         m_pFragProg = NullFC;
00391     }
00392 
00393     if(m_gradientImage != NullFC) 
00394     {
00395         subRefCP(m_gradientImage);
00396 
00397         m_gradientImage = NullFC;        
00398     }
00399     
00400     if (m_textureId != -1)
00401     {
00402         volume->getTextureManager().unregisterTexture(m_textureId);
00403     }
00404 }

void DVRIsoShader::renderSlice DVRVolume volume,
DrawActionBase action,
Real32 data,
UInt32  vertices,
UInt32  values
[virtual]
 

Reimplemented from osg::DVRShader.

Definition at line 409 of file OSGDVRIsoShader.cpp.

References m_shadingMode, renderSlice_FragmentProgramShading(), renderSlice_NVRegisterCombinerShading(), SM_FRAGMENT_PROGRAM_2D, and SM_REGISTER_COMBINERS_MULTI2D.

00414 {
00415     switch(m_shadingMode)
00416     {
00417         case SM_REGISTER_COMBINERS_MULTI2D:
00418             renderSlice_NVRegisterCombinerShading(volume,
00419                                                   action,
00420                                                   data,
00421                                                   vertices,
00422                                                   values);
00423             break;
00424 
00425         case SM_FRAGMENT_PROGRAM_2D:
00426             renderSlice_FragmentProgramShading(volume,
00427                                                action,
00428                                                data,
00429                                                vertices,
00430                                                values);
00431             break;
00432         default:
00433             break;
00434     }
00435 }

void DVRIsoShader::renderSlice DVRVolume volume,
DrawActionBase action,
DVRRenderSlice clippedSlice
[virtual]
 

Reimplemented from osg::DVRShader.

Definition at line 439 of file OSGDVRIsoShader.cpp.

References m_shadingMode, renderSlice_FragmentProgramShading(), renderSlice_NVRegisterCombinerShading(), SM_FRAGMENT_PROGRAM_2D, and SM_REGISTER_COMBINERS_MULTI2D.

00442 {
00443     switch(m_shadingMode)
00444     {
00445         case SM_REGISTER_COMBINERS_MULTI2D:
00446             renderSlice_NVRegisterCombinerShading(volume,action,clippedSlice);
00447             break;
00448 
00449         case SM_FRAGMENT_PROGRAM_2D:
00450             renderSlice_FragmentProgramShading(volume,action,clippedSlice);
00451             break;
00452 
00453         default:
00454             break;
00455      }
00456 }

bool DVRIsoShader::hasRenderCallback void   )  [virtual]
 

Reimplemented from osg::DVRShader.

Definition at line 461 of file OSGDVRIsoShader.cpp.

References m_shadingMode, SM_FRAGMENT_PROGRAM_2D, and SM_REGISTER_COMBINERS_MULTI2D.

00462 {
00463     switch(m_shadingMode)
00464     {
00465         case SM_REGISTER_COMBINERS_MULTI2D:
00466             return true;
00467 
00468         case SM_FRAGMENT_PROGRAM_2D:
00469             return true;
00470 
00471         default:
00472             break;
00473     }
00474 
00475     return false;
00476 }

bool DVRIsoShader::useMTSlabs void   )  [virtual]
 

Reimplemented from osg::DVRShader.

Definition at line 480 of file OSGDVRIsoShader.cpp.

References m_shadingMode, SM_FRAGMENT_PROGRAM_2D, and SM_REGISTER_COMBINERS_MULTI2D.

00481 {
00482     switch(m_shadingMode)
00483     {
00484         case SM_REGISTER_COMBINERS_MULTI2D:
00485             return true;
00486 
00487         case SM_FRAGMENT_PROGRAM_2D:
00488             return true;
00489 
00490         default:
00491             break;
00492     }
00493 
00494     return false;
00495 }

void DVRIsoShader::changed BitVector  whichField,
UInt32  origin
[virtual]
 

Reimplemented from osg::DVRShader.

Definition at line 226 of file OSGDVRIsoShader.cpp.

References osg::DVRShader::changed(), osg::DVRIsoShaderBase::setActiveShadeMode(), osg::DVRIsoShaderBase::ShadeModeFieldMask, and SM_AUTO.

00227 {
00228     // trigger re-initialization
00229     if(whichField & ShadeModeFieldMask)
00230         setActiveShadeMode(SM_AUTO);
00231     
00232     Inherited::changed(whichField, origin);
00233 }

void DVRIsoShader::dump UInt32  uiIndent = 0,
const BitVector  bvFlags = 0
const [virtual]
 

Reimplemented from osg::DVRShader.

Definition at line 236 of file OSGDVRIsoShader.cpp.

References SLOG.

00238 {
00239     SLOG << "Dump DVRIsoShader NI" << std::endl;
00240 }

ImagePtr DVRIsoShader::createGradientImage DVRVolumeTexturePtr  volTex  )  [protected]
 

Definition at line 499 of file OSGDVRIsoShader.cpp.

References osg::ImageBase::create(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::length(), m_gradientImage, osg::VectorInterface< ValueTypeT, StorageInterfaceT >::normalize(), and osg::Image::OSG_RGBA_PF.

Referenced by initialize().

00500 { 
00501     int resX = (int) volTex->getImage()->getWidth(); 
00502     int resY = (int) volTex->getImage()->getHeight(); 
00503     int resZ = (int) volTex->getImage()->getDepth(); 
00504     
00505     int nGradSetSize =   resX * resY * resZ * 4; 
00506     int zOff         =   resX * resY; 
00507     int yOff         =   resX;
00508     
00509     
00510     //  Compute the Gradients  
00511     UChar8 *volData = volTex->getImage()->getData();
00512   
00513     UChar8 *gradbuffer = new UChar8[nGradSetSize];  
0