VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkOpenGLProjectedTetrahedraMapper.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 =========================================================================*/
00015 
00016 /*
00017  * Copyright 2003 Sandia Corporation.
00018  * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00019  * license for use of this work by or on behalf of the
00020  * U.S. Government. Redistribution and use in source and binary forms, with
00021  * or without modification, are permitted provided that this Notice and any
00022  * statement of authorship are reproduced on all copies.
00023  */
00024 
00035 #ifndef vtkOpenGLProjectedTetrahedraMapper_h
00036 #define vtkOpenGLProjectedTetrahedraMapper_h
00037 
00038 #include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
00039 #include "vtkProjectedTetrahedraMapper.h"
00040 
00041 #include "vtkglVBOHelper.h" // used for ivars
00042 
00043 class vtkVisibilitySort;
00044 class vtkUnsignedCharArray;
00045 class vtkFloatArray;
00046 class vtkRenderWindow;
00047 class vtkOpenGLRenderWindow;
00048 
00049 class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkOpenGLProjectedTetrahedraMapper
00050   : public vtkProjectedTetrahedraMapper
00051 {
00052 public:
00053   vtkTypeMacro(vtkOpenGLProjectedTetrahedraMapper,
00054                        vtkProjectedTetrahedraMapper);
00055   static vtkOpenGLProjectedTetrahedraMapper *New();
00056   virtual void PrintSelf(ostream &os, vtkIndent indent);
00057 
00058   virtual void ReleaseGraphicsResources(vtkWindow *window);
00059 
00060   virtual void Render(vtkRenderer *renderer, vtkVolume *volume);
00061 
00063 
00065   vtkSetMacro(UseFloatingPointFrameBuffer,bool);
00066   vtkGetMacro(UseFloatingPointFrameBuffer,bool);
00067   vtkBooleanMacro(UseFloatingPointFrameBuffer,bool);
00069 
00072   virtual bool IsSupported(vtkRenderWindow *context);
00073 
00074 protected:
00075   vtkOpenGLProjectedTetrahedraMapper();
00076   ~vtkOpenGLProjectedTetrahedraMapper();
00077 
00078   void Initialize(vtkRenderer *ren);
00079   bool Initialized;
00080   int  CurrentFBOWidth, CurrentFBOHeight;
00081   bool AllocateFBOResources(vtkRenderer *ren);
00082   bool CanDoFloatingPointFrameBuffer;
00083   bool FloatingPointFrameBufferResourcesAllocated;
00084   bool UseFloatingPointFrameBuffer;
00085   bool HasHardwareSupport;
00086 
00087   vtkUnsignedCharArray *Colors;
00088   int UsingCellColors;
00089 
00090   vtkFloatArray *TransformedPoints;
00091 
00092   float MaxCellSize;
00093   vtkTimeStamp InputAnalyzedTime;
00094   vtkTimeStamp ColorsMappedTime;
00095 
00096   // The VBO and its layout.
00097   vtkgl::BufferObject VBO;
00098   vtkgl::VBOLayout Layout;
00099 
00100   // Structures for the various cell types we render.
00101   vtkgl::CellBO Tris;
00102 
00103   int GaveError;
00104 
00105   vtkVolumeProperty *LastProperty;
00106 
00107   float *SqrtTable;
00108   float SqrtTableBias;
00109 
00110   virtual void ProjectTetrahedra(vtkRenderer *renderer, vtkVolume *volume);
00111 
00112   float GetCorrectedDepth(float x, float y, float z1, float z2,
00113                           const float inverse_projection_mat[16],
00114                           int use_linear_depth_correction,
00115                           float linear_depth_correction);
00116 
00117 private:
00118   vtkOpenGLProjectedTetrahedraMapper(const vtkOpenGLProjectedTetrahedraMapper &);  // Not Implemented.
00119   void operator=(const vtkOpenGLProjectedTetrahedraMapper &);  // Not Implemented.
00120 
00121   class vtkInternals;
00122   vtkInternals *Internals;
00123 };
00124 
00125 #endif