VTK  9.5.20250918
vtkAMRSliceFilter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
19#ifndef vtkAMRSliceFilter_h
20#define vtkAMRSliceFilter_h
21
22#include "vtkFiltersAMRModule.h" // For export macro
24
25#include <vector> // For STL vector
26
27VTK_ABI_NAMESPACE_BEGIN
28class vtkInformation;
32class vtkPlane;
33class vtkAMRBox;
34class vtkUniformGrid;
35
36class VTKFILTERSAMR_EXPORT vtkAMRSliceFilter : public vtkOverlappingAMRAlgorithm
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
43 // Inline Getters & Setters
44
46
49 vtkSetMacro(OffsetFromOrigin, double);
50 vtkGetMacro(OffsetFromOrigin, double);
52
54
57 vtkSetMacro(MaxResolution, unsigned int);
58 vtkGetMacro(MaxResolution, unsigned int);
60
64 enum NormalTag : char
65 {
66 X_NORMAL = 1,
67 Y_NORMAL = 2,
68 Z_NORMAL = 4
69 };
70
72
76 vtkSetMacro(Normal, int);
77 vtkGetMacro(Normal, int);
79
81
86 vtkGetObjectMacro(Controller, vtkMultiProcessController);
88
89 // Standard Pipeline methods
91 int FillInputPortInformation(int port, vtkInformation* info) override;
92 int FillOutputPortInformation(int port, vtkInformation* info) override;
93
99 vtkInformationVector* outputVector) override;
100
105
106protected:
109
114 int GetDonorCellIdx(double x[3], vtkUniformGrid* ug);
115
120 int GetDonorPointIdx(double x[3], vtkUniformGrid* ug);
121
126 void ComputeCellCenter(vtkUniformGrid* ug, int cellIdx, double centroid[3]);
127
132 vtkUniformGrid* GetSlice(double origin[3], int* dims, double* gorigin, double* spacing);
133
138
143
147 bool PlaneIntersectsAMRBox(double plane[4], double bounds[6]);
148
155
160
165
170
173 unsigned int MaxResolution;
175
176 std::vector<int> BlocksToLoad;
177
178private:
179 vtkAMRSliceFilter(const vtkAMRSliceFilter&) = delete;
180 void operator=(const vtkAMRSliceFilter&) = delete;
181};
182
183VTK_ABI_NAMESPACE_END
184#endif /* vtkAMRSliceFilter_h */
Encloses a rectangular region of voxel like cells.
Definition vtkAMRBox.h:69
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 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.
vtkMultiProcessController * Controller
vtkPlane * GetCutPlane(vtkOverlappingAMR *input)
Returns the axis-aligned cut plane.
static vtkAMRSliceFilter * New()
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
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.
void ComputeCellCenter(vtkUniformGrid *ug, int cellIdx, double centroid[3])
Computes the cell center of the cell corresponding to the supplied cell index w.r....
std::vector< int > BlocksToLoad
int GetDonorPointIdx(double x[3], vtkUniformGrid *ug)
Returns the point index w.r.t.
~vtkAMRSliceFilter() override
NormalTag
Tags to identify normals along the X, Y and Z directions.
virtual void SetController(vtkMultiProcessController *)
Set/Get a multiprocess controller for parallel processing.
void GetAMRSliceInPlane(vtkPlane *p, vtkOverlappingAMR *inp, vtkOverlappingAMR *out)
Extracts a 2-D AMR slice from the dataset.
unsigned int MaxResolution
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 ...
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:108
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.
a multi-resolution dataset based on vtkCartesianGrid allowing overlaps
perform various plane computations
Definition vtkPlane.h:141
Deprecated vtkImageData.