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

vtkUnstructuredGridVolumeRayCastMapper.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkUnstructuredGridVolumeRayCastMapper.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 =========================================================================*/
00015 
00031 #ifndef __vtkUnstructuredGridVolumeRayCastMapper_h
00032 #define __vtkUnstructuredGridVolumeRayCastMapper_h
00033 
00034 #include "vtkUnstructuredGridVolumeMapper.h"
00035 
00036 class vtkMultiThreader;
00037 class vtkRenderer;
00038 class vtkTimerLog;
00039 class vtkVolume;
00040 class vtkUnstructuredGridVolumeRayCastFunction;
00041 class vtkUnstructuredGridVolumeRayCastIterator;
00042 class vtkUnstructuredGridVolumeRayIntegrator;
00043 class vtkRayCastImageDisplayHelper;
00044 
00045 class VTK_VOLUMERENDERING_EXPORT vtkUnstructuredGridVolumeRayCastMapper : public vtkUnstructuredGridVolumeMapper
00046 {
00047 public:
00048   static vtkUnstructuredGridVolumeRayCastMapper *New();
00049   vtkTypeRevisionMacro(vtkUnstructuredGridVolumeRayCastMapper,vtkUnstructuredGridVolumeMapper);
00050   void PrintSelf( ostream& os, vtkIndent indent );
00051 
00053 
00063   vtkSetMacro(ScalarMode,int);
00064   vtkGetMacro(ScalarMode,int);
00065   void SetScalarModeToDefault() {
00066     this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);};
00067   void SetScalarModeToUsePointData() {
00068     this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);};
00069   void SetScalarModeToUseCellData() {
00070     this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);};
00071   void SetScalarModeToUsePointFieldData() {
00072     this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);};
00073   void SetScalarModeToUseCellFieldData() {
00074     this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);};
00076   
00078 
00082   virtual void SelectScalarArray(int arrayNum); 
00083   virtual void SelectScalarArray(const char* arrayName); 
00085   
00087 
00088   virtual char* GetArrayName() { return this->ArrayName; }
00089   virtual int GetArrayId() { return this->ArrayId; }
00090   virtual int GetArrayAccessMode() { return this->ArrayAccessMode; }
00092 
00094   const char *GetScalarModeAsString();
00095 
00097 
00100   vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
00101   vtkGetMacro( ImageSampleDistance, float );
00103 
00105 
00107   vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
00108   vtkGetMacro( MinimumImageSampleDistance, float );
00110 
00112 
00114   vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
00115   vtkGetMacro( MaximumImageSampleDistance, float );
00117 
00119 
00122   vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
00123   vtkGetMacro( AutoAdjustSampleDistances, int );
00124   vtkBooleanMacro( AutoAdjustSampleDistances, int );
00126   
00128 
00130   vtkSetMacro( NumberOfThreads, int );
00131   vtkGetMacro( NumberOfThreads, int );
00133 
00135 
00137   vtkSetClampMacro( IntermixIntersectingGeometry, int, 0, 1 );
00138   vtkGetMacro( IntermixIntersectingGeometry, int );
00139   vtkBooleanMacro( IntermixIntersectingGeometry, int );
00141 
00143 
00144   virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f);
00145   vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
00147 
00149 
00151   virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri);
00152   vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
00154   
00155 //BTX
00158   void Render( vtkRenderer *, vtkVolume * );
00159 
00164   void ReleaseGraphicsResources(vtkWindow *);
00165   
00166   vtkGetVectorMacro( ImageInUseSize, int, 2 );
00167   vtkGetVectorMacro( ImageOrigin, int, 2 );
00168   vtkGetVectorMacro( ImageViewportSize, int , 2 );
00169   
00170 //ETX
00171   
00172   void CastRays( int threadID, int threadCount );
00173 
00174 protected:
00175   vtkUnstructuredGridVolumeRayCastMapper();
00176   ~vtkUnstructuredGridVolumeRayCastMapper();
00177 
00178   float                        ImageSampleDistance;
00179   float                        MinimumImageSampleDistance;
00180   float                        MaximumImageSampleDistance;
00181   int                          AutoAdjustSampleDistances;
00182   
00183   vtkMultiThreader  *Threader;
00184   int               NumberOfThreads;
00185 
00186   vtkRayCastImageDisplayHelper *ImageDisplayHelper;
00187   
00188   // This is how big the image would be if it covered the entire viewport
00189   int            ImageViewportSize[2];
00190   
00191   // This is how big the allocated memory for image is. This may be bigger
00192   // or smaller than ImageFullSize - it will be bigger if necessary to 
00193   // ensure a power of 2, it will be smaller if the volume only covers a
00194   // small region of the viewport
00195   int            ImageMemorySize[2];
00196   
00197   // This is the size of subregion in ImageSize image that we are using for
00198   // the current image. Since ImageSize is a power of 2, there is likely
00199   // wasted space in it. This number will be used for things such as clearing
00200   // the image if necessary.
00201   int            ImageInUseSize[2];
00202   
00203   // This is the location in ImageFullSize image where our ImageSize image
00204   // is located.
00205   int            ImageOrigin[2];
00206   
00207   // This is the allocated image
00208   unsigned char *Image;
00209   
00210   float        *RenderTimeTable;
00211   vtkVolume   **RenderVolumeTable;
00212   vtkRenderer **RenderRendererTable;
00213   int           RenderTableSize;
00214   int           RenderTableEntries;
00215 
00216   void StoreRenderTime( vtkRenderer *ren, vtkVolume *vol, float t );
00217   float RetrieveRenderTime( vtkRenderer *ren, vtkVolume *vol );
00218 
00219   int           IntermixIntersectingGeometry;
00220 
00221   float        *ZBuffer;
00222   int           ZBufferSize[2];
00223   int           ZBufferOrigin[2];
00224 
00225   // Get the ZBuffer value corresponding to location (x,y) where (x,y)
00226   // are indexing into the ImageInUse image. This must be converted to
00227   // the zbuffer image coordinates. Nearest neighbor value is returned.
00228   double         GetZBufferValue( int x, int y );
00229 
00230   double         GetMinimumBoundsDepth( vtkRenderer *ren,
00231                                        vtkVolume   *vol );
00232   
00233   vtkUnstructuredGridVolumeRayCastFunction  *RayCastFunction;
00234   vtkUnstructuredGridVolumeRayCastIterator **RayCastIterators;
00235   vtkUnstructuredGridVolumeRayIntegrator    *RayIntegrator;
00236   vtkUnstructuredGridVolumeRayIntegrator    *RealRayIntegrator;
00237 
00238   vtkVolume     *CurrentVolume;
00239   vtkRenderer   *CurrentRenderer;
00240 
00241   int         ScalarMode;
00242   char       *ArrayName;
00243   int         ArrayId;
00244   int         ArrayAccessMode;
00245   
00246   vtkDataArray *Scalars;
00247   int           CellScalars;
00248   
00249 private:
00250   vtkUnstructuredGridVolumeRayCastMapper(const vtkUnstructuredGridVolumeRayCastMapper&);  // Not implemented.
00251   void operator=(const vtkUnstructuredGridVolumeRayCastMapper&);  // Not implemented.
00252 };
00253 
00254 #endif
00255 

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