MCPcopy Create free account
hub / github.com/Kitware/ParaView / Update

Method Update

Remoting/ServerManager/vtkSMArrayListDomain.cxx:381–450  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

379
380//---------------------------------------------------------------------------
381void vtkSMArrayListDomain::Update(vtkSMProperty*)
382{
383 vtkSMProperty* input = this->GetRequiredProperty("Input");
384 if (!input)
385 {
386 vtkErrorMacro("Missing require property 'Input'. Update failed.");
387 return;
388 }
389
390 vtkPVDataInformation* dataInfo = this->GetInputDataInformation("Input");
391 if (!dataInfo)
392 {
393 return;
394 }
395
396 vtkSMProperty* fieldDataSelection = this->GetRequiredProperty("FieldDataSelection");
397 vtkSMInputArrayDomain* iad = this->InputDomainName
398 ? vtkSMInputArrayDomain::SafeDownCast(input->GetDomain(this->InputDomainName))
399 : vtkSMInputArrayDomain::FindApplicableDomain(input);
400
401 // we use a set so that the list gets sorted as well as helps us
402 // avoid duplicates esp. when processing two datainformation objects.
403 vtkSMArrayListDomainInternals::DomainValuesSet set;
404 const auto activeAssemblyProp =
405 vtkSMStringVectorProperty::SafeDownCast(this->GetRequiredProperty("ActiveAssembly"));
406 const auto selectors =
407 vtkSMStringVectorProperty::SafeDownCast(this->GetRequiredProperty("Selectors"));
408 const auto inputProperty = vtkSMInputProperty::SafeDownCast(input);
409 const auto inputProxy = inputProperty ? inputProperty->GetProxy(0) : nullptr;
410 if (activeAssemblyProp && activeAssemblyProp->GetNumberOfElements() == 1 && selectors &&
411 inputProxy)
412 {
413 for (unsigned int i = 0; i < selectors->GetNumberOfElements(); ++i)
414 {
415 vtkPVDataInformation* selectorInfo = this->GetInputSubsetDataInformation(
416 selectors->GetElement(i), activeAssemblyProp->GetElement(0), "Input");
417 if (selectorInfo)
418 {
419 this->ALDInternals->BuildArrayList(set, this, fieldDataSelection, iad, selectorInfo);
420 }
421 }
422 }
423 else
424 {
425 this->ALDInternals->BuildArrayList(set, this, fieldDataSelection, iad, dataInfo);
426
427 vtkPVDataInformation* extraInfo = this->GetExtraDataInformation();
428 if (extraInfo)
429 {
430 this->ALDInternals->BuildArrayList(set, this, fieldDataSelection, iad, extraInfo);
431 }
432 }
433
434 vtkSMArrayListDomainInternals::DomainValuesVector values;
435 values.insert(values.end(), set.begin(), set.end());
436 if (values != this->ALDInternals->DomainValues)
437 {
438 this->ALDInternals->DomainValues = values;

Callers

nothing calls this directly

Calls 15

GetRequiredPropertyMethod · 0.80
BuildArrayListMethod · 0.80
SetStringsMethod · 0.80
GetDomainValueStringsMethod · 0.80
GetDomainMethod · 0.45
GetProxyMethod · 0.45
GetNumberOfElementsMethod · 0.45
GetElementMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected