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

Method ReadXMLData

IO/XML/vtkXMLHyperTreeGridReader.cxx:331–417  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

329
330//------------------------------------------------------------------------------
331void vtkXMLHyperTreeGridReader::ReadXMLData()
332{
333 // Initializes the output structure
334 this->Superclass::ReadXMLData();
335
336 vtkXMLDataElement* ePrimary =
337 this->XMLParser->GetRootElement()->LookupElementWithName("HyperTreeGrid");
338
339 vtkHyperTreeGrid* output = vtkHyperTreeGrid::SafeDownCast(this->GetCurrentOutput());
340 int branchFactor;
341 int transposedRootIndexing;
342 int dimensions[3];
343
344 // Read the attributes of the hyper tree grid
345 // Whether or not there is a file description in the XML file,
346 // the Dimension and Orientation scalar attributes are no longer exploited.
347 if (!ePrimary->GetScalarAttribute("BranchFactor", branchFactor))
348 {
349 branchFactor = 2;
350 }
351 if (!ePrimary->GetScalarAttribute("TransposedRootIndexing", transposedRootIndexing))
352 {
353 transposedRootIndexing = 0;
354 }
355 if (ePrimary->GetVectorAttribute("Dimensions", 3, dimensions) != 3)
356 {
357 dimensions[0] = 1;
358 dimensions[1] = 1;
359 dimensions[2] = 1;
360 }
361 const char* normalsName = ePrimary->GetAttribute("InterfaceNormalsName");
362 if (normalsName)
363 {
364 output->SetInterfaceNormalsName(normalsName);
365 }
366 const char* interceptsName = ePrimary->GetAttribute("InterfaceInterceptsName");
367 if (interceptsName)
368 {
369 output->SetInterfaceInterceptsName(interceptsName);
370 }
371 if (normalsName && interceptsName)
372 {
373 output->SetHasInterface(true);
374 }
375 if (!ePrimary->GetScalarAttribute("NumberOfVertices", this->NumberOfPoints))
376 {
377 this->NumberOfPoints = 0;
378 }
379
380 // Define the hypertree grid
381 output->SetBranchFactor(branchFactor);
382 output->SetTransposedRootIndexing((transposedRootIndexing != 0));
383 output->SetDimensions(dimensions);
384
385 // Read geometry of hypertree grid expressed in coordinates
386 vtkXMLDataElement* eNested = ePrimary->LookupElementWithName("Grid");
387 if (eNested)
388 {

Callers

nothing calls this directly

Calls 15

ReadGridMethod · 0.95
CalculateHTsMethod · 0.95
ReadTrees_0Method · 0.95
ReadTrees_1Method · 0.95
ReadTrees_2Method · 0.95
LookupElementWithNameMethod · 0.80
GetRootElementMethod · 0.80
GetCurrentOutputMethod · 0.80
GetScalarAttributeMethod · 0.80
GetVectorAttributeMethod · 0.80
SetBranchFactorMethod · 0.80
GetAttributeMethod · 0.45

Tested by

no test coverage detected