Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkVolume.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkVolume.h,v $
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 =========================================================================*/
00036 #ifndef __vtkVolume_h
00037 #define __vtkVolume_h
00038 
00039 #include "vtkProp3D.h"
00040 
00041 class vtkRenderer;
00042 class vtkPropCollection;
00043 class vtkVolumeCollection;
00044 class vtkWindow;
00045 class vtkVolumeProperty;
00046 class vtkAbstractVolumeMapper;
00047 
00048 class VTK_RENDERING_EXPORT vtkVolume : public vtkProp3D
00049 {
00050 public:
00051   vtkTypeRevisionMacro(vtkVolume,vtkProp3D);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00053 
00057   static vtkVolume *New();
00058 
00060 
00061   void SetMapper(vtkAbstractVolumeMapper *mapper);
00062   vtkGetObjectMacro(Mapper, vtkAbstractVolumeMapper);
00064 
00066 
00067   void SetProperty(vtkVolumeProperty *property);
00068   vtkVolumeProperty *GetProperty();
00070 
00074   void GetVolumes(vtkPropCollection *vc);
00075 
00077   void Update();
00078 
00080 
00082   double *GetBounds();
00083   void GetBounds(double bounds[6]) { this->vtkProp3D::GetBounds( bounds ); };
00084   double GetMinXBound();
00085   double GetMaxXBound();
00086   double GetMinYBound();
00087   double GetMaxYBound();
00088   double GetMinZBound();
00089   double GetMaxZBound();
00091 
00093   unsigned long int GetMTime();
00094 
00099   unsigned long GetRedrawMTime();
00100 
00102   void ShallowCopy(vtkProp *prop);
00103 
00104 //BTX
00110   int RenderTranslucentGeometry(vtkViewport *viewport);
00111 
00116   void ReleaseGraphicsResources(vtkWindow *);
00117 
00119 
00121   float *GetCorrectedScalarOpacityArray(int);
00122   float *GetCorrectedScalarOpacityArray()
00123     {return this->GetCorrectedScalarOpacityArray(0);};
00125 
00127 
00129   float *GetScalarOpacityArray(int);
00130   float *GetScalarOpacityArray(){return this->GetScalarOpacityArray(0);};
00132 
00134 
00136   float *GetGradientOpacityArray(int);
00137   float *GetGradientOpacityArray(){return this->GetGradientOpacityArray(0);};
00139 
00141 
00143   float *GetGrayArray(int);
00144   float *GetGrayArray(){return this->GetGrayArray(0);};
00146 
00148 
00150   float *GetRGBArray(int);
00151   float *GetRGBArray(){return this->GetRGBArray(0);};
00153 
00155 
00157   float  GetGradientOpacityConstant(int);
00158   float  GetGradientOpacityConstant()
00159     {return this->GetGradientOpacityConstant(0);};
00161 
00164   float  GetArraySize () { return static_cast<float>(this->ArraySize); };
00165 
00168   void UpdateTransferFunctions( vtkRenderer *ren );
00169 
00171 
00173   void UpdateScalarOpacityforSampleSize( vtkRenderer *ren, 
00174                                          float sample_distance );
00176 
00177 //ETX
00178 
00179 protected:
00180   vtkVolume();
00181   ~vtkVolume();
00182 
00183   vtkAbstractVolumeMapper      *Mapper;
00184   vtkVolumeProperty            *Property;
00185 
00186   // The rgb transfer function array - for unsigned char data this
00187   // is 256 elements, for short or unsigned short it is 65536 elements
00188   // This is a sample at each scalar value of the rgb transfer
00189   // function.  A time stamp is kept to know when it needs rebuilding
00190   float                *RGBArray[VTK_MAX_VRCOMP];
00191   vtkTimeStamp          RGBArrayMTime[VTK_MAX_VRCOMP];
00192 
00193   // The gray transfer function array - for unsigned char data this
00194   // is 256 elements, for short or unsigned short it is 65536 elements
00195   // This is a sample at each scalar value of the gray transfer
00196   // function.  A time stamp is kept to know when it needs rebuilding
00197   float                *GrayArray[VTK_MAX_VRCOMP];
00198   vtkTimeStamp          GrayArrayMTime[VTK_MAX_VRCOMP];
00199 
00200   // The scalar opacity transfer function array - for unsigned char data this
00201   // is 256 elements, for short or unsigned short it is 65536 elements
00202   // This is a sample at each scalar value of the opacity transfer
00203   // function.  A time stamp is kept to know when it needs rebuilding
00204   float                *ScalarOpacityArray[VTK_MAX_VRCOMP];
00205   vtkTimeStamp          ScalarOpacityArrayMTime[VTK_MAX_VRCOMP];
00206 
00207   // The corrected scalar opacity transfer function array - this is identical
00208   // to the opacity transfer function array when the step size is 1.
00209   // In other cases, it is corrected to reflect the new material thickness
00210   // modeled by a step size different than 1.
00211   float                *CorrectedScalarOpacityArray[VTK_MAX_VRCOMP];
00212   vtkTimeStamp          CorrectedScalarOpacityArrayMTime[VTK_MAX_VRCOMP];
00213 
00214   // CorrectedStepSize is the step size currently modeled by
00215   // CorrectedArray.  It is used to determine when the 
00216   // CorrectedArray needs to be updated to match SampleDistance
00217   // in the volume mapper.
00218   float                CorrectedStepSize;
00219 
00220   // Number of elements in the rgb, gray, and opacity transfer function arrays
00221   int                  ArraySize;
00222 
00223   // The magnitude of gradient opacity transfer function array
00224   float                GradientOpacityArray[VTK_MAX_VRCOMP][256];
00225   float                GradientOpacityConstant[VTK_MAX_VRCOMP];
00226   vtkTimeStamp         GradientOpacityArrayMTime[VTK_MAX_VRCOMP];
00227 
00228   // Function to compute screen coverage of this volume
00229   float ComputeScreenCoverage( vtkViewport *vp );
00230   
00231 private:
00232   vtkVolume(const vtkVolume&);  // Not implemented.
00233   void operator=(const vtkVolume&);  // Not implemented.
00234 };
00235 
00236 #endif
00237 

Generated on Mon Jan 21 23:07:36 2008 for VTK by  doxygen 1.4.3-20050530