VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Rendering
vtkCgShader.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkCgShader.h
5
6
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7
All rights reserved.
8
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10
This software is distributed WITHOUT ANY WARRANTY; without even
11
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
PURPOSE. See the above copyright notice for more information.
13
14
=========================================================================*/
15
/*
16
* Copyright 2003 Sandia Corporation.
17
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
18
* license for use of this work by or on behalf of the
19
* U.S. Government. Redistribution and use in source and binary forms, with
20
* or without modification, are permitted provided that this Notice and any
21
* statement of authorship are reproduced on all copies.
22
*/
23
92
#ifndef __vtkCgShader_h
93
#define __vtkCgShader_h
94
95
#include "
vtkShader.h
"
96
97
class
vtkActor
;
98
class
vtkCamera
;
99
class
vtkCgShaderInternals;
100
class
vtkLight
;
101
class
vtkProperty
;
102
class
vtkRenderer
;
103
104
// manages all shaders defined in the XML file
105
// especially the part about sending things to the card
106
class
VTK_RENDERING_EXPORT
vtkCgShader
:
public
vtkShader
107
{
108
public
:
109
static
vtkCgShader
*
New
();
110
vtkTypeMacro(
vtkCgShader
,
vtkShader
);
111
void
PrintSelf
(ostream &os,
vtkIndent
indent);
112
113
// Called to compile the shader code.
114
// The vtkShaderProgram calls this method only when
115
// vtkShader::IsCompiled() returns false.
116
// The subclasses must only compile the code in this method.
117
// Returns if the compile was successful.
118
virtual
int
Compile
();
119
123
virtual
void
Bind
();
124
127
virtual
void
Unbind
();
128
131
void
ReportError();
132
136
void
ReleaseGraphicsResources
(
vtkWindow
*);
137
138
140
145
virtual
void
PassShaderVariables
(
vtkActor
* actor,
vtkRenderer
* ren);
146
//BTX
147
protected
:
148
vtkCgShader
();
149
~
vtkCgShader
();
151
153
154
virtual
void
SetUniformParameter
(
const
char
*
name
,
int
numValues,
const
int
*
value
) ;
155
virtual
void
SetUniformParameter
(
const
char
*
name
,
int
numValues,
const
float
*
value
) ;
156
virtual
void
SetUniformParameter
(
const
char
*
name
,
int
numValues,
const
double
*
value
);
158
160
161
virtual
void
SetMatrixParameter
(
const
char
*
name
,
int
numValues,
162
int
order
,
const
float
*
value
);
163
virtual
void
SetMatrixParameter
(
const
char
*
name
,
int
numValues,
164
int
order
,
const
double
*
value
);
165
virtual
void
SetMatrixParameter
(
const
char
*
name
,
const
char
* state_matix_type,
166
const
char
* transform_type);
168
169
virtual
void
SetSamplerParameter
(
const
char
*
name
,
vtkTexture
* texture,
170
int
);
171
172
friend
class
vtkCgShaderDeviceAdapter
;
173
private
:
174
vtkCgShader
(
const
vtkCgShader
&);
// Not Implemented
175
void
operator=(
const
vtkCgShader
&);
// Not Implemented
176
177
vtkCgShaderInternals*
Internals
;
178
//ETX
179
};
180
#endif //_vtkCgShader_h
Generated on Wed May 30 2012 13:22:21 for VTK by
1.8.1