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

Method ActivateTransferFunction

Rendering/VolumeOpenGL2/vtkVolumeInputHelper.cxx:267–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267void vtkVolumeInputHelper::ActivateTransferFunction(vtkShaderProgram* prog, int blendMode)
268{
269 int const transferMode = this->Volume->GetProperty()->GetTransferFunctionMode();
270 int const numActiveLuts =
271 this->ComponentMode == INDEPENDENT ? Texture->GetLoadedScalars()->GetNumberOfComponents() : 1;
272 switch (transferMode)
273 {
274 case vtkVolumeProperty::TF_1D:
275 for (int i = 0; i < numActiveLuts; ++i)
276 {
277 this->OpacityTables->GetTable(i)->Activate();
278 prog->SetUniformi(
279 this->OpacityTablesMap[i].c_str(), this->OpacityTables->GetTable(i)->GetTextureUnit());
280
281 if (blendMode != vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND)
282 {
283 this->RGBTables->GetTable(i)->Activate();
284 prog->SetUniformi(
285 this->RGBTablesMap[i].c_str(), this->RGBTables->GetTable(i)->GetTextureUnit());
286 }
287
288 if (this->GradientOpacityTables)
289 {
290 this->GradientOpacityTables->GetTable(i)->Activate();
291 prog->SetUniformi(this->GradientOpacityTablesMap[i].c_str(),
292 this->GradientOpacityTables->GetTable(i)->GetTextureUnit());
293 }
294 }
295 break;
296 case vtkVolumeProperty::TF_2D:
297 for (int i = 0; i < numActiveLuts; ++i)
298 {
299 vtkOpenGLVolumeTransferFunction2D* table = this->TransferFunctions2D->GetTable(i);
300 table->Activate();
301 prog->SetUniformi(this->TransferFunctions2DMap[i].c_str(), table->GetTextureUnit());
302 }
303 break;
304 }
305}
306
307void vtkVolumeInputHelper::DeactivateTransferFunction(int blendMode)
308{

Callers 1

Calls 8

GetLoadedScalarsMethod · 0.80
GetPropertyMethod · 0.45
GetNumberOfComponentsMethod · 0.45
ActivateMethod · 0.45
GetTableMethod · 0.45
SetUniformiMethod · 0.45
c_strMethod · 0.45
GetTextureUnitMethod · 0.45

Tested by

no test coverage detected