VTK
vtkOpenGLProjectedTetrahedraMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLProjectedTetrahedraMapper.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 /*
17  * Copyright 2003 Sandia Corporation.
18  * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
19  * license for use of this work by or on behalf of the
20  * U.S. Government. Redistribution and use in source and binary forms, with
21  * or without modification, are permitted provided that this Notice and any
22  * statement of authorship are reproduced on all copies.
23  */
24 
35 #ifndef vtkOpenGLProjectedTetrahedraMapper_h
36 #define vtkOpenGLProjectedTetrahedraMapper_h
37 
38 #include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
40 
41 #include "vtkOpenGLHelper.h" // used for ivars
42 
43 class vtkVisibilitySort;
45 class vtkFloatArray;
46 class vtkRenderWindow;
49 
50 class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkOpenGLProjectedTetrahedraMapper
52 {
53 public:
57  virtual void PrintSelf(ostream &os, vtkIndent indent);
58 
59  virtual void ReleaseGraphicsResources(vtkWindow *window);
60 
61  virtual void Render(vtkRenderer *renderer, vtkVolume *volume);
62 
64 
66  vtkSetMacro(UseFloatingPointFrameBuffer,bool);
67  vtkGetMacro(UseFloatingPointFrameBuffer,bool);
68  vtkBooleanMacro(UseFloatingPointFrameBuffer,bool);
70 
73  virtual bool IsSupported(vtkRenderWindow *context);
74 
75 protected:
78 
79  void Initialize(vtkRenderer *ren);
80  bool Initialized;
81  int CurrentFBOWidth, CurrentFBOHeight;
82  bool AllocateFBOResources(vtkRenderer *ren);
83  bool CanDoFloatingPointFrameBuffer;
84  bool FloatingPointFrameBufferResourcesAllocated;
85  bool UseFloatingPointFrameBuffer;
86  bool HasHardwareSupport;
87 
88  vtkUnsignedCharArray *Colors;
89  int UsingCellColors;
90 
91  vtkFloatArray *TransformedPoints;
92 
93  float MaxCellSize;
94  vtkTimeStamp InputAnalyzedTime;
95  vtkTimeStamp ColorsMappedTime;
96 
97  // The VBO and its layout.
99 
100  // Structures for the various cell types we render.
102 
103  int GaveError;
104 
105  vtkVolumeProperty *LastProperty;
106 
107  float *SqrtTable;
108  float SqrtTableBias;
109 
110  virtual void ProjectTetrahedra(vtkRenderer *renderer, vtkVolume *volume);
111 
112  float GetCorrectedDepth(float x, float y, float z1, float z2,
113  const float inverse_projection_mat[16],
114  int use_linear_depth_correction,
115  float linear_depth_correction);
116 
117 private:
119  void operator=(const vtkOpenGLProjectedTetrahedraMapper &); // Not Implemented.
120 
121  class vtkInternals;
122  vtkInternals *Internals;
123 };
124 
125 #endif
OpenGL rendering window.
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0
Abstract class that can sort cell data along a viewpoint.
virtual bool IsSupported(vtkRenderWindow *)
record modification and/or execution time
Definition: vtkTimeStamp.h:34
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
abstract specification for renderers
Definition: vtkRenderer.h:63
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
a simple class to control print indentation
Definition: vtkIndent.h:38
Unstructured grid volume renderer.
virtual void PrintSelf(ostream &os, vtkIndent indent)
represents the common properties for rendering a volume.
dynamic, self-adjusting array of unsigned char
static vtkProjectedTetrahedraMapper * New()
create a window for renderers to draw into
virtual void ReleaseGraphicsResources(vtkWindow *)