VTK  9.2.6
vtkAMRSliceFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRSliceFilter.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  =========================================================================*/
27 #ifndef vtkAMRSliceFilter_h
28 #define vtkAMRSliceFilter_h
29 
30 #include "vtkFiltersAMRModule.h" // For export macro
32 
33 #include <vector> // For STL vector
34 
35 class vtkInformation;
37 class vtkOverlappingAMR;
39 class vtkPlane;
40 class vtkAMRBox;
41 class vtkUniformGrid;
42 
43 class VTKFILTERSAMR_EXPORT vtkAMRSliceFilter : public vtkOverlappingAMRAlgorithm
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
50  // Inline Getters & Setters
51 
53 
56  vtkSetMacro(OffsetFromOrigin, double);
57  vtkGetMacro(OffsetFromOrigin, double);
59 
61 
64  vtkSetMacro(MaxResolution, unsigned int);
65  vtkGetMacro(MaxResolution, unsigned int);
67 
71  enum NormalTag : char
72  {
73  X_NORMAL = 1,
74  Y_NORMAL = 2,
75  Z_NORMAL = 4
76  };
77 
79 
83  vtkSetMacro(Normal, int);
84  vtkGetMacro(Normal, int);
86 
88 
93  vtkGetObjectMacro(Controller, vtkMultiProcessController);
95 
96  // Standard Pipeline methods
100 
106  vtkInformationVector* outputVector) override;
107 
112 
113 protected:
115  ~vtkAMRSliceFilter() override;
116 
121  int GetDonorCellIdx(double x[3], vtkUniformGrid* ug);
122 
127  int GetDonorPointIdx(double x[3], vtkUniformGrid* ug);
128 
133  void ComputeCellCenter(vtkUniformGrid* ug, const int cellIdx, double centroid[3]);
134 
139  vtkUniformGrid* GetSlice(double origin[3], int* dims, double* gorigin, double* spacing);
140 
145 
150 
154  bool PlaneIntersectsAMRBox(double plane[4], double bounds[6]);
155 
162 
167 
172 
177 
179  int Normal;
180  unsigned int MaxResolution;
182 
183  std::vector<int> BlocksToLoad;
184 
185 private:
186  vtkAMRSliceFilter(const vtkAMRSliceFilter&) = delete;
187  void operator=(const vtkAMRSliceFilter&) = delete;
188 };
189 
190 #endif /* vtkAMRSliceFilter_h */
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:79
A concrete instance of vtkOverlappingAMRAlgorithm which implements functionality for extracting slice...
bool IsAMRData2D(vtkOverlappingAMR *input)
A utility function that checks if the input AMR data is 2-D.
void ComputeCellCenter(vtkUniformGrid *ug, const int cellIdx, double centroid[3])
Computes the cell center of the cell corresponding to the supplied cell index w.r....
void ComputeAMRBlocksToLoad(vtkPlane *p, vtkOverlappingAMR *metadata)
Given the cut-plane and the metadata provided by a module upstream, this method generates the list of...
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Performs upstream requests to the reader.
void GetSlicePointData(vtkUniformGrid *slice, vtkUniformGrid *grid3D)
Copies the point data for the cells in the slice from the 3-D grid.
void GetSliceCellData(vtkUniformGrid *slice, vtkUniformGrid *grid3D)
Copies the cell data for the cells in the slice from the 3-D grid.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkAMRSliceFilter * New()
vtkMultiProcessController * Controller
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int FillInputPortInformation(int port, vtkInformation *info) override
See algorithm for more info.
int FillOutputPortInformation(int port, vtkInformation *info) override
See algorithm for more info.
vtkPlane * GetCutPlane(vtkOverlappingAMR *input)
Returns the axis-aligned cut plane.
bool PlaneIntersectsAMRBox(double plane[4], double bounds[6])
Determines if a plane intersects with an AMR box.
int GetDonorCellIdx(double x[3], vtkUniformGrid *ug)
Returns the cell index w.r.t.
std::vector< int > BlocksToLoad
int GetDonorPointIdx(double x[3], vtkUniformGrid *ug)
Returns the point index w.r.t.
~vtkAMRSliceFilter() override
vtkUniformGrid * GetSlice(double origin[3], int *dims, double *gorigin, double *spacing)
Gets the slice from the given grid given the plane origin & the user-supplied normal associated with ...
NormalTag
Tags to identify normals along the X, Y and Z directions.
virtual void SetController(vtkMultiProcessController *)
Set/Get a multiprocess controller for paralle processing.
void GetAMRSliceInPlane(vtkPlane *p, vtkOverlappingAMR *inp, vtkOverlappingAMR *out)
Extracts a 2-D AMR slice from the dataset.
unsigned int MaxResolution
int RequestInformation(vtkInformation *rqst, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Makes upstream request to a source, typically, a concrete instance of vtkAMRBaseReader,...
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Multiprocessing communication superclass.
A base class for all algorithms that take as input vtkOverlappingAMR and produce vtkOverlappingAMR.
hierarchical dataset of vtkUniformGrids
perform various plane computations
Definition: vtkPlane.h:146
image data with blanking
@ Normal
Definition: vtkX3D.h:51
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ spacing
Definition: vtkX3D.h:487