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

Method Synchronize

Rendering/ANARI/vtkAnariVolumeMapperNode.cxx:260–505  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

258
259//----------------------------------------------------------------------------
260void vtkAnariVolumeMapperNode::Synchronize(bool prepass)
261{
262 vtkAnariProfiling startProfiling(
263 "vtkAnariVolumeMapperNode::Synchronize", vtkAnariProfiling::GREEN);
264
265 if (!prepass)
266 {
267 return;
268 }
269
270 vtkVolumeNode* volNode = vtkVolumeNode::SafeDownCast(this->Parent);
271 vtkVolume* vol = vtkVolume::SafeDownCast(volNode->GetRenderable());
272
273 if (vol->GetVisibility() != false)
274 {
275 vtkVolumeProperty* const volumeProperty = vol->GetProperty();
276
277 if (!volumeProperty)
278 {
279 // this is OK, happens in paraview client side for instance
280 vtkDebugMacro(<< "Volume doesn't have property set");
281 return;
282 }
283
284 vtkAbstractVolumeMapper* mapper = vtkAbstractVolumeMapper::SafeDownCast(this->GetRenderable());
285
286 // make sure that we have scalar input and update the scalar input
287 if (mapper->GetDataSetInput() == nullptr)
288 {
289 // OK - PV cli/srv for instance vtkErrorMacro("VolumeMapper had no input!");
290 vtkDebugMacro(<< "No scalar input for the Volume");
291 return;
292 }
293
294 mapper->GetInputAlgorithm()->UpdateInformation();
295 mapper->GetInputAlgorithm()->Update();
296 vtkDataSet* dataSet = mapper->GetDataSetInput();
297 vtkImageData* data = vtkImageData::SafeDownCast(dataSet);
298
299 if (!data)
300 {
301 vtkDebugMacro("VolumeMapper's Input has no data!");
302 return;
303 }
304
305 int fieldAssociation;
306 vtkDataArray* sa = vtkDataArray::SafeDownCast(this->GetArrayToProcess(data, fieldAssociation));
307
308 if (!sa)
309 {
310 vtkErrorMacro("VolumeMapper's Input has no scalar array!");
311 return;
312 }
313
314 const int vectorComponent = volumeProperty->GetRGBTransferFunction()->GetVectorComponent();
315 const int vectorMode = volumeProperty->GetRGBTransferFunction()->GetVectorMode();
316
317 vtkDataArray* sca = this->Internal->ConvertScalarData(sa, vectorComponent, vectorMode);

Callers

nothing calls this directly

Calls 15

GetArrayToProcessMethod · 0.80
ConvertScalarDataMethod · 0.80
ReservePropIdMethod · 0.80
DeleteMethod · 0.65
ExecuteFunction · 0.50
releaseFunction · 0.50
GetVisibilityMethod · 0.45
GetPropertyMethod · 0.45
GetDataSetInputMethod · 0.45
UpdateInformationMethod · 0.45

Tested by

no test coverage detected