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

Method RequestDataPDC

Filters/ParallelStatistics/vtkGenerateStatistics.cxx:751–851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749}
750
751int vtkGenerateStatistics::RequestDataPDC(
752 vtkPartitionedDataSetCollection* pdc, vtkPartitionedDataSetCollection* modelTree)
753{
754 // Note: because a PDC may never contain another PDC, we know the
755 // accumulator – which calls RequestLocalDataDispatch() on its assembly
756 // nodes – will never recurse.
757 vtkNew<StatisticsAccumulator> accumulator;
758 accumulator->ModelTree = modelTree;
759 accumulator->Data = pdc;
760 accumulator->Self = this;
761 bool didVisit = false;
762 if (!this->SingleModel)
763 {
764 if (auto* assy = pdc->GetDataAssembly())
765 {
766 // Copy the assembly from the source dataset into the output model
767 // so we can add models in locations that match the data sources.
768 // Note that by copying the assembly before any models are added,
769 // we preserve not just the structure of the assembly but also the
770 // node numberings.
771 auto* modelAssembly = modelTree->GetDataAssembly();
772 if (!modelAssembly)
773 {
774 vtkNew<vtkDataAssembly> newModelAssembly;
775 modelTree->SetDataAssembly(newModelAssembly);
776 modelAssembly = modelTree->GetDataAssembly();
777 }
778 modelAssembly->DeepCopy(assy);
779 modelAssembly->RemoveAllDataSetIndices(/*node*/ 0, /*recurse*/ true);
780#if VTK_DBG_ASSEMBLY
781 vtkIndent indent(2);
782 std::cout << "About to traverse PDC and create multiple models.\n"
783 "The model hierarchy is\n"
784 << modelAssembly->SerializeToXML(indent) << "\n";
785#endif
786 // The visitor will invoke this->StatisticsAlgorithm on data
787 // from each node, placing its result into a local model.
788 // Then it aggregates/inserts the local model into the \a model
789 // this method was passed.
790 assy->Visit(accumulator);
791 didVisit = true;
792#if VTK_DBG_ASSEMBLY
793 {
794 vtkIndent indent(2);
795 std::cout << "Finished traverse of PDC and created models.\n"
796 "The model hierarchy is\n"
797 << modelTree->GetDataAssembly()->SerializeToXML(indent) << "\n";
798 }
799#endif
800 }
801 }
802 if (!didVisit)
803 {
804 // There is no structure or (if !SingleModel) we are ignoring it;
805 // just blob each model (i.e., each partitioned dataset) into its
806 // own assembly-node at the root of the assembly.
807 vtkNew<vtkDataAssembly> fakeAssembly;
808 int numNodes = pdc->GetNumberOfPartitionedDataSets();

Callers 2

RequestDataAMRMethod · 0.95

Calls 11

GetDataAssemblyMethod · 0.80
SerializeToXMLMethod · 0.80
AddDataSetIndexMethod · 0.80
to_stringFunction · 0.50
DeepCopyMethod · 0.45
VisitMethod · 0.45
AddNodeMethod · 0.45
c_strMethod · 0.45
SetPartitionMethod · 0.45

Tested by

no test coverage detected