VTK
vtkShadowMapBakerPass.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkShadowMapPass.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 =========================================================================*/
45 #ifndef __vtkShadowMapBakerPass_h
46 #define __vtkShadowMapBakerPass_h
47 
48 #include "vtkRenderPass.h"
49 
52 class vtkCamera;
53 class vtkLight;
55 class vtkShadowMapBakerPassTextures; // internal
56 class vtkShadowMapBakerPassLightCameras; // internal
57 
59 {
60 public:
61  static vtkShadowMapBakerPass *New();
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
68  static vtkInformationIntegerKey *OCCLUDER();
69 
70  // If this key exists on the Propertykeys of a prop, the prop is viewed as a
71  // light/shadow receiver. This key is not mutually exclusive with the
72  // OCCLUDER() key.
73  static vtkInformationIntegerKey *RECEIVER();
74 
75  //BTX
77 
79  virtual void Render(const vtkRenderState *s);
80  //ETX
82 
86 
88 
92  vtkGetObjectMacro(OpaquePass,vtkRenderPass);
93  virtual void SetOpaquePass(vtkRenderPass *opaquePass);
95 
97 
101  vtkGetObjectMacro(CompositeZPass,vtkRenderPass);
102  virtual void SetCompositeZPass(vtkRenderPass *compositeZPass);
104 
106 
109  vtkSetMacro(Resolution,unsigned int);
110  vtkGetMacro(Resolution,unsigned int);
112 
114 
122  vtkSetMacro(PolygonOffsetFactor,float);
123  vtkGetMacro(PolygonOffsetFactor,float);
125 
127 
136  vtkSetMacro(PolygonOffsetUnits,float);
137  vtkGetMacro(PolygonOffsetUnits,float);
139 
143  bool GetHasShadows();
144 
149  bool LightCreatesShadow(vtkLight *l);
150 
151 //BTX
154  vtkShadowMapBakerPassTextures *GetShadowMaps();
155 
157 
159  vtkShadowMapBakerPassLightCameras *GetLightCameras();
160 //ETX
162 
167  bool GetNeedUpdate();
168 
169  // // Description:
170  // INTERNAL USE ONLY.
171  // Internally used by vtkShadowMapBakerPass and vtkShadowMapPass.
172  //
173  // Set NeedUpate to false. Called by vtkShadowMapPass.
174  void SetUpToDate();
175 
176  protected:
179 
181  virtual ~vtkShadowMapBakerPass();
182 
184 
187  void PointNearFar(double *v,
188  double *pt,
189  double *dir,
190  double &mNear,
191  double &mFar,
192  bool initialized);
194 
196 
198  void BoxNearFar(double *bb,
199  double *pt,
200  double *dir,
201  double &mNear,
202  double &mFar);
204 
205  //BTX
207 
209  void BuildCameraLight(vtkLight *light,
210  double *boundingBox,
211  vtkCamera *lcamera);
212  //ETX
214 
217  void CheckSupport(vtkOpenGLRenderWindow *w);
218 
220 
222 
223  unsigned int Resolution;
224 
227 
229 
232 
235 
236 
239 
240 private:
241  vtkShadowMapBakerPass(const vtkShadowMapBakerPass&); // Not implemented.
242  void operator=(const vtkShadowMapBakerPass&); // Not implemented.
243 };
244 
245 #endif
OpenGL rendering window.
vtkShadowMapBakerPassTextures * ShadowMaps
record modification and/or execution time
Definition: vtkTimeStamp.h:33
void PrintSelf(ostream &os, vtkIndent indent)
vtkShadowMapBakerPassLightCameras * LightCameras
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
Context in which a vtkRenderPass will render.
a simple class to control print indentation
Definition: vtkIndent.h:37
a virtual camera for 3D rendering
Definition: vtkCamera.h:47
Key for integer values in vtkInformation.
a virtual light for 3D rendering
Definition: vtkLight.h:59
vtkFrameBufferObject * FrameBufferObject
internal class which encapsulates OpenGL frame buffer object. Not to be used directly.
#define VTK_RENDERING_EXPORT
virtual void Render(const vtkRenderState *s)=0
virtual void ReleaseGraphicsResources(vtkWindow *w)
static vtkObject * New()
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:53
Implement a builder of shadow map pass.