| 93 | |
| 94 | #if VTK_DBG_MODELDATA |
| 95 | void reportNode( |
| 96 | vtkPartitionedDataSetCollection* pdc, vtkDataAssembly* da, int nodeId, vtkIndent& indent) |
| 97 | { |
| 98 | auto dnodes = da->GetDataSetIndices(nodeId, /*traverse_subtree*/ false); |
| 99 | if (!dnodes.empty()) |
| 100 | { |
| 101 | // Print out datasets attached to nodeId: |
| 102 | std::cout << indent << da->GetNodePath(nodeId) << ":"; |
| 103 | for (const auto& dnode : dnodes) |
| 104 | { |
| 105 | |
| 106 | std::cout << " " << dnode << "("; |
| 107 | auto* pds = pdc->GetPartitionedDataSet(dnode); |
| 108 | if (!pds) |
| 109 | { |
| 110 | std::cout << "--)\n"; |
| 111 | continue; |
| 112 | } |
| 113 | int nn = pds->GetNumberOfPartitions(); |
| 114 | for (int ii = 0; ii < nn; ++ii) |
| 115 | { |
| 116 | auto* obj = pds->GetPartitionAsDataObject(ii); |
| 117 | if (ii > 0) |
| 118 | { |
| 119 | std::cout << " "; |
| 120 | } |
| 121 | std::cout << obj << " " << (obj ? obj->GetClassName() : "(null)"); |
| 122 | if (auto* model = vtkStatisticalModel::SafeDownCast(obj)) |
| 123 | { |
| 124 | if (model->IsEmpty()) |
| 125 | { |
| 126 | std::cout << "(empty)"; |
| 127 | } |
| 128 | else |
| 129 | { |
| 130 | std::cout << "(" |
| 131 | << model->GetTable(vtkStatisticalModel::Learned, 0) |
| 132 | ->GetValueByName(0, "Cardinality") |
| 133 | .ToInt() |
| 134 | << " samples)"; |
| 135 | } |
| 136 | } |
| 137 | std::cout << ")"; |
| 138 | } |
| 139 | } |
| 140 | std::cout << "\n"; |
| 141 | } |
| 142 | |
| 143 | // Now recurse over children, if any: |
| 144 | auto next = indent.GetNextIndent(); |
| 145 | for (int cc = 0; cc < da->GetNumberOfChildren(nodeId); ++cc) |
| 146 | { |
| 147 | int child = da->GetChild(nodeId, cc); |
| 148 | reportNode(pdc, da, child, next); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | void reportModelTree(vtkPartitionedDataSetCollection* pdc) |
no test coverage detected