1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkPointFillPass.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  * @class   vtkPointFillPass
17  * @brief   Implement a post-processing fillpass
18  *
19  *
20  * This pass is designed to fill in rendering of sparse point sets/coulds
21  * The delegate is used once and is usually set to a vtkCameraPass or
22  * to a post-processing pass.
23  *
24  * @sa
25  * vtkRenderPass
26 */
27 
28 #ifndef vtkPointFillPass_h
29 #define vtkPointFillPass_h
30 
31 #include "vtkRenderingOpenGL2Module.h" // For export macro
32 #include "vtkDepthImageProcessingPass.h"
33 
34 class vtkDepthPeelingPassLayerList; // Pimpl
35 class vtkOpenGLFramebufferObject;
36 class vtkOpenGLQuadHelper;
37 class vtkOpenGLRenderWindow;
38 class vtkTextureObject;
39 
40 class VTKRENDERINGOPENGL2_EXPORT vtkPointFillPass : public vtkDepthImageProcessingPass
41 {
42 public:
43   static vtkPointFillPass *New();
44   vtkTypeMacro(vtkPointFillPass,vtkDepthImageProcessingPass);
45   void PrintSelf(ostream& os, vtkIndent indent) override;
46 
47   /**
48    * Perform rendering according to a render state \p s.
49    * \pre s_exists: s!=0
50    */
51   void Render(const vtkRenderState *s) override;
52 
53   /**
54    * Release graphics resources and ask components to release their own
55    * resources.
56    * \pre w_exists: w!=0
57    */
58   void ReleaseGraphicsResources(vtkWindow *w) override;
59 
60   //@{
61   /**
62    * How far in front of a point must a neighboring point
63    * be to be used as a filler candidate.  Expressed as
64    * a multiple of the points distance from the camera.
65    * Defaults to 0.95
66    */
67   vtkSetMacro(CandidatePointRatio,float);
68   vtkGetMacro(CandidatePointRatio,float);
69   //@}
70 
71   //@{
72   /**
73    * How large of an angle must the filler candidates
74    * span before a point will be filled. Expressed in
75    * radians. A value of pi will keep edges from growing out.
76    * Large values require more support, lower values less.
77    */
78   vtkSetMacro(MinimumCandidateAngle,float);
79   vtkGetMacro(MinimumCandidateAngle,float);
80   //@}
81 
82  protected:
83   /**
84    * Default constructor. DelegatePass is set to NULL.
85    */
86   vtkPointFillPass();
87 
88   /**
89    * Destructor.
90    */
91   ~vtkPointFillPass() override;
92 
93   /**
94    * Graphics resources.
95    */
96   vtkOpenGLFramebufferObject *FrameBufferObject;
97   vtkTextureObject *Pass1; // render target for the scene
98   vtkTextureObject *Pass1Depth; // render target for the depth
99 
100   vtkOpenGLQuadHelper *QuadHelper;
101 
102   float CandidatePointRatio;
103   float MinimumCandidateAngle;
104 
105  private:
106   vtkPointFillPass(const vtkPointFillPass&) = delete;
107   void operator=(const vtkPointFillPass&) = delete;
108 };
109 
110 #endif
111