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

Function reportNode

Filters/ParallelStatistics/vtkGenerateStatistics.cxx:95–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94#if VTK_DBG_MODELDATA
95void 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
152void reportModelTree(vtkPartitionedDataSetCollection* pdc)

Callers 1

reportModelTreeFunction · 0.85

Calls 14

GetDataSetIndicesMethod · 0.80
GetNodePathMethod · 0.80
GetPartitionedDataSetMethod · 0.80
GetValueByNameMethod · 0.80
GetNextIndentMethod · 0.80
emptyMethod · 0.45
GetNumberOfPartitionsMethod · 0.45
GetClassNameMethod · 0.45
IsEmptyMethod · 0.45
ToIntMethod · 0.45
GetTableMethod · 0.45

Tested by

no test coverage detected