Drake Designer
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
vtkDepthImageProcessingPass.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkDepthImageProcessingPass.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 =========================================================================*/
32 /*----------------------------------------------------------------------
33 Acknowledgement:
34 This algorithm is the result of joint work by Electricité de France,
35 CNRS, Collège de France and Université J. Fourier as part of the
36 Ph.D. thesis of Christian BOUCHENY.
37 ------------------------------------------------------------------------*/
38 // .NAME vtkDepthImageProcessingPass - Convenient class for post-processing
39 // passes. Based on vtkDepthImageProcessingPass, but writes depth as well
40 // in a texture
41 // .SECTION Description
42 // Abstract class with some convenient methods frequently used in subclasses.
43 //
44 // .SECTION Implementation
45 
46 // .SECTION See Also
47 // vtkRenderPass vtkDepthImageProcessingPass vtkEDLShading
48 
49 #ifndef __vtkDepthImageProcessingPass_h
50 #define __vtkDepthImageProcessingPass_h
51 
52 #include "vtkImageProcessingPass.h"
53 
54 #include <vtkDRCFiltersModule.h>
55 
56 class vtkOpenGLRenderWindow;
57 class vtkDepthPeelingPassLayerList; // Pimpl
58 class vtkShaderProgram2;
59 class vtkShader2;
60 class vtkFrameBufferObject;
61 class vtkTextureObject;
62 
63 class VTKDRCFILTERS_EXPORT vtkDepthImageProcessingPass : public vtkImageProcessingPass
64 {
65 public:
66  vtkTypeRevisionMacro(vtkDepthImageProcessingPass,vtkRenderPass);
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
69  // Description:
70  // Release graphics resources and ask components to release their own
71  // resources.
72  // \pre w_exists: w!=0
73  void ReleaseGraphicsResources(vtkWindow *w);
74 
75  // Description:
76  // Delegate for rendering the image to be processed.
77  // If it is NULL, nothing will be rendered and a warning will be emitted.
78  // It is usually set to a vtkCameraPass or to a post-processing pass.
79  // Initial value is a NULL pointer.
80  vtkGetObjectMacro(DelegatePass,vtkRenderPass);
81  virtual void SetDelegatePass(vtkRenderPass *delegatePass);
82 
83  protected:
84  // Description:
85  // Default constructor. DelegatePass is set to NULL.
87 
88  // Description:
89  // Destructor.
90  virtual ~vtkDepthImageProcessingPass();
91 
92  // Description:
93  // Render delegate with a image of different dimensions than the
94  // original one.
95  // \pre s_exists: s!=0
96  // \pre fbo_exists: fbo!=0
97  // \pre fbo_has_context: fbo->GetContext()!=0
98  // \pre colortarget_exists: colortarget!=0
99  // \pre colortarget_has_context: colortarget->GetContext()!=0
100  virtual void RenderDelegate(const vtkRenderState *s,
101  int width,
102  int height,
103  int newWidth,
104  int newHeight,
105  vtkFrameBufferObject *fbo,
106  vtkTextureObject *colortarget,
107  vtkTextureObject *depthtarget);
108 
109  // Description:
110  // Test Hardware support for Framebuffer Objects, Texture Objets, GLSL shaders - for sake of code clarity
111  // This function is generic, can be useful in multiple image-based rendering classes
112  // \pre s_exists: s!=0
113  bool TestHardwareSupport(const vtkRenderState *s);
114 
115  // Description:
116  // Read parent size - for sake of code clarity
117  // This function is generic, can be useful in multiple image-based rendering classes
118  // \pre s_exists: s!=0
119  void ReadWindowSize(const vtkRenderState* s);
120 
121  vtkRenderPass *DelegatePass;
122  int width; // parent window width
123  int height; // parent window height
124  int w; // this width
125  int h; // this height
126  int extraPixels; // w(h) = width(height) + 2*extrapixels
127 
128  private:
129  vtkDepthImageProcessingPass(const vtkDepthImageProcessingPass&); // Not implemented.
130  void operator=(const vtkDepthImageProcessingPass&); // Not implemented.
131 };
132 
133 #endif
#define VTKDRCFILTERS_EXPORT