osg::DVRMtexLUTShader Class Reference

*put brief class description here* More...

#include <OSGDVRMtexLUTShader.h>

Inheritance diagram for osg::DVRMtexLUTShader:

osg::DVRMtexLUTShaderBase osg::DVRSimpleLUTShader osg::DVRSimpleLUTShaderBase osg::DVRSimpleShader osg::DVRSimpleShaderBase osg::DVRShader osg::DVRShaderBase osg::FieldContainer

List of all members.

Public Types

typedef DVRMtexLUTShaderPtr Ptr
enum  { LutModeFieldId = Inherited::NextFieldId, ActiveLutModeFieldId = LutModeFieldId + 1, NextFieldId = ActiveLutModeFieldId + 1 }
enum  { NextFieldId = 1 }

Public Member Functions

Sync


virtual void changed (BitVector whichField, UInt32 from)
 react to field changes
Output


virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
 output the instance for debug purposes
Volume Rendering


virtual bool initialize (DVRVolume *volume, DrawActionBase *action)
 callback to set up shader - register textures here
virtual void activate (DVRVolume *volume, DrawActionBase *action)
 callback before any slice is rendered - setup per volume
virtual void deactivate (DVRVolume *volume, DrawActionBase *action)
 callback after all rendering of the volume is done
virtual void renderSlice (DVRVolume *volume, DrawActionBase *action, Real32 *data, UInt32 vertices, UInt32 values)
 callback for rendering slices
virtual void renderSlice (DVRVolume *volume, DrawActionBase *action, DVRRenderSlice *clippedSlice)
virtual void cleanup (DVRVolume *volume, DrawActionBase *action)
 callback to clean up shader resources
virtual bool hasRenderCallback (void)
 callback to set up shader - register textures here
virtual bool useMTSlabs (void)
 callback to set up shader - register textures here
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
Volume Rendering


virtual void brickActivate (DVRVolume *volume, DrawActionBase *action, Brick *brick)
 Callback before any brick - state setup per brick.
Get Instance Type Information


UInt32 getTypeId (void) const
UInt16 getGroupId (void) const
const Char8getTypeName (void) const


FieldgetField (UInt32 fieldId)
FieldgetField (const Char8 *fieldName)

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 DVRMtexLUTShaderPtr create (void)
 create a new instance of the class
static DVRMtexLUTShaderPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype
Get Class Type Information


static UInt16 getClassGroupId (void)

Static Public Attributes

static const osg::BitVector MTInfluenceMask
static const osg::BitVector LutModeFieldMask
static const osg::BitVector ActiveLutModeFieldMask
static const BitVector NextFieldMask
CoredNodePtr helper


static const bool isNodeCore = false

Protected Types

enum  LutMode {
  LM_AUTO = 0, LM_TABLE_SGI, LM_PALETTE_EXT, LM_DEPENDENT,
  LM_FRAGPROG, LM_RELOAD, LM_NO
}

Protected Member Functions

Constructors
 DVRMtexLUTShader (void)
 Constructor.
 DVRMtexLUTShader (const DVRMtexLUTShader &source)
 Copy Constructor.
Destructors


virtual ~DVRMtexLUTShader (void)
 Destructor.
Sync


void executeSyncImpl (DVRMtexLUTShaderBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync


void executeSyncImpl (DVRSimpleLUTShaderBase *pOther, const BitVector &whichField)
Sync


void executeSyncImpl (DVRSimpleShaderBase *pOther, const BitVector &whichField)
Sync


void executeSyncImpl (DVRShaderBase *pOther, const BitVector &whichField)
Sync


void executeSyncImpl (FieldContainer *pOther, const BitVector &whichField)
Volume Rendering


void getPaletteFormat (DrawActionBase *action, UInt8 lutMode, GLenum &internalFormat, GLenum &externalFormat)
 returns texture formate for selected lookup table mode
bool isModeSupported (DrawActionBase *action, UInt8 mode, Int8 textureMode)
 Checks whether the selected mode is supported.
UInt8 selectMode (DrawActionBase *action, Int8 textureMode)
 Automatically select a lookup table mode.
void enablePalette (void)
 enables lut
void disablePalette (void)
 diasables lut
void initDependentTexture (Int32 size)
 create dependent texture
void updateDependentTexture (Int32 size, const UInt8 *data)
 update dependent texture
void destroyDependentTexture (void)
 destroy dependent texture
void setupAlphaCorrectionRegisterCombiners (DrawActionBase *action)
Field Get


SFInt8getSFLutMode (void)
 Get the DVRSimpleLUTShader::_sfLutMode field.
SFInt8getSFActiveLutMode (void)
 Get the DVRSimpleLUTShader::_sfActiveLutMode field.
Int8getLutMode (void)
 Get the value of the DVRSimpleLUTShader::_sfLutMode field.
const Int8getLutMode (void) const
 Get the value of the DVRSimpleLUTShader::_sfLutMode field.
Int8getActiveLutMode (void)
 Get the value of the DVRSimpleLUTShader::_sfActiveLutMode field.
const Int8getActiveLutMode (void) const
 Get the value of the DVRSimpleLUTShader::_sfActiveLutMode field.
Field Set


void setLutMode (const Int8 &value)
 Set the value of the DVRSimpleLUTShader::_sfLutMode field.
void setActiveLutMode (const Int8 &value)
 Set the value of the DVRSimpleLUTShader::_sfActiveLutMode field.
MT Edit


template<class FieldTypeT>
void beginEditX (const BitVector &whichField, FieldTypeT &field)
template<class FieldTypeT>
void endEditX (const BitVector &whichField, FieldTypeT &field)
MT Construction


void onCreate (const FieldContainer *source=NULL)
void onCreateAspect (const FieldContainer *aspect0, const FieldContainer *source=NULL)
MT Destruction


virtual void onDestroy (void)

Static Protected Member Functions

Create Fieldcontainer


template<class ObjectPtrT>
static void newPtr (ObjectPtrT &result, const typename ObjectPtrT::StoredObjectType *prototypeP)
template<class ObjectPtrT>
static void newPtr (ObjectPtrT &result)

Protected Attributes

UInt8 m_nTexturePaletteMode
Int8 m_nTextureMode
FragmentProgramChunkPtr m_pFragProg
TextureChunkPtr m_pDepTexture
Int32 m_nTextureId
Fields


SFInt8 _sfLutMode
SFInt8 _sfActiveLutMode
Member


UInt32 _shares

Private Types

typedef DVRMtexLUTShaderBase Inherited

Private Member Functions

void operator= (const DVRMtexLUTShader &source)
Volume Rendering


void initCombiners (DrawActionBase *action)
 set up correct register combiner state

Static Private Member Functions

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

Static Private Attributes

static UInt32 _arbMultitexture
static UInt32 _nvRegisterCombiners
static UInt32 _funcMultiTexCoord2dARB
static UInt32 _funcCombinerParameteriNV
static UInt32 _funcCombinerParameterfvNV
static UInt32 _funcCombinerInputNV
static UInt32 _funcCombinerOutputNV
static UInt32 _funcFinalCombinerInputNV

Friends

class FieldContainer
class DVRMtexLUTShaderBase


Detailed Description

Abstract shader class - not to be instantiated. Is intended to be stateless - NO FIELDS!!

Definition at line 57 of file OSGDVRMtexLUTShader.h.


Member Typedef Documentation

Reimplemented from osg::DVRMtexLUTShaderBase.

Definition at line 61 of file OSGDVRMtexLUTShader.h.

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 89 of file OSGDVRMtexLUTShaderBase.h.


Member Enumeration Documentation

enum osg::DVRSimpleLUTShader::LutMode [protected, inherited]

Enumerator:
LM_AUTO 
LM_TABLE_SGI 
LM_PALETTE_EXT 
LM_DEPENDENT 
LM_FRAGPROG 
LM_RELOAD 
LM_NO 

Definition at line 120 of file OSGDVRSimpleLUTShader.h.

00121     {
00122         LM_AUTO = 0,
00123         LM_TABLE_SGI,
00124         LM_PALETTE_EXT,
00125         LM_DEPENDENT,
00126         LM_FRAGPROG,
00127         LM_RELOAD,
00128         LM_NO
00129     };

anonymous enum [inherited]

Enumerator:
LutModeFieldId 
ActiveLutModeFieldId 
NextFieldId 

Definition at line 93 of file OSGDVRSimpleLUTShaderBase.h.

00094     {
00095         LutModeFieldId       = Inherited::NextFieldId,
00096         ActiveLutModeFieldId = LutModeFieldId       + 1,
00097         NextFieldId          = ActiveLutModeFieldId + 1
00098     };

anonymous enum [inherited]

Enumerator:
NextFieldId 

Definition at line 73 of file OSGFieldContainerImpl.h.

00073 { NextFieldId = 1 };


Constructor & Destructor Documentation

DVRMtexLUTShader::DVRMtexLUTShader ( void   )  [protected]

DVRMtexLUTShader::DVRMtexLUTShader ( const DVRMtexLUTShader source  )  [protected]

Definition at line 141 of file OSGDVRMtexLUTShader.cpp.

00141                                                                  :
00142     Inherited(source)
00143 {
00144 }

DVRMtexLUTShader::~DVRMtexLUTShader ( void   )  [protected, virtual]

Definition at line 147 of file OSGDVRMtexLUTShader.cpp.

00148 {
00149 }


Member Function Documentation

void DVRMtexLUTShader::changed ( BitVector  whichField,
UInt32  from 
) [virtual]

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 159 of file OSGDVRMtexLUTShader.cpp.

References osg::DVRSimpleLUTShader::changed(), and SWARNING.

00160 {
00161     SWARNING << "DVRMtexLUTShader::changed" << std::endl;
00162     
00163     Inherited::changed(whichField, origin);
00164 }

void DVRMtexLUTShader::dump ( UInt32  uiIndent = 0,
const BitVector  bvFlags = 0 
) const [virtual]

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 168 of file OSGDVRMtexLUTShader.cpp.

References SLOG.

00170 {
00171     SLOG << "Dump DVRMtexLUTShader NI" << std::endl;
00172 }

bool DVRMtexLUTShader::initialize ( DVRVolume volume,
DrawActionBase action 
) [virtual]

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 175 of file OSGDVRMtexLUTShader.cpp.

References _arbMultitexture, _nvRegisterCombiners, DVRVOLUME_PARAMETER, FWARNING, osg::DVRSimpleLUTShaderBase::getLutMode(), osg::DVRSimpleLUTShader::getPaletteFormat(), osg::DVRVolume::getTextureManager(), osg::DVRVolume::getTextureMode(), osg::DrawActionBase::getWindow(), GLenum, osg::Window::hasExtension(), osg::DVRSimpleLUTShader::isModeSupported(), osg::DVRSimpleLUTShader::LM_AUTO, osg::DVRSimpleLUTShader::LM_NO, osg::DVRSimpleShader::m_nTextureId, osg::DVRSimpleLUTShader::m_nTexturePaletteMode, osg::NullFC, osg::TextureManager::registerTexture(), osg::DVRSimpleLUTShader::selectMode(), osg::DVRSimpleLUTShaderBase::setActiveLutMode(), and SWARNING.

00176 {
00177     //FDEBUG(("DVRMtexLUTShader::initialize\n"));
00178     FWARNING(("DVRMtexLUTShader::initialize\n"));
00179 
00180     GLenum nInternalFormat;
00181     GLenum nExternalFormat;
00182 
00183     Window *win = action->getWindow();
00184 
00185     // Determine lookup table mechanism
00186     if(getLutMode() != LM_AUTO)
00187     {
00188         // A certain mode has been selected
00189         if(isModeSupported(action, 
00190                            getLutMode(), 
00191                            volume->getTextureMode(win)) == true)
00192         {
00193             SWARNING << "DVRMtexLUTShader - User specified lookup table mode "
00194                      << int(getLutMode()) 
00195                      << std::endl;
00196 
00197             m_nTexturePaletteMode = getLutMode();
00198         }
00199         else
00200         {
00201             SWARNING << "DVRMtexLUTShader - Unsupported lookup table mode " 
00202                      << int(getLutMode()) 
00203                      << " disabling LUT" 
00204                      << std::endl;
00205 
00206             m_nTexturePaletteMode = LM_NO;
00207         }
00208     }
00209     else 
00210     {
00211         // Use automatic mode selection
00212         m_nTexturePaletteMode = selectMode(action, 
00213                                            volume->getTextureMode(win));
00214     }
00215 
00216     setActiveLutMode(m_nTexturePaletteMode);
00217 
00218     
00219     getPaletteFormat(action, 
00220                      m_nTexturePaletteMode, 
00221                      nInternalFormat, 
00222                      nExternalFormat      );
00223 
00224     DVRLookupTablePtr   lut = DVRVOLUME_PARAMETER(volume, DVRLookupTable);
00225     DVRVolumeTexturePtr vol = DVRVOLUME_PARAMETER(volume, DVRVolumeTexture);
00226 
00227     if((volume == NULL) || (vol == NullFC)) 
00228     {
00229         SWARNING << "NO Volume..." << std::endl;
00230         return false;
00231     }
00232 
00233     // This shader requires ARB_multitexture and 
00234     // NV_register_combiner extensions
00235 
00236     if(!action->getWindow()->hasExtension(_arbMultitexture))
00237     {
00238         SWARNING << "NO multi textures ..." << std::endl;
00239 
00240         return false;
00241     }
00242 
00243     SWARNING << "Multitextures found" << std::endl;
00244 
00245     if(!action->getWindow()->hasExtension(_nvRegisterCombiners))
00246     {
00247         SWARNING << "NO register combiners" << std::endl;
00248         return false;
00249     }
00250 
00251     SWARNING << "Register Combiners found" << std::endl;
00252     
00253     m_nTextureId = volume->getTextureManager().registerTexture(
00254         vol->getImage(), // image
00255         nInternalFormat, // internalFormat
00256         nExternalFormat, // externalFormat
00257         1,               // doBricking
00258         0,               // textureStage0
00259         1);              // textureStage1
00260     
00261     if(m_nTextureId == -1) 
00262     {
00263         SWARNING << "Error registering textures ..." << std::endl;
00264         return false;
00265     }
00266     else
00267     {
00268         SWARNING << "New texture Id: " << m_nTextureId << std::endl;
00269     }
00270     
00271     if(lut != NullFC)
00272         lut->setTouched(true); // force initialization in first render pass
00273 
00274     return true;
00275 }

void DVRMtexLUTShader::activate ( DVRVolume volume,
DrawActionBase action 
) [virtual]

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 279 of file OSGDVRMtexLUTShader.cpp.

References osg::DVRSimpleLUTShader::activate(), osg::DVRVolumeBase::getDoTextures(), GL_REGISTER_COMBINERS_NV, initCombiners(), and SWARNING.

00280 {
00281     //FDEBUG(("DVRMtexLUTShader::activate\n"));
00282 
00283 #if !defined(GL_ARB_multitexture) || !defined(GL_NV_register_combiners)
00284     SWARNING << "DVRtexLUTShader requires ARB_multitexture and "
00285              << "NV_register_combiners extensions" 
00286              << std::endl;
00287 
00288     volume = volume; action = action; // calm down compiler
00289 #else
00290     DVRSimpleLUTShader::activate(volume, action);
00291 
00292     if(volume->getDoTextures())
00293     {
00294         glEnable(GL_REGISTER_COMBINERS_NV);
00295 
00296         initCombiners(action);
00297     }
00298 #endif // required extensions available
00299 }

void DVRMtexLUTShader::deactivate ( DVRVolume volume,
DrawActionBase action 
) [virtual]

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 303 of file OSGDVRMtexLUTShader.cpp.

References osg::DVRSimpleLUTShader::deactivate(), osg::DVRVolumeBase::getDoTextures(), GL_REGISTER_COMBINERS_NV, and SWARNING.

00304 {
00305     //FDEBUG(("DVRMtexLUTShader::deactivate\n"));
00306 
00307 #if !defined(GL_ARB_multitexture) || !defined(GL_NV_register_combiners)
00308     SWARNING << "DVRtexLUTShader requires ARB_multitexture and " 
00309              << "NV_register_combiners extensions"
00310              << std::endl;
00311 
00312     volume = volume; action = action; // calm down compiler
00313 #else
00314     if (volume->getDoTextures())
00315     {
00316         glDisable(GL_REGISTER_COMBINERS_NV);
00317     }
00318     
00319     DVRSimpleLUTShader::deactivate(volume, action);
00320 #endif // required extensions available
00321 }

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

! TODO - alpha correction

Reimplemented from osg::DVRShader.

Definition at line 342 of file OSGDVRMtexLUTShader.cpp.

References _arbMultitexture, _funcCombinerParameterfvNV, _funcMultiTexCoord2dARB, _nvRegisterCombiners, osg::DVRVolumeBase::getDoTextures(), osg::Window::getFunction(), osg::DrawActionBase::getWindow(), GL_CONSTANT_COLOR0_NV, GL_TEXTURE0_ARB, GL_TEXTURE1_ARB, osg::Window::hasExtension(), and SWARNING.

00347 {
00348 #if !defined(GL_ARB_multitexture) || !defined(GL_NV_register_combiners)
00349     SWARNING << "DVRtexLUTShader requires ARB_multitexture and "
00350              << "NV_register_combiners extensions" 
00351              << std::endl;
00352 
00353     volume   = volume;   action = action; data = data; // calm down compiler
00354     vertices = vertices; values = values; 
00355 #else
00356     Window *win = action->getWindow();
00357 
00358     if(!win->hasExtension(_nvRegisterCombiners) ||
00359        !win->hasExtension(_arbMultitexture))
00360     {
00361         return;
00362     }
00363 
00364     CombinerParameterfvNVFunc CombinerParameterfvNV = 
00365         (CombinerParameterfvNVFunc) win->getFunction(
00366             _funcCombinerParameterfvNV);
00367 
00368     MultiTexCoord2dARBFunc MultiTexCoord2dARB = 
00369         (MultiTexCoord2dARBFunc) win->getFunction(_funcMultiTexCoord2dARB); 
00370     
00371     //FINFO(("DVRMtexLUTShader::renderSlice - vert(%d) - values(%d)\n", 
00372     //       vertices, values));
00373     
00374     if(values < 6)
00375     {
00376         SWARNING << "DVRMtexLUTShader::renderSlice - insufficient values" 
00377                  << std::endl;
00378         return;
00379     }
00380     
00381     
00382     float col[4] = 
00383     { 
00384         0.f, 0.f, 0.f, data[5]
00385     };
00386 
00387     CombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, col);
00388 
00389     glFogfv(GL_FOG_COLOR, col);
00390 
00391     if(volume->getDoTextures())
00392     {
00393         glBegin(GL_TRIANGLE_FAN);
00394     }
00395     else
00396     {
00398         glColor4f(1.0, 1.0, 1.0, 1.0);
00399 
00400         glBegin(GL_LINE_LOOP);
00401     }
00402 
00403     
00404     for(UInt32 i = 0; i < vertices; i++)
00405     {
00406         Real32 *vert = data + i *values;
00407         
00408     // constant color is used as blending factor between tex0 and tex1
00409     // a == 0 means tex0
00410     // a == 1 means tex1 
00411     // float col[4] = {0, 0, 0, vert[5]};
00412     // CombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, col);
00413       
00414         MultiTexCoord2dARB(GL_TEXTURE0_ARB, vert[3], vert[4]);
00415         MultiTexCoord2dARB(GL_TEXTURE1_ARB, vert[3], vert[4]);
00416         
00417         glVertex3f(vert[0], vert[1], vert[2]);  
00418         
00419     }
00420     glEnd();
00421     
00422 #endif // required extensions
00423 }

void DVRMtexLUTShader::renderSlice ( DVRVolume volume,
DrawActionBase action,
DVRRenderSlice clippedSlice 
) [virtual]

Reimplemented from osg::DVRShader.

Definition at line 426 of file OSGDVRMtexLUTShader.cpp.

References _arbMultitexture, _funcCombinerParameterfvNV, _funcMultiTexCoord2dARB, _nvRegisterCombiners, osg::DVRVolumeBase::getDoTextures(), osg::Window::getFunction(), osg::DrawActionBase::getWindow(), GL_CONSTANT_COLOR0_NV, GL_TEXTURE0_ARB, GL_TEXTURE1_ARB, osg::Window::hasExtension(), osg::DVRRenderSlice::orientation, SWARNING, osg::DVRRenderSlice::XY, osg::DVRRenderSlice::XZ, and osg::DVRRenderSlice::YZ.

00429 {
00430 #if !defined(GL_ARB_multitexture) || !defined(GL_NV_register_combiners)
00431     SWARNING << "DVRtexLUTShader requires ARB_multitexture and "
00432              << "NV_register_combiners extensions" 
00433              << std::endl;
00434 
00435     volume       = volume; 
00436     action       = action; 
00437     clippedSlice = clippedSlice; // calm down compiler
00438 #else
00439 
00440     Window *win = action->getWindow();
00441 
00442     if(!win->hasExtension(_nvRegisterCombiners) ||
00443        !win->hasExtension(_arbMultitexture))
00444     {
00445         return;
00446     }
00447 
00448     CombinerParameterfvNVFunc CombinerParameterfvNV =
00449         (CombinerParameterfvNVFunc) win->getFunction(
00450             _funcCombinerParameterfvNV);
00451 
00452     MultiTexCoord2dARBFunc MultiTexCoord2dARB = 
00453         (MultiTexCoord2dARBFunc) win->getFunction(_funcMultiTexCoord2dARB); 
00454    
00455     GLfloat intFactor = 0;
00456     
00457     switch(clippedSlice->orientation)
00458     {
00459         case DVRRenderSlice::XY:
00460             intFactor = 
00461                 Real32((*(*clippedSlice->begin())->vertices.begin())[5]);
00462             break;
00463 
00464         case DVRRenderSlice::XZ:
00465             intFactor = 
00466                 Real32((*(*clippedSlice->begin())->vertices.begin())[4]);
00467             break;
00468 
00469         case DVRRenderSlice::YZ:
00470             intFactor = 
00471                 Real32((*(*clippedSlice->begin())->vertices.begin())[3]);
00472             break;
00473 
00474         default:
00475             break;
00476     }
00477 
00478     if(intFactor < 0 || intFactor > 1)
00479         std::cerr << intFactor << std::endl;
00480     
00481     float col[4] = 
00482     {
00483         0.f, 0.f, 0.f, intFactor
00484     };
00485 
00486     CombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, col);
00487 
00488     glFogfv(GL_FOG_COLOR, col);
00489 
00490     if(volume->getDoTextures())
00491     {
00492         //glBegin(GL_TRIANGLE_FAN);
00493     }
00494     else
00495     {
00497         glColor4f(1.0, 1.0, 1.0, 1.0);
00498         //glBegin(GL_LINE_LOOP);
00499     }
00500 
00501     switch(clippedSlice->orientation)
00502     {
00503         case DVRRenderSlice::XY:
00504 
00505             for(std::vector<DVRRenderSlicePrimitive *>::const_iterator prim = 
00506                     clippedSlice->begin();
00507 
00508                   prim != clippedSlice->end();
00509                 ++prim)
00510             {
00511                 glBegin((*prim)->type);
00512                 
00513                 std::vector<GLdouble *>::const_iterator vert = 
00514                     (*prim)->vertices.begin();        
00515 
00516                 for(; vert != (*prim)->vertices.end(); ++vert)
00517                 {
00518                     MultiTexCoord2dARB(GL_TEXTURE0_ARB, 
00519                                        (*vert)[3], 
00520                                        (*vert)[4]);
00521 
00522                     MultiTexCoord2dARB(GL_TEXTURE1_ARB, 
00523                                        (*vert)[3], 
00524                                        (*vert)[4]);
00525 
00526                     glVertex3dv(*vert);
00527                 }      
00528                 glEnd();
00529             }     
00530             break;
00531 
00532         case DVRRenderSlice::XZ:
00533 
00534             for(std::vector<DVRRenderSlicePrimitive *>::const_iterator prim = 
00535                     clippedSlice->begin();
00536  
00537                   prim != clippedSlice->end();
00538                 ++prim)
00539             {
00540                 glBegin((*prim)->type);
00541                 
00542                 std::vector<GLdouble *>::const_iterator vert = 
00543                     (*prim)->vertices.begin();        
00544 
00545                 for(; vert != (*prim)->vertices.end(); vert++)
00546                 {
00547                     MultiTexCoord2dARB(GL_TEXTURE0_ARB, 
00548                                        (*vert)[3], 
00549                                        (*vert)[5]);
00550                     MultiTexCoord2dARB(GL_TEXTURE1_ARB, 
00551                                        (*vert)[3], 
00552                                        (*vert)[5]);
00553 
00554                     glVertex3dv(*vert);
00555                 }      
00556                 glEnd();
00557             }     
00558             break;
00559 
00560         case DVRRenderSlice::YZ:
00561             
00562             for(std::vector<DVRRenderSlicePrimitive*>::const_iterator prim = 
00563                     clippedSlice->begin();
00564 
00565                   prim != clippedSlice->end();
00566                 ++prim)
00567             {
00568                 glBegin((*prim)->type);
00569    
00570                 std::vector<GLdouble*>::const_iterator vert = 
00571                     (*prim)->vertices.begin();        
00572 
00573                 for(; vert != (*prim)->vertices.end(); vert++)
00574                 {
00575                     MultiTexCoord2dARB(GL_TEXTURE0_ARB, 
00576                                        (*vert)[4], 
00577                                        (*vert)[5]);
00578 
00579                     MultiTexCoord2dARB(GL_TEXTURE1_ARB, 
00580                                        (*vert)[4], 
00581                                        (*vert)[5]);
00582                     glVertex3dv(*vert);
00583                 }      
00584                 glEnd();
00585             }
00586             break;
00587 
00588         default:
00589             break;
00590     }
00591 #endif // required extensions
00592 }

void DVRMtexLUTShader::cleanup ( DVRVolume volume,
DrawActionBase action 
) [virtual]

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 324 of file OSGDVRMtexLUTShader.cpp.

References osg::DVRVolume::getTextureManager(), osg::DVRSimpleShader::m_nTextureId, and osg::TextureManager::unregisterTexture().

00325 {
00326     if(volume != NULL)
00327     {
00328         if(m_nTextureId != -1)
00329             volume->getTextureManager().unregisterTexture(m_nTextureId);
00330     }
00331 }

bool DVRMtexLUTShader::hasRenderCallback ( void   )  [virtual]

Reimplemented from osg::DVRShader.

Definition at line 92 of file OSGDVRMtexLUTShader.cpp.

00093 {
00094     return true; 
00095 }

bool DVRMtexLUTShader::useMTSlabs ( void   )  [virtual]

Reimplemented from osg::DVRShader.

Definition at line 97 of file OSGDVRMtexLUTShader.cpp.

00098 {
00099     return true; 
00100 } 

void DVRMtexLUTShader::initCombiners ( DrawActionBase action  )  [private]

Definition at line 621 of file OSGDVRMtexLUTShader.cpp.

References _arbMultitexture, _funcCombinerInputNV, _funcCombinerOutputNV, _funcCombinerParameteriNV, _funcFinalCombinerInputNV, _nvRegisterCombiners, osg::Window::getFunction(), osg::DrawActionBase::getWindow(), GL_COMBINER0_NV, GL_CONSTANT_COLOR0_NV, GL_DISCARD_NV, GL_NUM_GENERAL_COMBINERS_NV, GL_SPARE0_NV, GL_TEXTURE0_ARB, GL_TEXTURE1_ARB, GL_UNSIGNED_IDENTITY_NV, GL_UNSIGNED_INVERT_NV, GL_VARIABLE_A_NV, GL_VARIABLE_B_NV, GL_VARIABLE_C_NV, GL_VARIABLE_D_NV, GL_VARIABLE_G_NV, and osg::Window::hasExtension().

Referenced by activate().

00622 {
00623     Window *win = action->getWindow();
00624 
00625     if(!win->hasExtension(_nvRegisterCombiners) ||
00626        !win->hasExtension(_arbMultitexture))
00627     {
00628         return;
00629     }
00630 
00631     CombinerParameteriNVFunc CombinerParameteriNV = 
00632         (CombinerParameteriNVFunc) win->getFunction(_funcCombinerParameteriNV);
00633 
00634     CombinerInputNVFunc CombinerInputNV           =
00635         (CombinerInputNVFunc     ) win->getFunction(_funcCombinerInputNV     );
00636 
00637     CombinerOutputNVFunc CombinerOutputNV         =
00638         (CombinerOutputNVFunc    ) win->getFunction(_funcCombinerOutputNV    );
00639 
00640     FinalCombinerInputNVFunc FinalCombinerInputNV =
00641         (FinalCombinerInputNVFunc) win->getFunction(_funcFinalCombinerInputNV);
00642     
00643     // use only first general combiner
00644     CombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, 1);
00645 
00646     // RGB-Portion
00647     // --------------------------------------------
00648     // Alpha value of const color is used as
00649     // blending factor for the two textures 0 and 1
00650     
00651     CombinerInputNV(             // (1 - ConstColor0) -> A
00652         GL_COMBINER0_NV,         // stage
00653         GL_RGB,                  // portion
00654         GL_VARIABLE_A_NV,        // variable
00655         GL_CONSTANT_COLOR0_NV,   // input  <- const color 0
00656         GL_UNSIGNED_INVERT_NV,   // mapping (1-x)
00657         GL_ALPHA);               // componentUsage
00658     
00659     CombinerInputNV(             // Texture0     -> B
00660         GL_COMBINER0_NV,         // stage         
00661         GL_RGB,                  // portion       
00662         GL_VARIABLE_B_NV,        // variable      
00663         GL_TEXTURE0_ARB,         // input <- texture 0         
00664         GL_UNSIGNED_IDENTITY_NV, // mapping 
00665         GL_RGB);                 // componentUsage
00666     
00667     CombinerInputNV(             // ConstColor0    -> C
00668         GL_COMBINER0_NV,         // stage         
00669         GL_RGB,                  // portion       
00670         GL_VARIABLE_C_NV,        // variable      
00671         GL_CONSTANT_COLOR0_NV,   // input    <- const color 0     
00672         GL_UNSIGNED_IDENTITY_NV, // mapping 
00673         GL_ALPHA);               // componentUsage
00674     
00675     CombinerInputNV(             // Texture1      -> D
00676         GL_COMBINER0_NV,         // stage         
00677         GL_RGB,                  // portion       
00678         GL_VARIABLE_D_NV,        // variable      
00679         GL_TEXTURE1_ARB,         // input         
00680         GL_UNSIGNED_IDENTITY_NV, // mapping 
00681         GL_RGB);                 // componentUsage
00682     
00683     // Alpha-Portion
00684     // --------------------------------------------
00685     // Alpha value of const color is used as
00686     // blending factor for the two textures 0 and 1
00687 
00688     CombinerInputNV(             // (1 - ConstColor0) -> A/
00689         GL_COMBINER0_NV,         // stage         
00690         GL_ALPHA,                // portion       
00691         GL_VARIABLE_A_NV,        // variable 
00692         GL_CONSTANT_COLOR0_NV,   // input <- const color 0     
00693         GL_UNSIGNED_INVERT_NV,   // mapping (1-x) 
00694         GL_ALPHA);               // componentUsage
00695     
00696     CombinerInputNV(             //  Texture0 -> A
00697         GL_COMBINER0_NV,         // stage         
00698         GL_ALPHA,                // portion       
00699         GL_VARIABLE_B_NV,        // variable      
00700         GL_TEXTURE0_ARB,         // input         
00701         GL_UNSIGNED_IDENTITY_NV, // mapping 
00702         GL_ALPHA);               // componentUsage
00703     
00704     CombinerInputNV(             // ConstColor0 -> C
00705         GL_COMBINER0_NV,         // stage         
00706         GL_ALPHA,                // portion       
00707         GL_VARIABLE_C_NV,        // variable      
00708         GL_CONSTANT_COLOR0_NV,   // input         
00709         GL_UNSIGNED_IDENTITY_NV, // mapping 
00710         GL_ALPHA);               // componentUsage
00711     
00712     CombinerInputNV(             // Texture1 -> D
00713         GL_COMBINER0_NV,         // stage         
00714         GL_ALPHA,                // portion       
00715         GL_VARIABLE_D_NV,        // variable      
00716         GL_TEXTURE1_ARB,         // input         
00717         GL_UNSIGNED_IDENTITY_NV, // mapping
00718         GL_ALPHA);               // componentUsage
00719     
00720     // general combiner output
00721     //------------------------------------- 
00722  
00723     CombinerOutputNV(    // Spare0(RGB) = AB+CD
00724         GL_COMBINER0_NV, // stage
00725         GL_RGB,          // portion
00726         GL_DISCARD_NV,   // abOutput  (not used)
00727         GL_DISCARD_NV,   // cdOutput  (not used)
00728         GL_SPARE0_NV,    // sumOutput (this is AB+CD) 
00729         GL_NONE,         // scale     (not used)
00730         GL_NONE,         // bias      (not used)
00731         GL_FALSE,        // abDotProduct
00732         GL_FALSE,        // cdDotproduct
00733         GL_FALSE);       // muxSum                      
00734     
00735     CombinerOutputNV(    // Spare0(A) = AB+CD
00736         GL_COMBINER0_NV, // stage                       
00737         GL_ALPHA,        // portion                     
00738         GL_DISCARD_NV,   // abOutput  (not used)        
00739         GL_DISCARD_NV,   // cdOutput  (not used)        
00740         GL_SPARE0_NV,    // sumOutput (this is AB+CD)   
00741         GL_NONE,         // scale     (not used)        
00742         GL_NONE,         // bias      (not used)        
00743         GL_FALSE,        // abDotProduct                
00744         GL_FALSE,        // cdDotproduct                
00745         GL_FALSE);       // muxSum                      
00746     
00747     // final combiner input
00748     //------------------------------------- 
00749     
00750     FinalCombinerInputNV(        // A(RGB) = 0
00751         GL_VARIABLE_A_NV,        // variable
00752         GL_ZERO,                 // input
00753         GL_UNSIGNED_IDENTITY_NV, // mapping 
00754         GL_RGB);                 // componentUsage
00755     
00756     FinalCombinerInputNV(        // B(RGB) = 0
00757         GL_VARIABLE_B_NV,        // variable         
00758         GL_ZERO,                 // input         
00759         GL_UNSIGNED_IDENTITY_NV, // mapping        
00760         GL_RGB);                 // componentUsage
00761     
00762     FinalCombinerInputNV(        // C(RGB) = 0
00763         GL_VARIABLE_C_NV,        // variable      
00764         GL_ZERO,                 // input         
00765         GL_UNSIGNED_IDENTITY_NV, // mapping        
00766         GL_RGB);                 // componentUsage
00767     
00768     FinalCombinerInputNV(        // D = Spare0(RGB)
00769         GL_VARIABLE_D_NV,        // variable      
00770         GL_SPARE0_NV,            // input         
00771         GL_UNSIGNED_IDENTITY_NV, // mapping        
00772         GL_RGB);                 // componentUsage
00773     
00774     FinalCombinerInputNV(        // G = Spare0(A)
00775         GL_VARIABLE_G_NV,        // variable      
00776         GL_SPARE0_NV,            // input         
00777         GL_UNSIGNED_IDENTITY_NV, // mapping        
00778         GL_ALPHA);               // componentUsage
00779 }

void DVRMtexLUTShader::initMethod ( void   )  [static, private]

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 154 of file OSGDVRMtexLUTShader.cpp.

00155 {
00156 }

void osg::DVRMtexLUTShader::operator= ( const DVRMtexLUTShader source  )  [private]

osg::FieldContainerType & osg::DVRMtexLUTShaderBase::getClassType ( void   )  [inline, static, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 58 of file OSGDVRMtexLUTShaderBase.inl.

References osg::DVRMtexLUTShaderBase::_type.

Referenced by osg::DVRMtexLUTShaderBase::create().

00059 {
00060     return _type; 
00061 } 

osg::UInt32 osg::DVRMtexLUTShaderBase::getClassTypeId ( void   )  [inline, static, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 65 of file OSGDVRMtexLUTShaderBase.inl.

References osg::DVRMtexLUTShaderBase::_type, and osg::TypeBase::getId().

00066 {
00067     return _type.getId(); 
00068 } 

FieldContainerType & DVRMtexLUTShaderBase::getType ( void   )  [virtual, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 86 of file OSGDVRMtexLUTShaderBase.cpp.

References osg::DVRMtexLUTShaderBase::_type.

00087 {
00088     return _type; 
00089 } 

const FieldContainerType & DVRMtexLUTShaderBase::getType ( void   )  const [virtual, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 91 of file OSGDVRMtexLUTShaderBase.cpp.

References osg::DVRMtexLUTShaderBase::_type.

00092 {
00093     return _type;
00094 } 

UInt32 DVRMtexLUTShaderBase::getContainerSize ( void   )  const [virtual, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 106 of file OSGDVRMtexLUTShaderBase.cpp.

00107 { 
00108     return sizeof(DVRMtexLUTShader); 
00109 }

UInt32 DVRMtexLUTShaderBase::getBinSize ( const BitVector whichField  )  [virtual, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 166 of file OSGDVRMtexLUTShaderBase.cpp.

References osg::DVRSimpleLUTShaderBase::getBinSize().

00167 {
00168     UInt32 returnValue = Inherited::getBinSize(whichField);
00169 
00170 
00171     return returnValue;
00172 }

void DVRMtexLUTShaderBase::copyToBin ( BinaryDataHandler pMem,
const BitVector whichField 
) [virtual, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 174 of file OSGDVRMtexLUTShaderBase.cpp.

References osg::DVRSimpleLUTShaderBase::copyToBin().

00176 {
00177     Inherited::copyToBin(pMem, whichField);
00178 
00179 
00180 }

void DVRMtexLUTShaderBase::copyFromBin ( BinaryDataHandler pMem,
const BitVector whichField 
) [virtual, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 182 of file OSGDVRMtexLUTShaderBase.cpp.

References osg::DVRSimpleLUTShaderBase::copyFromBin().

00184 {
00185     Inherited::copyFromBin(pMem, whichField);
00186 
00187 
00188 }

DVRMtexLUTShaderPtr osg::DVRMtexLUTShaderBase::create ( void   )  [inline, static, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 72 of file OSGDVRMtexLUTShaderBase.inl.

References osg::DVRMtexLUTShaderBase::getClassType(), osg::NullFC, and osg::DVRMtexLUTShaderBase::shallowCopy().

00073 {
00074     DVRMtexLUTShaderPtr fc; 
00075 
00076     if(getClassType().getPrototype() != OSG::NullFC) 
00077     {
00078         fc = DVRMtexLUTShaderPtr::dcast(
00079             getClassType().getPrototype()-> shallowCopy()); 
00080     }
00081     
00082     return fc; 
00083 }

DVRMtexLUTShaderPtr osg::DVRMtexLUTShaderBase::createEmpty ( void   )  [inline, static, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 87 of file OSGDVRMtexLUTShaderBase.inl.

References osg::FieldContainer::newPtr().

00088 { 
00089     DVRMtexLUTShaderPtr returnValue; 
00090     
00091     newPtr(returnValue); 
00092 
00093     return returnValue; 
00094 }

FieldContainerPtr DVRMtexLUTShaderBase::shallowCopy ( void   )  const [virtual, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 97 of file OSGDVRMtexLUTShaderBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by osg::DVRMtexLUTShaderBase::create().

00098 { 
00099     DVRMtexLUTShaderPtr returnValue; 
00100 
00101     newPtr(returnValue, dynamic_cast<const DVRMtexLUTShader *>(this)); 
00102 
00103     return returnValue; 
00104 }

void DVRMtexLUTShaderBase::executeSyncImpl ( DVRMtexLUTShaderBase pOther,
const BitVector whichField 
) [protected, inherited]

Definition at line 191 of file OSGDVRMtexLUTShaderBase.cpp.

References osg::DVRSimpleLUTShaderBase::executeSyncImpl().

Referenced by osg::DVRMtexLUTShaderBase::executeSync().

00193 {
00194 
00195     Inherited::executeSyncImpl(pOther, whichField);
00196 
00197 
00198 }

void DVRSimpleLUTShaderBase::executeSyncImpl ( DVRSimpleLUTShaderBase pOther,
const BitVector whichField 
) [protected, inherited]

void DVRSimpleShaderBase::executeSyncImpl ( DVRSimpleShaderBase pOther,
const BitVector whichField 
) [protected, inherited]

Definition at line 191 of file OSGDVRSimpleShaderBase.cpp.

References osg::DVRShaderBase::executeSyncImpl().

Referenced by osg::DVRSimpleShaderBase::executeSync(), and osg::DVRSimpleLUTShaderBase::executeSyncImpl().

00193 {
00194 
00195     Inherited::executeSyncImpl(pOther, whichField);
00196 
00197 
00198 }

void DVRShaderBase::executeSyncImpl ( DVRShaderBase pOther,
const BitVector whichField 
) [protected, inherited]

void osg::FieldContainer::executeSyncImpl ( FieldContainer pOther,
const BitVector whichField 
) [inline, protected, inherited]

void DVRMtexLUTShaderBase::executeSync ( FieldContainer other,
const BitVector whichField 
) [protected, virtual, inherited]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 113 of file OSGDVRMtexLUTShaderBase.cpp.

References osg::DVRMtexLUTShaderBase::executeSyncImpl().

00115 {
00116     this->executeSyncImpl((DVRMtexLUTShaderBase *) &other, whichField);
00117 }

void DVRSimpleLUTShader::brickActivate ( DVRVolume volume,
DrawActionBase action,
Brick brick 
) [virtual, inherited]

! FIXME: This is a workaround for the current snapshot since ! it overwrites the texture shader settings on texture activation

Reimplemented from osg::DVRSimpleShader.

Definition at line 1095 of file OSGDVRSimpleLUTShader.cpp.

References osg::DVRSimpleShader::brickActivate(), osg::DVRVolume::getTextureMode(), osg::DrawActionBase::getWindow(), GL_SHADER_OPERATION_NV, GL_TEXTURE_3D, GL_TEXTURE_SHADER_NV, osg::DVRSimpleLUTShader::LM_DEPENDENT, osg::DVRSimpleLUTShader::m_nTexturePaletteMode, osg::TextureManager::TM_2D, and osg::TextureManager::TM_3D.

01098 {
01099     //FDEBUG(("DVRSimpleLUTShader::brickActivate %d\n", (int) this));
01100 
01101     DVRSimpleShader::brickActivate(volume, action, brick);
01102 
01105 
01106     if(m_nTexturePaletteMode == LM_DEPENDENT) 
01107     {
01108         switch(volume->getTextureMode(action->getWindow())) 
01109         {
01110             case TextureManager::TM_3D:
01111                 glTexEnvi(GL_TEXTURE_SHADER_NV, 
01112                           GL_SHADER_OPERATION_NV, 
01113                           GL_TEXTURE_3D);
01114                 break;
01115 
01116             case TextureManager::TM_2D:
01117                 glTexEnvi(GL_TEXTURE_SHADER_NV, 
01118                           GL_SHADER_OPERATION_NV, 
01119                           GL_TEXTURE_2D);
01120                 break;
01121 
01122             default:
01123                 // FFATAL(("Texture mode for dependent texture not "
01124                 //         "supported by DVRSimpleLUTShader"));
01125                 break;
01126         }
01127     }
01128 }

void DVRSimpleLUTShader::getPaletteFormat ( DrawActionBase action,
UInt8  lutMode,
GLenum &  internalFormat,
GLenum &  externalFormat 
) [protected, inherited]

Definition at line 195 of file OSGDVRSimpleLUTShader.cpp.

References GL_COLOR_INDEX8_EXT, osg::DVRSimpleLUTShader::LM_DEPENDENT, osg::DVRSimpleLUTShader::LM_FRAGPROG, osg::DVRSimpleLUTShader::LM_NO, osg::DVRSimpleLUTShader::LM_PALETTE_EXT, osg::DVRSimpleLUTShader::LM_RELOAD, and osg::DVRSimpleLUTShader::LM_TABLE_SGI.

Referenced by osg::DVRSimpleLUTShader::initialize(), and initialize().

00199 {
00200     switch(mode)
00201     {
00202         case LM_TABLE_SGI:
00203             internalFormat = GL_INTENSITY; 
00204             externalFormat = GL_LUMINANCE; 
00205             break;
00206 
00207 #if defined GL_EXT_paletted_texture && defined GL_EXT_shared_texture_palette
00208         case LM_PALETTE_EXT:
00209             internalFormat = GL_COLOR_INDEX8_EXT; 
00210             externalFormat = GL_COLOR_INDEX; 
00211             break;
00212 #endif
00213     
00214         case LM_DEPENDENT:
00215             internalFormat = GL_INTENSITY;
00216             externalFormat = GL_LUMINANCE;
00217             break;
00218 
00219         case LM_FRAGPROG:
00220             internalFormat = GL_INTENSITY;
00221             externalFormat = GL_LUMINANCE;
00222             break;
00223     
00224         case LM_RELOAD:
00225             internalFormat = GL_RGBA;  
00226             externalFormat = GL_COLOR_INDEX; 
00227             break;
00228 
00229         case LM_NO:
00230         default:
00231             internalFormat = GL_INTENSITY; 
00232             externalFormat = GL_LUMINANCE;
00233     }
00234 }

bool DVRSimpleLUTShader::isModeSupported ( DrawActionBase action,
UInt8  mode,
Int8  textureMode 
) [protected, inherited]

Definition at line 279 of file OSGDVRSimpleLUTShader.cpp.

References osg::DVRSimpleLUTShader::_arbFragmentProgram, osg::DVRSimpleLUTShader::_arbMultitexture, osg::DVRSimpleLUTShader::_extPalettedTexture, osg::DVRSimpleLUTShader::_extSharedPalettedTexture, osg::DVRSimpleLUTShader::_nvRegisterCombiners, osg::DVRSimpleLUTShader::_nvTextureShader2, osg::DVRSimpleLUTShader::_sgiTexColorTable, osg::DrawActionBase::getWindow(), osg::Window::hasExtension(), osg::DVRSimpleLUTShader::LM_DEPENDENT, osg::DVRSimpleLUTShader::LM_FRAGPROG, osg::DVRSimpleLUTShader::LM_NO, osg::DVRSimpleLUTShader::LM_PALETTE_EXT, osg::DVRSimpleLUTShader::LM_RELOAD, osg::DVRSimpleLUTShader::LM_TABLE_SGI, and osg::TextureManager::TM_2D_Multi.

Referenced by osg::DVRSimpleLUTShader::initialize(), initialize(), and osg::DVRSimpleLUTShader::selectMode().

00282 {
00283     bool result = false;
00284   
00285     switch(mode) 
00286     {
00287         case LM_TABLE_SGI:
00288             result = 
00289                 (action->getWindow()->hasExtension(_sgiTexColorTable) &&
00290                  (0 != strncmp("IMPACT", 
00291                                (char *) glGetString(GL_RENDERER), 
00292                                6)));
00293     break;
00294 
00295       case LM_PALETTE_EXT:
00296           result = 
00297               (action->getWindow()->hasExtension(_extPalettedTexture      ) &&
00298                action->getWindow()->hasExtension(_extSharedPalettedTexture));
00299     break;
00300     
00301         case LM_DEPENDENT:
00302             result = 
00303                 (action->getWindow()->hasExtension(_arbMultitexture    ) &&
00304                  action->getWindow()->hasExtension(_nvTextureShader2   ) &&
00305                  action->getWindow()->hasExtension(_nvRegisterCombiners) &&
00306                  textureMode != TextureManager::TM_2D_Multi               );
00307     break;
00308 
00309         case LM_FRAGPROG:
00310             result = (action->getWindow()->hasExtension(_arbMultitexture   ) &&
00311                       action->getWindow()->hasExtension(_arbFragmentProgram) &&
00312                       textureMode != TextureManager::TM_2D_Multi             );
00313             break;
00314             
00315         case LM_RELOAD:
00316             result = true;
00317             break;
00318 
00319         case LM_NO:
00320             result = true;
00321             break;
00322             
00323         default: 
00324             result = false;
00325     }
00326     
00327     return result;
00328 }

UInt8 DVRSimpleLUTShader::selectMode ( DrawActionBase action,
Int8  textureMode 
) [protected, inherited]

Definition at line 238 of file OSGDVRSimpleLUTShader.cpp.

References FDEBUG, FFATAL, osg::DVRSimpleLUTShader::isModeSupported(), osg::DVRSimpleLUTShader::LM_DEPENDENT, osg::DVRSimpleLUTShader::LM_FRAGPROG, osg::DVRSimpleLUTShader::LM_PALETTE_EXT, osg::DVRSimpleLUTShader::LM_RELOAD, and osg::DVRSimpleLUTShader::LM_TABLE_SGI.

Referenced by osg::DVRSimpleLUTShader::initialize(), and initialize().

00239 {
00240     if(isModeSupported( action, LM_TABLE_SGI, textureMode ))
00241     {
00242         FDEBUG(("Using SGI postshading palette....\n"));
00243         FFATAL(("Using SGI postshading palette....\n"));
00244 
00245         return LM_TABLE_SGI;
00246     }
00247 
00248     if(isModeSupported( action, LM_DEPENDENT, textureMode ))
00249     { 
00250         FDEBUG(("Using dependent texture postshading palette....\n"));
00251         FFATAL(("Using dependent texture postshading palette....\n"));
00252 
00253         return LM_DEPENDENT;
00254     }
00255 
00256     if(isModeSupported( action, LM_FRAGPROG, textureMode ))
00257     {
00258         FDEBUG(("Using fragment program postshading palette....\n"));
00259         FFATAL(("Using fragment program postshading palette....\n"));
00260 
00261         return LM_FRAGPROG;
00262     }
00263 
00264     if(isModeSupported( action, LM_PALETTE_EXT, textureMode ))
00265     {
00266         FDEBUG(("Using preshading palette....\n"));
00267         FFATAL(("Using preshading palette....\n"));
00268 
00269         return LM_PALETTE_EXT;
00270     }
00271 
00272     FDEBUG(("Using palette reload ....\n"));
00273     FFATAL(("Using palette reload ....\n"));
00274 
00275     return LM_RELOAD;
00276 }

void DVRSimpleLUTShader::enablePalette ( void   )  [protected, inherited]

Definition at line 331 of file OSGDVRSimpleLUTShader.cpp.

00332 {
00333 }

void DVRSimpleLUTShader::disablePalette ( void   )  [protected, inherited]

Definition at line 336 of file OSGDVRSimpleLUTShader.cpp.

00337 {
00338 }

void DVRSimpleLUTShader::initDependentTexture ( Int32  size  )  [protected, inherited]

Definition at line 341 of file OSGDVRSimpleLUTShader.cpp.

References osg::addRefCP(), osg::beginEditCP(), osg::TextureChunkBase::create(), osg::ImageBase::create(), osg::endEditCP(), FDEBUG, GL_CLAMP_TO_EDGE, osg::DVRSimpleLUTShader::m_pDepTexture, and osg::Image::OSG_RGBA_PF.

Referenced by osg::DVRSimpleLUTShader::activate().

00342 {
00343     FDEBUG(("Initializing dependent texture"));
00344     
00345     ImagePtr img = Image::create();
00346     
00347     // we create a dummy 2D texture here since there is only a dependent
00348     // 2D texture lookup with texture shaders
00349 
00350     beginEditCP(img);
00351     {
00352         img->set  (Image::OSG_RGBA_PF, size, 2);
00353         img->clear(128);
00354     }
00355     endEditCP(img);
00356 
00357     m_pDepTexture = TextureChunk::create();
00358 
00359     addRefCP(m_pDepTexture);
00360             
00361     TextureChunkPtr &chunk = m_pDepTexture;
00362 
00363     beginEditCP(chunk);
00364     {
00365         chunk->setImage         (img             );
00366         chunk->setInternalFormat(GL_RGBA         );
00367         chunk->setExternalFormat(GL_RGBA         );
00368             
00369         chunk->setWrapS         (GL_CLAMP_TO_EDGE);
00370         chunk->setWrapT         (GL_CLAMP_TO_EDGE);
00371         chunk->setWrapR         (GL_CLAMP_TO_EDGE);
00372         
00373         chunk->setMinFilter     (GL_LINEAR       );
00374         chunk->setMagFilter     (GL_LINEAR       );
00375         
00376         chunk->setEnvMode       (GL_REPLACE      );
00377     }
00378     endEditCP  (chunk);
00379 
00380     FDEBUG((" - DONE\n"));
00381 }

void DVRSimpleLUTShader::updateDependentTexture ( Int32  size,
const UInt8 data 
) [protected, inherited]

Definition at line 384 of file OSGDVRSimpleLUTShader.cpp.

References osg::beginEditCP(), osg::endEditCP(), FDEBUG, and osg::DVRSimpleLUTShader::m_pDepTexture.

Referenced by osg::DVRSimpleLUTShader::activate().

00385 {
00386     FDEBUG(("Updating dependent texture\n"));
00387 
00388     ImagePtr img = m_pDepTexture->getImage();
00389 
00390     beginEditCP(img);
00391     {
00392         img->setSubData(0, 0, 0, size, 1, 1, data);
00393         img->setSubData(0, 1, 0, size, 1, 1, data);
00394     }
00395     endEditCP  (img);
00396         
00397     m_pDepTexture->imageContentChanged(); // makes begin/end edit unneccessary
00398 
00399     FDEBUG((" - DONE\n"));
00400 }

void DVRSimpleLUTShader::destroyDependentTexture ( void   )  [protected, inherited]

void DVRSimpleLUTShader::setupAlphaCorrectionRegisterCombiners ( DrawActionBase action  )  [protected, inherited]

! First general combiner: multiply result of texture stage 1 ! by primary color

! Final combiner: route color and opacity of first general combinter ! to output (spare0)

Definition at line 436 of file OSGDVRSimpleLUTShader.cpp.

References osg::DVRSimpleLUTShader::_funcCombinerInputNV, osg::DVRSimpleLUTShader::_funcCombinerOutputNV, osg::DVRSimpleLUTShader::_funcFinalCombinerInputNV, osg::DVRSimpleLUTShader::_nvRegisterCombiners, osg::Window::getFunction(), osg::DrawActionBase::getWindow(), GL_COMBINER0_NV, GL_DISCARD_NV, GL_PRIMARY_COLOR_NV, GL_SPARE0_NV, GL_TEXTURE1_ARB, GL_UNSIGNED_IDENTITY_NV, GL_VARIABLE_A_NV, GL_VARIABLE_B_NV, GL_VARIABLE_C_NV, GL_VARIABLE_D_NV, GL_VARIABLE_E_NV, GL_VARIABLE_F_NV, GL_VARIABLE_G_NV, and osg::Window::hasExtension().

00438 {
00439     Window *win = action->getWindow();
00440     
00441     if(!win->hasExtension(_nvRegisterCombiners))
00442         return;
00443 
00444     FinalCombinerInputNVFunc FinalCombinerInputNV = NULL;
00445     CombinerInputNVFunc      CombinerInputNV      = NULL;
00446     CombinerOutputNVFunc     CombinerOutputNV     = NULL;
00447     
00448     FinalCombinerInputNV =
00449         (FinalCombinerInputNVFunc) win->getFunction(
00450             _funcFinalCombinerInputNV);
00451 
00452     CombinerInputNV = 
00453         (CombinerInputNVFunc) win->getFunction(_funcCombinerInputNV);
00454     
00455     CombinerOutputNV = 
00456         (CombinerOutputNVFunc) win->getFunction(_funcCombinerOutputNV);
00457     
00458 #if defined GL_NV_register_combiners
00461     // ----------------------------------------------------------------------
00462     
00463     // Input: RGB-portion
00464     CombinerInputNV(GL_COMBINER0_NV, 
00465                     GL_RGB, 
00466                     GL_VARIABLE_A_NV, 
00467                     GL_TEXTURE1_ARB,     
00468                     GL_UNSIGNED_IDENTITY_NV, 
00469                     GL_RGB);
00470 
00471     CombinerInputNV(GL_COMBINER0_NV, 
00472                     GL_RGB, 
00473                     GL_VARIABLE_B_NV, 
00474                     GL_PRIMARY_COLOR_NV, 
00475                     GL_UNSIGNED_IDENTITY_NV, 
00476                     GL_RGB);
00477 
00478     CombinerInputNV(GL_COMBINER0_NV, 
00479                     GL_RGB, 
00480                     GL_VARIABLE_C_NV,
00481                     GL_ZERO, 
00482                     GL_UNSIGNED_IDENTITY_NV,
00483                     GL_RGB);
00484 
00485     CombinerInputNV(GL_COMBINER0_NV, 
00486                     GL_RGB, 
00487                     GL_VARIABLE_D_NV, 
00488                     GL_ZERO,             
00489                     GL_UNSIGNED_IDENTITY_NV, 
00490                     GL_RGB);
00491 
00492     // Input: Alpha Portion
00493     CombinerInputNV(GL_COMBINER0_NV, 
00494                     GL_ALPHA, 
00495                     GL_VARIABLE_A_NV, 
00496                     GL_TEXTURE1_ARB,     
00497                     GL_UNSIGNED_IDENTITY_NV, 
00498                     GL_ALPHA);
00499 
00500     CombinerInputNV(GL_COMBINER0_NV, 
00501                     GL_ALPHA, 
00502                     GL_VARIABLE_B_NV, 
00503                     GL_PRIMARY_COLOR_NV, 
00504                     GL_UNSIGNED_IDENTITY_NV, 
00505                     GL_ALPHA);
00506 
00507     CombinerInputNV(GL_COMBINER0_NV, 
00508                     GL_ALPHA, 
00509                     GL_VARIABLE_C_NV, 
00510                     GL_ZERO,             
00511                     GL_UNSIGNED_IDENTITY_NV, 
00512                     GL_ALPHA);
00513 
00514     CombinerInputNV(GL_COMBINER0_NV, 
00515                     GL_ALPHA, 
00516                     GL_VARIABLE_D_NV, 
00517                     GL_ZERO,             
00518                     GL_UNSIGNED_IDENTITY_NV, 
00519                     GL_ALPHA);
00520 
00521     // Output
00522     CombinerOutputNV(GL_COMBINER0_NV, // stage
00523                      GL_RGB,          // portion
00524                      GL_SPARE0_NV,    // abOutput
00525                      GL_DISCARD_NV,   // cdOutput
00526                      GL_DISCARD_NV,   // sumOutput
00527                      GL_NONE,         // scale
00528                      GL_NONE,         // bias
00529                      GL_FALSE,        // abDotProduct
00530                      GL_FALSE,        // cdDotproduct
00531                      GL_FALSE);       // muxSum
00532 
00533     CombinerOutputNV(GL_COMBINER0_NV, 
00534                      GL_ALPHA, 
00535                      GL_SPARE0_NV,    // abOutput
00536                      GL_DISCARD_NV,   // cdOutput
00537                      GL_DISCARD_NV,   // sumOutput
00538                      GL_NONE, 
00539                      GL_NONE, 
00540                      GL_FALSE, 
00541                      GL_FALSE, 
00542                      GL_FALSE); 
00543     
00546     // -----------------------------------------------------------------------
00547     
00548     // RGB portion
00549     FinalCombinerInputNV(GL_VARIABLE_A_NV, 
00550                          GL_ZERO,      
00551                          GL_UNSIGNED_IDENTITY_NV, 
00552                          GL_RGB);
00553 
00554     FinalCombinerInputNV(GL_VARIABLE_B_NV, 
00555                          GL_ZERO,      
00556                          GL_UNSIGNED_IDENTITY_NV, 
00557                          GL_RGB);
00558 
00559     FinalCombinerInputNV(GL_VARIABLE_C_NV, 
00560                          GL_ZERO,      
00561                          GL_UNSIGNED_IDENTITY_NV, 
00562                          GL_RGB);   
00563 
00564     FinalCombinerInputNV(GL_VARIABLE_E_NV, 
00565                          GL_ZERO,      
00566                          GL_UNSIGNED_IDENTITY_NV, 
00567                          GL_RGB);
00568 
00569     FinalCombinerInputNV(GL_VARIABLE_F_NV, 
00570                          GL_ZERO,      
00571                          GL_UNSIGNED_IDENTITY_NV, 
00572                          GL_RGB);
00573 
00574     FinalCombinerInputNV(GL_VARIABLE_D_NV, 
00575                          GL_SPARE0_NV, 
00576                          GL_UNSIGNED_IDENTITY_NV, 
00577                          GL_RGB);
00578 
00579     // Alpha component
00580     FinalCombinerInputNV(GL_VARIABLE_G_NV, 
00581                          GL_SPARE0_NV, 
00582                          GL_UNSIGNED_IDENTITY_NV, 
00583                          GL_ALPHA);
00584 #endif
00585 }

SFInt8 * osg::DVRSimpleLUTShaderBase::getSFLutMode ( void   )  [inline, protected, inherited]

Definition at line 101 of file OSGDVRSimpleLUTShaderBase.inl.

References osg::DVRSimpleLUTShaderBase::_sfLutMode.

00102 {
00103     return &_sfLutMode;
00104 }

SFInt8 * osg::DVRSimpleLUTShaderBase::getSFActiveLutMode ( void   )  [inline, protected, inherited]

Definition at line 108 of file OSGDVRSimpleLUTShaderBase.inl.

References osg::DVRSimpleLUTShaderBase::_sfActiveLutMode.

00109 {
00110     return &_sfActiveLutMode;
00111 }

Int8 & osg::DVRSimpleLUTShaderBase::getLutMode ( void   )  [inline, protected, inherited]

const Int8 & osg::DVRSimpleLUTShaderBase::getLutMode ( void   )  const [inline, protected, inherited]

Definition at line 123 of file OSGDVRSimpleLUTShaderBase.inl.

References osg::DVRSimpleLUTShaderBase::_sfLutMode, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00124 {
00125     return _sfLutMode.getValue();
00126 }

Int8 & osg::DVRSimpleLUTShaderBase::getActiveLutMode ( void   )  [inline, protected, inherited]

const Int8 & osg::DVRSimpleLUTShaderBase::getActiveLutMode ( void   )  const [inline, protected, inherited]

void osg::DVRSimpleLUTShaderBase::setLutMode ( const Int8 value  )  [inline, protected, inherited]

void osg::DVRSimpleLUTShaderBase::setActiveLutMode ( const Int8 value  )  [inline, protected, inherited]

UInt16 osg::FieldContainer::getClassGroupId ( void   )  [inline, static, inherited]

Definition at line 71 of file OSGFieldContainerImpl.inl.

References osg::FieldContainer::_type, and osg::FieldContainerType::getGroupId().

00072 {
00073     return _type.getGroupId();
00074 }

UInt32 osg::FieldContainer::getTypeId ( void   )  const [inline, inherited]

Definition at line 77 of file OSGFieldContainerImpl.inl.

References osg::TypeBase::getId(), and osg::FieldContainer::getType().

Referenced by osg::TextureChunk::changeFrom(), and osg::CubeTextureChunk::changeFrom().

00078 {
00079     return getType().getId();
00080 }

UInt16 osg::FieldContainer::getGroupId ( void   )  const [inline, inherited]

const Char8 * osg::FieldContainer::getTypeName ( void   )  const [inline, inherited]

Definition at line 89 of file OSGFieldContainerImpl.inl.

References osg::TypeBase::getCName(), and osg::FieldContainer::getType().

00090 {
00091     return getType().getCName();
00092 }

Field * osg::FieldContainer::getField ( UInt32  fieldId  )  [inline, inherited]

Generic Field Access

Definition at line 95 of file OSGFieldContainerImpl.inl.

References osg::FieldDescription::getField(), osg::FieldContainerType::getFieldDescription(), and osg::FieldContainer::getType().

Referenced by osg::QFCItem::expand(), osg::VRMLShapeDesc::getFieldAndDesc(), osg::QFieldViewBase::getFieldPtr(), osg::QFieldEditorBase::getFieldPtr(), osg::getParentsField(), and osg::QFCItem::setup().

00096 {
00097     const FieldDescription *desc = getType().getFieldDescription(fieldId);
00098 
00099     return desc ? desc->getField(*this) : NULL;
00100 }

Field * osg::FieldContainer::getField ( const Char8 fieldName  )  [inline, inherited]

Generic Field Access

Definition at line 103 of file OSGFieldContainerImpl.inl.

References osg::FieldContainerType::findFieldDescription(), osg::FieldDescription::getField(), and osg::FieldContainer::getType().

00104 {
00105     const FieldDescription *desc =getType().findFieldDescription(fieldName);
00106 
00107     return desc ? desc->getField(*this) : NULL;
00108 }

template<class ObjectPtrT>
void osg::FieldContainer::newPtr ( ObjectPtrT &  result,
const typename ObjectPtrT::StoredObjectType *  prototypeP 
) [inline, static, protected, inherited]

Definition at line 138 of file OSGFieldContainerImpl.inl.

References osg::ChangeList::addCreated(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), osg::ThreadManager::getNumAspects(), osg::FieldContainerFactory::registerFieldContainer(), and osg::FieldContainerFactory::the().

Referenced by osg::XWindowBase::createEmpty(), osg::WIN32WindowBase::createEmpty(), osg::ViewportBase::createEmpty(), osg::VertexProgramChunkBase::createEmpty(), osg::TwoSidedLightingChunkBase::createEmpty(), osg::TransformChunkBase::createEmpty(), osg::TransformBase::createEmpty(), osg::TileCameraDecoratorBase::createEmpty(), osg::TextureTransformChunkBase::createEmpty(), osg::TextureGrabForegroundBase::createEmpty(), osg::TextureGrabBackgroundBase::createEmpty(), osg::TextureChunkBase::createEmpty(), osg::TextureBackgroundBase::createEmpty(), osg::TexGenChunkBase::createEmpty(), osg::SwitchMaterialBase::createEmpty(), osg::SwitchBase::createEmpty(), osg::SurfaceBase::createEmpty(), osg::StringAttributeMapBase::createEmpty(), osg::StereoBufferViewportBase::createEmpty(), osg::StencilChunkBase::createEmpty(), osg::StateSortingGroupBase::createEmpty(), osg::StateBase::createEmpty(), osg::SpotLightBase::createEmpty(), osg::SortFirstWindowBase::createEmpty(), osg::SolidBackgroundBase::createEmpty(), osg::SlicesBase::createEmpty(), osg::SkyBackgroundBase::createEmpty(), osg::SimpleTexturedMaterialBase::createEmpty(), osg::SimpleStatisticsForegroundBase::createEmpty(), osg::SimpleMaterialBase::createEmpty(), osg::SHLParameterChunkBase::createEmpty(), osg::SHLChunkBase::createEmpty(), osg::ShearedStereoCameraDecoratorBase::createEmpty(), osg::ShaderParameterVec4fBase::createEmpty(), osg::ShaderParameterVec3fBase::createEmpty(), osg::ShaderParameterVec2fBase::createEmpty(), osg::ShaderParameterStringBase::createEmpty(), osg::ShaderParameterRealBase::createEmpty(), osg::ShaderParameterMVec4fBase::createEmpty(), osg::ShaderParameterMVec3fBase::createEmpty(), osg::ShaderParameterMVec2fBase::createEmpty(), osg::ShaderParameterMRealBase::createEmpty(), osg::ShaderParameterMMatrixBase::createEmpty(), osg::ShaderParameterMIntBase::createEmpty(), osg::ShaderParameterMatrixBase::createEmpty(), osg::ShaderParameterIntBase::createEmpty(), osg::ShaderParameterBoolBase::createEmpty(), osg::ScreenGroupBase::createEmpty(), osg::SClipPlaneChunkBase::createEmpty(), osg::ResolutionDisplayFilterBase::createEmpty(), osg::RenderOptionsBase::createEmpty(), osg::RegisterCombinersChunkBase::createEmpty(), osg::QTWindowBase::createEmpty(), osg::ProxyGroupBase::createEmpty(), osg::ProjectionCameraDecoratorBase::createEmpty(), osg::PolygonForegroundBase::createEmpty(), osg::PolygonChunkBase::createEmpty(), osg::PolygonBackgroundBase::createEmpty(), osg::PointLightBase::createEmpty(), osg::PointChunkBase::createEmpty(), osg::PhongMaterialBase::createEmpty(), osg::PerspectiveCameraBase::createEmpty(), osg::PassiveWindowBase::createEmpty(), osg::PassiveViewportBase::createEmpty(), osg::PassiveBackgroundBase::createEmpty(), osg::ParticlesBase::createEmpty(), osg::OrthographicCameraBase::createEmpty(), osg::OffCenterPerspectiveCameraBase::createEmpty(), osg::MultiPassMaterialBase::createEmpty(), osg::MultiDisplayWindowBase::createEmpty(), osg::MatrixCameraDecoratorBase::createEmpty(), osg::MatrixCameraBase::createEmpty(), osg::MaterialPoolBase::createEmpty(), osg::MaterialGroupBase::createEmpty(), osg::MaterialChunkBase::createEmpty(), osg::LogicOpChunkBase::createEmpty(), osg::LineChunkBase::createEmpty(), osg::LightModelChunkBase::createEmpty(), osg::LightEnvBase::createEmpty(), osg::LightChunkBase::createEmpty(), osg::InverseTransformBase::createEmpty(), osg::InlineBase::createEmpty(), osg::ImageForegroundBase::createEmpty(), osg::ImageBase::createEmpty(), osg::ImageBackgroundBase::createEmpty(), osg::GroupBase::createEmpty(), osg::GraphicStatisticsForegroundBase::createEmpty(), osg::GradientBackgroundBase::createEmpty(), osg::GrabForegroundBase::createEmpty(), osg::GLUTWindowBase::createEmpty(), osg::GeometryBase::createEmpty(), osg::FresnelMaterialBase::createEmpty(), osg::FragmentProgramChunkBase::createEmpty(), osg::FileGrabForegroundBase::createEmpty(), osg::FCPtrAttributeMapBase::createEmpty(), osg::FBOViewportBase::createEmpty(), osg::FatBorderChunkBase::createEmpty(), osg::DVRVolumeTextureBase::createEmpty(), osg::DVRVolumeBase::createEmpty(), osg::DVRSimpleShaderBase::createEmpty(), osg::DVRSimpleLUTShaderBase::createEmpty(), osg::DVRMtexLUTShaderBase::createEmpty(), osg::DVRLookupTableBase::createEmpty(), osg::DVRIsoSurfaceBase::createEmpty(), osg::DVRIsoShaderBase::createEmpty(), osg::DVRGeometryBase::createEmpty(), osg::DVRClipObjectsBase::createEmpty(), osg::DVRClipGeometryBase::createEmpty(), osg::DVRAppearanceBase::createEmpty(), osg::DistortionDisplayFilterBase::createEmpty(), osg::DistanceLODBase::createEmpty(), osg::DisplayFilterForegroundBase::createEmpty(), osg::DisplayCalibrationBase::createEmpty(), osg::DirectionalLightBase::createEmpty(), osg::DepthClearBackgroundBase::createEmpty(), osg::DepthChunkBase::createEmpty(), osg::CubeTextureChunkBase::createEmpty(), osg::ComponentTransformBase::createEmpty(), osg::ColorMaskChunkBase::createEmpty(), osg::ColorDisplayFilterBase::createEmpty(), osg::ColorBufferViewportBase::createEmpty(), osg::ClusterWindowBase::createEmpty(), osg::ClipPlaneChunkBase::createEmpty(), osg::ClipPlaneBase::createEmpty(), osg::ChunkMaterialBase::createEmpty(), osg::BlendChunkBase::createEmpty(), osg::BillboardBase::createEmpty(), osg::XWindowBase::shallowCopy(), osg::WIN32WindowBase::shallowCopy(), osg::ViewportBase::shallowCopy(), osg::VertexProgramChunkBase::shallowCopy(), osg::TwoSidedLightingChunkBase::shallowCopy(), osg::TransformChunkBase::shallowCopy(), osg::TransformBase::shallowCopy(), osg::TileCameraDecoratorBase::shallowCopy(), osg::TextureTransformChunkBase::shallowCopy(), osg::TextureGrabForegroundBase::shallowCopy(), osg::TextureGrabBackgroundBase::shallowCopy(), osg::TextureChunkBase::shallowCopy(), osg::TextureBackgroundBase::shallowCopy(), osg::TexGenChunkBase::shallowCopy(), osg::SwitchMaterialBase::shallowCopy(), osg::SwitchBase::shallowCopy(), osg::SurfaceBase::shallowCopy(), osg::StringAttributeMapBase::shallowCopy(), osg::StereoBufferViewportBase::shallowCopy(), osg::StencilChunkBase::shallowCopy(), osg::StateSortingGroupBase::shallowCopy(), osg::StateBase::shallowCopy(), osg::SpotLightBase::shallowCopy(), osg::SortFirstWindowBase::shallowCopy(), osg::SolidBackgroundBase::shallowCopy(), osg::SlicesBase::shallowCopy(), osg::SkyBackgroundBase::shallowCopy(), osg::SimpleTexturedMaterialBase::shallowCopy(), osg::SimpleStatisticsForegroundBase::shallowCopy(), osg::SimpleMaterialBase::shallowCopy(), osg::SHLParameterChunkBase::shallowCopy(), osg::SHLChunkBase::shallowCopy(), osg::ShearedStereoCameraDecoratorBase::shallowCopy(), osg::ShaderParameterVec4fBase::shallowCopy(), osg::ShaderParameterVec3fBase::shallowCopy(), osg::ShaderParameterVec2fBase::shallowCopy(), osg::ShaderParameterStringBase::shallowCopy(), osg::ShaderParameterRealBase::shallowCopy(), osg::ShaderParameterMVec4fBase::shallowCopy(), osg::ShaderParameterMVec3fBase::shallowCopy(), osg::ShaderParameterMVec2fBase::shallowCopy(), osg::ShaderParameterMRealBase::shallowCopy(), osg::ShaderParameterMMatrixBase::shallowCopy(), osg::ShaderParameterMIntBase::shallowCopy(), osg::ShaderParameterMatrixBase::shallowCopy(), osg::ShaderParameterIntBase::shallowCopy(), osg::ShaderParameterBoolBase::shallowCopy(), osg::ScreenGroupBase::shallowCopy(), osg::SClipPlaneChunkBase::shallowCopy(), osg::ResolutionDisplayFilterBase::shallowCopy(), osg::RenderOptionsBase::shallowCopy(), osg::RegisterCombinersChunkBase::shallowCopy(), osg::QTWindowBase::shallowCopy(), osg::ProxyGroupBase::shallowCopy(), osg::ProjectionCameraDecoratorBase::shallowCopy(), osg::PolygonForegroundBase::shallowCopy(), osg::PolygonChunkBase::shallowCopy(), osg::PolygonBackgroundBase::shallowCopy(), osg::PointLightBase::shallowCopy(), osg::PointChunkBase::shallowCopy(), osg::PhongMaterialBase::shallowCopy(), osg::PerspectiveCameraBase::shallowCopy(), osg::PassiveWindowBase::shallowCopy(), osg::PassiveViewportBase::shallowCopy(), osg::PassiveBackgroundBase::shallowCopy(), osg::ParticlesBase::shallowCopy(), osg::OrthographicCameraBase::shallowCopy(), osg::OffCenterPerspectiveCameraBase::shallowCopy(), osg::MultiPassMaterialBase::shallowCopy(), osg::MultiDisplayWindowBase::shallowCopy(), osg::MatrixCameraDecoratorBase::shallowCopy(), osg::MatrixCameraBase::shallowCopy(), osg::MaterialPoolBase::shallowCopy(), osg::MaterialGroupBase::shallowCopy(), osg::MaterialChunkBase::shallowCopy(), osg::LogicOpChunkBase::shallowCopy(), osg::LineChunkBase::shallowCopy(), osg::LightModelChunkBase::shallowCopy(), osg::LightEnvBase::shallowCopy(), osg::LightChunkBase::shallowCopy(), osg::InverseTransformBase::shallowCopy(), osg::InlineBase::shallowCopy(), osg::ImageForegroundBase::shallowCopy(), osg::ImageBase::shallowCopy(), osg::ImageBackgroundBase::shallowCopy(), osg::GroupBase::shallowCopy(), osg::GraphicStatisticsForegroundBase::shallowCopy(), osg::GradientBackgroundBase::shallowCopy(), osg::GrabForegroundBase::shallowCopy(), osg::GLUTWindowBase::shallowCopy(), osg::GeometryBase::shallowCopy(), osg::FresnelMaterialBase::shallowCopy(), osg::FragmentProgramChunkBase::shallowCopy(), osg::FileGrabForegroundBase::shallowCopy(), osg::FCPtrAttributeMapBase::shallowCopy(), osg::FBOViewportBase::shallowCopy(), osg::FatBorderChunkBase::shallowCopy(), osg::DVRVolumeTextureBase::shallowCopy(), osg::DVRVolumeBase::shallowCopy(), osg::DVRSimpleShaderBase::shallowCopy(), osg::DVRSimpleLUTShaderBase::shallowCopy(), osg::DVRMtexLUTShaderBase::shallowCopy(), osg::DVRLookupTableBase::shallowCopy(), osg::DVRIsoSurfaceBase::shallowCopy(), osg::DVRIsoShaderBase::shallowCopy(), osg::DVRGeometryBase::shallowCopy(), osg::DVRClipObjectsBase::shallowCopy(), osg::DVRClipGeometryBase::shallowCopy(), osg::DVRAppearanceBase::shallowCopy(), osg::DistortionDisplayFilterBase::shallowCopy(), osg::DistanceLODBase::shallowCopy(), osg::DisplayFilterForegroundBase::shallowCopy(), osg::DisplayCalibrationBase::shallowCopy(), osg::DirectionalLightBase::shallowCopy(), osg::DepthClearBackgroundBase::shallowCopy(), osg::DepthChunkBase::shallowCopy(), osg::CubeTextureChunkBase::shallowCopy(), osg::ComponentTransformBase::shallowCopy(), osg::ColorMaskChunkBase::shallowCopy(), osg::ColorDisplayFilterBase::shallowCopy(), osg::ColorBufferViewportBase::shallowCopy(), osg::ClusterWindowBase::shallowCopy(), osg::ClipPlaneChunkBase::shallowCopy(), osg::ClipPlaneBase::shallowCopy(), osg::ChunkMaterialBase::shallowCopy(), osg::BlendChunkBase::shallowCopy(), and osg::BillboardBase::shallowCopy().

00141 {
00142     typedef typename ObjectPtrT::StoredObjectType ObjectType;
00143     
00144     UInt8 *pTmp;
00145     
00146     result._containerSize = sizeof(ObjectType);
00147     
00148     pTmp        = 
00149         static_cast<UInt8 *>(operator new(
00150             sizeof(Int32)      + // ReferenceCount
00151             sizeof(UInt32)     + // ContainerId
00152             sizeof(ObjectType) * ThreadManager::getNumAspects()));
00153     
00154     *(reinterpret_cast<Int32 *>(pTmp)) = 0;
00155     
00156     pTmp += sizeof(Int32);
00157     
00158     result._storeP = (pTmp + sizeof(UInt32));
00159 
00160 #ifdef OSG_DEBUG_FCPTR
00161     result._typedStoreP = reinterpret_cast<FieldContainer *>(result._storeP);
00162 #endif
00163 
00164     *(reinterpret_cast<UInt32 *>(pTmp)) = 
00165         FieldContainerFactory::the()->registerFieldContainer(result);
00166     
00167     Thread::getCurrentChangeList()->addCreated(
00168         *(reinterpret_cast<UInt32 *>(pTmp)));
00169     
00170     pTmp += sizeof(UInt32);
00171     
00172     ObjectType *aObject = reinterpret_cast<ObjectType *>(pTmp);
00173 
00174     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00175     {
00176         pTmp = 
00177             reinterpret_cast<UInt8 *>(new (pTmp) ObjectType(*prototypeP));
00178         
00179         pTmp += sizeof(ObjectType);
00180     }
00181     
00182     result->onCreate(prototypeP);
00183 
00184     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00185     {
00186         aObject[i].onCreateAspect(aObject, prototypeP);
00187     }
00188 
00189 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM)
00190 
00191     fprintf(stderr, "GV_MEM_FC_DBG : (%u) cc (%p|%u)\n", 
00192             Thread::getAspect(),
00193             result._storeP,
00194 //            ObjectType::getClassType().getCName(),
00195             ObjectType::getClassType().getId());
00196 #endif
00197 
00198 #ifdef OSG_DEBUG_TYPED_FCPTR
00199     result.updateTypedStore();
00200 #endif
00201 }

template<class ObjectPtrT>
void osg::FieldContainer::newPtr ( ObjectPtrT &  result  )  [inline, static, protected, inherited]

Definition at line 204 of file OSGFieldContainerImpl.inl.

References osg::ChangeList::addCreated(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), osg::ThreadManager::getNumAspects(), osg::FieldContainerFactory::registerFieldContainer(), and osg::FieldContainerFactory::the().

00205 {
00206     typedef typename ObjectPtrT::StoredObjectType ObjectType;
00207     
00208     UInt8 *pTmp;
00209     
00210     result._containerSize = sizeof(ObjectType);
00211     
00212     pTmp        =             
00213         static_cast<UInt8 *>(operator new(
00214             sizeof(Int32)      + // ReferenceCount
00215             sizeof(UInt32)     + // ContainerId
00216             sizeof(ObjectType) * ThreadManager::getNumAspects()));
00217     
00218     *(reinterpret_cast<Int32 *>(pTmp)) = 0;
00219     
00220     pTmp  += sizeof(Int32);
00221     
00222     result._storeP = (pTmp + sizeof(UInt32));
00223     
00224 #ifdef OSG_DEBUG_FCPTR
00225     result._typedStoreP = reinterpret_cast<FieldContainer *>(result._storeP);
00226 #endif
00227 
00228     *(reinterpret_cast<UInt32 *>(pTmp)) = 
00229         FieldContainerFactory::the()->registerFieldContainer(result);
00230     
00231     Thread::getCurrentChangeList()->addCreated(
00232         *(reinterpret_cast<UInt32 *>(pTmp)));
00233     
00234     pTmp += sizeof(UInt32);
00235     
00236     ObjectType *aObject = reinterpret_cast<ObjectType *>(pTmp);
00237 
00238     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00239     {
00240         pTmp = reinterpret_cast<UInt8 *>(new (pTmp) ObjectType());
00241         
00242         pTmp += sizeof(ObjectType);
00243     }
00244     
00245     result->onCreate();
00246     
00247     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00248     {
00249         aObject[i].onCreateAspect(aObject);
00250     }
00251 
00252 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM)
00253     fprintf(stderr, "GV_MEM_FC_DBG : (%u) c (%p|%u)\n", 
00254             Thread::getAspect(),
00255             result._storeP,
00256 //            ObjectType::getClassType().getCName(),
00257             ObjectType::getClassType().getId());
00258 #endif
00259     
00260 #ifdef OSG_DEBUG_TYPED_FCPTR
00261     result.updateTypedStore();
00262 #endif
00263 }

template<class FieldTypeT>
void osg::FieldContainer::beginEditX ( const BitVector whichField,
FieldTypeT &  field 
) [inline, protected, inherited]

Definition at line 285 of file OSGFieldContainerImpl.inl.

00286 {
00287 //    fieldR.beginEdit();
00288 }

template<class FieldTypeT>
void osg::FieldContainer::endEditX ( const BitVector whichField,
FieldTypeT &  field 
) [inline, protected, inherited]

Definition at line 291 of file OSGFieldContainerImpl.inl.

References osg::endEditCP().

00292 {
00293     FieldContainerPtr tmpPtr(this);
00294     endEditCP(tmpPtr, whichField);
00295 }

void osg::FieldContainer::onCreate ( const FieldContainer source = NULL  )  [inline, protected, inherited]

Definition at line 318 of file OSGFieldContainerImpl.inl.

Referenced by osg::ShaderParameterChunk::onCreate().

00319 {
00320 }

void osg::FieldContainer::onCreateAspect ( const FieldContainer aspect0,
const FieldContainer source = NULL 
) [inline, protected, inherited]

Definition at line 323 of file OSGFieldContainerImpl.inl.

00325 {
00326 }

void FieldContainer::onDestroy ( void   )  [protected, virtual, inherited]


Friends And Related Function Documentation

friend class FieldContainer [friend]

Reimplemented from osg::DVRMtexLUTShaderBase.

Definition at line 172 of file OSGDVRMtexLUTShader.h.

friend class DVRMtexLUTShaderBase [friend]

Definition at line 173 of file OSGDVRMtexLUTShader.h.


Member Data Documentation

Initial value:

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 150 of file OSGDVRMtexLUTShader.h.

Referenced by DVRMtexLUTShader(), initCombiners(), initialize(), and renderSlice().

Initial value:

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 151 of file OSGDVRMtexLUTShader.h.

Referenced by DVRMtexLUTShader(), initCombiners(), initialize(), and renderSlice().

Initial value:

Definition at line 154 of file OSGDVRMtexLUTShader.h.

Referenced by DVRMtexLUTShader(), and renderSlice().

Initial value:

Definition at line 155 of file OSGDVRMtexLUTShader.h.

Referenced by DVRMtexLUTShader(), and initCombiners().

Initial value:

Definition at line 156 of file OSGDVRMtexLUTShader.h.

Referenced by DVRMtexLUTShader(), and renderSlice().

Initial value:

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 157 of file OSGDVRMtexLUTShader.h.

Referenced by DVRMtexLUTShader(), and initCombiners().

Initial value:

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 158 of file OSGDVRMtexLUTShader.h.

Referenced by DVRMtexLUTShader(), and initCombiners().

Initial value:

Reimplemented from osg::DVRSimpleLUTShader.

Definition at line 159 of file OSGDVRMtexLUTShader.h.

Referenced by DVRMtexLUTShader(), and initCombiners().

Initial value:

 
    (Inherited::MTInfluenceMask) | 
    (static_cast<BitVector>(0x0) << Inherited::NextFieldId)

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 92 of file OSGDVRMtexLUTShaderBase.h.

Definition at line 116 of file OSGDVRSimpleLUTShader.h.

Referenced by osg::DVRSimpleLUTShader::activate().

Int8 DVRSimpleLUTShaderBase::_sfLutMode [protected, inherited]

Int32 osg::DVRSimpleShader::m_nTextureId [protected, inherited]

const BitVector osg::FieldContainer::NextFieldMask [static, inherited]

Initial value:

 
                    (TypeTraits<BitVector>::One << NextFieldId)

Definition at line 75 of file OSGFieldContainerImpl.h.

const bool osg::FieldContainer::isNodeCore = false [static, inherited]

Reimplemented in osg::NodeCore.

Definition at line 181 of file OSGFieldContainerImpl.h.

UInt32 osg::FieldContainer::_shares [protected, inherited]

Definition at line 199 of file OSGFieldContainerImpl.h.


The documentation for this class was generated from the following files:

Generated on Mon Mar 17 12:08:10 2008 for OpenSG by  doxygen 1.5.5