VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
makVrv::DtEffectTextureRegistry Class Reference

class which holds some static utility functions for handling effect textures once we work out how to have extendable classes in the CDB plugin we should change this to be a singleton class instead of just a bunch of static functions

Inheritance diagram for makVrv::DtEffectTextureRegistry:
Inheritance graph
[legend]

Classes

struct  EffectTextureTypeInfo
 

Public Member Functions

int effectTextureTypeFromName (const std::string &texName)
 
bool isEffectTexture (const std::string &texName, const std::string &effectTypeCode)
 
bool isEffectTexture (const osg::Texture *tex, const std::string &texName, const std::string &effectTypeCode)
 
std::string getTextureNameLessExtension (const std::string &baseFileName)
 
std::string getExtendedFileName (const std::string &baseFileName, const std::string &effectTypeCode)
 
int effectTextureTypeFrom (osg::ExtendedMaterial::EffectTextureLayer extendedMaterialLayer)
 
void getPossibleEffectTextureFileNames (const std::string &baseFileName, std::vector< std::string > &output, const std::string &effectTypeCode)
 
void registerEffectTextureType (int effectTextureType, const std::string &readableString, const std::string &typeString, const std::string &postfix, bool isExtendedMaterialType, const std::set< osg::ExtendedMaterial::EffectTextureLayer > &extendedMaterialLayer=std::set< osg::ExtendedMaterial::EffectTextureLayer >())
 
void registerIndirectShaderEffectTexturetype (int effectTextureType, const DtIndirectEffectTextureShader &indirectEffectTextureShader)
 
bool hasIndirectShaderForType (int effectTextureType) const
 
DtIndirectEffectTextureShader indirectEffectTextureShaderForType (int effectTextureType) const
 
std::string toString (int effectTextureType)
 
std::string toDtEffectTextureTypeString (int effectTextureType)
 
std::string toTextureMapNameString (int effectTextureType) const
 
std::string toTextureCoordNameString (int effectTextureType) const
 
std::string getTextureArrayPattern (const std::string &effectUnitName)
 
std::string getTextureArrayReplacement (const std::string &effectUnitName)
 
bool isSupportedByExtendedMaterial (int effectTextureType)
 
bool effectTextureInstalled (const std::string &baseTextureName, const osg::StateSet *stateSet, const std::string &effectTypeCode)
 
std::string getTextureFilePathAndSetNameIfNotSet (const osg::Texture *texture, bool doSetName)
 
bool isRemoteTexture (const std::string &texturePath)
 
DtIndirectEffectTexturesTemplate effectTexturesTemplate ()
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtEffectTextureRegistryinstance (DtDe &de)
 

Protected Types

typedef std::map< int,
EffectTextureTypeInfo
IntEffectTextureTypeMap
 

Protected Member Functions

 DtEffectTextureRegistry (DtDe &de)
 
 ~DtEffectTextureRegistry ()
 

Protected Attributes

IntEffectTextureTypeMap myEffectTextureTypeInfoMap
 
std::map< int,
DtIndirectEffectTextureShader
myMapTypeToFXTextureShader
 
DtDemyDe
 
boost::shared_mutex myEffectTextureInfoTypeMapMutex
 
DtIndirectEffectTexturesTemplate myEffectTexturesTemplate
 
boost::shared_mutex myMutableMapTypeToFxTextureShaderMutex
 

Static Protected Attributes

static const
DtIndirectEffectTextureShader 
theDummyShader
 

Private Member Functions

 DtEffectTextureRegistry (const DtEffectTextureRegistry &other)
 
DtEffectTextureRegistryoperator= (const DtEffectTextureRegistry &other)
 

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtEffectTextureRegistry::DtEffectTextureRegistry ( DtDe de)
protected
makVrv::DtEffectTextureRegistry::~DtEffectTextureRegistry ( )
protected
makVrv::DtEffectTextureRegistry::DtEffectTextureRegistry ( const DtEffectTextureRegistry other)
private

Copy Constructor not implemented – Copy Not Allowed.

Member Function Documentation

DtEffectTextureRegistry& makVrv::DtEffectTextureRegistry::operator= ( const DtEffectTextureRegistry other)
private

Assignment Operator Not implemented – Assignment Not Allowed.

int makVrv::DtEffectTextureRegistry::effectTextureTypeFromName ( const std::string &  texName)

check to see if the texName corresponds to any effect texture types

bool makVrv::DtEffectTextureRegistry::isEffectTexture ( const std::string &  texName,
const std::string &  effectTypeCode 
)

return whether the texture name represents the effect type code passed in

bool makVrv::DtEffectTextureRegistry::isEffectTexture ( const osg::Texture *  tex,
const std::string &  texName,
const std::string &  effectTypeCode 
)

return whether the texture name represents the effect type code passed in. checks whether passed in texture is null as well

std::string makVrv::DtEffectTextureRegistry::getTextureNameLessExtension ( const std::string &  baseFileName)
std::string makVrv::DtEffectTextureRegistry::getExtendedFileName ( const std::string &  baseFileName,
const std::string &  effectTypeCode 
)
int makVrv::DtEffectTextureRegistry::effectTextureTypeFrom ( osg::ExtendedMaterial::EffectTextureLayer  extendedMaterialLayer)
void makVrv::DtEffectTextureRegistry::getPossibleEffectTextureFileNames ( const std::string &  baseFileName,
std::vector< std::string > &  output,
const std::string &  effectTypeCode 
)
void makVrv::DtEffectTextureRegistry::registerEffectTextureType ( int  effectTextureType,
const std::string &  readableString,
const std::string &  typeString,
const std::string &  postfix,
bool  isExtendedMaterialType,
const std::set< osg::ExtendedMaterial::EffectTextureLayer > &  extendedMaterialLayer = std::set< osg::ExtendedMaterial::EffectTextureLayer >() 
)

register an effect texture type allong with all the information we need to know about it.

void makVrv::DtEffectTextureRegistry::registerIndirectShaderEffectTexturetype ( int  effectTextureType,
const DtIndirectEffectTextureShader indirectEffectTextureShader 
)

register the indirect shader effect texture information

bool makVrv::DtEffectTextureRegistry::hasIndirectShaderForType ( int  effectTextureType) const

check to see if the registrar has this texture type registered to an indirect shader

DtIndirectEffectTextureShader makVrv::DtEffectTextureRegistry::indirectEffectTextureShaderForType ( int  effectTextureType) const

get the indirect shader info for the specified type

std::string makVrv::DtEffectTextureRegistry::toString ( int  effectTextureType)

convert the effect texture type to a legible string (useful for debugging)

std::string makVrv::DtEffectTextureRegistry::toDtEffectTextureTypeString ( int  effectTextureType)

the typedef itself in string form

std::string makVrv::DtEffectTextureRegistry::toTextureMapNameString ( int  effectTextureType) const

get the indirect shader texture map name, passed in with the DtIndirectEffectTextureShader

std::string makVrv::DtEffectTextureRegistry::toTextureCoordNameString ( int  effectTextureType) const

get the indirect shader texture coord name, passed in with the DtIndirectEffectTextureShader

std::string makVrv::DtEffectTextureRegistry::getTextureArrayPattern ( const std::string &  effectUnitName)

helpers to get the #undef string to remove if texture arrays are used

std::string makVrv::DtEffectTextureRegistry::getTextureArrayReplacement ( const std::string &  effectUnitName)

helper function to get #define for array replacement if texture arrays are used

bool makVrv::DtEffectTextureRegistry::isSupportedByExtendedMaterial ( int  effectTextureType)

Check if this effect texture is supported by the flt extended material by it's type.

bool makVrv::DtEffectTextureRegistry::effectTextureInstalled ( const std::string &  baseTextureName,
const osg::StateSet *  stateSet,
const std::string &  effectTypeCode 
)

True if there's already an effect texture installed on the given stateset that corresponds to the given base texture.

std::string makVrv::DtEffectTextureRegistry::getTextureFilePathAndSetNameIfNotSet ( const osg::Texture *  texture,
bool  doSetName 
)

find the file path for a texture. do set the name if its empty

bool makVrv::DtEffectTextureRegistry::isRemoteTexture ( const std::string &  texturePath)

Check if the texture is local to this machine or not.

DtIndirectEffectTexturesTemplate makVrv::DtEffectTextureRegistry::effectTexturesTemplate ( )

Get the master effect texture template for this registry includes all effect texture types that have an indirect shader registered.

static DtEffectTextureRegistry& makVrv::DtEffectTextureRegistry::instance ( DtDe de)
static

Static instance accessor.

Member Data Documentation

IntEffectTextureTypeMap makVrv::DtEffectTextureRegistry::myEffectTextureTypeInfoMap
protected
std::map<int, DtIndirectEffectTextureShader> makVrv::DtEffectTextureRegistry::myMapTypeToFXTextureShader
protected
DtDe& makVrv::DtEffectTextureRegistry::myDe
protected
boost::shared_mutex makVrv::DtEffectTextureRegistry::myEffectTextureInfoTypeMapMutex
protected
DtIndirectEffectTexturesTemplate makVrv::DtEffectTextureRegistry::myEffectTexturesTemplate
protected
boost::shared_mutex makVrv::DtEffectTextureRegistry::myMutableMapTypeToFxTextureShaderMutex
mutableprotected

mutable so the accessor function for the map can be const.

const DtIndirectEffectTextureShader makVrv::DtEffectTextureRegistry::theDummyShader
staticprotected

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)