forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvtkXMLMaterial.h
108 lines (84 loc) · 3.24 KB
/
vtkXMLMaterial.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*=========================================================================
Program: Visualization Toolkit
Module: vtkXMLMaterial.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkXMLMaterial - encapsulates a VTK Material description.
// .SECTION Description
// vtkXMLMaterial encapsulates VTK Material description. It keeps a pointer
// to vtkXMLDataElement that defines the material and provides
// access to Shaders/Properties defined in it.
// .SECTION Thanks
// Shader support in VTK includes key contributions by Gary Templet at
// Sandia National Labs.
#ifndef __vtkXMLMaterial_h
#define __vtkXMLMaterial_h
#include "vtkObject.h"
class vtkXMLDataElement;
class vtkXMLMaterialInternals;
class vtkXMLShader;
class VTK_IO_EXPORT vtkXMLMaterial : public vtkObject
{
public:
static vtkXMLMaterial* New();
vtkTypeMacro(vtkXMLMaterial, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Create a new instance. It searches for the material
// using the following order: first, check the MaterialLibrary; second,
// treat the name as an absolute path and try to locate it; third,
// search the Material repository. Returns null is it fails to
// locate the material.
static vtkXMLMaterial* CreateInstance(const char* name);
// Description:
// Get number of elements of type Property.
int GetNumberOfProperties();
// Description:
// Get number of elements of type Texture.
int GetNumberOfTextures();
// Description:
// Get number of Vertex shaders.
int GetNumberOfVertexShaders();
// Description:
// Get number of fragment shaders.
int GetNumberOfFragmentShaders();
// Description:
// Get the ith vtkXMLDataElement of type <Property />.
vtkXMLDataElement* GetProperty(int id=0);
// Description:
// Get the ith vtkXMLDataElement of type <Texture />.
vtkXMLDataElement* GetTexture(int id=0);
// Description:
// Get the ith vtkXMLDataElement of type <VertexShader />.
vtkXMLShader* GetVertexShader(int id=0);
// Description:
// Get the ith vtkXMLDataElement of type <FragmentShader />.
vtkXMLShader* GetFragmentShader(int id=0);
// Description:
// Get/Set the XML root element that describes this material.
vtkGetObjectMacro(RootElement, vtkXMLDataElement);
void SetRootElement(vtkXMLDataElement*);
// Description:
// Get the Language used by the shaders in this Material.
// The Language of a vtkXMLMaterial is based on the Language of it's
// shaders.
int GetShaderLanguage();
// Description:
// Get the style the shaders.
// \post valid_result: result==1 || result==2
int GetShaderStyle();
protected:
vtkXMLMaterial();
~vtkXMLMaterial();
vtkXMLDataElement* RootElement;
vtkXMLMaterialInternals* Internals;
private:
vtkXMLMaterial(const vtkXMLMaterial&); // Not implemented.
void operator=(const vtkXMLMaterial&); // Not implemented.
};
#endif