| 148 | } |
| 149 | |
| 150 | void 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 | |
| 186 | const char* vtkStatisticalModel::GetTableTypeName(int tableType) |
| 187 | { |
nothing calls this directly
no test coverage detected