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

Method GetObjectAttributeName

IO/Exodus/vtkExodusIIReader.cxx:5094–5122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5092}
5093
5094const char* vtkExodusIIReaderPrivate::GetObjectAttributeName(int otyp, int oi, int ai)
5095{
5096 std::map<int, std::vector<BlockInfoType>>::iterator it = this->BlockInfo.find(otyp);
5097 if (it != this->BlockInfo.end())
5098 {
5099 int N = (int)it->second.size();
5100 if (oi < 0 || oi >= N)
5101 {
5102 vtkDebugMacro("You requested block " << oi << " in a collection of only " << N << " blocks.");
5103 return nullptr;
5104 }
5105 oi = this->SortedObjectIndices[otyp][oi]; // index into sorted list of objects (block order, not
5106 // file order)
5107 N = (int)it->second[oi].AttributeNames.size();
5108 if (ai < 0 || ai >= N)
5109 {
5110 vtkDebugMacro(
5111 "You requested attribute " << ai << " in a collection of only " << N << " attributes.");
5112 return nullptr;
5113 }
5114 else
5115 {
5116 return it->second[oi].AttributeNames[ai].c_str();
5117 }
5118 }
5119 vtkDebugMacro("Could not find collection of blocks of type "
5120 << otyp << " (" << objtype_names[this->GetObjectTypeIndexFromObjectType(otyp)] << ").");
5121 return nullptr;
5122}
5123
5124int vtkExodusIIReaderPrivate::GetObjectAttributeIndex(int otyp, int oi, const char* attribName)
5125{

Callers 1

SetUpEmptyGridMethod · 0.95

Calls 5

findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected