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

Method ComputeMagnitudePointData

Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.cxx:589–611  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

587
588//------------------------------------------------------------------------------
589void vtkSmartVolumeMapper::ComputeMagnitudePointData(vtkDataSet* input, vtkDataArray* arr)
590{
591 vtkImageData* imData = vtkImageData::SafeDownCast(input);
592 if (!imData)
593 {
594 // TODO: Support image magnitude calculation for rectilinear grids
595 return;
596 }
597 vtkNew<vtkImageData> tempInput;
598 tempInput->ShallowCopy(imData);
599
600 const int id =
601 tempInput->GetPointData()->SetActiveAttribute(arr->GetName(), vtkDataSetAttributes::SCALARS);
602 if (id < 0)
603 {
604 vtkErrorMacro("Failed to set the active attribute in vtkImageMagnitude's input!");
605 return;
606 }
607
608 this->ImageMagnitude->SetInputData(tempInput);
609 this->ImageMagnitude->Update();
610 this->InputDataMagnitude->ShallowCopy(this->ImageMagnitude->GetOutput());
611}
612
613//------------------------------------------------------------------------------
614void vtkSmartVolumeMapper::SetupVectorMode(vtkVolume* vol)

Callers 1

SetupVectorModeMethod · 0.95

Calls 7

ShallowCopyMethod · 0.45
SetActiveAttributeMethod · 0.45
GetPointDataMethod · 0.45
GetNameMethod · 0.45
SetInputDataMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected