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

Method DeepCopy

Common/DataModel/vtkStatisticalModel.cxx:150–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150void vtkStatisticalModel::DeepCopy(vtkDataObject* src)
151{
152 if (src == this)
153 {
154 return;
155 }
156
157 if (auto* source = vtkStatisticalModel::SafeDownCast(src))
158 {
159 this->Superclass::DeepCopy(source);
160 this->SetAlgorithmParameters(source->GetAlgorithmParameters());
161 this->ModelTables.clear();
162 for (const auto& tableTypeEntry : source->ModelTables)
163 {
164 this->SetNumberOfTables(tableTypeEntry.first, static_cast<int>(tableTypeEntry.second.size()));
165 int ii = 0;
166 for (const auto& table : tableTypeEntry.second)
167 {
168 if (table)
169 {
170 auto tname = source->GetTableName(tableTypeEntry.first, ii);
171 auto tableCopy = vtkSmartPointer<vtkTable>::New();
172 tableCopy->DeepCopy(table);
173 this->SetTable(tableTypeEntry.first, ii, tableCopy, tname);
174 }
175 ++ii;
176 }
177 }
178 this->Modified();
179 }
180 else
181 {
182 vtkErrorMacro("Can only copy another vtkStatisticalModel.");
183 }
184}
185
186const char* vtkStatisticalModel::GetTableTypeName(int tableType)
187{

Callers

nothing calls this directly

Calls 8

SetNumberOfTablesMethod · 0.95
SetTableMethod · 0.95
GetTableNameMethod · 0.80
NewFunction · 0.50
clearMethod · 0.45
sizeMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected