16 #ifndef vtkOpenGLVolumeOpacityTable_h_ 17 #define vtkOpenGLVolumeOpacityTable_h_ 70 glActiveTexture(GL_TEXTURE2);
71 glBindTexture(GL_TEXTURE_1D, this->
TextureId);
78 double sampleDistance,
81 bool linearInterpolation)
84 glActiveTexture(GL_TEXTURE2);
86 bool needUpdate=
false;
101 glBindTexture(GL_TEXTURE_1D,this->
TextureId);
104 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S,
112 needUpdate || !this->
Loaded)
128 float* ptr = this->
Table;
129 double factor = sampleDistance/unitDistance;
135 *ptr =
static_cast<float>(1.0-pow(1.0-static_cast<double>(*ptr),
145 float* ptr = this->
Table;
146 double factor = sampleDistance/unitDistance;
152 *ptr =
static_cast<float>(
static_cast<double>(*ptr)*factor);
160 glTexImage1D(GL_TEXTURE_1D, 0, GL_ALPHA16, this->
TextureWidth,
166 needUpdate= needUpdate ||
171 GLint value = linearInterpolation ? GL_LINEAR : GL_NEAREST;
172 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, value);
173 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, value);
176 glActiveTexture(GL_TEXTURE0);
204 this->NumberOfTables = numberOfTables;
210 delete [] this->Tables;
217 return &this->Tables[i];
224 return this->NumberOfTables;
228 unsigned int NumberOfTables;
241 #endif // vtkOpenGLVolumeOpacityTable_h_
vtkOpenGLOpacityTables(unsigned int numberOfTables)
Defines a 1D piecewise function.
typedef GLuint(APIENTRYP PFNGLCREATEPROGRAMPROC)(void)
record modification and/or execution time
unsigned long int GetMTime()
void Update(vtkPiecewiseFunction *scalarOpacity, int blendMode, double sampleDistance, double range[2], double unitDistance, bool linearInterpolation)
GLsizei const GLfloat * value
void GetTable(double x1, double x2, int size, float *table, int stride=1)
double LastSampleDistance
bool LastLinearInterpolation
GLint GLint GLsizei width
vtkOpenGLOpacityTable(int width=1024)
~vtkOpenGLOpacityTables()
typedef GLint(APIENTRYP PFNGLGETATTRIBLOCATIONPROC)(GLuint program
vtkOpenGLOpacityTable * GetTable(unsigned int i)
unsigned int GetNumberOfTables()