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

Method InitVariableData

IO/Geometry/vtkWindBladeReader.cxx:1461–1488  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1459
1460//------------------------------------------------------------------------------
1461void vtkWindBladeReader::InitVariableData(
1462 int var, int& numberOfComponents, float*& varData, int& planeSize, int& rowSize)
1463{
1464 // Set the number of components for this variable
1465 numberOfComponents = 0;
1466 if (this->VariableStruct[var] == SCALAR)
1467 {
1468 numberOfComponents = 1;
1469 this->Data[var]->SetNumberOfComponents(numberOfComponents);
1470 }
1471 else if (this->VariableStruct[var] == VECTOR)
1472 {
1473 numberOfComponents = DIMENSION;
1474 this->Data[var]->SetNumberOfComponents(numberOfComponents);
1475 }
1476
1477 // Set the number of tuples which will allocate all tuples
1478 this->Data[var]->SetNumberOfTuples(this->NumberOfTuples);
1479
1480 // For each component of the requested variable load data
1481 varData = this->Data[var]->GetPointer(0);
1482
1483 // Entire block of data is read so to calculate index into that data we
1484 // must use the entire Dimension and not the SubDimension
1485 // Only the requested subextents are stored on this processor
1486 planeSize = this->Dimension[0] * this->Dimension[1];
1487 rowSize = this->Dimension[0];
1488}
1489
1490//------------------------------------------------------------------------------
1491bool vtkWindBladeReader::SetUpGlobalData(const std::string& fileName, std::stringstream& inStr)

Callers 2

LoadVariableDataMethod · 0.95
LoadVariableDataMethod · 0.80

Calls 3

SetNumberOfComponentsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
GetPointerMethod · 0.45

Tested by

no test coverage detected