00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00092 #ifndef __vtkCgShader_h
00093 #define __vtkCgShader_h
00094 
00095 #include "vtkShader.h"
00096 
00097 class vtkActor;
00098 class vtkCamera;
00099 class vtkCgShaderInternals;
00100 class vtkLight;
00101 class vtkProperty;
00102 class vtkRenderer;
00103 
00104 
00105 
00106 class VTK_RENDERING_EXPORT vtkCgShader : public vtkShader
00107 {
00108 public:
00109   static vtkCgShader *New();
00110   vtkTypeMacro(vtkCgShader, vtkShader);
00111   void PrintSelf(ostream &os, vtkIndent indent);
00112  
00113   
00114   
00115   
00116   
00117   
00118   virtual int Compile();
00119 
00123   virtual void  Bind();
00124 
00127   virtual void Unbind();
00128 
00131   void ReportError();
00132 
00136   void ReleaseGraphicsResources(vtkWindow *);
00137 
00138 
00144   virtual void PassShaderVariables(vtkActor* actor, vtkRenderer* ren);
00145 
00146 protected:
00147   vtkCgShader();
00148   ~vtkCgShader();
00149 
00151 
00152   virtual void SetUniformParameter(const char* name, int numValues, const int* value) ;
00153   virtual void SetUniformParameter(const char* name, int numValues, const float* value) ;
00154   virtual void SetUniformParameter(const char* name, int numValues, const double* value);
00156 
00158 
00159   virtual void SetMatrixParameter(const char* name, int numValues, 
00160     int order, const float* value);
00161   virtual void SetMatrixParameter(const char* name, int numValues, 
00162     int order, const double* value);
00163   virtual void SetMatrixParameter(const char* name, const char* state_matix_type,
00164     const char* transform_type);
00166 
00167   virtual void SetSamplerParameter(const char* name, vtkTexture* texture,
00168                                    int);
00169 
00170   friend class vtkCgShaderDeviceAdapter;
00171 private:
00172   vtkCgShader(const vtkCgShader&); 
00173   void operator=(const vtkCgShader&); 
00174   
00175   vtkCgShaderInternals* Internals;
00176 
00177 };
00178 #endif //_vtkCgShader_h