VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkShaderCodeLibrary.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 =========================================================================*/ 00024 #ifndef __vtkShaderCodeLibrary_h 00025 #define __vtkShaderCodeLibrary_h 00026 00027 #include "vtkRenderingCoreModule.h" // For export macro 00028 #include "vtkObject.h" 00029 00030 class VTKRENDERINGCORE_EXPORT vtkShaderCodeLibrary : public vtkObject 00031 { 00032 public: 00033 static vtkShaderCodeLibrary* New(); 00034 vtkTypeMacro(vtkShaderCodeLibrary, vtkObject); 00035 void PrintSelf(ostream& os, vtkIndent indent); 00036 00041 static char* GetShaderCode(const char* name); 00042 00046 static const char** GetListOfShaderCodeNames(); 00047 00049 00051 static void RegisterShaderCode(const char* name, const char* code); 00052 //BTX 00053 protected: 00054 vtkShaderCodeLibrary(); 00055 ~vtkShaderCodeLibrary(); 00057 00058 private: 00059 vtkShaderCodeLibrary(const vtkShaderCodeLibrary&); // Not implemented. 00060 void operator=(const vtkShaderCodeLibrary&); // Not implemented. 00061 00062 // vtkInternalCleanup is used to destroy Internal ptr when the application 00063 // exits. 00064 class vtkInternalCleanup 00065 { 00066 public: 00067 vtkInternalCleanup() {} 00068 ~vtkInternalCleanup(); 00069 }; 00070 00071 friend class vtkInternalCleanup; 00072 static vtkInternalCleanup Cleanup; 00073 00074 // vtkInternal is used to maintain user registered shader codes. 00075 class vtkInternal; 00076 static vtkInternal* Internal; 00077 //ETX 00078 }; 00079 00080 #endif