| 79 | } |
| 80 | |
| 81 | void Visit(int nodeId) override |
| 82 | { |
| 83 | auto indices = this->GetCurrentDataSetIndices(); |
| 84 | int parentNode = nodeId; |
| 85 | int midIdx = indices.size() > 1 ? 0 : -1; |
| 86 | for (const auto& index : indices) |
| 87 | { |
| 88 | auto* pd = this->In->GetPartitionedDataSet(index); |
| 89 | if (!pd || pd->GetNumberOfPartitions() == 0) |
| 90 | { |
| 91 | continue; |
| 92 | } |
| 93 | unsigned int np = pd->GetNumberOfPartitions(); |
| 94 | if (np > 1 && midIdx < 0) |
| 95 | { |
| 96 | midIdx = 0; |
| 97 | } |
| 98 | // Loop over partitions. If any is a statistical model, add its tables. |
| 99 | for (unsigned int ii = 0; ii < np; ++ii) |
| 100 | { |
| 101 | if (auto* model = vtkStatisticalModel::SafeDownCast(pd->GetPartitionAsDataObject(ii))) |
| 102 | { |
| 103 | if (midIdx >= 0) |
| 104 | { |
| 105 | std::string midNodeName = vtk::to_string(midIdx++); |
| 106 | parentNode = this->AssemblyOut->AddNode(midNodeName.c_str(), nodeId); |
| 107 | } |
| 108 | AddModelToAssembly(this->Out, model, this->AssemblyOut, parentNode); |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | }; |
| 114 | |
| 115 | } // anonymous namespace |
no test coverage detected