VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkXMLShader.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 =========================================================================*/ 00026 #ifndef __vtkXMLShader_h 00027 #define __vtkXMLShader_h 00028 00029 #include "vtkObject.h" 00030 00031 class vtkXMLDataElement; 00032 00033 class VTK_IO_EXPORT vtkXMLShader : public vtkObject 00034 { 00035 public: 00036 static vtkXMLShader* New(); 00037 vtkTypeMacro(vtkXMLShader, vtkObject); 00038 void PrintSelf(ostream& os, vtkIndent indent); 00039 00041 00042 vtkGetObjectMacro(RootElement, vtkXMLDataElement); 00043 void SetRootElement(vtkXMLDataElement*); 00045 00047 int GetLanguage(); 00048 00050 int GetScope(); 00051 00053 int GetLocation(); 00054 00063 int GetStyle(); 00064 00066 const char* GetName(); 00067 00069 const char* GetEntry(); 00070 00072 const char* GetCode(); 00073 00076 const char** GetArgs(); 00077 00080 static char* LocateFile(const char* filename); 00081 00082 //BTX 00083 enum LanguageCodes 00084 { 00085 LANGUAGE_NONE=0, 00086 LANGUAGE_MIXED, 00087 LANGUAGE_CG, 00088 LANGUAGE_GLSL 00089 }; 00090 00091 enum ScopeCodes 00092 { 00093 SCOPE_NONE=0, 00094 SCOPE_MIXED, 00095 SCOPE_VERTEX, 00096 SCOPE_FRAGMENT 00097 }; 00098 00099 enum LocationCodes 00100 { 00101 LOCATION_NONE=0, 00102 LOCATION_INLINE, 00103 LOCATION_FILE, 00104 LOCATION_LIBRARY 00105 }; 00106 //ETX 00107 protected: 00108 vtkXMLShader(); 00109 ~vtkXMLShader(); 00110 00111 // Reads the file and fills it in this->Code. 00112 void ReadCodeFromFile(const char* fullpath); 00113 00114 char* Code; // cache for the code. 00115 vtkSetStringMacro(Code); 00116 00117 vtkXMLDataElement* RootElement; 00118 vtkXMLDataElement* SourceLibraryElement; 00119 void SetSourceLibraryElement(vtkXMLDataElement*); 00120 00121 char** Args; 00122 void CleanupArgs(); 00123 private: 00124 vtkXMLShader(const vtkXMLShader&); // Not implemented. 00125 void operator=(const vtkXMLShader&); // Not implemented. 00126 }; 00127 00128 #endif 00129