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

Method GetStructuredGridFromPointPackingZone

IO/Geometry/vtkTecplotReader.cxx:952–995  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

950
951//------------------------------------------------------------------------------
952void vtkTecplotReader::GetStructuredGridFromPointPackingZone(int iDimSize, int jDimSize,
953 int kDimSize, int zoneIndx, const char* zoneName, vtkMultiBlockDataSet* multZone)
954{
955 if (!zoneName || !multZone)
956 {
957 vtkErrorMacro("Zone name un-specified or nullptr vtkMultiBlockDataSet.");
958 return;
959 }
960
961 if (jDimSize == 1 && kDimSize == 1)
962 {
963 this->Internal->TopologyDim = vtkMath::Max(this->Internal->TopologyDim, 1);
964 }
965 else if (kDimSize == 1)
966 {
967 this->Internal->TopologyDim = vtkMath::Max(this->Internal->TopologyDim, 2);
968 }
969 else
970 {
971 this->Internal->TopologyDim = vtkMath::Max(this->Internal->TopologyDim, 3);
972 }
973
974 // number of points, number of cells, and dimensionality
975 int numNodes = iDimSize * jDimSize * kDimSize;
976 int gridDims[3] = { iDimSize, jDimSize, kDimSize };
977
978 // Create vtkPoints and vtkStructuredGrid and associate them
979 vtkPoints* pntCords = vtkPoints::New();
980 vtkStructuredGrid* strcGrid = vtkStructuredGrid::New();
981 this->GetArraysFromPointPackingZone(numNodes, pntCords, strcGrid->GetPointData());
982 strcGrid->SetDimensions(gridDims);
983 strcGrid->SetPoints(pntCords);
984 pntCords->Delete();
985 pntCords = nullptr;
986
987 if ((this->Internal->TopologyDim == 2 || this->Internal->TopologyDim == 3) ||
988 (this->Internal->TopologyDim == 0 && this->Internal->GeometryDim > 1))
989 {
990 multZone->SetBlock(zoneIndx, strcGrid);
991 multZone->GetMetaData(zoneIndx)->Set(vtkCompositeDataSet::NAME(), zoneName);
992 }
993 strcGrid->Delete();
994 strcGrid = nullptr;
995}
996
997void vtkTecplotReader::GetPolygonalGridFromBlockPackingZone(int numNodes, int numCells,
998 int numFaces, int zoneIndx, const char* zoneName, vtkMultiBlockDataSet* multZone)

Callers 1

ReadFileMethod · 0.95

Calls 10

SetBlockMethod · 0.80
DeleteMethod · 0.65
MaxFunction · 0.50
NewFunction · 0.50
GetPointDataMethod · 0.45
SetDimensionsMethod · 0.45
SetPointsMethod · 0.45
SetMethod · 0.45
GetMetaDataMethod · 0.45

Tested by

no test coverage detected