VTK  9.2.6
vtkStructuredNeighbor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkStructuredNeighbor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14  =========================================================================*/
23 #ifndef vtkStructuredNeighbor_h
24 #define vtkStructuredNeighbor_h
25 
26 #include "vtkFiltersGeometryModule.h" // For export macro
27 #include "vtkObject.h"
28 
29 class VTKFILTERSGEOMETRY_EXPORT vtkStructuredNeighbor
30 {
31 public:
32  // An enum that defines the neighboring orientation which is stored in a
33  // 3-tuple vtkStructuredNeighbor::Orientation. In each dimension, there
34  // is a high and low end, the orientation tuple defines how to grow ghost
35  // layers along each dimension.
37  {
38  SUBSET_LO = -2, // The grid is a subset of the neighboring grid and the
39  // ghost layers are pointing away from the low end
40  LO = -1, // The grid partially overlap with its neighbor on the
41  // low end, thus, ghost layers are pointing away from
42  // the low end
43  ONE_TO_ONE = 0, // grids abut 1-to-1 in both HI and LO, the
44  // cardinality of both grids is the same in the
45  // corresponding dimension.
46  HI = 1, // The grid partially overlaps with its neighbor on the
47  // high end, thus, ghost layers are pointing away from
48  // the high end
49  SUBSET_HI = 2, // The grid is a subset of the neighboring grid and the
50  // ghost layers are pointing away from the high end
51  SUBSET_BOTH = 3, // The grid is a subset of the neighboring grid and the
52  // ghost layers grow from both low and high ends.
53  SUPERSET = 4, // grid is a superset of the neighboring grid in the
54  // given direction.
55  UNDEFINED = 5 // the neighboring relationship is undefined, e.g., if
56  // we are checking 2D data, the neighbor orientation
57  // in the 3rd dimension is undefined.
58  };
59 
60  // Class Member Variables made public for easier access
61  int NeighborID; // The registered ID of the neighboring grid
62  int OverlapExtent[6]; // The extent at which the grids overlap
63  int SendExtent[6]; // The extent that we send to this neighbor
64  int RcvExtent[6]; // The extent that we receive from this neighbor
65  int Orientation[3]; // Defines how we are neighboring with this grid, see
66  // NeighborOrientation enum above.
67 
72 
77  vtkStructuredNeighbor(const int NeiID, int overlap[6]);
78 
83  vtkStructuredNeighbor(const int NeiID, int overlap[6], int orient[3]);
84 
89 
93  virtual ~vtkStructuredNeighbor();
94 
96 
100  {
101  if (this != &N)
102  {
103  this->Orientation[0] = N.Orientation[0];
104  this->Orientation[1] = N.Orientation[1];
105  this->Orientation[2] = N.Orientation[2];
106  this->NeighborID = N.NeighborID;
107  for (int i = 0; i < 6; ++i)
108  {
109  this->SendExtent[i] = N.SendExtent[i];
110  this->RcvExtent[i] = N.RcvExtent[i];
111  this->OverlapExtent[i] = N.OverlapExtent[i];
112  } // END for
113  } // END if
114  return *this;
115  }
117 
119 
125  virtual void ComputeSendAndReceiveExtent(int gridRealExtent[6], int gridGhostedExtent[6],
126  int neiRealExtent[6], int WholeExtent[6], const int N);
128 };
129 
130 #endif /* vtkStructuredNeighbor_h */
131 // VTK-HeaderTest-Exclude: vtkStructuredNeighbor.h
vtkStructuredNeighbor & operator=(const vtkStructuredNeighbor &N)
Overload assignment operator.
vtkStructuredNeighbor(const vtkStructuredNeighbor &N)
Copy constructor.
An internal, light-weight class used to store neighbor information.