VTK
vtkHAVSVolumeMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkHAVSVolumeMapper.h
5 
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 /* Copyright 2005, 2006 by University of Utah. */
17 
119 #ifndef vtkHAVSVolumeMapper_h
120 #define vtkHAVSVolumeMapper_h
121 
122 #include "vtkRenderingVolumeModule.h" // For export macro
124 
125 #define VTK_KBUFFER_SIZE_2 0
126 #define VTK_KBUFFER_SIZE_6 1
127 #define VTK_FIELD_LEVEL_OF_DETAIL 0
128 #define VTK_AREA_LEVEL_OF_DETAIL 1
129 
130 
131 class vtkUnstructuredGrid;
132 class vtkDepthRadixSortUnstructuredGrid;
133 class vtkHAVSSortedFace;
134 
136 {
137 public:
138  static vtkHAVSVolumeMapper *New();
139  vtkTypeMacro(vtkHAVSVolumeMapper,
141  virtual void PrintSelf(ostream& os, vtkIndent indent);
142 
144 
145  vtkSetMacro(PartiallyRemoveNonConvexities, bool);
146  vtkGetMacro(PartiallyRemoveNonConvexities, bool);
148 
150 
152  vtkSetMacro(LevelOfDetailTargetTime, float);
153  vtkGetMacro(LevelOfDetailTargetTime, float);
155 
157 
158  vtkSetMacro(LevelOfDetail, bool);
159  vtkGetMacro(LevelOfDetail, bool);
161 
163 
164  void SetLevelOfDetailMethod(int);
165  vtkGetMacro(LevelOfDetailMethod, int);
167  {this->SetLevelOfDetailMethod(VTK_FIELD_LEVEL_OF_DETAIL);}
169  {this->SetLevelOfDetailMethod(VTK_AREA_LEVEL_OF_DETAIL);}
171 
173 
174  vtkSetMacro(KBufferSize,int);
175  vtkGetMacro(KBufferSize,int);
177  {this->SetKBufferSize(VTK_KBUFFER_SIZE_2);}
179  {this->SetKBufferSize(VTK_KBUFFER_SIZE_6);}
181 
183 
187  virtual bool SupportedByHardware(vtkRenderer *vtkNotUsed(r))
188  {return false; }
190 
192 
194  virtual void SetGPUDataStructures(bool) = 0;
195  vtkGetMacro(GPUDataStructures, bool);
197 
198 protected:
201 
202 //BTX
203  virtual void Initialize(vtkRenderer *ren, vtkVolume *vol) = 0;
204  void InitializePrimitives(vtkVolume *vol);
205  void InitializeScalars();
206  void InitializeLevelOfDetail();
207  void InitializeLookupTables(vtkVolume *vol);
208 
209  void FRadixSort(vtkHAVSSortedFace *array, vtkHAVSSortedFace *temp, int lo, int up);
210  void FRadix(int byte, int len, vtkHAVSSortedFace *source, vtkHAVSSortedFace *dest, int *count);
211 
212  void UpdateLevelOfDetail(float targetTime);
213  void PartialVisibilitySort(float *eye);
214  bool CheckInitializationError();
215 
216  enum
217  {
218  NO_INIT_ERROR=0,
219  NON_TETRAHEDRA=1,
220  UNSUPPORTED_EXTENSIONS=2,
221  NO_SCALARS=3,
222  CELL_DATA=4,
223  NO_CELLS=5
224  };
225 
226  // Mesh
227  float *Vertices;
228  float *Scalars;
229  double ScalarRange[2];
230  unsigned int *Triangles;
231  unsigned int *OrderedTriangles;
232  vtkHAVSSortedFace *SortedFaces;
233  vtkHAVSSortedFace *RadixTemp;
234  float *Centers;
235  unsigned int NumberOfVertices;
236  unsigned int NumberOfCells;
237  unsigned int NumberOfScalars;
238  unsigned int NumberOfTriangles;
239 
240  // Level-Of-Detail
243  unsigned int *BoundaryTriangles;
244  unsigned int *InternalTriangles;
250 
251  // K-Buffer
257  float Diagonal;
260 
261  // Lookup Tables
264 
265  // State and Timing Stats
275 //ETX
276 
277 private:
278  vtkHAVSVolumeMapper(const vtkHAVSVolumeMapper&); // Not implemented.
279  void operator=(const vtkHAVSVolumeMapper&); // Not implemented.
280 };
281 #endif
vtkTimeStamp ColorTransferFunctionMTime
unsigned int * InternalTriangles
#define VTK_KBUFFER_SIZE_2
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
#define VTKRENDERINGVOLUME_EXPORT
record modification and/or execution time
Definition: vtkTimeStamp.h:34
virtual bool SupportedByHardware(vtkRenderer *vtkNotUsed(r))
unsigned int NumberOfBoundaryTriangles
abstract specification for renderers
Definition: vtkRenderer.h:63
#define VTK_FIELD_LEVEL_OF_DETAIL
unsigned int NumberOfInternalTriangles
a simple class to control print indentation
Definition: vtkIndent.h:38
Abstract class for a unstructured grid volume mapper.
#define VTK_AREA_LEVEL_OF_DETAIL
#define VTK_KBUFFER_SIZE_6
dataset represents arbitrary combinations of all possible cell types
vtkTimeStamp AlphaTransferFunctionMTime
unsigned int * OrderedTriangles
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkHAVSSortedFace * SortedFaces
static vtkAlgorithm * New()
vtkHAVSSortedFace * RadixTemp
unsigned int * BoundaryTriangles
unsigned int LevelOfDetailTriangleCount
vtkTimeStamp UnstructuredGridMTime
Hardware-Assisted Visibility Sorting unstructured grid mapper.
unsigned int NumberOfTriangles
void PrintSelf(ostream &os, vtkIndent indent)