------------------------------------------------------------------------------
| 254 | |
| 255 | //------------------------------------------------------------------------------ |
| 256 | bool vtkSelectionNode::EqualProperties(vtkSelectionNode* other, bool fullcompare /*=true*/) |
| 257 | { |
| 258 | if (!other) |
| 259 | { |
| 260 | return false; |
| 261 | } |
| 262 | |
| 263 | vtkNew<vtkInformationIterator> iterSelf; |
| 264 | |
| 265 | iterSelf->SetInformation(this->Properties); |
| 266 | |
| 267 | vtkInformation* otherProperties = other->GetProperties(); |
| 268 | for (iterSelf->InitTraversal(); !iterSelf->IsDoneWithTraversal(); iterSelf->GoToNextItem()) |
| 269 | { |
| 270 | vtkInformationKey* key = iterSelf->GetCurrentKey(); |
| 271 | auto ikey = static_cast<vtkInformationIntegerKey*>(key); |
| 272 | if (ikey) |
| 273 | { |
| 274 | if (!otherProperties->Has(ikey) || this->Properties->Get(ikey) != otherProperties->Get(ikey)) |
| 275 | { |
| 276 | return false; |
| 277 | } |
| 278 | } |
| 279 | else |
| 280 | { |
| 281 | auto okey = static_cast<vtkInformationObjectBaseKey*>(key); |
| 282 | if (okey) |
| 283 | { |
| 284 | if (!otherProperties->Has(okey) || |
| 285 | this->Properties->Get(okey) != otherProperties->Get(okey)) |
| 286 | { |
| 287 | return false; |
| 288 | } |
| 289 | } |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | // Also check that array names match for certain content types |
| 294 | // For VALUES and THRESHOLDS, names represent array where values come from. |
| 295 | // For PEDIGREEIDS, names represent the domain of the selection. |
| 296 | if (this->GetContentType() == vtkSelectionNode::VALUES || |
| 297 | this->GetContentType() == vtkSelectionNode::PEDIGREEIDS || |
| 298 | this->GetContentType() == vtkSelectionNode::THRESHOLDS) |
| 299 | { |
| 300 | int numArrays = other->SelectionData->GetNumberOfArrays(); |
| 301 | if (this->SelectionData->GetNumberOfArrays() != numArrays) |
| 302 | { |
| 303 | return false; |
| 304 | } |
| 305 | for (int a = 0; a < numArrays; ++a) |
| 306 | { |
| 307 | vtkAbstractArray* arr = this->SelectionData->GetAbstractArray(a); |
| 308 | vtkAbstractArray* otherArr = other->SelectionData->GetAbstractArray(a); |
| 309 | if (!arr->GetName() && otherArr->GetName()) |
| 310 | { |
| 311 | return false; |
| 312 | } |
| 313 | if (arr->GetName() && !otherArr->GetName()) |
no test coverage detected