------------------------------------------------------------------------------
| 36 | |
| 37 | //------------------------------------------------------------------------------ |
| 38 | bool VerifyArrayAttribute( |
| 39 | vtkTree* tree, const char* arrayName, const char* attributeName, const char* baseline) |
| 40 | { |
| 41 | vtkAbstractArray* array = tree->GetVertexData()->GetAbstractArray(arrayName); |
| 42 | if (!array) |
| 43 | { |
| 44 | std::cout << "could not find " << arrayName << std::endl; |
| 45 | return false; |
| 46 | } |
| 47 | vtkInformation* info = array->GetInformation(); |
| 48 | vtkNew<vtkInformationIterator> infoItr; |
| 49 | infoItr->SetInformation(info); |
| 50 | for (infoItr->InitTraversal(); !infoItr->IsDoneWithTraversal(); infoItr->GoToNextItem()) |
| 51 | { |
| 52 | vtkInformationStringKey* key = vtkInformationStringKey::SafeDownCast(infoItr->GetCurrentKey()); |
| 53 | if (strcmp(key->GetName(), attributeName) == 0) |
| 54 | { |
| 55 | std::string value = info->Get(key); |
| 56 | if (value == baseline) |
| 57 | { |
| 58 | return true; |
| 59 | } |
| 60 | else |
| 61 | { |
| 62 | std::cout << "found " << value << " for " << arrayName << "'s " << attributeName |
| 63 | << " attribute. Expected " << baseline << std::endl; |
| 64 | return false; |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | std::cout << "could not find " << attributeName << " for " << arrayName << std::endl; |
| 69 | return false; |
| 70 | } |
| 71 | |
| 72 | //------------------------------------------------------------------------------ |
| 73 | bool VerifyColor(vtkTree* tree, vtkIdType vertex, unsigned char r, unsigned char g, unsigned char b) |
no test coverage detected