OpenWalnut
1.5.0dev
|
This class allows simple creation of WGETexture3D by using a specified grid and value-set. More...
#include <WDataTexture3D.h>
Public Member Functions | |
WDataTexture3D (std::shared_ptr< WValueSetBase > valueSet, std::shared_ptr< WGridRegular3D > grid) | |
Constructor. More... | |
virtual | ~WDataTexture3D () |
Destructor. More... | |
virtual WBoundingBox | getBoundingBox () const |
Returns the texture's bounding box. More... | |
Public Member Functions inherited from WGETexture< TextureType > | |
WGETexture (double scale=1.0, double min=0.0) | |
Default constructor. More... | |
WGETexture (WGEImage::SPtr image, double scale=1.0, double min=0.0) | |
Creates texture from given image. More... | |
WGETexture (osg::Image *image, double scale=1.0, double min=0.0) | |
Creates texture from given image. More... | |
WGETexture (const WGETexture< TextureType > &texture, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
Copy the texture. More... | |
virtual | ~WGETexture () |
Destructor. More... | |
WPropString | name () const |
Returns the name property of the texture. More... | |
WPropInt | sortIndex () const |
The sorting index in the colormapper's texture list. More... | |
WPropDouble | minimum () const |
Get the minimum in the de-scaled value space. More... | |
WPropDouble | scale () const |
Get the scaling factor for de-scaling the texture. More... | |
WPropDouble | alpha () const |
Returns the alpha property. More... | |
WPropBool | clipZero () const |
Clip the values assumed to be zero. More... | |
WPropDouble | thresholdLower () const |
Returns the threshold property. More... | |
WPropDouble | thresholdUpper () const |
Returns the threshold property. More... | |
WPropBool | thresholdEnabled () const |
Returns the property responsible for enabling threshold based clipping. More... | |
WPropBool | interpolation () const |
Returns the interpolation property. More... | |
WPropSelection | colormap () const |
Returns the colormap property. More... | |
WPropBool | active () const |
Returns the active property. More... | |
WPropInterval | window () const |
Returns the window level definition for the colormap. More... | |
WPropBool | windowEnabled () const |
Returns the property responsible for enabling window based interval scaling. More... | |
WPropMatrix4X4 | transformation () const |
Returns the texture transformation matrix. More... | |
void | bind (osg::ref_ptr< osg::Node > node, size_t unit=0) |
Binds the texture to the specified node and texture unit. More... | |
std::shared_ptr< WProperties > | getProperties () const |
Return a pointer to the properties object of the dataset. More... | |
std::shared_ptr< WProperties > | getInformationProperties () const |
Return a pointer to the information properties object of the dataset. More... | |
virtual void | applyUniforms (std::string prefix, osg::StateSet *states) const |
Applies some custom uniforms to the specified state-set which directly relate to this texture. More... | |
void | setFilterMinMag (osg::Texture::FilterMode mode) |
For all the lazy guys to set the filter MIN and MAG at once. More... | |
void | setWrapSTR (osg::Texture::WrapMode mode) |
For all the lazy guys to set the wrapping for s,t and r directions at once. More... | |
virtual void | copyPropertiesExceptTransformation (osg::ref_ptr< WGETexture< TextureType > > const &from) |
Copy the values of all properties except the texture transformation into the properties of this texture. More... | |
Protected Member Functions | |
virtual void | create () |
Creates the texture data. More... | |
Protected Member Functions inherited from WGETexture< TextureType > | |
virtual void | handleUpdate () |
Handles all property updates. More... | |
virtual void | updateCallback (osg::StateAttribute *state) |
This method implements an update callback which updates the texture image if needed and several other properties like texture matrix. More... | |
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. More... | |
Private Attributes | |
std::shared_ptr< WValueSetBase > | m_valueSet |
The value set from which the texture gets created. More... | |
WBoundingBox | m_boundingBox |
The bounding box of the underlying grid. More... | |
std::shared_mutex | m_creationLock |
The lock for securing createTexture. More... | |
Additional Inherited Members | |
Public Types inherited from WGETexture< TextureType > | |
typedef osg::ref_ptr< WGETexture< TextureType > > | RPtr |
Convenience type for OSG reference pointer on WGETextures. More... | |
typedef osg::ref_ptr< WGETexture< TextureType > > | SPtr |
Convenience type for OSG reference pointer on WGETextures. More... | |
Static Public Member Functions inherited from WGETexture< TextureType > | |
static WPVBaseTypes::PV_INT | getUnsetSortIndex () |
Get the index used to refer to an unset sort index. More... | |
Static Public Attributes inherited from WGETexture< TextureType > | |
static std::size_t const | MAX_NUMBER_OF_TEXTURES = 8 |
We support only 8 textures because some known hardware does not support more texture coordinates. More... | |
static std::size_t const | MAX_TEXTURE_DIMENSION = 2048 |
The maximum texture dimension. More... | |
Static Protected Member Functions inherited from WGETexture< TextureType > | |
static void | initTextureSize (osg::Texture1D *texture, int width, int height, int depth) |
Initialize the size of the texture properly according to real texture type (1D,2D,3D). More... | |
static void | initTextureSize (osg::Texture2D *texture, int width, int height, int depth) |
Initialize the size of the texture properly according to real texture type (1D,2D,3D). More... | |
static void | initTextureSize (osg::Texture3D *texture, int width, int height, int depth) |
Initialize the size of the texture properly according to real texture type (1D,2D,3D). More... | |
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 | ( | std::shared_ptr< WValueSetBase > | valueSet, |
std::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 32 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().
|
virtual |
Destructor.
Definition at line 78 of file WDataTexture3D.cpp.
|
protectedvirtual |
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 83 of file WDataTexture3D.cpp.
References m_valueSet.
|
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().
|
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 177 of file WDataTexture3D.cpp.
References m_boundingBox.
|
private |
The bounding box of the underlying grid.
Definition at line 135 of file WDataTexture3D.h.
Referenced by getBoundingBox().
|
private |
The lock for securing createTexture.
Definition at line 140 of file WDataTexture3D.h.
Referenced by createTexture().
|
private |
The value set from which the texture gets created.
Definition at line 130 of file WDataTexture3D.h.
Referenced by create().