OpenWalnut  1.5.0dev
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
WGEColormapping Class Reference

Class implements a manager for multiple 3D textures. More...

#include <WGEColormapping.h>

+ Collaboration diagram for WGEColormapping:

Classes

struct  NodeInfo
 Simple structure to store some additional node-related info like texture units and so on. More...
 

Public Types

enum  TextureListSignal { Registered = 0 , Deregistered , Replaced , Sorted }
 Possible signals that can be subscribed for being notified about texture list changes. More...
 
typedef WSharedSequenceContainer< std::vector< osg::ref_ptr< WGETexture3D > > > TextureContainerType
 The alias for a shared container. More...
 
typedef TextureContainerType::Iterator TextureIterator
 Iterator to access the texture list. More...
 
typedef TextureContainerType::ConstIterator TextureConstIterator
 Const iterator to access the texture list. More...
 
typedef boost::function< void(osg::ref_ptr< WGETexture3D >) > TextureRegisterHandler
 The type of handler used for being notified about added textures. More...
 
typedef TextureRegisterHandler TextureDeregisterHandler
 The type of handler used for being notified about removed textures. More...
 
typedef boost::function< void(osg::ref_ptr< WGETexture3D >, osg::ref_ptr< WGETexture3D >) > TextureReplaceHandler
 The type of handler used for being notified about replaced textures. More...
 
typedef boost::function< void(void) > TextureSortHandler
 The type of handler called whenever the texture list got resorted. More...
 
typedef std::vector< osg::ref_ptr< osg::Node > > NodeList
 a bunch of nodes. More...
 

Public Member Functions

virtual ~WGEColormapping ()
 Destructor. More...
 
template<typename Comparator >
void sort (Comparator comp)
 Resorts the texture list using the specified comparator. More...
 
template<typename Comparator >
void stableSort (Comparator comp)
 Resorts the texture list using the specified comparator using a stable sorting algorithm. More...
 
void sortByIndex ()
 Sort the texture list by the indices that have been stored in each texture's sortIndex. More...
 
void setSortIndices ()
 This function sets the index of a texture in the list to this texture's WGETexture::sortIndex(). More...
 
void resetSortIndices ()
 Reset all sort indices. More...
 
bool moveToTop (osg::ref_ptr< WGETexture3D > texture)
 Move the specified texture up in the list, directly to the top. More...
 
bool moveToBottom (osg::ref_ptr< WGETexture3D > texture)
 Move the specified texture down in the list, directly to the bottom. More...
 
bool moveUp (osg::ref_ptr< WGETexture3D > texture)
 Move the specified texture one item up in the list. More...
 
bool moveDown (osg::ref_ptr< WGETexture3D > texture)
 Move the specified texture one item down in the list. More...
 
bool moveTo (osg::ref_ptr< WGETexture3D > texture, size_t idx)
 Move the texture to the specified index. More...
 
size_t size () const
 Counts the number of textures in the colormapper. More...
 
boost::signals2::connection subscribeSignal (TextureListSignal signal, TextureRegisterHandler notifier)
 Subscribe to the specified signal. More...
 
boost::signals2::connection subscribeSignal (TextureListSignal signal, TextureReplaceHandler notifier)
 Subscribe to the specified signal. More...
 
boost::signals2::connection subscribeSignal (TextureListSignal signal, TextureSortHandler notifier)
 Subscribe to the specified signal. More...
 
TextureContainerType::ReadTicket getReadTicket ()
 Returns a read ticket to the texture array. More...
 
WBoundingBox getBoundingBox () const
 This returns the bounding box of all the data textures. More...
 
WCondition::SPtr getChangeCondition () const
 Returns the condition firing if the texture list changes (sort, replace, add or remove). More...
 

Static Public Member Functions

static std::shared_ptr< WGEColormappinginstance ()
 Returns instance of the module factory to use to create modules. More...
 
static void apply (osg::ref_ptr< osg::Node > node, WMatrix4d preTransform=WMatrix4d::identity(), osg::ref_ptr< WGEShader > shader=osg::ref_ptr< WGEShader >(), size_t startTexUnit=0)
 Apply the colormapping to the specified node. More...
 
static void apply (NodeList nodes, WMatrix4d preTransform=WMatrix4d::identity(), osg::ref_ptr< WGEShader > shader=osg::ref_ptr< WGEShader >(), size_t startTexUnit=0)
 Apply the colormapping to a list of nodes using the same shader. More...
 
static void apply (osg::ref_ptr< osg::Node > node, osg::ref_ptr< WGEShader > shader=osg::ref_ptr< WGEShader >(), size_t startTexUnit=0)
 Apply the colormapping to the specified node. More...
 
static void apply (NodeList nodes, osg::ref_ptr< WGEShader > shader=osg::ref_ptr< WGEShader >(), size_t startTexUnit=0)
 Apply the colormapping to a list of nodes which all use the same shader. More...
 
static void registerTexture (osg::ref_ptr< WGETexture3D > texture, std::string name="")
 Register the specified texture to the colormapper. More...
 
static void deregisterTexture (osg::ref_ptr< WGETexture3D > texture)
 De-register the specified texture to the colormapper. More...
 
static void replaceTexture (osg::ref_ptr< WGETexture3D > old, osg::ref_ptr< WGETexture3D > newTex, std::string name="")
 Replaces the specified texture with the given new one. More...
 

Protected Member Functions

 WGEColormapping ()
 Default constructor. More...
 
void applyInst (NodeList nodes, WMatrix4d preTransform=WMatrix4d::identity(), osg::ref_ptr< WGEShader > shader=osg::ref_ptr< WGEShader >(), size_t startTexUnit=0)
 Apply the colormapping to the specified nodes. More...
 
void registerTextureInst (osg::ref_ptr< WGETexture3D > texture, std::string name)
 Register the specified texture to the colormapper. More...
 
void deregisterTextureInst (osg::ref_ptr< WGETexture3D > texture)
 De-register the specified texture to the colormapper. More...
 
void replaceTextureInst (osg::ref_ptr< WGETexture3D > old, osg::ref_ptr< WGETexture3D > newTex, std::string name="")
 Replaces the specified texture with the given new one. More...
 
void callback (osg::Node *node)
 This callback handles all the updates needed. More...
 
void textureUpdate ()
 Called whenever the texture list is updated. More...
 

Private Types

typedef WSharedAssociativeContainer< std::map< osg::Node *, NodeInfo *, std::less< osg::Node * > > > NodeInfoContainerType
 The alias for a shared container with a set of node-nodeInfo pairs. More...
 

Private Member Functions

void updateBounds ()
 Updates the bounding box information. More...
 

Private Attributes

TextureContainerType m_textures
 The textures managed by this instance. More...
 
NodeInfoContainerType m_nodeInfo
 This map is needed to keep track of several node specific settings. More...
 
boost::signals2::signal< void(osg::ref_ptr< WGETexture3D >) > m_registerSignal
 Called whenever a texture got registered. More...
 
boost::signals2::signal< void(osg::ref_ptr< WGETexture3D >) > m_deregisterSignal
 Called whenever a texture got removed. More...
 
boost::signals2::signal< void(osg::ref_ptr< WGETexture3D >, osg::ref_ptr< WGETexture3D >) > m_replaceSignal
 Called whenever a texture got replaced. More...
 
boost::signals2::signal< void(void) > m_sortSignal
 Called whenever the texture list got resorted. More...
 
WSharedObject< WBoundingBoxm_boundingBox
 The bounding box of all the textures. More...
 

Static Private Attributes

static std::shared_ptr< WGEColormappingm_instance = std::shared_ptr< WGEColormapping >()
 Singleton instance of WGEColormapping. More...
 

Detailed Description

Class implements a manager for multiple 3D textures.

They can be applied to arbitrary osg::Node. This allows very comfortable use of dataset based colormapping. The only requirement is that your geometry/node needs to specify texture coordinates in Object Space. That means: the texture coordinates equal the regular 3D grid of the texture.

Definition at line 52 of file WGEColormapping.h.

Member Typedef Documentation

◆ NodeInfoContainerType

typedef WSharedAssociativeContainer< std::map< osg::Node*, NodeInfo*, std::less< osg::Node* > > > WGEColormapping::NodeInfoContainerType
private

The alias for a shared container with a set of node-nodeInfo pairs.

Definition at line 411 of file WGEColormapping.h.

◆ NodeList

typedef std::vector< osg::ref_ptr< osg::Node > > WGEColormapping::NodeList

a bunch of nodes.

Definition at line 105 of file WGEColormapping.h.

◆ TextureConstIterator

Const iterator to access the texture list.

Definition at line 68 of file WGEColormapping.h.

◆ TextureContainerType

The alias for a shared container.

Definition at line 58 of file WGEColormapping.h.

◆ TextureDeregisterHandler

The type of handler used for being notified about removed textures.

Definition at line 78 of file WGEColormapping.h.

◆ TextureIterator

Iterator to access the texture list.

Definition at line 63 of file WGEColormapping.h.

◆ TextureRegisterHandler

typedef boost::function< void ( osg::ref_ptr< WGETexture3D > ) > WGEColormapping::TextureRegisterHandler

The type of handler used for being notified about added textures.

Definition at line 73 of file WGEColormapping.h.

◆ TextureReplaceHandler

typedef boost::function< void ( osg::ref_ptr< WGETexture3D >, osg::ref_ptr< WGETexture3D > ) > WGEColormapping::TextureReplaceHandler

The type of handler used for being notified about replaced textures.

Definition at line 83 of file WGEColormapping.h.

◆ TextureSortHandler

typedef boost::function< void ( void ) > WGEColormapping::TextureSortHandler

The type of handler called whenever the texture list got resorted.

Definition at line 88 of file WGEColormapping.h.

Member Enumeration Documentation

◆ TextureListSignal

Possible signals that can be subscribed for being notified about texture list changes.

Enumerator
Registered 

texture got added

Deregistered 

texture got removed

Replaced 

texture got replaced

Sorted 

texture list was resorted

Definition at line 268 of file WGEColormapping.h.

Constructor & Destructor Documentation

◆ ~WGEColormapping()

WGEColormapping::~WGEColormapping ( )
virtual

Destructor.

Definition at line 94 of file WGEColormapping.cpp.

◆ WGEColormapping()

WGEColormapping::WGEColormapping ( )
protected

Default constructor.

Definition at line 87 of file WGEColormapping.cpp.

References WSharedObject< T >::getChangeCondition(), m_boundingBox, m_textures, and textureUpdate().

Referenced by instance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ apply() [1/4]

void WGEColormapping::apply ( NodeList  nodes,
osg::ref_ptr< WGEShader shader = osg::ref_ptr< WGEShader >(),
size_t  startTexUnit = 0 
)
static

Apply the colormapping to a list of nodes which all use the same shader.

Parameters
nodesthe node list.
shaderthe shader to use for colormapping. Provide your own shader here to let WGEColormap set some defines needed. If not specified, a default shader is used.
startTexUnitthe first texture unit allowed to be used

Definition at line 125 of file WGEColormapping.cpp.

References WMatrixFixed< double, 4, 4 >::identity(), and instance().

+ Here is the call graph for this function:

◆ apply() [2/4]

void WGEColormapping::apply ( NodeList  nodes,
WMatrix4d  preTransform = WMatrix4d::identity(),
osg::ref_ptr< WGEShader shader = osg::ref_ptr< WGEShader >(),
size_t  startTexUnit = 0 
)
static

Apply the colormapping to a list of nodes using the same shader.

Parameters
nodesthe node-list.
shaderthe shader to use for colormapping. Provide your own shader here to let WGEColormap set some defines needed. If not specified, a default shader is used.
preTransformTransformation matrix getting applied to your texture coordinates before applying texture matrices. This allows you to specify any kind of texture coordinates as long as you use this matrix to transform them to the right space.
startTexUnitthe first texture unit allowed to be used

Definition at line 120 of file WGEColormapping.cpp.

References instance().

+ Here is the call graph for this function:

◆ apply() [3/4]

void WGEColormapping::apply ( osg::ref_ptr< osg::Node >  node,
osg::ref_ptr< WGEShader shader = osg::ref_ptr< WGEShader >(),
size_t  startTexUnit = 0 
)
static

Apply the colormapping to the specified node.

Parameters
nodethe node.
shaderthe shader to use for colormapping. Provide your own shader here to let WGEColormap set some defines needed. If not specified, a default shader is used.
startTexUnitthe first texture unit allowed to be used

Definition at line 109 of file WGEColormapping.cpp.

References WMatrixFixed< double, 4, 4 >::identity(), and instance().

+ Here is the call graph for this function:

◆ apply() [4/4]

void WGEColormapping::apply ( osg::ref_ptr< osg::Node >  node,
WMatrix4d  preTransform = WMatrix4d::identity(),
osg::ref_ptr< WGEShader shader = osg::ref_ptr< WGEShader >(),
size_t  startTexUnit = 0 
)
static

Apply the colormapping to the specified node.

Parameters
nodethe node.
shaderthe shader to use for colormapping. Provide your own shader here to let WGEColormap set some defines needed. If not specified, a default shader is used.
preTransformTransformation matrix getting applied to your texture coordinates before applying texture matrices. This allows you to specify any kind of texture coordinates as long as you use this matrix to transform them to the right space.
startTexUnitthe first texture unit allowed to be used

Definition at line 114 of file WGEColormapping.cpp.

References instance().

Referenced by WMArbitraryPlane::initPlane(), WMFiberDisplay::moduleMain(), WMImageSpaceLIC::moduleMain(), WMImageSpaceTensorLIC::moduleMain(), WMIsosurfaceRaytracer::moduleMain(), WMNavigationSlices::moduleMain(), WMProjectionsAsContext::moduleMain(), WMTemplateColormapping::moduleMain(), WMVoxelizer::moduleMain(), WMIsosurface::renderMesh(), WMSplineSurface::renderMesh(), WMSurfaceIllustrator::renderMesh(), and WMTriangleMeshRenderer::renderMesh().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyInst()

void WGEColormapping::applyInst ( NodeList  nodes,
WMatrix4d  preTransform = WMatrix4d::identity(),
osg::ref_ptr< WGEShader shader = osg::ref_ptr< WGEShader >(),
size_t  startTexUnit = 0 
)
protected

Apply the colormapping to the specified nodes.

Parameters
nodesthe nodes.
preTransformTransformation matrix getting applied to your texture coordinates before applying texture matrices. This allows you to specify any kind of texture coordinates as long as you use this matrix to transform them to the right space.
shaderthe shader to use for colormapping. Provide your own shader here to let WGEColormap set some defines needed. If not specified, a default shader is used.
startTexUnitthe first texture unit allowed to be used

Definition at line 145 of file WGEColormapping.cpp.

References callback(), WSharedAssociativeContainer< T >::insert(), and m_nodeInfo.

+ Here is the call graph for this function:

◆ callback()

void WGEColormapping::callback ( osg::Node *  node)
protected

This callback handles all the updates needed.

It is called by the callback instance every update cycle for each node using this WGEColormapping instance.

Parameters
node

Definition at line 295 of file WGEColormapping.cpp.

References wge::bindTexture(), wge::getMaxTexUnits(), WSharedObject< T >::getReadTicket(), m_nodeInfo, m_textures, string_utils::toString(), and wge::unbindTexture().

Referenced by applyInst().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deregisterTexture()

void WGEColormapping::deregisterTexture ( osg::ref_ptr< WGETexture3D texture)
static

De-register the specified texture to the colormapper.

The texture is the automatically removed from all users of WGEColormapping. If the texture is not in the list, nothing happens.

Parameters
texturethe texture to remove

Definition at line 135 of file WGEColormapping.cpp.

References instance().

Referenced by WMColormapper::moduleMain(), WMFunctionalMRIViewer::moduleMain(), WMImageExtractor::moduleMain(), WMPaintTexture::moduleMain(), and WMData::updateColorMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deregisterTextureInst()

void WGEColormapping::deregisterTextureInst ( osg::ref_ptr< WGETexture3D texture)
protected

De-register the specified texture to the colormapper.

The texture is the automatically removed from all users of WGEColormapping.

Parameters
texturethe texture to remove

Definition at line 190 of file WGEColormapping.cpp.

References WSharedSequenceContainer< S >::count(), wlog::debug(), m_deregisterSignal, m_textures, WSharedSequenceContainer< S >::remove(), and updateBounds().

+ Here is the call graph for this function:

◆ getBoundingBox()

WBoundingBox WGEColormapping::getBoundingBox ( ) const

This returns the bounding box of all the data textures.

This is very useful if you implement an universal color-mapped exploration tool. It returns a copy of the current bounding box. Please note that this can change any moment.

Returns
the bounding box.

Definition at line 242 of file WGEColormapping.cpp.

References m_boundingBox.

◆ getChangeCondition()

WCondition::SPtr WGEColormapping::getChangeCondition ( ) const

Returns the condition firing if the texture list changes (sort, replace, add or remove).

If you are interested in a certain event only, use subscribeSignal.

Returns
the change condition

Definition at line 532 of file WGEColormapping.cpp.

References WSharedObject< T >::getChangeCondition(), and m_textures.

+ Here is the call graph for this function:

◆ getReadTicket()

WGEColormapping::TextureContainerType::ReadTicket WGEColormapping::getReadTicket ( )

Returns a read ticket to the texture array.

Useful to iterate the textures.

Returns
the read ticket

Definition at line 527 of file WGEColormapping.cpp.

References WSharedObject< T >::getReadTicket(), and m_textures.

+ Here is the call graph for this function:

◆ instance()

std::shared_ptr< WGEColormapping > WGEColormapping::instance ( )
static

◆ moveDown()

bool WGEColormapping::moveDown ( osg::ref_ptr< WGETexture3D texture)

Move the specified texture one item down in the list.

Causes the sort signal to fire.

Parameters
texturethe texture swapped with its descendant
Returns
true if swap was successful. False if not (texture not found, texture already at end).

Definition at line 332 of file WGEColormapping.cpp.

References WSharedObject< T >::getWriteTicket(), m_sortSignal, and m_textures.

+ Here is the call graph for this function:

◆ moveTo()

bool WGEColormapping::moveTo ( osg::ref_ptr< WGETexture3D texture,
size_t  idx 
)

Move the texture to the specified index.

If the texture is not in the list, nothing happens.

Parameters
texturethe texture to move
idxthe target index
Returns
true if the operation was successful.

Definition at line 442 of file WGEColormapping.cpp.

References WSharedObject< T >::getWriteTicket(), m_sortSignal, and m_textures.

+ Here is the call graph for this function:

◆ moveToBottom()

bool WGEColormapping::moveToBottom ( osg::ref_ptr< WGETexture3D texture)

Move the specified texture down in the list, directly to the bottom.

Causes the sort signal to fire.

Parameters
texturethe texture swapped with its descendant
Returns
true if swap was successful. False if not (texture not found, texture already at end).

Definition at line 414 of file WGEColormapping.cpp.

References WSharedObject< T >::getWriteTicket(), m_sortSignal, and m_textures.

+ Here is the call graph for this function:

◆ moveToTop()

bool WGEColormapping::moveToTop ( osg::ref_ptr< WGETexture3D texture)

Move the specified texture up in the list, directly to the top.

Causes the sort signal to fire.

Parameters
texturethe texture swapped with its ascendant
Returns
true if swap was successful. False if not (texture not found, texture already at beginning).

Definition at line 386 of file WGEColormapping.cpp.

References WSharedObject< T >::getWriteTicket(), m_sortSignal, and m_textures.

+ Here is the call graph for this function:

◆ moveUp()

bool WGEColormapping::moveUp ( osg::ref_ptr< WGETexture3D texture)

Move the specified texture one item up in the list.

Causes the sort signal to fire.

Parameters
texturethe texture swapped with its ascendant
Returns
true if swap was successful. False if not (texture not found, texture already at beginning).

Definition at line 359 of file WGEColormapping.cpp.

References WSharedObject< T >::getWriteTicket(), m_sortSignal, and m_textures.

+ Here is the call graph for this function:

◆ registerTexture()

void WGEColormapping::registerTexture ( osg::ref_ptr< WGETexture3D texture,
std::string  name = "" 
)
static

Register the specified texture to the colormapper.

The registered texture is the automatically applied to all users of WGEColormapping. The texture gets inserted at the beginning of the texture list.

Parameters
texturethe texture to add
namethe name of the texture to add

Definition at line 130 of file WGEColormapping.cpp.

References instance().

Referenced by WMPaintTexture::createTexture(), WMColormapper::moduleMain(), WMFunctionalMRIViewer::moduleMain(), WMImageExtractor::moduleMain(), and WMData::updateColorMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerTextureInst()

void WGEColormapping::registerTextureInst ( osg::ref_ptr< WGETexture3D texture,
std::string  name 
)
protected

Register the specified texture to the colormapper.

The registered texture is the automatically applied to all users of WGEColormapping.

Parameters
texturethe texture to add
namethe name of the texture.

Definition at line 175 of file WGEColormapping.cpp.

References WSharedSequenceContainer< S >::count(), wlog::debug(), m_registerSignal, m_textures, WSharedSequenceContainer< S >::push_front(), and updateBounds().

Referenced by replaceTextureInst().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replaceTexture()

void WGEColormapping::replaceTexture ( osg::ref_ptr< WGETexture3D old,
osg::ref_ptr< WGETexture3D newTex,
std::string  name = "" 
)
static

Replaces the specified texture with the given new one.

If the old texture does not exist, the new one gets inserted at the front of the list as registerTexture does.

Parameters
oldthe texture to remove
newTexthe new texture to put at the position of the old one
namethe name of the texture.

Definition at line 140 of file WGEColormapping.cpp.

References instance().

Referenced by WMColormapper::moduleMain(), and WMImageExtractor::moduleMain().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replaceTextureInst()

void WGEColormapping::replaceTextureInst ( osg::ref_ptr< WGETexture3D old,
osg::ref_ptr< WGETexture3D newTex,
std::string  name = "" 
)
protected

Replaces the specified texture with the given new one.

If the old texture does not exist, the new one gets inserted at the front of the list as registerTexture does.

Parameters
oldthe texture to remove
newTexthe new texture to put at the position of the old one
namethe name of the texture.

Definition at line 201 of file WGEColormapping.cpp.

References WSharedSequenceContainer< S >::count(), wlog::debug(), m_replaceSignal, m_textures, registerTextureInst(), WSharedSequenceContainer< S >::replace(), and updateBounds().

+ Here is the call graph for this function:

◆ resetSortIndices()

void WGEColormapping::resetSortIndices ( )

Reset all sort indices.

This can be useful when loading new project files with new sort indices.

Definition at line 286 of file WGEColormapping.cpp.

References WSharedObject< T >::getReadTicket(), WGETexture< TextureType >::getUnsetSortIndex(), and m_textures.

+ Here is the call graph for this function:

◆ setSortIndices()

void WGEColormapping::setSortIndices ( )

This function sets the index of a texture in the list to this texture's WGETexture::sortIndex().

This can be used later using sortByIndex().

Definition at line 275 of file WGEColormapping.cpp.

References WSharedObject< T >::getReadTicket(), and m_textures.

+ Here is the call graph for this function:

◆ size()

size_t WGEColormapping::size ( ) const

Counts the number of textures in the colormapper.

Returns
the number of textures.

Definition at line 487 of file WGEColormapping.cpp.

References m_textures, and WSharedSequenceContainer< S >::size().

+ Here is the call graph for this function:

◆ sort()

template<typename Comparator >
void WGEColormapping::sort ( Comparator  comp)

Resorts the texture list using the specified comparator.

Template Parameters
Comparatorthe comparator type. Usually a boost::function or class providing the operator().
Parameters
compthe comparator

Definition at line 450 of file WGEColormapping.h.

References m_textures, and WSharedSequenceContainer< S >::sort().

+ Here is the call graph for this function:

◆ sortByIndex()

void WGEColormapping::sortByIndex ( )

Sort the texture list by the indices that have been stored in each texture's sortIndex.

Definition at line 269 of file WGEColormapping.cpp.

References stableSort().

+ Here is the call graph for this function:

◆ stableSort()

template<typename Comparator >
void WGEColormapping::stableSort ( Comparator  comp)

Resorts the texture list using the specified comparator using a stable sorting algorithm.

Template Parameters
Comparatorthe comparator type. Usually a boost::function or class providing the operator().
Parameters
compthe comparator

Definition at line 456 of file WGEColormapping.h.

References m_textures, and WSharedSequenceContainer< S >::stableSort().

Referenced by sortByIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subscribeSignal() [1/3]

boost::signals2::connection WGEColormapping::subscribeSignal ( TextureListSignal  signal,
TextureRegisterHandler  notifier 
)

Subscribe to the specified signal.

See TextureListSignal for details about their meaning.

Parameters
signalthe signal to subscribe
notifierthe notifier
Returns
the connection. Keep this and disconnect it properly!

Definition at line 492 of file WGEColormapping.cpp.

References Deregistered, m_deregisterSignal, m_registerSignal, and Registered.

◆ subscribeSignal() [2/3]

boost::signals2::connection WGEColormapping::subscribeSignal ( TextureListSignal  signal,
TextureReplaceHandler  notifier 
)

Subscribe to the specified signal.

See TextureListSignal for details about their meaning.

Parameters
signalthe signal to subscribe
notifierthe notifier
Returns
the connection. Keep this and disconnect it properly!

Definition at line 505 of file WGEColormapping.cpp.

References m_replaceSignal, and Replaced.

◆ subscribeSignal() [3/3]

boost::signals2::connection WGEColormapping::subscribeSignal ( TextureListSignal  signal,
TextureSortHandler  notifier 
)

Subscribe to the specified signal.

See TextureListSignal for details about their meaning.

Parameters
signalthe signal to subscribe
notifierthe notifier
Returns
the connection. Keep this and disconnect it properly!

Definition at line 516 of file WGEColormapping.cpp.

References m_sortSignal, and Sorted.

◆ textureUpdate()

void WGEColormapping::textureUpdate ( )
protected

Called whenever the texture list is updated.

Definition at line 247 of file WGEColormapping.cpp.

References WSharedObject< T >::getWriteTicket(), and m_nodeInfo.

Referenced by WGEColormapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateBounds()

void WGEColormapping::updateBounds ( )
private

Updates the bounding box information.

This is called for every write-update in m_textures.

Definition at line 222 of file WGEColormapping.cpp.

References WSharedObject< T >::getReadTicket(), m_boundingBox, and m_textures.

Referenced by deregisterTextureInst(), registerTextureInst(), and replaceTextureInst().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_boundingBox

WSharedObject< WBoundingBox > WGEColormapping::m_boundingBox
private

The bounding box of all the textures.

Definition at line 441 of file WGEColormapping.h.

Referenced by getBoundingBox(), updateBounds(), and WGEColormapping().

◆ m_deregisterSignal

boost::signals2::signal< void( osg::ref_ptr< WGETexture3D > ) > WGEColormapping::m_deregisterSignal
private

Called whenever a texture got removed.

Definition at line 426 of file WGEColormapping.h.

Referenced by deregisterTextureInst(), and subscribeSignal().

◆ m_instance

std::shared_ptr< WGEColormapping > WGEColormapping::m_instance = std::shared_ptr< WGEColormapping >()
staticprivate

Singleton instance of WGEColormapping.

Definition at line 391 of file WGEColormapping.h.

Referenced by instance().

◆ m_nodeInfo

NodeInfoContainerType WGEColormapping::m_nodeInfo
private

This map is needed to keep track of several node specific settings.

Definition at line 416 of file WGEColormapping.h.

Referenced by applyInst(), callback(), and textureUpdate().

◆ m_registerSignal

boost::signals2::signal< void( osg::ref_ptr< WGETexture3D > ) > WGEColormapping::m_registerSignal
private

Called whenever a texture got registered.

Definition at line 421 of file WGEColormapping.h.

Referenced by registerTextureInst(), and subscribeSignal().

◆ m_replaceSignal

boost::signals2::signal< void( osg::ref_ptr< WGETexture3D >, osg::ref_ptr< WGETexture3D > ) > WGEColormapping::m_replaceSignal
private

Called whenever a texture got replaced.

Definition at line 431 of file WGEColormapping.h.

Referenced by replaceTextureInst(), and subscribeSignal().

◆ m_sortSignal

boost::signals2::signal< void( void ) > WGEColormapping::m_sortSignal
private

Called whenever the texture list got resorted.

Definition at line 436 of file WGEColormapping.h.

Referenced by moveDown(), moveTo(), moveToBottom(), moveToTop(), moveUp(), and subscribeSignal().

◆ m_textures

TextureContainerType WGEColormapping::m_textures
private

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