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

Method FillPoints

IO/NetCDF/vtkNetCDFUGRIDReader.cxx:579–613  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

577
578//--------------------------------------------------------------------------------------------------
579bool vtkNetCDFUGRIDReader::FillPoints(vtkUnstructuredGrid* output)
580{
581 vtkNew<vtkPoints> points;
582
583 if (this->NodeType == NC_FLOAT)
584 {
585 points->SetDataTypeToFloat();
586 }
587 else if (this->NodeType == NC_DOUBLE)
588 {
589 points->SetDataTypeToDouble();
590 }
591 else
592 {
593 vtkErrorMacro("Invalid mesh has nodes that are not floating point values");
594 return false;
595 }
596
597 points->SetNumberOfPoints(this->NodeCount);
598
599 PointsExtractor worker{};
600 using Dispatcher = vtkArrayDispatch::DispatchByArray<vtkArrayDispatch::AOSPointArrays>;
601 int result{ NC_NOERR };
602 Dispatcher::Execute(
603 points->GetData(), worker, this->NcId, this->NodeXVarId, this->NodeYVarId, result);
604
605 if (!this->CheckError(result))
606 {
607 return false;
608 }
609
610 output->SetPoints(points);
611
612 return true;
613}
614
615//--------------------------------------------------------------------------------------------------
616bool vtkNetCDFUGRIDReader::FillCells(vtkUnstructuredGrid* output)

Callers 1

RequestDataMethod · 0.95

Calls 5

CheckErrorMethod · 0.95
ExecuteFunction · 0.50
SetNumberOfPointsMethod · 0.45
GetDataMethod · 0.45
SetPointsMethod · 0.45

Tested by

no test coverage detected