| 381 | } |
| 382 | |
| 383 | void 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 | |
| 410 | void vtkVolumeInputHelper::ReleaseGraphicsResources(vtkWindow* window) |
| 411 | { |
no test coverage detected