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

Method CreateTransferFunction2D

Rendering/VolumeOpenGL2/vtkVolumeInputHelper.cxx:383–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383void vtkVolumeInputHelper::CreateTransferFunction2D(vtkRenderer* ren, int index)
384{
385 this->ReleaseGraphicsTransfer2D(ren->GetRenderWindow());
386
387 unsigned int const num =
388 this->ComponentMode == INDEPENDENT ? Texture->GetLoadedScalars()->GetNumberOfComponents() : 1;
389
390 this->TransferFunctions2D =
391 vtkSmartPointer<vtkOpenGLVolumeLookupTables<vtkOpenGLVolumeTransferFunction2D>>::New();
392 this->TransferFunctions2D->Create(num);
393
394 std::ostringstream idx;
395 idx << index;
396
397 this->GradientCacheName = "g_gradients_" + idx.str();
398
399 for (unsigned int i = 0; i < num; i++)
400 {
401 std::ostringstream comp;
402 comp << "[" << i << "]";
403
404 this->TransferFunctions2DMap[i] = "in_transfer2D_" + idx.str() + comp.str();
405 }
406
407 this->LutInit.Modified();
408}
409
410void vtkVolumeInputHelper::ReleaseGraphicsResources(vtkWindow* window)
411{

Callers 1

Calls 8

GetLoadedScalarsMethod · 0.80
NewFunction · 0.50
GetRenderWindowMethod · 0.45
GetNumberOfComponentsMethod · 0.45
CreateMethod · 0.45
strMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected