VTK
dox/Filters/Geometry/vtkStructuredNeighbor.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003  Program:   Visualization Toolkit
00004  Module:    vtkStructuredNeighbor.h
00005 
00006  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007  All rights reserved.
00008  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010  This software is distributed WITHOUT ANY WARRANTY; without even
00011  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012  PURPOSE.  See the above copyright notice for more information.
00013 
00014  =========================================================================*/
00024 #ifndef VTKSTRUCTUREDNEIGHBOR_H_
00025 #define VTKSTRUCTUREDNEIGHBOR_H_
00026 
00027 #include "vtkFiltersGeometryModule.h" // For export macro
00028 #include "vtkObject.h"
00029 
00030 class VTKFILTERSGEOMETRY_EXPORT vtkStructuredNeighbor
00031 {
00032 public:
00033 
00034   // An enum that defines the neighboring orientation which is stored in a
00035   // 3-tuple vtkStructuredNeighbor::Orientation. In each dimension, there
00036   // is a high and low end, the orientation tuple defines how to grow ghost
00037   // layers along each dimension.
00038   enum NeighborOrientation
00039     {
00040     SUBSET_LO   = -2, // The grid is a subset of the neighboring grid and the
00041                       // ghost layers are pointing away from the low end
00042     LO          = -1, // The grid partially overlap with its neighbor on the
00043                       // low end, thus, ghost layers are pointing away from
00044                       // the low end
00045     ONE_TO_ONE  =  0, // grids abut 1-to-1 in both HI and LO, the
00046                       // cardinality of both grids is the same in the
00047                       // corresponding dimension.
00048     HI          =  1, // The grid partially overlaps with its neighbor on the
00049                       // high end, thus, ghost layers are pointing away from
00050                       // the high end
00051     SUBSET_HI   =  2, // The grid is a subset of the neighboring grid and the
00052                       // ghost layers are pointing away from the high end
00053     SUBSET_BOTH =  3, // The grid is a subset of the neighboring grid and the
00054                       // ghost layers grow from both low and high ends.
00055     SUPERSET    =  4, // grid is a superset of the neighboring grid in the
00056                       // given direction.
00057     UNDEFINED   =  5  // the neighboring relationship is undefined, e.g., if
00058                       // we are checking 2D data, the neighbor orientation
00059                       // in the 3rd dimension is undefined.
00060     };
00061 
00062   // Class Member Variables made public for easier access
00063   int NeighborID;       // The registered ID of the neighboring grid
00064   int OverlapExtent[6]; // The extent at which the grids overlap
00065   int SendExtent[6];    // The extent that we send to this neighbor
00066   int RcvExtent[6];     // The extent that we receive from this neighbor
00067   int Orientation[3];   // Defines how we are neighboring with this grid, see
00068                         // NeighborOrientation enum above.
00069 
00071   vtkStructuredNeighbor();
00072 
00075   vtkStructuredNeighbor( const int NeiID, int overlap[6] );
00076 
00079   vtkStructuredNeighbor( const int NeiID, int overlap[6], int orient[3] );
00080 
00082   vtkStructuredNeighbor(const vtkStructuredNeighbor &N ){ *this = N; };
00083 
00085   virtual ~vtkStructuredNeighbor();
00086 
00087 
00089 
00090   vtkStructuredNeighbor& operator=(const vtkStructuredNeighbor &N )
00091   {
00092     if( this != &N )
00093       {
00094       this->Orientation[ 0 ] = N.Orientation[ 0 ];
00095       this->Orientation[ 1 ] = N.Orientation[ 1 ];
00096       this->Orientation[ 2 ] = N.Orientation[ 2 ];
00097       this->NeighborID = N.NeighborID;
00098       for( int i=0; i < 6; ++i )
00099         {
00100         this->SendExtent[ i ]    = N.SendExtent[ i ];
00101         this->RcvExtent[ i ]     = N.RcvExtent[ i ];
00102         this->OverlapExtent[ i ] = N.OverlapExtent[ i ];
00103         } // END for
00104       } // END if
00105     return *this;
00106   }
00108 
00110 
00114   virtual void ComputeSendAndReceiveExtent(
00115       int gridRealExtent[6], int gridGhostedExtent[6], int neiRealExtent[6],
00116       int WholeExtent[6], const int N);
00117 };
00119 
00120 #endif /* VTKSTRUCTUREDNEIGHBOR_H_ */
00121 // VTK-HeaderTest-Exclude: vtkStructuredNeighbor.h