File: vtkStructuredNeighbor.h

package info (click to toggle)
vtk6 6.3.0%2Bdfsg2-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 118,880 kB
  • sloc: cpp: 1,442,792; ansic: 113,395; python: 72,383; tcl: 46,998; xml: 8,119; yacc: 4,525; java: 4,239; perl: 3,108; lex: 1,694; sh: 1,093; asm: 154; makefile: 103; objc: 17
file content (120 lines) | stat: -rw-r--r-- 4,921 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*=========================================================================

 Program:   Visualization Toolkit
 Module:    vtkStructuredNeighbor.h

 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
 All rights reserved.
 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

 This software is distributed WITHOUT ANY WARRANTY; without even
 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE.  See the above copyright notice for more information.

 =========================================================================*/
// .NAME vtkStructuredNeighbor.h -- Stores neighboring information
//
// .SECTION Description
//  An internal, light-weight class used to store neighbor information.

#ifndef VTKSTRUCTUREDNEIGHBOR_H_
#define VTKSTRUCTUREDNEIGHBOR_H_

#include "vtkFiltersGeometryModule.h" // For export macro
#include "vtkObject.h"

class VTKFILTERSGEOMETRY_EXPORT vtkStructuredNeighbor
{
public:

  // An enum that defines the neighboring orientation which is stored in a
  // 3-tuple vtkStructuredNeighbor::Orientation. In each dimension, there
  // is a high and low end, the orientation tuple defines how to grow ghost
  // layers along each dimension.
  enum NeighborOrientation
    {
    SUBSET_LO   = -2, // The grid is a subset of the neighboring grid and the
                      // ghost layers are pointing away from the low end
    LO          = -1, // The grid partially overlap with its neighbor on the
                      // low end, thus, ghost layers are pointing away from
                      // the low end
    ONE_TO_ONE  =  0, // grids abut 1-to-1 in both HI and LO, the
                      // cardinality of both grids is the same in the
                      // corresponding dimension.
    HI          =  1, // The grid partially overlaps with its neighbor on the
                      // high end, thus, ghost layers are pointing away from
                      // the high end
    SUBSET_HI   =  2, // The grid is a subset of the neighboring grid and the
                      // ghost layers are pointing away from the high end
    SUBSET_BOTH =  3, // The grid is a subset of the neighboring grid and the
                      // ghost layers grow from both low and high ends.
    SUPERSET    =  4, // grid is a superset of the neighboring grid in the
                      // given direction.
    UNDEFINED   =  5  // the neighboring relationship is undefined, e.g., if
                      // we are checking 2D data, the neighbor orientation
                      // in the 3rd dimension is undefined.
    };

  // Class Member Variables made public for easier access
  int NeighborID;       // The registered ID of the neighboring grid
  int OverlapExtent[6]; // The extent at which the grids overlap
  int SendExtent[6];    // The extent that we send to this neighbor
  int RcvExtent[6];     // The extent that we receive from this neighbor
  int Orientation[3];   // Defines how we are neighboring with this grid, see
                        // NeighborOrientation enum above.

  // Description:
  // Default Constructor
  vtkStructuredNeighbor();

  // Description:
  // Custom constructor. Constructs a neighbor with the prescribed neighbor
  // grid/block ID and overlap.
  vtkStructuredNeighbor( const int NeiID, int overlap[6] );

  // Description:
  // Custom constructor. Constructs a neighbor with the prescribed neigbhor
  // grid/block ID, overlap extent, and orientation
  vtkStructuredNeighbor( const int NeiID, int overlap[6], int orient[3] );

  // Description:
  // Copy constructor
  vtkStructuredNeighbor(const vtkStructuredNeighbor &N ){ *this = N; };

  // Description:
  // Default destructor
  virtual ~vtkStructuredNeighbor();


  // Description:
  // Overload assignment operator
  vtkStructuredNeighbor& operator=(const vtkStructuredNeighbor &N )
  {
    if( this != &N )
      {
      this->Orientation[ 0 ] = N.Orientation[ 0 ];
      this->Orientation[ 1 ] = N.Orientation[ 1 ];
      this->Orientation[ 2 ] = N.Orientation[ 2 ];
      this->NeighborID = N.NeighborID;
      for( int i=0; i < 6; ++i )
        {
        this->SendExtent[ i ]    = N.SendExtent[ i ];
        this->RcvExtent[ i ]     = N.RcvExtent[ i ];
        this->OverlapExtent[ i ] = N.OverlapExtent[ i ];
        } // END for
      } // END if
    return *this;
  }

  // Description:
  // Computes the SendExtent and the RcvExtent for this neighbor. The method
  // assumes that the overlap extent and orientation are already computed.
  // Using this information, the method grows the overlap extent to form the
  // Send and Rcv Extents for this neighbor instance.
  virtual void ComputeSendAndReceiveExtent(
      int gridRealExtent[6], int gridGhostedExtent[6], int neiRealExtent[6],
      int WholeExtent[6], const int N);
};

#endif /* VTKSTRUCTUREDNEIGHBOR_H_ */
// VTK-HeaderTest-Exclude: vtkStructuredNeighbor.h