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

Method GetComponentMode

Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx:3158–3181  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3156
3157//----------------------------------------------------------------------------
3158int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::GetComponentMode(
3159 vtkVolumeProperty* prop, vtkDataArray* array) const
3160{
3161 if (prop->GetIndependentComponents())
3162 {
3163 return VolumeInput::INDEPENDENT;
3164 }
3165 else
3166 {
3167 const auto numComp = array->GetNumberOfComponents();
3168 if (numComp == 1 || numComp == 2)
3169 return VolumeInput::LA;
3170 else if (numComp == 4)
3171 return VolumeInput::RGBA;
3172 else if (numComp == 3)
3173 {
3174 vtkGenericWarningMacro(<< "3 dependent components (e.g. RGB) are not supported."
3175 "Only 2 (LA) and 4 (RGBA) supported.");
3176 return VolumeInput::INVALID;
3177 }
3178 else
3179 return VolumeInput::INVALID;
3180 }
3181}
3182
3183//------------------------------------------------------------------------------
3184void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren, vtkVolume* vol)

Callers 2

UpdateInputsMethod · 0.95
RequestDataMethod · 0.80

Calls 1

GetNumberOfComponentsMethod · 0.45

Tested by

no test coverage detected