VTK
dox/Rendering/Core/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 "vtkRenderingCoreModule.h" // For export macro
00034 #include "vtkObject.h"
00035 
00036 class vtkShaderProgram;
00037 
00038 class VTKRENDERINGCORE_EXPORT vtkShaderDeviceAdapter : public vtkObject
00039 {
00040 public:
00041   vtkTypeMacro(vtkShaderDeviceAdapter, vtkObject);
00042   virtual void PrintSelf(ostream &os, vtkIndent indent);
00043 
00045 
00054   virtual void SendAttribute(const char* attrname,
00055     int components, int type,
00056     const void* attribute, unsigned long offset=0) = 0;
00058 
00060 
00062   void SetShaderProgram(vtkShaderProgram* pgm)
00063     { this->ShaderProgram = pgm; }
00064   vtkGetObjectMacro(ShaderProgram, vtkShaderProgram);
00066 
00067   // Descrition:
00068   // This method is called before rendering. This gives the shader device
00069   // adapter an opportunity to collect information, such as attribute indices
00070   // that it will need while rendering.
00071   virtual void PrepareForRender() = 0;
00072 protected:
00073   vtkShaderDeviceAdapter();
00074   ~vtkShaderDeviceAdapter();
00075 
00076   vtkShaderProgram* ShaderProgram;
00077 
00078 private:
00079   vtkShaderDeviceAdapter(const vtkShaderDeviceAdapter&); // Not implemented
00080   void operator=(const vtkShaderDeviceAdapter&); // Not implemented
00081 };
00082 
00083 #endif