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

Method AddMirrorPoint

IO/NetCDF/vtkMPASReader.cxx:1966–1993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1964//------------------------------------------------------------------------------
1965
1966int vtkMPASReader::AddMirrorPoint(int index, double dividerX, double offset)
1967{
1968 double X = this->PointX[index];
1969 double Y = this->PointY[index];
1970
1971 // add on east
1972 if (X < dividerX)
1973 {
1974 X += offset;
1975 }
1976 else
1977 {
1978 // add on west
1979 X -= offset;
1980 }
1981
1982 assert(this->CurrentExtraPoint < this->ModNumPoints);
1983 this->PointX[this->CurrentExtraPoint] = X;
1984 this->PointY[this->CurrentExtraPoint] = Y;
1985
1986 size_t mirrorPoint = this->CurrentExtraPoint;
1987
1988 // record mapping
1989 *(this->PointMap + (this->CurrentExtraPoint - this->NumberOfPoints - this->PointOffset)) = index;
1990 this->CurrentExtraPoint++;
1991
1992 return static_cast<int>(mirrorPoint);
1993}
1994
1995//------------------------------------------------------------------------------
1996// Check for out-of-range values and do bugfix

Callers 1

EliminateXWrapMethod · 0.95

Calls 1

assertFunction · 0.50

Tested by

no test coverage detected