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

Method Update

Rendering/VolumeOpenGL2/vtkOpenGLVolumeLookupTable.cxx:129–168  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

127
128//------------------------------------------------------------------------------
129void vtkOpenGLVolumeLookupTable::Update(vtkObject* func, double scalarRange[2], int blendMode,
130 double sampleDistance, double unitDistance, int filterValue, vtkOpenGLRenderWindow* renWin)
131{
132 if (!func || !renWin)
133 {
134 return;
135 }
136
137 if (!this->TextureObject)
138 {
139 this->TextureObject = vtkTextureObject::New();
140 }
141
142 this->TextureObject->SetContext(renWin);
143
144 if (this->NeedsUpdate(func, scalarRange, blendMode, sampleDistance))
145 {
146 int idealW = 1024;
147 int newHeight = 1;
148 this->ComputeIdealTextureSize(func, idealW, newHeight, renWin);
149 int const newWidth = this->GetMaximumSupportedTextureWidth(renWin, idealW);
150 if (!this->Table || this->TextureWidth != newWidth || this->TextureHeight != newHeight)
151 {
152 this->TextureWidth = newWidth;
153 this->TextureHeight = newHeight;
154 this->AllocateTable();
155 }
156
157 this->InternalUpdate(func, blendMode, sampleDistance, unitDistance, filterValue);
158 this->LastInterpolation = filterValue;
159 this->BuildTime.Modified();
160 }
161
162 if (this->LastInterpolation != filterValue)
163 {
164 this->LastInterpolation = filterValue;
165 this->TextureObject->SetMagnificationFilter(filterValue);
166 this->TextureObject->SetMinificationFilter(filterValue);
167 }
168}
169
170//------------------------------------------------------------------------------
171void vtkOpenGLVolumeLookupTable::AllocateTable()

Callers 15

GetBoundsMethod · 0.45
GetBoundsMethod · 0.45
UpdateMaskTransferMethod · 0.45
RenderVolumeGeometryMethod · 0.45
InternalUpdateMethod · 0.45
RenderPieceMethod · 0.45

Calls 8

NeedsUpdateMethod · 0.95
AllocateTableMethod · 0.95
InternalUpdateMethod · 0.95
NewFunction · 0.50
SetContextMethod · 0.45
ModifiedMethod · 0.45

Tested by 15

TestGPURayCastIsosurfaceFunction · 0.36
CreateCurvedPlaneFunction · 0.36
TestLUTRangeFunction · 0.36
TestRGBSourceFunction · 0.36
TestGPURayCastUserShaderFunction · 0.36
CreateCurvedPlaneFunction · 0.36
TestGPURayCastSlicePlaneFunction · 0.36