vtkRenderStepsPass.h 3.67 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkRenderStepsPass.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .NAME vtkRenderStepsPass - Execute render passes sequentially.
// .SECTION Description
// vtkRenderStepsPass executes a standard list of render passes sequentially.
// This class allows to define a sequence of render passes at run time.
// You can set a step to NULL in order to skip that step. Likewise you
// can replace any of the default steps with your own step. Typically in
// such a case you would get the current step, replace it with your own
// and likely have your step call the current step as a delegate. For example
// to replace the translucent step with a depthpeeling step you would get the
// current tranlucent step and set it as a delegate on the depthpeeling step.
// Then set this classes translparent step to the depthpeelnig step.
//
// .SECTION See Also
// vtkRenderPass

30 31
#ifndef vtkRenderStepsPass_h
#define vtkRenderStepsPass_h
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112

#include "vtkRenderingOpenGL2Module.h" // For export macro
#include "vtkRenderPass.h"

class vtkSequencePass;
class vtkCameraPass;

class VTKRENDERINGOPENGL2_EXPORT vtkRenderStepsPass : public vtkRenderPass
{
public:
  static vtkRenderStepsPass *New();
  vtkTypeMacro(vtkRenderStepsPass,vtkRenderPass);
  void PrintSelf(ostream& os, vtkIndent indent);

  //BTX
  // Description:
  // Perform rendering according to a render state \p s.
  // \pre s_exists: s!=0
  virtual void Render(const vtkRenderState *s);
  //ETX

  // Description:
  // Release graphics resources and ask components to release their own
  // resources.
  // \pre w_exists: w!=0
  virtual void ReleaseGraphicsResources(vtkWindow *w);

  // Description:
  // Get the RenderPass used for the Camera Step
  vtkGetObjectMacro(CameraPass, vtkCameraPass);
  void SetCameraPass(vtkCameraPass *);

  // Description:
  // Get the RenderPass used for the Lights Step
  vtkGetObjectMacro(LightsPass, vtkRenderPass);
  void SetLightsPass(vtkRenderPass *);

  // Description:
  // Get the RenderPass used for the Opaque Step
  vtkGetObjectMacro(OpaquePass, vtkRenderPass);
  void SetOpaquePass(vtkRenderPass *);

  // Description:
  // Get the RenderPass used for the translucent Step
  vtkGetObjectMacro(TranslucentPass, vtkRenderPass);
  void SetTranslucentPass(vtkRenderPass *);

  // Description:
  // Get the RenderPass used for the Volume Step
  vtkGetObjectMacro(VolumetricPass, vtkRenderPass);
  void SetVolumetricPass(vtkRenderPass *);

  // Description:
  // Get the RenderPass used for the Overlay Step
  vtkGetObjectMacro(OverlayPass, vtkRenderPass);
  void SetOverlayPass(vtkRenderPass *);

  // Description:
  // Get the RenderPass used for the PostProcess Step
  vtkGetObjectMacro(PostProcessPass, vtkRenderPass);
  void SetPostProcessPass(vtkRenderPass *);

protected:
  vtkRenderStepsPass();
  virtual ~vtkRenderStepsPass();

  vtkCameraPass *CameraPass;
  vtkRenderPass *LightsPass;
  vtkRenderPass *OpaquePass;
  vtkRenderPass *TranslucentPass;
  vtkRenderPass *VolumetricPass;
  vtkRenderPass *OverlayPass;
  vtkRenderPass *PostProcessPass;
  vtkSequencePass *SequencePass;

private:
  vtkRenderStepsPass(const vtkRenderStepsPass&);  // Not implemented.
  void operator=(const vtkRenderStepsPass&);  // Not implemented.
};

#endif