VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/OpenGL2/vtkOpenGLRenderer.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkOpenGLRenderer.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00022 #ifndef vtkOpenGLRenderer_h
00023 #define vtkOpenGLRenderer_h
00024 
00025 #include "vtkRenderingOpenGL2Module.h" // For export macro
00026 #include "vtkRenderer.h"
00027 #include <vector>  // STL Header
00028 
00029 class vtkRenderPass;
00030 class vtkOpenGLTexture;
00031 class vtkTextureObject;
00032 class vtkDepthPeelingPass;
00033 
00034 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderer : public vtkRenderer
00035 {
00036 public:
00037   static vtkOpenGLRenderer *New();
00038   vtkTypeMacro(vtkOpenGLRenderer, vtkRenderer);
00039   void PrintSelf(ostream& os, vtkIndent indent);
00040 
00042   void DeviceRender(void);
00043 
00047   virtual void DeviceRenderTranslucentPolygonalGeometry();
00048 
00049   void Clear(void);
00050 
00052   int UpdateLights(void);
00053 
00058   int GetDepthPeelingHigherLayer();
00059 
00061 
00062   void SetPass(vtkRenderPass *p);
00063   vtkGetObjectMacro(Pass, vtkRenderPass);
00065 
00066 protected:
00067   vtkOpenGLRenderer();
00068   ~vtkOpenGLRenderer();
00069 
00071   void CheckCompilation(unsigned int fragmentShader);
00072 
00073   // Internal method to release graphics resources in any derived renderers.
00074   virtual void ReleaseGraphicsResources(vtkWindow *w);
00075 
00076   // Picking functions to be implemented by sub-classes
00077   virtual void DevicePickRender();
00078   virtual void StartPick(unsigned int pickFromSize);
00079   virtual void UpdatePickId();
00080   virtual void DonePick();
00081   virtual unsigned int GetPickedId();
00082   virtual unsigned int GetNumPickedIds();
00083   virtual int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer);
00084   virtual double GetPickedZ();
00085 
00086   // Ivars used in picking
00087   class vtkGLPickInfo* PickInfo;
00088 
00089   double PickedZ;
00090 
00091   friend class vtkOpenGLProperty;
00092   friend class vtkOpenGLTexture;
00093   friend class vtkOpenGLImageSliceMapper;
00094   friend class vtkOpenGLImageResliceMapper;
00095 
00097   vtkDepthPeelingPass *DepthPeelingPass;
00098 
00099   // Is rendering at translucent geometry stage using depth peeling and
00100   // rendering a layer other than the first one? (Boolean value)
00101   // If so, the uniform variables UseTexture and Texture can be set.
00102   // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
00103   int DepthPeelingHigherLayer;
00104 
00105   friend class vtkRenderPass;
00106   vtkRenderPass *Pass;
00107 
00108 private:
00109   vtkOpenGLRenderer(const vtkOpenGLRenderer&);  // Not implemented.
00110   void operator=(const vtkOpenGLRenderer&);  // Not implemented.
00111 };
00112 
00113 #endif