VTK
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 =========================================================================*/
25#ifndef vtkStructuredNeighbor_h
26#define vtkStructuredNeighbor_h
27
28#include "vtkFiltersGeometryModule.h" // For export macro
29#include "vtkObject.h"
30
31class VTKFILTERSGEOMETRY_EXPORT vtkStructuredNeighbor
32{
33public:
34
35 // An enum that defines the neighboring orientation which is stored in a
36 // 3-tuple vtkStructuredNeighbor::Orientation. In each dimension, there
37 // is a high and low end, the orientation tuple defines how to grow ghost
38 // layers along each dimension.
40 {
41 SUBSET_LO = -2, // The grid is a subset of the neighboring grid and the
42 // ghost layers are pointing away from the low end
43 LO = -1, // The grid partially overlap with its neighbor on the
44 // low end, thus, ghost layers are pointing away from
45 // the low end
46 ONE_TO_ONE = 0, // grids abut 1-to-1 in both HI and LO, the
47 // cardinality of both grids is the same in the
48 // corresponding dimension.
49 HI = 1, // The grid partially overlaps with its neighbor on the
50 // high end, thus, ghost layers are pointing away from
51 // the high end
52 SUBSET_HI = 2, // The grid is a subset of the neighboring grid and the
53 // ghost layers are pointing away from the high end
54 SUBSET_BOTH = 3, // The grid is a subset of the neighboring grid and the
55 // ghost layers grow from both low and high ends.
56 SUPERSET = 4, // grid is a superset of the neighboring grid in the
57 // given direction.
58 UNDEFINED = 5 // the neighboring relationship is undefined, e.g., if
59 // we are checking 2D data, the neighbor orientation
60 // in the 3rd dimension is undefined.
61 };
62
63 // Class Member Variables made public for easier access
64 int NeighborID; // The registered ID of the neighboring grid
65 int OverlapExtent[6]; // The extent at which the grids overlap
66 int SendExtent[6]; // The extent that we send to this neighbor
67 int RcvExtent[6]; // The extent that we receive from this neighbor
68 int Orientation[3]; // Defines how we are neighboring with this grid, see
69 // NeighborOrientation enum above.
70
75
80 vtkStructuredNeighbor( const int NeiID, int overlap[6] );
81
86 vtkStructuredNeighbor( const int NeiID, int overlap[6], int orient[3] );
87
92
97
98
100
104 {
105 if( this != &N )
106 {
107 this->Orientation[ 0 ] = N.Orientation[ 0 ];
108 this->Orientation[ 1 ] = N.Orientation[ 1 ];
109 this->Orientation[ 2 ] = N.Orientation[ 2 ];
110 this->NeighborID = N.NeighborID;
111 for( int i=0; i < 6; ++i )
112 {
113 this->SendExtent[ i ] = N.SendExtent[ i ];
114 this->RcvExtent[ i ] = N.RcvExtent[ i ];
115 this->OverlapExtent[ i ] = N.OverlapExtent[ i ];
116 } // END for
117 } // END if
118 return *this;
119 }
121
123
130 int gridRealExtent[6], int gridGhostedExtent[6], int neiRealExtent[6],
131 int WholeExtent[6], const int N);
132};
134
135#endif /* vtkStructuredNeighbor_h */
136// VTK-HeaderTest-Exclude: vtkStructuredNeighbor.h
An internal, light-weight class used to store neighbor information.
vtkStructuredNeighbor()
Default Constructor.
virtual void ComputeSendAndReceiveExtent(int gridRealExtent[6], int gridGhostedExtent[6], int neiRealExtent[6], int WholeExtent[6], const int N)
Computes the SendExtent and the RcvExtent for this neighbor.
vtkStructuredNeighbor(const int NeiID, int overlap[6], int orient[3])
Custom constructor.
vtkStructuredNeighbor & operator=(const vtkStructuredNeighbor &N)
Overload assignment operator.
virtual ~vtkStructuredNeighbor()
Default destructor.
vtkStructuredNeighbor(const vtkStructuredNeighbor &N)
Copy constructor.
vtkStructuredNeighbor(const int NeiID, int overlap[6])
Custom constructor.