OpenWalnut  1.4.0
WGETexture.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WGETEXTURE_H
26 #define WGETEXTURE_H
27 
28 #include <string>
29 #include <limits>
30 
31 #include <boost/shared_ptr.hpp>
32 
33 #include <osg/Node>
34 #include <osg/StateSet>
35 #include <osg/Texture>
36 #include <osg/Texture1D>
37 #include <osg/Texture2D>
38 #include <osg/Texture3D>
39 
40 #include "callbacks/WGEFunctorCallback.h"
41 #include "../common/WBoundingBox.h"
42 #include "../common/WProperties.h"
43 #include "../common/WPropertyTypes.h"
44 #include "../common/WPropertyHelper.h"
45 
46 #include "WGETextureUtils.h"
47 
48 /**
49  * This calls serves a simple purpose: have a texture and its scaling information together which allows very easy binding of textures to nodes
50  * with associated shaders. When this texture gets bind using the bindTo methods, uniforms get added containing needed scaling information.
51  */
52 template < typename TextureType = osg::Texture >
53 class WGETexture: public TextureType
54 {
55 public:
56  /**
57  * Convenience type for OSG reference pointer on WGETextures.
58  */
59  typedef osg::ref_ptr< WGETexture< TextureType > > RPtr;
60 
61  //! We support only 8 textures because some known hardware does not support more texture coordinates.
62  static std::size_t const MAX_NUMBER_OF_TEXTURES = 8;
63 
64  //! The maximum texture dimension.
65  static std::size_t const MAX_TEXTURE_DIMENSION = 2048;
66 
67  /**
68  * Default constructor. Creates an empty instance of the texture.
69  *
70  * \param scale the scaling factor needed for de-scaling the texture values
71  * \param min the minimum value allowing negative values too.
72  */
73  WGETexture( double scale = 1.0, double min = 0.0 );
74 
75  /**
76  * Creates texture from given image. Scaling is set to identity.
77  *
78  * \param image the image to use as texture
79  * \param scale the scaling factor needed for de-scaling the texture values
80  * \param min the minimum value allowing negative values too.
81  */
82  WGETexture( osg::Image* image, double scale = 1.0, double min = 0.0 );
83 
84  /**
85  * Copy the texture.
86  *
87  * \param texture the texture to copy
88  * \param copyop
89  */
90  WGETexture( const WGETexture< TextureType >& texture, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY );
91 
92  /**
93  * Destructor.
94  */
95  virtual ~WGETexture();
96 
97  /**
98  * Returns the name property of the texture. You should set it if you create a texture.
99  *
100  * \return texture name property
101  */
102  WPropString name() const;
103 
104  /**
105  * The sorting index in the colormapper's texture list.
106  *
107  * \return the property.
108  */
109  WPropInt sortIndex() const;
110 
111  /**
112  * Get the index used to refer to an unset sort index.
113  *
114  * \return the value.
115  */
117 
118  /**
119  * Get the minimum in the de-scaled value space. The property can be changed. A change affects all colormaps using this texture. But be
120  * careful as the texture creating depends on these values.
121  *
122  * \return the minimum
123  */
124  WPropDouble minimum() const;
125 
126  /**
127  * Get the scaling factor for de-scaling the texture. The property can be changed. A change affects all colormaps using this texture. But be
128  * careful as the texture creating depends on these values.
129  *
130  * \return the scale
131  */
132  WPropDouble scale() const;
133 
134  /**
135  * Returns the alpha property. The property can be changed. A change affects all colormaps using this texture.
136  *
137  * \return alpha property
138  */
139  WPropDouble alpha() const;
140 
141  /**
142  * Clip the values assumed to be zero.
143  *
144  * \return true to clip.
145  */
146  WPropBool clipZero() const;
147 
148  /**
149  * Returns the threshold property. The property can be changed. A change affects all colormaps using this texture.
150  *
151  * \return threshold property
152  */
153  WPropDouble thresholdLower() const;
154 
155  /**
156  * Returns the threshold property. The property can be changed. A change affects all colormaps using this texture.
157  *
158  * \return threshold property
159  */
160  WPropDouble thresholdUpper() const;
161 
162  /**
163  * Returns the property responsible for enabling threshold based clipping. If this is false, the threshold is ignored.
164  *
165  * \return threshold-enable property.
166  */
167  WPropBool thresholdEnabled() const;
168 
169  /**
170  * Returns the interpolation property. The property can be changed. A change affects all colormaps using this texture.
171  *
172  * \return interpolation property
173  */
174  WPropBool interpolation() const;
175 
176  /**
177  * Returns the colormap property. The property can be changed. A change affects all colormaps using this texture.
178  *
179  * \return colormap property
180  */
181  WPropSelection colormap() const;
182 
183  /**
184  * Returns the active property. The property can be changed. A change affects all colormaps using this texture.
185  *
186  * \return active property
187  */
188  WPropBool active() const;
189 
190  /**
191  * Returns the window level definition for the colormap. The property can be changed. A change affects all colormaps using this texture.
192  *
193  * \return window colormap
194  */
195  WPropInterval window() const;
196 
197  /**
198  * Returns the property responsible for enabling window based interval scaling. If this is false, the window setting is ignored.
199  *
200  * \return windowing-enable property.
201  */
202  WPropBool windowEnabled() const;
203 
204  /**
205  * Returns the texture transformation matrix. The property can be changed. A change affects all colormaps using this texture. This matrix
206  * converts an world-space coordinate to an texture coordinate! This can be seen as a scaled inverse matrix of the grid's transformation.
207  *
208  * \return the matrix
209  */
210  WPropMatrix4X4 transformation() const;
211 
212  /**
213  * Binds the texture to the specified node and texture unit. It also adds two uniforms: u_textureXMin and u_textureXScale, where X
214  * is the unit number. This can be used in shaders to unscale it.
215  *
216  * \param node the node where to bind the texture to
217  * \param unit the unit, by default 0
218  */
219  void bind( osg::ref_ptr< osg::Node > node, size_t unit = 0 );
220 
221  /**
222  * Return a pointer to the properties object of the dataset. Add all the modifiable settings here. This allows the user to modify several
223  * properties of a dataset.
224  *
225  * \return the properties.
226  */
227  boost::shared_ptr< WProperties > getProperties() const;
228 
229  /**
230  * Return a pointer to the information properties object of the dataset. The dataset intends these properties to not be modified.
231  *
232  * \return the properties.
233  */
234  boost::shared_ptr< WProperties > getInformationProperties() const;
235 
236  /**
237  * Applies some custom uniforms to the specified state-set which directly relate to this texture
238  *
239  * \param prefix the prefix used for the uniforms
240  * \param states the state where to add the uniforms
241  */
242  virtual void applyUniforms( std::string prefix, osg::StateSet* states ) const;
243 
244  /**
245  * For all the lazy guys to set the filter MIN and MAG at once.
246  *
247  * \param mode the new mode for MIN_FILTER and MAG_FILTER.
248  */
249  void setFilterMinMag( osg::Texture::FilterMode mode );
250 
251  /**
252  * For all the lazy guys to set the wrapping for s,t and r directions at once.
253  *
254  * \param mode the new mode for WRAP_S, WRAP_T and WRAP_R.
255  */
256  void setWrapSTR( osg::Texture::WrapMode mode );
257 
258  /**
259  * Returns the texture's bounding box. This is const. Although there exists the transformation() property, it is an information property and
260  * can't be changed.
261  *
262  * \return the bounding box.
263  */
264  virtual WBoundingBox getBoundingBox() const;
265 
266 protected:
267  /**
268  * Handles all property updates. Called by m_propCondition.
269  */
270  virtual void handleUpdate();
271 
272  /**
273  * Creates the texture data. Overwrite this method if you want to provide a custom texture creation procedure.
274  */
275  virtual void create();
276 
277  /**
278  * This method implements an update callback which updates the texture image if needed and several other properties like texture matrix.
279  *
280  * \param state the state to update
281  */
282  virtual void updateCallback( osg::StateAttribute* state );
283 
284  /**
285  * Initialize the size of the texture properly according to real texture type (1D,2D,3D).
286  * \note This is needed because osg::Texture::setImage is not virtual and does not set the size from the image.
287  *
288  * \param texture the texture where to set the size
289  * \param width the new width
290  * \param height the new height
291  * \param depth the new depth
292  */
293  static void initTextureSize( osg::Texture1D* texture, int width, int height, int depth );
294 
295  /**
296  * Initialize the size of the texture properly according to real texture type (1D,2D,3D).
297  * \note This is needed because osg::Texture::setImage is not virtual and does not set the size from the image.
298  *
299  * \param texture the texture where to set the size
300  * \param width the new width
301  * \param height the new height
302  * \param depth the new depth
303  */
304  static void initTextureSize( osg::Texture2D* texture, int width, int height, int depth );
305 
306  /**
307  * Initialize the size of the texture properly according to real texture type (1D,2D,3D).
308  * \note This is needed because osg::Texture::setImage is not virtual and does not set the size from the image.
309  *
310  * \param texture the texture where to set the size
311  * \param width the new width
312  * \param height the new height
313  * \param depth the new depth
314  */
315  static void initTextureSize( osg::Texture3D* texture, int width, int height, int depth );
316 
317 private:
318  /**
319  * Creates and assigns all properties.
320  *
321  * \param min the min value of the texture
322  * \param scale the scale value of the texture
323  */
324  void setupProperties( double scale, double min );
325 
326  /**
327  * A condition used to notify about changes in several properties.
328  */
329  boost::shared_ptr< WCondition > m_propCondition;
330 
331  /**
332  * The property object for the dataset.
333  */
334  boost::shared_ptr< WProperties > m_properties;
335 
336  /**
337  * The property object for the dataset containing only props whose purpose is "PV_PURPOSE_INFORMNATION". It is useful to define some property
338  * to only be of informational nature. The GUI does not modify them. As it is a WProperties instance, you can use it the same way as
339  * m_properties.
340  */
341  boost::shared_ptr< WProperties > m_infoProperties;
342 
343  /**
344  * If true, the texture gets created. This is used to create texture on demand.
345  */
347 
348  /**
349  * The texture name. This might be useful to identify textures.
350  */
351  WPropString m_name;
352 
353  /**
354  * The sort index of the texture. This is important for restoring and saving the colormapper's sorting.
355  */
356  WPropInt m_sortIdx;
357 
358  /**
359  * The minimum of each value in the texture in unscaled space.
360  */
361  WPropDouble m_min;
362 
363  /**
364  * The scaling factor to de-scale a [0-1] texture to original space.
365  */
366  WPropDouble m_scale;
367 
368  /**
369  * A list of color map selection types
370  */
371  boost::shared_ptr< WItemSelection > m_colorMapSelectionsList;
372 
373  /**
374  * Selection property for color map
375  */
376  WPropSelection m_colorMap;
377 
378  /**
379  * Alpha blending value.
380  */
381  WPropDouble m_alpha;
382 
383  /**
384  * If set to true, zero values are clipped by making them transparent
385  */
386  WPropBool m_clipZero;
387 
388  /**
389  * Threshold for clipping areas.
390  */
391  WPropDouble m_thresholdLower;
392 
393  /**
394  * Threshold for clipping areas.
395  */
396  WPropDouble m_thresholdUpper;
397 
398  /**
399  * Threshold-enable flag.
400  */
402 
403  /**
404  * True if interpolation should be used.
405  */
406  WPropBool m_interpolation;
407 
408  /**
409  * True if the texture is active.
410  */
411  WPropBool m_active;
412 
413  /**
414  * The texture transformation matrix.
415  */
416  WPropMatrix4X4 m_texMatrix;
417 
418  /**
419  * Window level setting for the current colormap
420  */
421  WPropInterval m_window;
422 
423  /**
424  * Window-Level-Setting-enable flag.
425  */
426  WPropBool m_windowEnabled;
427 };
428 
429 // Some convenience typedefs
430 
431 /**
432  * OSG's Texture1D with scaling features
433  */
435 
436 /**
437  * OSG's Texture2D with scaling features
438  */
440 
441 /**
442  * OSG's Texture3D with scaling features
443  */
445 
446 
447 template < typename TextureType >
448 WGETexture< TextureType >::WGETexture( double scale, double min ):
449  TextureType(),
450  m_propCondition( boost::shared_ptr< WCondition >( new WCondition() ) ),
451  m_properties( boost::shared_ptr< WProperties >( new WProperties( "Texture Properties", "Properties of a texture." ) ) ),
452  m_infoProperties( boost::shared_ptr< WProperties >( new WProperties( "Texture Info Properties", "Texture's information properties." ) ) ),
453  m_needCreate( true )
454 {
455  setupProperties( scale, min );
456 }
457 
458 template < typename TextureType >
459 WGETexture< TextureType >::WGETexture( osg::Image* image, double scale, double min ):
460  TextureType( image ),
461  m_propCondition( boost::shared_ptr< WCondition >( new WCondition() ) ),
462  m_properties( boost::shared_ptr< WProperties >( new WProperties( "Texture Properties", "Properties of a texture." ) ) ),
463  m_infoProperties( boost::shared_ptr< WProperties >( new WProperties( "Texture Info Properties", "Texture's information properties." ) ) ),
464  m_needCreate( true )
465 {
466  setupProperties( scale, min );
467  WGETexture< TextureType >::initTextureSize( this, image->s(), image->t(), image->r() );
468 }
469 
470 template < typename TextureType >
471 WGETexture< TextureType >::WGETexture( const WGETexture< TextureType >& texture, const osg::CopyOp& copyop ):
472  TextureType( texture, copyop ),
473  m_min( texture.m_min ),
474  m_scale( texture.m_scale )
475 {
476  // initialize members
477 }
478 
479 template < typename TextureType >
480 void WGETexture< TextureType >::setupProperties( double scale, double min )
481 {
482  m_propCondition->subscribeSignal( boost::bind( &WGETexture< TextureType >::handleUpdate, this ) );
483 
484  m_name = m_properties->addProperty( "Name", "The name of the texture.", std::string( "Unnamed" ) );
485 
486  m_sortIdx = m_properties->addProperty( "Sort Index",
487  "The index specifies the index in the colormapper, used to restore colormapper sorting on load.",
488  getUnsetSortIndex() );
489  m_sortIdx->setHidden( true );
490 
491  // initialize members
492  m_min = m_properties->addProperty( "Minimum", "The minimum value in the original space.", min, true );
493  m_min->removeConstraint( m_min->getMin() );
494  m_min->removeConstraint( m_min->getMax() );
495 
496  m_scale = m_properties->addProperty( "Scale", "The scaling factor to un-scale the texture values to the original space.", scale, true );
497  m_scale->removeConstraint( m_scale->getMin() );
498  m_scale->removeConstraint( m_scale->getMax() );
499 
500  m_alpha = m_properties->addProperty( "Alpha", "The alpha blending value.", 1.0 );
501  m_alpha->setMin( 0.0 );
502  m_alpha->setMax( 1.0 );
503 
504  m_clipZero = m_properties->addProperty( "Enable Zero Clip", "If enabled, zero values are clipped.", true );
505 
506  m_thresholdEnabled = m_properties->addProperty( "Enable Threshold",
507  "If enabled, threshold based clipping is used. If not, threshold is ignored.", false );
508 
509  m_thresholdLower = m_properties->addProperty( "Lower Threshold", "The threshold used to clip areas below the specified value.", 0.0 );
510  m_thresholdLower->setMin( min );
511  m_thresholdLower->setMax( min + scale );
512 
513  m_thresholdUpper = m_properties->addProperty( "Upper Threshold", "The threshold used to clip areas above the specified value.", 1.0 );
514  m_thresholdUpper->setMin( min );
515  m_thresholdUpper->setMax( min + scale );
516 
517  m_windowEnabled = m_properties->addProperty( "Enable Windowing", "If enabled, window level settings are applied.", false );
518  m_window = m_properties->addProperty( "Window Level", "Define the interval in the data which is mapped to the colormap.",
519  make_interval( 0.0, 1.0 ) );
520 
521  m_interpolation = m_properties->addProperty( "Interpolate", "Interpolation of the volume data.", true, m_propCondition );
522 
523  m_colorMapSelectionsList = boost::shared_ptr< WItemSelection >( new WItemSelection() );
524  m_colorMapSelectionsList->addItem( "Grayscale", "" );
525  m_colorMapSelectionsList->addItem( "Rainbow", "" );
526  m_colorMapSelectionsList->addItem( "Hot iron", "" );
527  m_colorMapSelectionsList->addItem( "Negative to positive", "" );
528  m_colorMapSelectionsList->addItem( "Atlas", "" );
529  m_colorMapSelectionsList->addItem( "Blue-Green-Purple", "" );
530  m_colorMapSelectionsList->addItem( "Vector", "" );
531 
532  m_colorMap = m_properties->addProperty( "Colormap", "The colormap of this texture.", m_colorMapSelectionsList->getSelectorFirst() );
534 
535  m_active = m_properties->addProperty( "Active", "Can dis-enable a texture.", true );
536 
538  m_texMatrix = m_properties->addProperty( "Texture Transformation", "Usable to transform the texture.", m );
539  m_texMatrix->setHidden();
540  m_texMatrix->setPurpose( PV_PURPOSE_INFORMATION );
541 
542  TextureType::setResizeNonPowerOfTwoHint( false );
543  TextureType::setUpdateCallback( new WGEFunctorCallback< osg::StateAttribute >(
544  boost::bind( &WGETexture< TextureType >::updateCallback, this, _1 ) )
545  );
546 
547  // init filters
548  TextureType::setFilter( osg::Texture::MIN_FILTER, m_interpolation->get( true ) ? osg::Texture::LINEAR : osg::Texture::NEAREST );
549  TextureType::setFilter( osg::Texture::MAG_FILTER, m_interpolation->get( true ) ? osg::Texture::LINEAR : osg::Texture::NEAREST );
550 }
551 
552 template < typename TextureType >
554 {
555  // cleanup.
556 }
557 
558 template < typename TextureType >
559 boost::shared_ptr< WProperties > WGETexture< TextureType >::getProperties() const
560 {
561  return m_properties;
562 }
563 
564 template < typename TextureType >
565 boost::shared_ptr< WProperties > WGETexture< TextureType >::getInformationProperties() const
566 {
567  return m_infoProperties;
568 }
569 
570 template < typename TextureType >
571 inline WPropString WGETexture< TextureType >::name() const
572 {
573  return m_name;
574 }
575 
576 template < typename TextureType >
578 {
579  return m_sortIdx;
580 }
581 
582 template < typename TextureType >
583 inline WPropDouble WGETexture< TextureType >::minimum() const
584 {
585  return m_min;
586 }
587 
588 template < typename TextureType >
589 inline WPropDouble WGETexture< TextureType >::scale() const
590 {
591  return m_scale;
592 }
593 
594 template < typename TextureType >
595 inline WPropDouble WGETexture< TextureType >::alpha() const
596 {
597  return m_alpha;
598 }
599 
600 template < typename TextureType >
601 inline WPropBool WGETexture< TextureType >::clipZero() const
602 {
603  return m_clipZero;
604 }
605 
606 template < typename TextureType >
608 {
609  return m_thresholdLower;
610 }
611 
612 template < typename TextureType >
614 {
615  return m_thresholdUpper;
616 }
617 
618 template < typename TextureType >
620 {
621  return m_thresholdEnabled;
622 }
623 
624 template < typename TextureType >
626 {
627  return m_interpolation;
628 }
629 
630 template < typename TextureType >
631 inline WPropSelection WGETexture< TextureType >::colormap() const
632 {
633  return m_colorMap;
634 }
635 
636 template < typename TextureType >
637 inline WPropBool WGETexture< TextureType >::active() const
638 {
639  return m_active;
640 }
641 
642 template < typename TextureType >
644 {
645  return m_windowEnabled;
646 }
647 
648 template < typename TextureType >
649 inline WPropInterval WGETexture< TextureType >::window() const
650 {
651  return m_window;
652 }
653 
654 template < typename TextureType >
655 inline WPropMatrix4X4 WGETexture< TextureType >::transformation() const
656 {
657  return m_texMatrix;
658 }
659 
660 template < typename TextureType >
662 {
663  if( m_interpolation->changed() )
664  {
665  TextureType::setFilter( osg::Texture::MIN_FILTER, m_interpolation->get( true ) ? osg::Texture::LINEAR : osg::Texture::NEAREST );
666  TextureType::setFilter( osg::Texture::MAG_FILTER, m_interpolation->get( true ) ? osg::Texture::LINEAR : osg::Texture::NEAREST );
667  }
668 }
669 
670 template < typename TextureType >
671 void WGETexture< TextureType >::applyUniforms( std::string prefix, osg::StateSet* states ) const
672 {
673  states->addUniform( new WGEPropertyUniform< WPropDouble >( prefix + "Min", minimum() ) );
674  states->addUniform( new WGEPropertyUniform< WPropDouble >( prefix + "Scale", scale() ) );
675  states->addUniform( new WGEPropertyUniform< WPropDouble >( prefix + "Alpha", alpha() ) );
676  states->addUniform( new WGEPropertyUniform< WPropBool >( prefix + "ClipZeroEnabled", clipZero() ) );
677  states->addUniform( new WGEPropertyUniform< WPropBool >( prefix + "ThresholdEnabled", thresholdEnabled() ) );
678  states->addUniform( new WGEPropertyUniform< WPropDouble >( prefix + "ThresholdLower", thresholdLower() ) );
679  states->addUniform( new WGEPropertyUniform< WPropDouble >( prefix + "ThresholdUpper", thresholdUpper() ) );
680  states->addUniform( new WGEPropertyUniform< WPropSelection >( prefix + "Colormap", colormap() ) );
681  states->addUniform( new WGEPropertyUniform< WPropBool >( prefix + "Active", active() ) );
682  states->addUniform( new WGEPropertyUniform< WPropBool >( prefix + "WindowEnabled", windowEnabled() ) );
683  states->addUniform( new WGEPropertyUniform< WPropInterval >( prefix + "Window", window() ) );
684 }
685 
686 template < typename TextureType >
687 void WGETexture< TextureType >::bind( osg::ref_ptr< osg::Node > node, size_t unit )
688 {
689  // let our utilities do the work
690  wge::bindTexture( node, osg::ref_ptr< WGETexture< TextureType > >( this ), unit ); // to avoid recursive stuff -> explicitly specify the type
691 }
692 
693 template < typename TextureType >
695 {
696  // do nothing. Derived classes may implement this.
697 }
698 
699 template < typename TextureType >
700 void WGETexture< TextureType >::updateCallback( osg::StateAttribute* /*state*/ )
701 {
702  // create if not done yet
703  if( m_needCreate )
704  {
705  m_needCreate = false;
706  create();
707  TextureType::dirtyTextureObject();
708  }
709 }
710 
711 template < typename TextureType >
712 void WGETexture< TextureType >::setFilterMinMag( osg::Texture::FilterMode mode )
713 {
714  this->setFilter( osg::Texture2D::MIN_FILTER, mode );
715  this->setFilter( osg::Texture2D::MAG_FILTER, mode );
716 }
717 
718 template < typename TextureType >
719 void WGETexture< TextureType >::setWrapSTR( osg::Texture::WrapMode mode )
720 {
721  this->setWrap( osg::Texture2D::WRAP_S, mode );
722  this->setWrap( osg::Texture2D::WRAP_T, mode );
723  this->setWrap( osg::Texture2D::WRAP_R, mode );
724 }
725 
726 template < typename TextureType >
727 void WGETexture< TextureType >::initTextureSize( osg::Texture1D* texture, int width, int /*height*/, int /*depth*/ )
728 {
729  texture->setTextureWidth( width );
730 }
731 
732 template < typename TextureType >
733 void WGETexture< TextureType >::initTextureSize( osg::Texture2D* texture, int width, int height, int /*depth*/ )
734 {
735  texture->setTextureSize( width, height );
736 }
737 
738 template < typename TextureType >
739 void WGETexture< TextureType >::initTextureSize( osg::Texture3D* texture, int width, int height, int depth )
740 {
741  texture->setTextureSize( width, height, depth );
742 }
743 
744 template < typename TextureType >
746 {
747  return WBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 );
748 }
749 
750 template < typename TextureType >
752 {
753  return std::numeric_limits< WPVBaseTypes::PV_INT >::max();
754 }
755 
756 #endif // WGETEXTURE_H
757