VTK
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 :
45 {
46 public:
49  void PrintSelf(ostream &os, vtkIndent indent ) override;
50 
51  // Inline Gettters & Setters
52 
54 
57  vtkSetMacro(OffsetFromOrigin,double);
58  vtkGetMacro(OffsetFromOrigin,double);
60 
62 
65  vtkSetMacro(MaxResolution,unsigned int);
66  vtkGetMacro(MaxResolution,unsigned int);
68 
72  enum NormalTag : int
73  {
74  X_NORMAL = 1, Y_NORMAL = 2, Z_NORMAL = 4
75  };
76 
78 
82  vtkSetMacro(Normal,int);
83  vtkGetMacro(Normal,int);
85 
87 
91  vtkSetMacro( Controller, vtkMultiProcessController* );
92  vtkGetMacro( Controller, vtkMultiProcessController* );
94 
95  // Standard Pipeline methods
100 
106  vtkInformation *rqst,
107  vtkInformationVector **inputVector,
108  vtkInformationVector *outputVector ) override;
109 
115 
116 protected:
118  ~vtkAMRSliceFilter() override;
119 
124  int GetDonorCellIdx( double x[3], vtkUniformGrid *ug );
125 
131  vtkUniformGrid *ug, const int cellIdx, double centroid[3] );
132 
137  vtkUniformGrid* GetSlice( double origin[3], int* dims, double* gorigin, double* spacing );
138 
143 
147  bool PlaneIntersectsAMRBox( double plane[4], double bounds[6] );
148 
155  vtkPlane *p, vtkOverlappingAMR *metadata );
156 
161  vtkPlane *p, vtkOverlappingAMR *inp,
162  vtkOverlappingAMR *out );
163 
168 
173 
175  int Normal;
176  unsigned int MaxResolution;
178 
179  std::vector< int > BlocksToLoad;
180 
181 private:
182  vtkAMRSliceFilter( const vtkAMRSliceFilter& ) = delete;
183  void operator=( const vtkAMRSliceFilter& ) = delete;
184 };
185 
186 #endif /* vtkAMRSliceFilter_h */
vtkAMRBox
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:40
vtkAMRSliceFilter::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Performs upstream requests to the reader.
vtkPlane
perform various plane computations
Definition: vtkPlane.h:38
vtkAMRSliceFilter::OffsetFromOrigin
double OffsetFromOrigin
Definition: vtkAMRSliceFilter.h:174
vtkAMRSliceFilter
A concrete instance of vtkOverlappingAMRAlgorithm which implements functionality for extracting slice...
Definition: vtkAMRSliceFilter.h:45
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkAMRSliceFilter::IsAMRData2D
bool IsAMRData2D(vtkOverlappingAMR *input)
A utility function that checks if the input AMR data is 2-D.
vtkX3D::Normal
@ Normal
Definition: vtkX3D.h:45
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:41
vtkAMRSliceFilter::GetCutPlane
vtkPlane * GetCutPlane(vtkOverlappingAMR *input)
Returns the axis-aligned cut plane.
vtkAMRSliceFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkAMRSliceFilter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkAMRSliceFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAMRSliceFilter::GetSlice
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 ...
vtkAMRSliceFilter::Normal
int Normal
Definition: vtkAMRSliceFilter.h:175
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkAMRSliceFilter::RequestInformation
int RequestInformation(vtkInformation *rqst, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Makes upstream request to a source, typically, a concrete instance of vtkAMRBaseReader,...
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:83
vtkAMRSliceFilter::BlocksToLoad
std::vector< int > BlocksToLoad
Definition: vtkAMRSliceFilter.h:179
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkOverlappingAMRAlgorithm
A base class for all algorithms that take as input vtkOverlappingAMR and produce vtkOverlappingAMR.
Definition: vtkOverlappingAMRAlgorithm.h:37
vtkAMRSliceFilter::GetAMRSliceInPlane
void GetAMRSliceInPlane(vtkPlane *p, vtkOverlappingAMR *inp, vtkOverlappingAMR *out)
Extracts a 2-D AMR slice from the dataset.
vtkAMRSliceFilter::ComputeCellCenter
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....
vtkOverlappingAMR
hierarchical dataset of vtkUniformGrids
Definition: vtkOverlappingAMR.h:47
vtkAMRSliceFilter::NormalTag
NormalTag
Tags to identify normals along the X, Y and Z directions.
Definition: vtkAMRSliceFilter.h:73
vtkX3D::spacing
@ spacing
Definition: vtkX3D.h:481
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkAMRSliceFilter::Controller
vtkMultiProcessController * Controller
Definition: vtkAMRSliceFilter.h:177
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkAMRSliceFilter::vtkAMRSliceFilter
vtkAMRSliceFilter()
vtkAMRSliceFilter::GetSliceCellData
void GetSliceCellData(vtkUniformGrid *slice, vtkUniformGrid *grid3D)
Copies the cell data for the cells in the slice from the 3-D grid.
vtkAMRSliceFilter::ComputeAMRBlocksToLoad
void ComputeAMRBlocksToLoad(vtkPlane *p, vtkOverlappingAMR *metadata)
Given the cut-plane and the metadata provided by a module upstream, this method generates the list of...
vtkAMRSliceFilter::PlaneIntersectsAMRBox
bool PlaneIntersectsAMRBox(double plane[4], double bounds[6])
Determines if a plane intersects with an AMR box.
vtkOverlappingAMRAlgorithm.h
vtkAMRSliceFilter::New
static vtkAMRSliceFilter * New()
vtkAMRSliceFilter::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
See algorithm for more info.
vtkAMRSliceFilter::MaxResolution
unsigned int MaxResolution
Definition: vtkAMRSliceFilter.h:176
vtkAMRSliceFilter::~vtkAMRSliceFilter
~vtkAMRSliceFilter() override
vtkAMRSliceFilter::GetDonorCellIdx
int GetDonorCellIdx(double x[3], vtkUniformGrid *ug)
Returns the cell index w.r.t.