VTK
dox/Rendering/vtkShaderDeviceAdapter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkShaderDeviceAdapter.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 =========================================================================*/
00030 #ifndef __vtkShaderDeviceAdapter_h
00031 #define __vtkShaderDeviceAdapter_h
00032 
00033 #include "vtkObject.h"
00034 
00035 class vtkShaderProgram;
00036 
00037 class VTK_RENDERING_EXPORT vtkShaderDeviceAdapter : public vtkObject
00038 {
00039 public:
00040   vtkTypeMacro(vtkShaderDeviceAdapter, vtkObject);
00041   virtual void PrintSelf(ostream &os, vtkIndent indent);
00042 
00044 
00053   virtual void SendAttribute(const char* attrname,
00054     int components, int type, 
00055     const void* attribute, unsigned long offset=0)=0;
00057     
00059 
00061   void SetShaderProgram(vtkShaderProgram* pgm)
00062     { this->ShaderProgram = pgm; }
00063   vtkGetObjectMacro(ShaderProgram, vtkShaderProgram);
00065 
00066   // Descrition:
00067   // This method is called before rendering. This gives the shader device
00068   // adapter an opportunity to collect information, such as attribute indices
00069   // that it will need while rendering.
00070   virtual void PrepareForRender()=0;
00071 protected:
00072   vtkShaderDeviceAdapter();
00073   ~vtkShaderDeviceAdapter();
00074 
00075   vtkShaderProgram* ShaderProgram;
00076 
00077 private:
00078   vtkShaderDeviceAdapter(const vtkShaderDeviceAdapter&); // Not implemented
00079   void operator=(const vtkShaderDeviceAdapter&); // Not implemented
00080 };
00081 
00082 #endif