• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

dox/Rendering/vtkCgShader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCgShader.h,v $
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 =========================================================================*/
00015 /*
00016  * Copyright 2003 Sandia Corporation.
00017  * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00018  * license for use of this work by or on behalf of the
00019  * U.S. Government. Redistribution and use in source and binary forms, with
00020  * or without modification, are permitted provided that this Notice and any
00021  * statement of authorship are reproduced on all copies.
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 // manages all shaders defined in the XML file
00105 // especially the part about sending things to the card
00106 class VTK_RENDERING_EXPORT vtkCgShader : public vtkShader
00107 {
00108 public:
00109   static vtkCgShader *New();
00110   vtkTypeRevisionMacro(vtkCgShader, vtkShader);
00111   void PrintSelf(ostream &os, vtkIndent indent);
00112  
00113   // Called to compile the shader code.
00114   // The vtkShaderProgram calls this method only when
00115   // vtkShader::IsCompiled() returns false.
00116   // The subclasses must only compile the code in this method.
00117   // Returns if the compile was successful.
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 //BTX
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&); // Not Implemented
00173   void operator=(const vtkCgShader&); // Not Implemented
00174   
00175   vtkCgShaderInternals* Internals;
00176 //ETX
00177 };
00178 #endif //_vtkCgShader_h

Generated by  doxygen 1.7.1