VTK
dox/Rendering/Volume/vtkVolumeTextureMapper2D.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkVolumeTextureMapper2D.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00031 #ifndef __vtkVolumeTextureMapper2D_h
00032 #define __vtkVolumeTextureMapper2D_h
00033 
00034 #include "vtkRenderingVolumeModule.h" // For export macro
00035 #include "vtkVolumeTextureMapper.h"
00036 
00037 class VTKRENDERINGVOLUME_EXPORT vtkVolumeTextureMapper2D : public vtkVolumeTextureMapper
00038 {
00039 public:
00040   vtkTypeMacro(vtkVolumeTextureMapper2D,vtkVolumeTextureMapper);
00041   void PrintSelf( ostream& os, vtkIndent indent );
00042 
00043   static vtkVolumeTextureMapper2D *New();
00044 
00046 
00051   vtkSetVector2Macro( TargetTextureSize, int );
00052   vtkGetVector2Macro( TargetTextureSize, int );
00054 
00056 
00061   vtkSetMacro( MaximumNumberOfPlanes, int );
00062   vtkGetMacro( MaximumNumberOfPlanes, int );
00064 
00066 
00070   vtkSetMacro( MaximumStorageSize, int );
00071   vtkGetMacro( MaximumStorageSize, int );
00073 
00074 //BTX
00075 
00078   virtual void Render(vtkRenderer *, vtkVolume *) {};
00079 
00080   virtual void RenderQuads( int vtkNotUsed(count),
00081                             float *vtkNotUsed(v), float *vtkNotUsed(t),
00082                             unsigned char *vtkNotUsed(texture),
00083                             int vtkNotUsed(size)[2],
00084                             int vtkNotUsed(reverseFlag)) {};
00085 
00088   int GetInternalSkipFactor() {return this->InternalSkipFactor;};
00089 
00090   int *GetAxisTextureSize() {return &(this->AxisTextureSize[0][0]);};
00091 
00092   int GetSaveTextures() {return this->SaveTextures;};
00093 
00094   unsigned char *GetTexture() {return this->Texture;};
00095 
00096 //ETX
00097 
00098 
00099 protected:
00100   vtkVolumeTextureMapper2D();
00101   ~vtkVolumeTextureMapper2D();
00102 
00103   void InitializeRender( vtkRenderer *ren, vtkVolume *vol )
00104     {this->InitializeRender( ren, vol, -1 );}
00105 
00106   void InitializeRender( vtkRenderer *ren, vtkVolume *vol, int majorDirection );
00107 
00108   void GenerateTexturesAndRenderQuads( vtkRenderer *ren, vtkVolume *vol );
00109 
00110   int  MajorDirection;
00111   int  TargetTextureSize[2];
00112 
00113   int  MaximumNumberOfPlanes;
00114   int  InternalSkipFactor;
00115   int  MaximumStorageSize;
00116 
00117   unsigned char  *Texture;
00118   int             TextureSize;
00119   int             SaveTextures;
00120   vtkTimeStamp    TextureMTime;
00121 
00122   int             AxisTextureSize[3][3];
00123   void            ComputeAxisTextureSize( int axis, int *size );
00124 
00125   void           RenderSavedTexture();
00126 
00127 private:
00128   vtkVolumeTextureMapper2D(const vtkVolumeTextureMapper2D&);  // Not implemented.
00129   void operator=(const vtkVolumeTextureMapper2D&);  // Not implemented.
00130 };
00131 
00132 
00133 #endif
00134 
00135