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

Method ReadPrimaryElement

IO/XML/vtkXMLPStructuredGridReader.cxx:73–105  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

71
72//------------------------------------------------------------------------------
73int vtkXMLPStructuredGridReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
74{
75 if (!this->Superclass::ReadPrimaryElement(ePrimary))
76 {
77 return 0;
78 }
79
80 // Find the PPoints element.
81 this->PPointsElement = nullptr;
82 int numNested = ePrimary->GetNumberOfNestedElements();
83 for (int i = 0; i < numNested; ++i)
84 {
85 vtkXMLDataElement* eNested = ePrimary->GetNestedElement(i);
86 if ((strcmp(eNested->GetName(), "PPoints") == 0) && (eNested->GetNumberOfNestedElements() == 1))
87 {
88 this->PPointsElement = eNested;
89 }
90 }
91
92 if (!this->PPointsElement)
93 {
94 int extent[6];
95 this->GetCurrentOutputInformation()->Get(
96 vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), extent);
97 if ((extent[0] <= extent[1]) && (extent[2] <= extent[3]) && (extent[4] <= extent[5]))
98 {
99 vtkErrorMacro("Could not find PPoints element with 1 array.");
100 return 0;
101 }
102 }
103
104 return 1;
105}
106
107//------------------------------------------------------------------------------
108void vtkXMLPStructuredGridReader::SetupOutputData()

Callers

nothing calls this directly

Calls 5

GetNestedElementMethod · 0.80
GetNameMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected