osg::DVRMtexLUTShaderBase Class Reference

DVRMtexLUTShader Base Class.

#include <OSGDVRMtexLUTShaderBase.h>

Inheritance diagram for osg::DVRMtexLUTShaderBase:

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

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

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
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 brickActivate (DVRVolume *volume, DrawActionBase *action, Brick *brick)
 Callback before any brick - state setup per brick.
virtual void deactivate (DVRVolume *volume, DrawActionBase *action)
 Callback after all rendering of the volume is done.
virtual void cleanup (DVRVolume *volume, DrawActionBase *action)
 Callback to clean up shader resources.
Volume Rendering


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)
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


 DVRMtexLUTShaderBase (void)
 DVRMtexLUTShaderBase (const DVRMtexLUTShaderBase &source)
Destructors


virtual ~DVRMtexLUTShaderBase (void)
Sync


void executeSyncImpl (DVRMtexLUTShaderBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, 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.
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)
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 DVRSimpleLUTShader Inherited

Private Member Functions

void operator= (const DVRMtexLUTShaderBase &source)

Static Private Attributes

static FieldContainerType _type

Friends

class FieldContainer


Detailed Description

Definition at line 80 of file OSGDVRMtexLUTShaderBase.h.


Member Typedef Documentation

Reimplemented from osg::DVRSimpleLUTShader.

Reimplemented in osg::DVRMtexLUTShader.

Definition at line 84 of file OSGDVRMtexLUTShaderBase.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

DVRMtexLUTShaderBase::DVRMtexLUTShaderBase ( void   )  [protected]

Definition at line 144 of file OSGDVRMtexLUTShaderBase.cpp.

00144                                                :
00145     Inherited() 
00146 {
00147 }

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

Definition at line 153 of file OSGDVRMtexLUTShaderBase.cpp.

00153                                                                              :
00154     Inherited                 (source)
00155 {
00156 }

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

Definition at line 160 of file OSGDVRMtexLUTShaderBase.cpp.

00161 {
00162 }


Member Function Documentation

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

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 58 of file OSGDVRMtexLUTShaderBase.inl.

References _type.

Referenced by create().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 65 of file OSGDVRMtexLUTShaderBase.inl.

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

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

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

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 86 of file OSGDVRMtexLUTShaderBase.cpp.

References _type.

00087 {
00088     return _type; 
00089 } 

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

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 91 of file OSGDVRMtexLUTShaderBase.cpp.

References _type.

00092 {
00093     return _type;
00094 } 

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

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]

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]

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]

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]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 72 of file OSGDVRMtexLUTShaderBase.inl.

References getClassType(), osg::NullFC, and 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]

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]

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 97 of file OSGDVRMtexLUTShaderBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by 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]

Definition at line 191 of file OSGDVRMtexLUTShaderBase.cpp.

References osg::DVRSimpleLUTShaderBase::executeSyncImpl().

Referenced by executeSync().

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

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

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 113 of file OSGDVRMtexLUTShaderBase.cpp.

References executeSyncImpl().

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

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

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

Reimplemented from osg::DVRSimpleShader.

Reimplemented in osg::DVRMtexLUTShader.

Definition at line 593 of file OSGDVRSimpleLUTShader.cpp.

References osg::DVRSimpleShader::changed(), FDEBUG, FWARNING, osg::DVRSimpleLUTShader::LM_AUTO, osg::DVRSimpleLUTShaderBase::LutModeFieldMask, and osg::DVRSimpleLUTShaderBase::setActiveLutMode().

Referenced by osg::DVRMtexLUTShader::changed().

00594 {
00595     FDEBUG(("DVRSimpleLUTShader::changed\n"));
00596     FWARNING(("DVRSimpleLUTShader::changed\n"));
00597     
00598     // trigger re-initialization
00599     if(whichField & LutModeFieldMask)
00600     {
00601         setActiveLutMode(LM_AUTO);
00602     }
00603 
00604     Inherited::changed(whichField, origin);
00605 }

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

Reimplemented from osg::DVRSimpleShader.

Reimplemented in osg::DVRMtexLUTShader.

Definition at line 608 of file OSGDVRSimpleLUTShader.cpp.

References SLOG.

00610 {
00611     SLOG << "Dump DVRSimpleLUTShader NI" << std::endl;
00612 }

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

! Should fix uninizialized textures

Reimplemented from osg::DVRSimpleShader.

Reimplemented in osg::DVRMtexLUTShader.

Definition at line 616 of file OSGDVRSimpleLUTShader.cpp.

References osg::beginEditCP(), DVRVOLUME_PARAMETER, osg::endEditCP(), FWARNING, osg::DVRSimpleLUTShaderBase::getLutMode(), osg::DVRSimpleLUTShader::getPaletteFormat(), osg::DVRVolume::getTextureManager(), osg::DVRVolume::getTextureMode(), osg::DrawActionBase::getWindow(), GLenum, 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::TextureManager::reloadTexture(), osg::DVRSimpleLUTShader::selectMode(), osg::DVRSimpleLUTShaderBase::setActiveLutMode(), SWARNING, and osg::DVRLookupTableBase::TouchedFieldMask.

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

00617 {
00618     FWARNING(("DVRSimpleLUTShader::initialize\n"));
00619     
00620     GLenum nInternalFormat = GL_INTENSITY; 
00621     GLenum nExternalFormat = GL_LUMINANCE; 
00622 
00623     m_nTexturePaletteMode  = LM_NO;
00624     m_nTextureId           = -1; 
00625 
00626     Window *win            = action->getWindow(); 
00627 
00628     // Determine lookup table mechanism
00629     if(getLutMode() != LM_AUTO)
00630     {
00631         // A certain mode has been selected
00632         if(isModeSupported(action, getLutMode(), volume->getTextureMode(win)))
00633         {
00634             SWARNING << "DVRSimpleLUTShader - User specified lookup table "
00635                      << "mode "
00636                      << int(getLutMode()) << std::endl;
00637 
00638             m_nTexturePaletteMode =  getLutMode();
00639         }
00640         else
00641         {
00642             SWARNING << "DVRSimpleLUTShader - Unsupported lookup table mode "
00643                      << int(getLutMode()) << " disabling LUT" << std::endl;
00644 
00645             m_nTexturePaletteMode = LM_NO;
00646         }
00647     }
00648     else 
00649     {
00650         // Use automatic mode selection
00651         m_nTexturePaletteMode = selectMode(action, 
00652                                            volume->getTextureMode(win));
00653     }
00654 
00655     setActiveLutMode(m_nTexturePaletteMode);
00656     
00657     getPaletteFormat(action, 
00658                      m_nTexturePaletteMode, 
00659                      nInternalFormat, 
00660                      nExternalFormat      );
00661 
00662     DVRLookupTablePtr   lut = DVRVOLUME_PARAMETER(volume, DVRLookupTable  );
00663     DVRVolumeTexturePtr vol = DVRVOLUME_PARAMETER(volume, DVRVolumeTexture);
00664 
00665     if((volume == NULL) || (vol == NullFC)) 
00666     {
00667         SWARNING << "NO Volume..." << std::endl;
00668 
00669         return false;
00670     }
00671 
00672     m_nTextureId = volume->getTextureManager().registerTexture(
00673         vol->getImage(), // image
00674         nInternalFormat, // internalFormat
00675         nExternalFormat, // externalFormat
00676         1,               // doBricking
00677         0,               // textureStage0
00678         -1);             // textureStage1
00679     
00680     if(m_nTextureId == -1) 
00681     {
00682         SWARNING << "Error registering textures ..." << std::endl;
00683 
00684         return false;
00685     }
00686     else
00687     {
00688         SWARNING << "New texture Id: " << m_nTextureId << std::endl;
00689 
00691         volume->getTextureManager().reloadTexture(m_nTextureId, action); 
00692     }
00693     
00694     if(lut != NullFC)
00695     {
00696         beginEditCP(lut, DVRLookupTable::TouchedFieldMask);
00697         {
00698             lut->setTouched(true); // force initialization in first render
00699                                    // pass
00700         }
00701         endEditCP  (lut, DVRLookupTable::TouchedFieldMask);
00702     }
00703     
00704     return true;
00705 }

typedef const GLvoid *typedef const GLvoid *void DVRSimpleLUTShader::activate(DVRVolume *volume, DrawActionBase *action) ( DVRVolume volume,
DrawActionBase action 
) [virtual, inherited]

! Texture Stage 1 - dependent lookup

! Texture Stage 0 - ordinary lookup

! Register combiners to account for alpha value correction

Reimplemented from osg::DVRSimpleShader.

Reimplemented in osg::DVRMtexLUTShader.

Definition at line 739 of file OSGDVRSimpleLUTShader.cpp.

References osg::DVRSimpleLUTShader::_extSharedPalettedTexture, osg::DVRSimpleLUTShader::_fragProg2D, osg::DVRSimpleLUTShader::_fragProg2DMulti, osg::DVRSimpleLUTShader::_fragProg3D, osg::DVRSimpleLUTShader::_funcActiveTextureARB, osg::DVRSimpleLUTShader::_funcColorTableEXT, osg::DVRSimpleLUTShader::_funcColorTableSGI, osg::DVRSimpleLUTShader::_sgiTexColorTable, osg::DVRSimpleShader::activate(), osg::addRefCP(), osg::beginEditCP(), osg::DVRSimpleLUTShader::cleanup(), osg::FragmentProgramChunkBase::create(), DVRVOLUME_PARAMETER, osg::endEditCP(), FDEBUG, FFATAL, osg::DVRSimpleLUTShaderBase::getActiveLutMode(), osg::Window::getFunction(), osg::DVRVolume::getTextureManager(), osg::DVRVolume::getTextureMode(), osg::DrawActionBase::getWindow(), GL_DEPENDENT_AR_TEXTURE_2D_NV, GL_REGISTER_COMBINERS_NV, GL_SHADER_OPERATION_NV, GL_SHARED_TEXTURE_PALETTE_EXT, GL_TEXTURE0_ARB, GL_TEXTURE1_ARB, GL_TEXTURE_3D, GL_TEXTURE_SHADER_NV, osg::Window::hasExtension(), osg::DVRSimpleLUTShader::initDependentTexture(), osg::DVRSimpleLUTShader::initialize(), osg::DVRSimpleLUTShader::LM_AUTO, 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, osg::DVRSimpleShader::m_nTextureId, osg::DVRSimpleLUTShader::m_nTextureMode, osg::DVRSimpleLUTShader::m_nTexturePaletteMode, osg::DVRSimpleLUTShader::m_pDepTexture, osg::DVRSimpleLUTShader::m_pFragProg, osg::NullFC, osg::TextureManager::reloadTexture(), osg::DVRVolumeBase::ShaderFieldMask, SLOG, SNOTICE, SWARNING, osg::TextureManager::TM_2D, osg::TextureManager::TM_2D_Multi, osg::TextureManager::TM_3D, and osg::DVRSimpleLUTShader::updateDependentTexture().

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

00740 {
00741     // FDEBUG(("DVRSimpleLUTShader::activate - v1.2 (%d)\n", (int) this));
00742 
00743     Window *win = action->getWindow();
00744 
00745     // remove compiler warnings for unused variable
00746 #if defined GL_NV_texture_shader2 
00747     ActiveTextureARBFunc ActiveTextureARB = 
00748         (ActiveTextureARBFunc) win->getFunction(_funcActiveTextureARB);
00749 #endif
00750     
00751     ColorTableSGIFunc ColorTableSGI = NULL;
00752 
00753     if(win->hasExtension(_sgiTexColorTable))
00754     {
00755         ColorTableSGI = 
00756             (ColorTableSGIFunc) win->getFunction(_funcColorTableSGI);
00757     }
00758     
00759     ColorTableEXTFunc ColorTableEXT = NULL;
00760 
00761     if(win->hasExtension(_extSharedPalettedTexture))
00762     {
00763         ColorTableEXT = 
00764             (ColorTableEXTFunc) win->getFunction(_funcColorTableEXT);
00765     }
00766     
00767     DVRSimpleShader::activate(volume, action);
00768     
00769     DVRLookupTablePtr   lut = DVRVOLUME_PARAMETER(volume, DVRLookupTable);
00770     DVRVolumeTexturePtr vol = DVRVOLUME_PARAMETER(volume, DVRVolumeTexture);
00771 
00772     if((volume == NULL) || (vol == NullFC)) 
00773     {
00774         SWARNING << "NO Volume ..." << std::endl;
00775 
00776         return;
00777     }
00778 
00779     
00780     // reinitialize if hardware mode has not yet been chosen or mode has 
00781     // changed
00782 
00783     if(getActiveLutMode() == LM_AUTO) 
00784     {
00785         SNOTICE << "Reinitializing DVRSimpleLUTShader" << std::endl;
00786 
00787         cleanup   (volume, action);
00788         initialize(volume, action);
00789 
00790         // notify volume about shader changed
00791         beginEditCP(DVRVolumePtr(volume), DVRVolume::ShaderFieldMask);
00792         endEditCP  (DVRVolumePtr(volume), DVRVolume::ShaderFieldMask);
00793     }
00794 
00795 
00796     // reload lookup table if neccessary
00797     if((lut != NullFC) && (lut->getTouched())) 
00798     {
00799         Int32  colorTableSize =   lut->getSize(0);
00800         UInt8 *data           = &(lut->getData(0));
00801         
00802         lut->setTouched(false);
00803         
00804         switch(m_nTexturePaletteMode) 
00805         {
00806             case LM_TABLE_SGI:
00807 
00808                 FDEBUG(("Using SGI postshading palette....\n"));
00809 
00810 #if defined GL_SGI_texture_color_table
00811                 glEnable(GL_TEXTURE_COLOR_TABLE_SGI); 
00812 
00813                 ColorTableSGI(
00814                     GL_TEXTURE_COLOR_TABLE_SGI, // GLenum target,
00815                     GL_RGBA,                    // GLenum internalformat, 
00816                     colorTableSize,             // GLsizei width, 
00817                     GL_RGBA,                    // GLenum format, 
00818                     GL_UNSIGNED_BYTE,           // GLenum type, 
00819                     data);                      // const GLvoid *table 
00820 #endif // GL_SGI_texture_color_table     
00821 
00822                 break;
00823                 
00824             case LM_PALETTE_EXT:
00825 
00826                 FDEBUG(("Using preshading palette....\n"));
00827 
00828 #if defined GL_EXT_paletted_texture && defined GL_EXT_shared_texture_palette
00829 
00830                 glEnable(GL_SHARED_TEXTURE_PALETTE_EXT);
00831 
00832                 ColorTableEXT(
00833                     GL_SHARED_TEXTURE_PALETTE_EXT, // GLenum target, 
00834                     GL_RGBA,                       // GLenum internalformat, 
00835                     colorTableSize,                // GLsizei width, 
00836                     GL_RGBA,                       // GLenum format, 
00837                     GL_UNSIGNED_BYTE,              // GLenum type, 
00838                     data);                         // const GLvoid *table  
00839 #endif  
00840 
00841                 break;
00842                 
00843             case LM_RELOAD: 
00844             {
00845                 FDEBUG(("Using palette reload ....\n"));
00846                 FFATAL(("Using palette reload ....\n"));
00847 
00848                 glPixelTransferi(GL_MAP_COLOR, GL_TRUE);
00849 
00850                 glPixelMapfv(GL_PIXEL_MAP_I_TO_R, 
00851                              colorTableSize, 
00852                              &(lut->getDataR(0)));
00853 
00854                 glPixelMapfv(GL_PIXEL_MAP_I_TO_G, 
00855                              colorTableSize, 
00856                              &(lut->getDataG(0)));
00857 
00858                 glPixelMapfv(GL_PIXEL_MAP_I_TO_B, 
00859                              colorTableSize, 
00860                              &(lut->getDataB(0)));
00861 
00862                 glPixelMapfv(GL_PIXEL_MAP_I_TO_A, 
00863                              colorTableSize, 
00864                              &(lut->getDataA(0)));
00865                 
00866                 volume->getTextureManager().reloadTexture(m_nTextureId, 
00867                                                           action);
00868 
00869                 glPixelTransferi(GL_MAP_COLOR, GL_FALSE);
00870                 break;
00871             }
00872                 
00873             case LM_DEPENDENT: 
00874             {
00875                 // Initialize dependent texture
00876                 if(m_pDepTexture == NullFC)
00877                     initDependentTexture(lut->getSize(0));
00878                 
00879                 // Setup the correct texture shader mode
00880                 if(volume->getTextureMode(win) != m_nTextureMode) 
00881                 {
00882                     switch (volume->getTextureMode(win)) 
00883                     {
00884                         case TextureManager::TM_3D:
00885                             SLOG << "Setup texture shader for 3D" << std::endl;
00886                             break;
00887 
00888                         case TextureManager::TM_2D:
00889                             SLOG << "Setup texture shader for 2D" << std::endl;
00890                             break;
00891 
00892                         default:
00893                             FFATAL(
00894                                 ( "Texture mode for dependent textures"
00895                                   " not supported by DVRSimpleLUTShader\n"));
00896                             return;
00897                     }
00898 
00899                     m_nTextureMode = volume->getTextureMode(win);
00900                 }
00901                 
00902                 // Update dependent texture if neccessary
00903                 updateDependentTexture(lut->getSize(0), &(lut->getData(0)));
00904                 break;
00905             }
00906                 
00907             case LM_FRAGPROG: 
00908             {
00909                 // Initialize dependent texture
00910                 if(m_pDepTexture == NullFC)
00911                     initDependentTexture(lut->getSize(0));
00912                 
00913                 // Initialize fragment program
00914                 if(m_pFragProg == NullFC) 
00915                 {
00916                     FDEBUG(("Initializing fragment program "));
00917 
00918                     m_pFragProg = FragmentProgramChunk::create();
00919 
00920                     addRefCP( m_pFragProg );
00921                     
00922                     FDEBUG((" - DONE\n"));
00923                 }
00924                 
00925                 // Load the appropriate program
00926                 if(volume->getTextureMode(win) != m_nTextureMode) 
00927                 {
00928                     switch(volume->getTextureMode(win)) 
00929                     {
00930                         case TextureManager::TM_3D:
00931                             //SLOG << "Loading ... lutFragProg3D.asm" 
00932                             //     << std::endl;
00933 
00934                             beginEditCP(m_pFragProg);
00935                             {
00936                                 m_pFragProg->setProgram(_fragProg3D);
00937                                 // m_pFragProg->read("lutFragProg3D.asm");
00938                             }
00939                             endEditCP  (m_pFragProg);
00940                             break;
00941 
00942                         case TextureManager::TM_2D:
00943                             //SLOG << "Loading ... lutFragProg2D.asm" 
00944                             //     << std::endl;
00945 
00946                             beginEditCP(m_pFragProg);
00947                             {
00948                                 m_pFragProg->setProgram(_fragProg2D);
00949                                 // m_pFragProg->read("lutFragProg2D.asm");
00950                             }
00951                             endEditCP  (m_pFragProg);
00952                             break;
00953 
00954                         case TextureManager::TM_2D_Multi:
00955                             //SLOG << "Loading ... lutFragProg2DMulti.asm" 
00956                             //     << std::endl;
00957 
00958                             beginEditCP(m_pFragProg);
00959                             {
00960                                 m_pFragProg->setProgram(_fragProg2DMulti);
00961                                 //m_pFragProg->read("lutFragProg2DMulti.asm");
00962                             }
00963                             endEditCP  (m_pFragProg);
00964                             break;
00965 
00966                         default:
00967                             FFATAL(( "Texture mode for fragment programs"
00968                                      " not supported by DVRSimpleLUTShader" ));
00969                             return;
00970                     }
00971 
00972                     m_nTextureMode = volume->getTextureMode(win);
00973                 }
00974                 
00975                 // Update dependent texture if neccessary
00976                 updateDependentTexture(lut->getSize(0), &(lut->getData(0)));
00977                 break;
00978             }
00979                 
00980             case LM_NO:
00981                 FDEBUG(("Using NO palette reload ....\n"));
00982                 break;
00983         }
00984     }
00985     
00986     
00987     // enable lookup table
00988     if(lut != NullFC)
00989     {
00990         switch(m_nTexturePaletteMode) 
00991         {
00992             case LM_TABLE_SGI:
00993 
00994 #if defined GL_SGI_texture_color_table
00995                 glEnable(GL_TEXTURE_COLOR_TABLE_SGI);
00996 #endif
00997 
00998                 break;
00999 
01000             case LM_PALETTE_EXT:
01001 
01002 #if defined GL_EXT_paletted_texture && defined GL_EXT_shared_texture_palette
01003                 glEnable(GL_SHARED_TEXTURE_PALETTE_EXT);
01004 #endif
01005                 break;
01006                 
01007             case LM_DEPENDENT:
01008 
01009 #if defined GL_NV_texture_shader2
01010                 if(m_pDepTexture == NullFC)
01011                 {
01012                     SWARNING << "LM_DEPENDENT - no dependent texture" 
01013                              << std::endl;
01014                 }
01015 
01016                 //beginEditCP(m_pDepTexture, 
01017                 //            TextureChunk::EnvModeFieldMask | 
01018                 //            TextureChunk::ShaderOperationFieldMask);
01019                 //{
01020                 //   m_pDepTexture->setEnvMode        (GL_REPLACE);
01021                 //    m_pDepTexture->setShaderOperation(
01022                 //        GL_DEPENDENT_AR_TEXTURE_2D_NV);
01023                 //}
01024                 //endEditCP  (m_pDepTexture, 
01025                 //            TextureChunk::EnvModeFieldMask | 
01026                 //            TextureChunk::ShaderOperationFieldMask);
01027 
01028                 m_pDepTexture->activate(action, 1);
01029                 
01031                 glEnable(GL_TEXTURE_SHADER_NV);
01032                 
01033                 ActiveTextureARB(GL_TEXTURE1_ARB);
01034 
01035                 glTexEnvf(GL_TEXTURE_ENV, 
01036                           GL_TEXTURE_ENV_MODE, 
01037                           GL_REPLACE);
01038 
01039                 glTexEnvi(GL_TEXTURE_SHADER_NV, 
01040                           GL_SHADER_OPERATION_NV, 
01041                           GL_DEPENDENT_AR_TEXTURE_2D_NV);
01042                 
01044 
01045                 ActiveTextureARB(GL_TEXTURE0_ARB);
01046 
01047                 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
01048                 
01049                 switch(volume->getTextureMode(win)) 
01050                 {
01051                     case TextureManager::TM_3D:
01052 
01053                         glTexEnvi(GL_TEXTURE_SHADER_NV, 
01054                                   GL_SHADER_OPERATION_NV, 
01055                                   GL_TEXTURE_3D);
01056                         break;
01057 
01058                     case TextureManager::TM_2D:
01059 
01060                         glTexEnvi(GL_TEXTURE_SHADER_NV, 
01061                                   GL_SHADER_OPERATION_NV, GL_TEXTURE_2D);
01062                         break;
01063 
01064                     default:
01065 
01066                         //FFATAL(("Texture mode for dependent texture not "
01067                         //        "supported by DVRSimpleLUTShader"));
01068                         break;
01069                 }
01070 #endif
01071                 
01072 #if defined GL_NV_register_combiners
01074                 setupAlphaCorrectionRegisterCombiners(action);
01075                 glEnable(GL_REGISTER_COMBINERS_NV);
01076                 break;
01077 #endif
01078                 
01079             case LM_FRAGPROG:
01080 
01081                 // activate fragment program chunk
01082                 m_pDepTexture->activate(action, 2);
01083                 m_pFragProg  ->activate(action   );
01084 
01085                 break;
01086                 
01087             default:
01088                 break;
01089         }
01090     }
01091     
01092 }

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::deactivate ( DVRVolume volume,
DrawActionBase action 
) [virtual, inherited]

Reimplemented from osg::DVRSimpleShader.

Reimplemented in osg::DVRMtexLUTShader.

Definition at line 1131 of file OSGDVRSimpleLUTShader.cpp.

References osg::DVRSimpleLUTShader::_funcActiveTextureARB, osg::DVRSimpleShader::deactivate(), FDEBUG, osg::Window::getFunction(), osg::DrawActionBase::getWindow(), GL_REGISTER_COMBINERS_NV, GL_SHARED_TEXTURE_PALETTE_EXT, GL_TEXTURE_SHADER_NV, osg::DVRSimpleLUTShader::LM_DEPENDENT, osg::DVRSimpleLUTShader::LM_FRAGPROG, osg::DVRSimpleLUTShader::LM_PALETTE_EXT, osg::DVRSimpleLUTShader::LM_RELOAD, osg::DVRSimpleLUTShader::LM_TABLE_SGI, osg::DVRSimpleLUTShader::m_nTexturePaletteMode, osg::DVRSimpleLUTShader::m_pDepTexture, osg::DVRSimpleLUTShader::m_pFragProg, and osg::NullFC.

Referenced by osg::DVRMtexLUTShader::deactivate().

01132 {
01133     FDEBUG(("DVRSimpleLUTShader::deactivate\n"));
01134     
01135 // remove compiler warnings for unused variable
01136 #if defined GL_NV_texture_shader2 
01137     ActiveTextureARBFunc ActiveTextureARB =
01138         (ActiveTextureARBFunc) action->getWindow()->getFunction(
01139             _funcActiveTextureARB);
01140 #endif
01141 
01142     switch(m_nTexturePaletteMode) 
01143     {
01144         case LM_TABLE_SGI:
01145 #if defined GL_SGI_texture_color_table
01146             glDisable(GL_TEXTURE_COLOR_TABLE_SGI);
01147 #endif
01148             break;
01149             
01150         case LM_PALETTE_EXT:
01151 #if defined GL_EXT_paletted_texture && defined GL_EXT_shared_texture_palette
01152             glDisable(GL_SHARED_TEXTURE_PALETTE_EXT);
01153 #endif
01154             break;
01155         
01156         case LM_DEPENDENT:
01157 #if defined GL_NV_register_combiners
01158             glEnable(GL_REGISTER_COMBINERS_NV);
01159 #endif
01160 #if defined GL_NV_texture_shader2
01161             glDisable(GL_TEXTURE_SHADER_NV);
01162             
01163             if(m_pDepTexture != NullFC) 
01164                 m_pDepTexture->deactivate(action, 1);
01165             break;
01166 #endif
01167             
01168         case LM_FRAGPROG:
01169             // de-activate fragment program chunk
01170             if(m_pFragProg != NullFC)
01171             {
01172                 m_pFragProg->deactivate(action);
01173             }
01174             if(m_pDepTexture != NullFC) 
01175             {
01176                 m_pDepTexture->deactivate(action, 2);
01177             }
01178             break;
01179             
01180         case LM_RELOAD:
01181             glPixelTransferi(GL_MAP_COLOR, GL_FALSE);
01182             break;
01183             
01184         default:
01185             break;
01186     }
01187     
01188     DVRSimpleShader::deactivate(volume, action);
01189 }

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

Reimplemented from osg::DVRSimpleShader.

Reimplemented in osg::DVRMtexLUTShader.

Definition at line 1192 of file OSGDVRSimpleLUTShader.cpp.

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

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

01193 {
01194     if (volume != NULL)
01195     {
01196         if(m_nTextureId != -1) 
01197         {
01198             volume->getTextureManager().unregisterTexture(m_nTextureId);
01199 
01200             m_nTextureId = -1;
01201         }
01202     }
01203     
01204     destroyDependentTexture();
01205 }

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 osg::DVRMtexLUTShader::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(), osg::DVRMtexLUTShader::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 osg::DVRMtexLUTShader::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]

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 DVRShader::renderSlice ( DVRVolume volume,
DrawActionBase action,
Real32 data,
UInt32  vertices,
UInt32  values 
) [virtual, inherited]

Reimplemented in osg::DVRIsoShader, and osg::DVRMtexLUTShader.

Definition at line 85 of file OSGDVRShader.cpp.

References SLOG.

00090 {
00091     SLOG << "DVRShader::renderSlice - NI" << std::endl;
00092 }

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

Reimplemented in osg::DVRIsoShader, and osg::DVRMtexLUTShader.

Definition at line 94 of file OSGDVRShader.cpp.

References SLOG.

00097 {
00098     SLOG << "DVRShader::renderSlice - NI" << std::endl;
00099 }

bool DVRShader::hasRenderCallback ( void   )  [virtual, inherited]

Reimplemented in osg::DVRIsoShader, and osg::DVRMtexLUTShader.

Definition at line 101 of file OSGDVRShader.cpp.

00102 {
00103     return false; 
00104 }

bool DVRShader::useMTSlabs ( void   )  [virtual, inherited]

Reimplemented in osg::DVRIsoShader, and osg::DVRMtexLUTShader.

Definition at line 106 of file OSGDVRShader.cpp.

00107 {
00108     return false; 
00109 }; 

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(), 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(), 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::DVRSimpleLUTShader.

Reimplemented in osg::DVRMtexLUTShader.

Definition at line 197 of file OSGDVRMtexLUTShaderBase.h.


Member Data Documentation

Initial value:

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

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 92 of file OSGDVRMtexLUTShaderBase.h.

Reimplemented from osg::DVRSimpleLUTShaderBase.

Definition at line 199 of file OSGDVRMtexLUTShaderBase.h.

Referenced by getClassType(), getClassTypeId(), and getType().

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 11:14:33 2008 for OpenSG by  doxygen 1.5.5