OpenWalnut
1.4.0
|
This class allows simple creation of WGETexture3D by using a specified grid and value-set. More...
#include <WDataTexture3D.h>
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< WValueSetBase > | m_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. |
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 96 of file WDataTexture3D.h.
WDataTexture3D::WDataTexture3D | ( | boost::shared_ptr< WValueSetBase > | valueSet, |
boost::shared_ptr< WGridRegular3D > | grid | ||
) |
Constructor.
Creates the texture. Just run it after graphics engine was initialized.
valueSet | the value set to use |
grid | the grid to use |
Definition at line 31 of file WDataTexture3D.cpp.
References WMatrixFixed< double, 4, 4 >::identity(), WGETexture< TextureType >::initTextureSize(), WGETexture< TextureType >::scale(), WGETexture< TextureType >::thresholdLower(), WGETexture< TextureType >::thresholdUpper(), WGETexture< TextureType >::transformation(), WGETexture< TextureType >::window(), and WMatrixFixed< double, 4, 4 >::zero().
WDataTexture3D::~WDataTexture3D | ( | ) | [virtual] |
Destructor.
Definition at line 74 of file WDataTexture3D.cpp.
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 79 of file WDataTexture3D.cpp.
References createTexture(), wlog::debug(), wlog::error(), and m_valueSet.
osg::ref_ptr< osg::Image > WDataTexture3D::createTexture | ( | T * | source, |
int | components = 1 |
||
) | [private] |
Creates a properly sized osg::Image from the specified source data.
source | the source data |
components | number of components |
T | the type of source data |
Definition at line 180 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.
Reimplemented from WGETexture< TextureType >.
Definition at line 173 of file WDataTexture3D.cpp.
References m_boundingBox.
WBoundingBox WDataTexture3D::m_boundingBox [private] |
The bounding box of the underlying grid.
Definition at line 135 of file WDataTexture3D.h.
Referenced by getBoundingBox().
boost::shared_mutex WDataTexture3D::m_creationLock [private] |
The lock for securing createTexture.
Definition at line 140 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 130 of file WDataTexture3D.h.
Referenced by create().