------------------------------------------------------------------------------ The Render method will determine the render mode and then render using the appropriate mapper. If the render mode is invalid (the user explicitly chooses something that is not supported) the render will silently fail. ------------------------------------------------------------------------------
| 200 | // chooses something that is not supported) the render will silently fail. |
| 201 | //------------------------------------------------------------------------------ |
| 202 | void vtkSmartVolumeMapper::Render(vtkRenderer* ren, vtkVolume* vol) |
| 203 | { |
| 204 | // Compute the render mode based on the requested |
| 205 | // render mode, available hardware, and render window's |
| 206 | // desired update rate |
| 207 | this->ComputeRenderMode(ren, vol); |
| 208 | |
| 209 | vtkGPUVolumeRayCastMapper* usedMapper = nullptr; |
| 210 | |
| 211 | switch (this->CurrentRenderMode) |
| 212 | { |
| 213 | case vtkSmartVolumeMapper::RayCastRenderMode: |
| 214 | if (this->InteractiveAdjustSampleDistances) |
| 215 | { |
| 216 | this->RayCastMapper->SetAutoAdjustSampleDistances( |
| 217 | ren->GetRenderWindow()->GetDesiredUpdateRate() >= this->InteractiveUpdateRate); |
| 218 | } |
| 219 | else |
| 220 | { |
| 221 | this->RayCastMapper->SetAutoAdjustSampleDistances(this->AutoAdjustSampleDistances); |
| 222 | } |
| 223 | this->RayCastMapper->Render(ren, vol); |
| 224 | break; |
| 225 | case vtkSmartVolumeMapper::GPURenderMode: |
| 226 | if (this->LowResGPUNecessary) |
| 227 | { |
| 228 | usedMapper = this->GPULowResMapper; |
| 229 | } |
| 230 | else |
| 231 | { |
| 232 | usedMapper = this->GPUMapper; |
| 233 | } |
| 234 | if (this->InteractiveAdjustSampleDistances) |
| 235 | { |
| 236 | usedMapper->SetAutoAdjustSampleDistances( |
| 237 | ren->GetRenderWindow()->GetDesiredUpdateRate() >= this->InteractiveUpdateRate); |
| 238 | } |
| 239 | else |
| 240 | { |
| 241 | usedMapper->SetAutoAdjustSampleDistances(this->AutoAdjustSampleDistances); |
| 242 | } |
| 243 | usedMapper->Render(ren, vol); |
| 244 | break; |
| 245 | case vtkSmartVolumeMapper::OSPRayRenderMode: |
| 246 | if (!this->OSPRayMapper) |
| 247 | { |
| 248 | this->OSPRayMapper = vtkOSPRayVolumeInterface::New(); |
| 249 | } |
| 250 | this->OSPRayMapper->Render(ren, vol); |
| 251 | break; |
| 252 | case vtkSmartVolumeMapper::AnariRenderMode: |
| 253 | if (!this->AnariMapper) |
| 254 | { |
| 255 | this->AnariMapper = vtkAnariVolumeInterface::New(); |
| 256 | } |
| 257 | this->AnariMapper->Render(ren, vol); |
| 258 | break; |
| 259 | case vtkSmartVolumeMapper::InvalidRenderMode: |
nothing calls this directly
no test coverage detected