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