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

Function VerifyArrayAttribute

IO/Infovis/Testing/Cxx/TestPhyloXMLTreeReadWrite.cxx:38–70  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

36
37//------------------------------------------------------------------------------
38bool 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//------------------------------------------------------------------------------
73bool VerifyColor(vtkTree* tree, vtkIdType vertex, unsigned char r, unsigned char g, unsigned char b)

Callers 1

Calls 10

GetAbstractArrayMethod · 0.80
GetVertexDataMethod · 0.80
GetCurrentKeyMethod · 0.80
GetInformationMethod · 0.45
SetInformationMethod · 0.45
InitTraversalMethod · 0.45
IsDoneWithTraversalMethod · 0.45
GoToNextItemMethod · 0.45
GetNameMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected