VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkOpenGLProjectedAAHexahedraMapper.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 vtkOpenGLProjectedAAHexahedraMapper_h 00032 #define vtkOpenGLProjectedAAHexahedraMapper_h 00033 00034 #include "vtkRenderingVolumeOpenGLModule.h" // For export macro 00035 #include "vtkProjectedAAHexahedraMapper.h" 00036 00037 class vtkFloatArray; 00038 class vtkPoints; 00039 class vtkUnsignedCharArray; 00040 class vtkVisibilitySort; 00041 class vtkVolumeProperty; 00042 class vtkRenderWindow; 00043 class vtkShaderProgram2; 00044 00045 class VTKRENDERINGVOLUMEOPENGL_EXPORT vtkOpenGLProjectedAAHexahedraMapper 00046 : public vtkProjectedAAHexahedraMapper 00047 { 00048 public: 00049 vtkTypeMacro(vtkOpenGLProjectedAAHexahedraMapper, 00050 vtkProjectedAAHexahedraMapper); 00051 static vtkOpenGLProjectedAAHexahedraMapper *New(); 00052 virtual void PrintSelf(ostream &os, vtkIndent indent); 00053 00056 bool IsRenderSupported(vtkRenderWindow *w); 00057 00058 void Render(vtkRenderer *renderer, vtkVolume *volume); 00059 00060 void ReleaseGraphicsResources(vtkWindow *window); 00061 00062 protected: 00063 vtkOpenGLProjectedAAHexahedraMapper(); 00064 ~vtkOpenGLProjectedAAHexahedraMapper(); 00065 00067 float* ConvertScalars(vtkDataArray* inScalars); 00068 00070 float* ConvertPoints(vtkPoints* inPoints); 00071 00073 virtual void ProjectHexahedra(vtkRenderer *renderer, vtkVolume *volume); 00074 00076 void Initialize(vtkRenderer *renderer, vtkVolume *volume); 00077 00080 void UpdatePreintegrationTexture(vtkVolume *vome, vtkDataArray *scalars); 00081 00084 void CreateProgram(vtkRenderWindow *w); 00085 00087 void SetState(double* observer); 00088 00090 void RenderHexahedron(float min[3], float max[3], float scalars[8]); 00091 00093 void UnsetState(); 00094 00095 00096 bool Initialized; 00097 00098 int UsingCellColors; 00099 00100 float MaxCellSize; 00101 vtkTimeStamp InputAnalyzedTime; 00102 vtkTimeStamp PreintTextureTime; 00103 vtkTimeStamp ColorsMappedTime; 00104 00105 unsigned int PreintTexture; 00106 00107 // OpenGL arrays for primitive submission 00108 float* pos_points; 00109 float* min_points; 00110 float* node_data1; 00111 float* node_data2; 00112 00113 // number of pending points 00114 int num_points; 00115 static const int max_points = 4096; 00116 00117 // our shader 00118 vtkShaderProgram2 *Shader; 00119 00120 int GaveError; 00121 00122 float ScalarScale, ScalarShift, ScalarResolution; 00123 float LengthScale; 00124 00125 vtkVolumeProperty *LastProperty; 00126 00127 vtkFloatArray *ConvertedPoints; 00128 vtkFloatArray *ConvertedScalars; 00129 00130 private: 00131 vtkOpenGLProjectedAAHexahedraMapper(const vtkOpenGLProjectedAAHexahedraMapper &); // Not Implemented. 00132 void operator=(const vtkOpenGLProjectedAAHexahedraMapper &); // Not Implemented. 00133 }; 00134 00135 #endif