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

Method InternalUpdate

Rendering/VolumeOpenGL2/vtkOpenGLVolumeTransferFunction2D.cxx:24–50  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

22
23//------------------------------------------------------------------------------
24void vtkOpenGLVolumeTransferFunction2D::InternalUpdate(vtkObject* func, int vtkNotUsed(blendMode),
25 double vtkNotUsed(sampleDistance), double vtkNotUsed(unitDistance), int filterValue)
26{
27 vtkImageData* transfer2D = vtkImageData::SafeDownCast(func);
28 if (!transfer2D)
29 {
30 return;
31 }
32 int* dims = transfer2D->GetDimensions();
33 // Resample if there is a size restriction
34 void* data = transfer2D->GetPointData()->GetScalars()->GetVoidPointer(0);
35 if (dims[0] != this->TextureWidth || dims[1] != this->TextureHeight)
36 {
37 this->ResizeFilter->SetInputData(transfer2D);
38 this->ResizeFilter->SetResizeMethodToOutputDimensions();
39 this->ResizeFilter->SetOutputDimensions(this->TextureWidth, this->TextureHeight, 1);
40 this->ResizeFilter->Update();
41 data = this->ResizeFilter->GetOutput()->GetPointData()->GetScalars()->GetVoidPointer(0);
42 }
43
44 this->TextureObject->SetWrapS(vtkTextureObject::ClampToEdge);
45 this->TextureObject->SetWrapT(vtkTextureObject::ClampToEdge);
46 this->TextureObject->SetMagnificationFilter(filterValue);
47 this->TextureObject->SetMinificationFilter(filterValue);
48 this->TextureObject->Create2DFromRaw(
49 this->TextureWidth, this->TextureHeight, this->NumberOfColorComponents, VTK_FLOAT, data);
50}
51
52//------------------------------------------------------------------------------
53bool vtkOpenGLVolumeTransferFunction2D::NeedsUpdate(vtkObject* func,

Callers

nothing calls this directly

Calls 8

Create2DFromRawMethod · 0.80
GetDimensionsMethod · 0.45
GetVoidPointerMethod · 0.45
GetScalarsMethod · 0.45
GetPointDataMethod · 0.45
SetInputDataMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected