OpenWalnut 1.2.5
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
WDataTexture3D Class Reference

This class allows simple creation of WGETexture3D by using a specified grid and value-set. More...

#include <WDataTexture3D.h>

Inheritance diagram for WDataTexture3D:

List of all members.

Public Member Functions

 WDataTexture3D (boost::shared_ptr< WValueSetBase > valueSet, boost::shared_ptr< WGridRegular3D > grid)
 Constructor.
virtual ~WDataTexture3D ()
 Destructor.
virtual WBoundingBox getBoundingBox () const
 Returns the texture's bounding box.

Protected Member Functions

virtual void create ()
 Creates the texture data.

Private Member Functions

template<typename T >
osg::ref_ptr< osg::Image > createTexture (T *source, int components=1)
 Creates a properly sized osg::Image from the specified source data.

Private Attributes

boost::shared_ptr< WValueSetBasem_valueSet
 The value set from which the texture gets created.
WBoundingBox m_boundingBox
 The bounding box of the underlying grid.
boost::shared_mutex m_creationLock
 The lock for securing createTexture.

Detailed Description

This class allows simple creation of WGETexture3D by using a specified grid and value-set.

One advantage: the first call to the texture's update callback ensures texture creation. It is not created earlier.

Definition at line 97 of file WDataTexture3D.h.


Constructor & Destructor Documentation

WDataTexture3D::WDataTexture3D ( boost::shared_ptr< WValueSetBase valueSet,
boost::shared_ptr< WGridRegular3D grid 
)

Constructor.

Creates the texture. Just run it after graphics engine was initialized.

Parameters:
valueSetthe value set to use
gridthe grid to use

Definition at line 33 of file WDataTexture3D.cpp.

References WMatrixFixed< double, 4, 4 >::identity(), WGETexture< TextureType >::initTextureSize(), WGETexture< TextureType >::scale(), WGETexture< TextureType >::threshold(), WGETexture< TextureType >::transformation(), and WMatrixFixed< double, 4, 4 >::zero().

WDataTexture3D::~WDataTexture3D ( ) [virtual]

Destructor.

Definition at line 70 of file WDataTexture3D.cpp.


Member Function Documentation

void WDataTexture3D::create ( ) [protected, virtual]

Creates the texture data.

This method creates the texture during the first update traversal using the value set and grid.

Reimplemented from WGETexture< TextureType >.

Definition at line 75 of file WDataTexture3D.cpp.

References createTexture(), wlog::debug(), wlog::error(), and m_valueSet.

template<typename T >
osg::ref_ptr< osg::Image > WDataTexture3D::createTexture ( T *  source,
int  components = 1 
) [private]

Creates a properly sized osg::Image from the specified source data.

Parameters:
sourcethe source data
componentsnumber of components
Template Parameters:
Tthe type of source data
Returns:

Definition at line 184 of file WDataTexture3D.h.

References wlog::debug(), wlog::error(), m_creationLock, WGETexture< TextureType >::minimum(), WGETexture< TextureType >::scale(), and WDataTexture3DScalers::scaleInterval().

Referenced by create().

WBoundingBox WDataTexture3D::getBoundingBox ( ) const [virtual]

Returns the texture's bounding box.

This is const. Although there exists the transformation() property, it is an information property and can't be changed. This represents the underlying grid.

Returns:
the bounding box.

Reimplemented from WGETexture< TextureType >.

Definition at line 141 of file WDataTexture3D.cpp.

References m_boundingBox.


Member Data Documentation

The bounding box of the underlying grid.

Definition at line 139 of file WDataTexture3D.h.

Referenced by getBoundingBox().

boost::shared_mutex WDataTexture3D::m_creationLock [private]

The lock for securing createTexture.

Definition at line 144 of file WDataTexture3D.h.

Referenced by createTexture().

boost::shared_ptr< WValueSetBase > WDataTexture3D::m_valueSet [private]

The value set from which the texture gets created.

Definition at line 134 of file WDataTexture3D.h.

Referenced by create().


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends