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

Method OutputPoints

IO/NetCDF/vtkMPASReader.cxx:2209–2303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2207//------------------------------------------------------------------------------
2208
2209void vtkMPASReader::OutputPoints()
2210{
2211 vtkUnstructuredGrid* output = this->GetOutput();
2212
2213 double adjustedLayerThickness = this->IsAtmosphere ? static_cast<double>(-this->LayerThickness)
2214 : static_cast<double>(this->LayerThickness);
2215
2216 vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
2217 points->Allocate(this->MaximumPoints);
2218 output->SetPoints(points);
2219
2220 for (size_t j = 0; j < this->CurrentExtraPoint; j++)
2221 {
2222 double x, y, z;
2223
2224 switch (this->Geometry)
2225 {
2226 case vtkMPASReader::Planar:
2227 case vtkMPASReader::Spherical:
2228 x = this->PointX[j];
2229 y = this->PointY[j];
2230 z = this->PointZ[j];
2231 break;
2232
2233 case vtkMPASReader::Projected:
2234 x = this->PointX[j] * 180.0 / vtkMath::Pi();
2235 y = this->PointY[j] * 180.0 / vtkMath::Pi();
2236 z = 0.0;
2237 break;
2238
2239 default:
2240 vtkErrorMacro("Unrecognized geometry type (" << this->Geometry << ").");
2241 return;
2242 }
2243
2244 if (!this->ShowMultilayerView)
2245 {
2246 points->InsertNextPoint(x, y, z);
2247 }
2248 else
2249 {
2250 double rho = 0.0, rholevel = 0.0, theta = 0.0, phi = 0.0;
2251 int retval = -1;
2252
2253 if (this->Geometry == Spherical)
2254 {
2255 if ((x != 0.0) || (y != 0.0) || (z != 0.0))
2256 {
2257 retval = CartesianToSpherical(x, y, z, &rho, &phi, &theta);
2258 if (retval)
2259 {
2260 vtkWarningMacro("Can't create point for layered view.");
2261 }
2262 }
2263 }
2264
2265 for (size_t levelNum = 0; levelNum < this->MaximumNVertLevels + 1; levelNum++)
2266 {

Callers 1

ReadAndOutputGridMethod · 0.95

Calls 8

GetOutputMethod · 0.95
PiFunction · 0.85
CartesianToSphericalFunction · 0.85
SphericalToCartesianFunction · 0.85
NewFunction · 0.50
AllocateMethod · 0.45
SetPointsMethod · 0.45
InsertNextPointMethod · 0.45

Tested by

no test coverage detected