MCPcopy Create free account
hub / github.com/Kitware/VTK / UpdateTransferFunction2D

Method UpdateTransferFunction2D

Rendering/VolumeOpenGL2/vtkVolumeInputHelper.cxx:247–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247void vtkVolumeInputHelper::UpdateTransferFunction2D(vtkRenderer* ren, unsigned int component)
248{
249 // Use the first LUT when using dependent components
250 vtkVolumeProperty* prop = this->Volume->GetProperty();
251 unsigned int const lutIndex = prop->GetIndependentComponents() ? component : 0;
252
253 vtkImageData* transfer2D = prop->GetTransferFunction2D(lutIndex);
254#ifndef GL_ES_VERSION_3_0
255 int const interp = prop->GetInterpolationType() == VTK_LINEAR_INTERPOLATION
256 ? vtkTextureObject::Linear
257 : vtkTextureObject::Nearest;
258#else
259 int const interp = vtkTextureObject::Nearest;
260#endif
261
262 double scalarRange[2] = { 0, 1 };
263 this->TransferFunctions2D->GetTable(lutIndex)->Update(transfer2D, scalarRange, 0, 0, 0, interp,
264 vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow()));
265}
266
267void vtkVolumeInputHelper::ActivateTransferFunction(vtkShaderProgram* prog, int blendMode)
268{

Callers 1

Calls 5

GetTransferFunction2DMethod · 0.80
GetPropertyMethod · 0.45
UpdateMethod · 0.45
GetTableMethod · 0.45
GetRenderWindowMethod · 0.45

Tested by

no test coverage detected