File: vtkXMLMaterial.h

package info (click to toggle)
paraview 4.0.1-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 526,572 kB
  • sloc: cpp: 2,284,430; ansic: 816,374; python: 239,936; xml: 70,162; tcl: 48,295; fortran: 39,116; yacc: 5,466; java: 3,518; perl: 3,107; lex: 1,620; sh: 1,555; makefile: 932; asm: 471; pascal: 228
file content (109 lines) | stat: -rw-r--r-- 3,376 bytes parent folder | download | duplicates (2)
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
108
109
/*=========================================================================

  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 "vtkRenderingCoreModule.h" // For export macro
#include "vtkObject.h"

class vtkXMLDataElement;
class vtkXMLMaterialInternals;
class vtkXMLShader;

class VTKRENDERINGCORE_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