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 );
50 
51  // Inline Gettters & Setters
52  vtkSetMacro(OffSetFromOrigin,double);
53  vtkGetMacro(OffSetFromOrigin,double);
54 
56 
59  vtkSetMacro( ForwardUpstream, int );
60  vtkGetMacro( ForwardUpstream, int );
61  vtkBooleanMacro( ForwardUpstream, int );
63 
65 
68  vtkSetMacro( EnablePrefetching, int );
69  vtkGetMacro( EnablePrefetching, int );
70  vtkBooleanMacro( EnablePrefetching, int );
72 
74 
77  vtkSetMacro(MaxResolution,int);
78  vtkGetMacro(MaxResolution,int);
80 
82 
87  vtkGetMacro(Normal,int);
89 
91 
96  vtkGetMacro( Controller, vtkMultiProcessController* );
98 
99  // Standard Pipeline methods
100  virtual int RequestData(
104 
109  virtual int RequestInformation(
110  vtkInformation *rqst,
111  vtkInformationVector **inputVector,
112  vtkInformationVector *outputVector );
113 
117  virtual int RequestUpdateExtent(
119 
120 protected:
123 
128  int GetDonorCellIdx( double x[3], vtkUniformGrid *ug );
129 
135  vtkUniformGrid *ug, const int cellIdx, double centroid[3] );
136 
141  vtkUniformGrid* GetSlice( double origin[3], int* dims, double* gorigin, double* spacing );
142 
147 
151  bool PlaneIntersectsAMRBox( double plane[4], double bounds[6] );
152 
159  vtkPlane *p, vtkOverlappingAMR *metadata );
160 
165  vtkPlane *p, vtkOverlappingAMR *inp,
166  vtkOverlappingAMR *out );
167 
172 
177 
182  vtkOverlappingAMR *inp, double *min, double *max );
183 
185  int Normal; // 1=>X-Normal, 2=>Y-Normal, 3=>Z-Normal
189 
192 
193  std::vector< int > BlocksToLoad;
194 
195 private:
196  vtkAMRSliceFilter( const vtkAMRSliceFilter& ) VTK_DELETE_FUNCTION;
197  void operator=( const vtkAMRSliceFilter& ) VTK_DELETE_FUNCTION;
198 };
199 
200 #endif /* vtkAMRSliceFilter_h */
vtkAMRBox
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:40
vtkPlane
perform various plane computations
Definition: vtkPlane.h:38
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::~vtkAMRSliceFilter
~vtkAMRSliceFilter()
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
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::initialRequest
bool initialRequest
Definition: vtkAMRSliceFilter.h:186
vtkAMRSliceFilter::Normal
int Normal
Definition: vtkAMRSliceFilter.h:185
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:83
vtkAMRSliceFilter::RequestInformation
virtual int RequestInformation(vtkInformation *rqst, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Makes upstream request to a source, typically, a concrete instance of vtkAMRBaseReader,...
vtkAMRSliceFilter::OffSetFromOrigin
double OffSetFromOrigin
Definition: vtkAMRSliceFilter.h:184
vtkAMRSliceFilter::BlocksToLoad
std::vector< int > BlocksToLoad
Definition: vtkAMRSliceFilter.h:193
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::EnablePrefetching
int EnablePrefetching
Definition: vtkAMRSliceFilter.h:191
vtkAMRSliceFilter::GetAMRSliceInPlane
void GetAMRSliceInPlane(vtkPlane *p, vtkOverlappingAMR *inp, vtkOverlappingAMR *out)
Extracts a 2-D AMR slice from the dataset.
vtkAMRSliceFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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::MaxResolution
int MaxResolution
Definition: vtkAMRSliceFilter.h:187
vtkX3D::spacing
@ spacing
Definition: vtkX3D.h:481
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkAMRSliceFilter::Controller
vtkMultiProcessController * Controller
Definition: vtkAMRSliceFilter.h:188
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkAMRSliceFilter::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
See algorithm for more info.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkAMRSliceFilter::InitializeOffSet
void InitializeOffSet(vtkOverlappingAMR *inp, double *min, double *max)
Initializes the off-set to be at the center of the input data-set.
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::ForwardUpstream
int ForwardUpstream
Definition: vtkAMRSliceFilter.h:190
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.
vtkAMRSliceFilter::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkOverlappingAMRAlgorithm.h
vtkAMRSliceFilter::New
static vtkAMRSliceFilter * New()
vtkAMRSliceFilter::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkAMRSliceFilter::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Performs upstream requests to the reader.
vtkAMRSliceFilter::GetDonorCellIdx
int GetDonorCellIdx(double x[3], vtkUniformGrid *ug)
Returns the cell index w.r.t.