VTK
vtkAMRResampleFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRResampleFilter.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  =========================================================================*/
35 #ifndef vtkAMRResampleFilter_h
36 #define vtkAMRResampleFilter_h
37 
38 #include "vtkFiltersAMRModule.h" // For export macro
40 #include <vector> // For STL vector
41 
42 class vtkInformation;
44 class vtkUniformGrid;
45 class vtkOverlappingAMR;
48 class vtkFieldData;
49 class vtkCellData;
50 class vtkPointData;
51 class vtkIndent;
52 
53 class vtkAMRBox;
55 {
56 public:
59  void PrintSelf(ostream &oss, vtkIndent indent);
60 
62 
64  vtkSetVector3Macro(NumberOfSamples,int);
65  vtkGetVector3Macro(NumberOfSamples,int);
67 
69 
70  vtkSetMacro(TransferToNodes,int);
71  vtkGetMacro(TransferToNodes,int);
73 
75 
77  vtkSetMacro(DemandDrivenMode,int);
78  vtkGetMacro(DemandDrivenMode,int);
80 
82 
83  vtkSetMacro(NumberOfPartitions,int);
84  vtkGetMacro(NumberOfPartitions,int);
86 
88 
89  vtkSetVector3Macro(Min,double);
90  vtkGetVector3Macro(Min,double);
92 
94 
95  vtkSetVector3Macro(Max,double);
96  vtkGetVector3Macro(Max,double);
98 
100 
101  vtkSetMacro(UseBiasVector,bool);
102  vtkGetMacro(UseBiasVector,bool);
104 
106 
109  vtkSetVector3Macro(BiasVector,double);
110  vtkGetVector3Macro(BiasVector,double);
112 
114 
118 
119  // Standard pipeline routines
120 
122 
124  virtual int RequestInformation(
125  vtkInformation *rqst,
126  vtkInformationVector **inputVector,
127  vtkInformationVector *outputVector );
129 
130  virtual int RequestData(
134 
136 
137  virtual int RequestUpdateExtent(
140 
141 
142 protected:
145 
147  vtkMultiBlockDataSet *ROI; // Pointer to the region of interest.
148  int NumberOfSamples[3];
149  int GridNumberOfSamples[3];
150  double Min[3];
151  double Max[3];
152  double GridMin[3];
153  double GridMax[3];
160  double BiasVector[3];
161 
162  // Debugging Stuff
170  double AverageLevel;
171 // BTX
172  std::vector< int > BlocksToLoad; // Holds the ids of the blocks to load.
173 // ETX
174 
176  bool IsParallel();
177 
180  bool IsRegionMine( const int regionIdx );
181 
184  int GetRegionProcessId( const int regionIdx );
185 
187 
190  vtkUniformGrid *g, const vtkIdType cellIdx, double c[3] );
192 
198 
200 
202  vtkCellData *src, vtkIdType srcIdx );
204 
208  bool FoundDonor(double q[3],vtkUniformGrid *&donorGrid,int &cellIdx);
209 
210 
212 
216  double q[3], vtkOverlappingAMR *amrds,
217  unsigned int level, unsigned int& gridId,
218  int &donorCellIdx);
220 
222 
227  double q[3], unsigned int &donorLevel, unsigned int& donorGridId,
228  vtkOverlappingAMR *amrds, unsigned int maxLevel, bool useCached);
230 
232 
238  unsigned int &donorLevel, unsigned int &donorGridId,
239  vtkOverlappingAMR *amrds, unsigned int maxLevel, bool useCached);
241 
243 
248 
250 
255 
257 
261 
263 
266  vtkOverlappingAMR *metadata );
268 
271  bool IsBlockWithinBounds( double *grd );
272 
277 
279 
281  vtkOverlappingAMR *amrds,
282  int N[3], double min[3], double max[3], double h[3] );
284 
286 
288  vtkOverlappingAMR *amr,
289  double domainMin[3], double domainMax[3], double h[3],
290  int dims[3], double &rf );
292 
294 
296  double domainMin[3], double domainMax[3],
297  double regionMin[3], double regionMax[3] );
299 
301 
303  void AdjustNumberOfSamplesInRegion(const double Rh[3],
304  const bool outside[6], int N[3] );
306 
308 
312  const int N[3], const double h0[3], const double L[3], const double rf);
314 
316 
322  const double h0[3], const double domainMin[3], const double domainMax[3],
323  const int dims[3], bool outside[6] );
325 
327 
332  vtkOverlappingAMR *amrds, double h[3] );
334 
336  void GetRegion( double h[3] );
337 
339  bool GridsIntersect( double *g1, double *g2 );
340 
343 
353  void SearchGridDecendants(double q[3],
354  vtkOverlappingAMR *amrds,
355  unsigned int maxLevel,
356  unsigned int &level,
357  unsigned int &gridId,
358  int &id);
360 
362 
364  bool SearchGridAncestors(double q[3],
365  vtkOverlappingAMR *amrds,
366  unsigned int &level,
367  unsigned int &gridId,
368  int &id);
370 
371 
372 private:
373  vtkAMRResampleFilter(const vtkAMRResampleFilter&); // Not implemented
374  void operator=(const vtkAMRResampleFilter&); // Not implemented
375 
376 };
377 
378 #endif /* vtkAMRResampleFilter_h */
vtkAMRBox
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:39
vtkAMRResampleFilter::GridsIntersect
bool GridsIntersect(double *g1, double *g2)
vtkAMRResampleFilter::AMRMetaData
vtkOverlappingAMR * AMRMetaData
Definition: vtkAMRResampleFilter.h:146
vtkAMRResampleFilter::GetDomainParameters
void GetDomainParameters(vtkOverlappingAMR *amr, double domainMin[3], double domainMax[3], double h[3], int dims[3], double &rf)
vtkAMRResampleFilter::~vtkAMRResampleFilter
virtual ~vtkAMRResampleFilter()
vtkAMRResampleFilter::TransferToGridNodes
void TransferToGridNodes(vtkUniformGrid *g, vtkOverlappingAMR *amrds)
vtkAMRResampleFilter::NumberOfTimesLevelUp
int NumberOfTimesLevelUp
Definition: vtkAMRResampleFilter.h:167
vtkAMRResampleFilter::ROI
vtkMultiBlockDataSet * ROI
Definition: vtkAMRResampleFilter.h:147
vtkgl::h
GLfloat GLfloat GLfloat GLfloat h
Definition: vtkgl.h:14364
vtkAMRResampleFilter::TransferSolution
void TransferSolution(vtkUniformGrid *g, vtkOverlappingAMR *amrds)
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkAMRResampleFilter::IsRegionMine
bool IsRegionMine(const int regionIdx)
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkAMRResampleFilter::NumberOfTimesFoundOnDonorLevel
int NumberOfTimesFoundOnDonorLevel
Definition: vtkAMRResampleFilter.h:166
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkAMRResampleFilter::UseBiasVector
bool UseBiasVector
Definition: vtkAMRResampleFilter.h:159
vtkAMRResampleFilter::AdjustNumberOfSamplesInRegion
void AdjustNumberOfSamplesInRegion(const double Rh[3], const bool outside[6], int N[3])
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:40
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkAMRResampleFilter::AverageLevel
double AverageLevel
Definition: vtkAMRResampleFilter.h:170
vtkAMRResampleFilter::NumberOfPartitions
int NumberOfPartitions
Definition: vtkAMRResampleFilter.h:155
vtkAMRResampleFilter::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkAMRResampleFilter::TransferToNodes
int TransferToNodes
Definition: vtkAMRResampleFilter.h:156
vtkAMRResampleFilter::GetRegionProcessId
int GetRegionProcessId(const int regionIdx)
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:51
vtkAMRResampleFilter::LevelOfResolution
int LevelOfResolution
Definition: vtkAMRResampleFilter.h:154
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:30
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:56
vtkAMRResampleFilter::InitializeFields
void InitializeFields(vtkFieldData *f, vtkIdType size, vtkCellData *src)
vtkAMRResampleFilter::ComputeAMRBlocksToLoad
void ComputeAMRBlocksToLoad(vtkOverlappingAMR *metadata)
vtkAMRResampleFilter::NumberOfBlocksVisSkipped
int NumberOfBlocksVisSkipped
Definition: vtkAMRResampleFilter.h:165
vtkAMRResampleFilter::ComputeCellCentroid
void ComputeCellCentroid(vtkUniformGrid *g, const vtkIdType cellIdx, double c[3])
vtkAMRResampleFilter::NumberOfFailedPoints
int NumberOfFailedPoints
Definition: vtkAMRResampleFilter.h:169
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkAMRResampleFilter::ComputeAndAdjustRegionParameters
void ComputeAndAdjustRegionParameters(vtkOverlappingAMR *amrds, double h[3])
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkFiltersAMRModule.h
vtkAMRResampleFilter::SearchGridAncestors
bool SearchGridAncestors(double q[3], vtkOverlappingAMR *amrds, unsigned int &level, unsigned int &gridId, int &id)
vtkgl::c
const GLubyte * c
Definition: vtkgl.h:15720
vtkAMRResampleFilter::RegionIntersectsWithAMR
bool RegionIntersectsWithAMR(double domainMin[3], double domainMax[3], double regionMin[3], double regionMax[3])
vtkAMRResampleFilter::GetReferenceGrid
vtkUniformGrid * GetReferenceGrid(vtkOverlappingAMR *amrds)
vtkAMRResampleFilter::ExtractRegion
void ExtractRegion(vtkOverlappingAMR *amrds, vtkMultiBlockDataSet *mbds, vtkOverlappingAMR *metadata)
vtkgl::src
GLenum src
Definition: vtkgl.h:12525
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:85
vtkAMRResampleFilter::SearchGridDecendants
void SearchGridDecendants(double q[3], vtkOverlappingAMR *amrds, unsigned int maxLevel, unsigned int &level, unsigned int &gridId, int &id)
vtkAMRResampleFilter::ComputeRegionParameters
void ComputeRegionParameters(vtkOverlappingAMR *amrds, int N[3], double min[3], double max[3], double h[3])
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkAMRResampleFilter::IsBlockWithinBounds
bool IsBlockWithinBounds(double *grd)
vtkAMRResampleFilter::SnapBounds
void SnapBounds(const double h0[3], const double domainMin[3], const double domainMax[3], const int dims[3], bool outside[6])
vtkAMRResampleFilter::CopyData
void CopyData(vtkFieldData *target, vtkIdType targetIdx, vtkCellData *src, vtkIdType srcIdx)
vtkAMRResampleFilter::SearchForDonorGridAtLevel
bool SearchForDonorGridAtLevel(double q[3], vtkOverlappingAMR *amrds, unsigned int level, unsigned int &gridId, int &donorCellIdx)
vtkMultiBlockDataSetAlgorithm.h
vtkAMRResampleFilter::PrintSelf
void PrintSelf(ostream &oss, vtkIndent indent)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkAMRResampleFilter::RequestInformation
virtual int RequestInformation(vtkInformation *rqst, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkAMRResampleFilter::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkAMRResampleFilter::BlocksToLoad
std::vector< int > BlocksToLoad
Definition: vtkAMRResampleFilter.h:172
vtkgl::level
GLint level
Definition: vtkgl.h:11316
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkAMRResampleFilter::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkOverlappingAMR
hierarchical dataset of vtkUniformGrids
Definition: vtkOverlappingAMR.h:46
vtkAMRResampleFilter::NumberOfBlocksTestedForLevel
int NumberOfBlocksTestedForLevel
Definition: vtkAMRResampleFilter.h:163
vtkAMRResampleFilter::GetRegion
void GetRegion(double h[3])
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkX3D::info
@ info
Definition: vtkX3D.h:376
VTKFILTERSAMR_EXPORT
#define VTKFILTERSAMR_EXPORT
Definition: vtkFiltersAMRModule.h:15
vtkgl::g
GLboolean GLboolean g
Definition: vtkgl.h:12312
vtkAMRResampleFilter::IsParallel
bool IsParallel()
vtkAMRResampleFilter::Controller
vtkMultiProcessController * Controller
Definition: vtkAMRResampleFilter.h:158
vtkAMRResampleFilter::NumberOfBlocksTested
int NumberOfBlocksTested
Definition: vtkAMRResampleFilter.h:164
vtkAMRResampleFilter::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
vtkAMRResampleFilter::DemandDrivenMode
int DemandDrivenMode
Definition: vtkAMRResampleFilter.h:157
vtkAMRResampleFilter::TransferToCellCenters
void TransferToCellCenters(vtkUniformGrid *g, vtkOverlappingAMR *amrds)
vtkAMRResampleFilter::ComputeLevelOfResolution
void ComputeLevelOfResolution(const int N[3], const double h0[3], const double L[3], const double rf)
vtkAMRResampleFilter::FoundDonor
bool FoundDonor(double q[3], vtkUniformGrid *&donorGrid, int &cellIdx)
vtkAMRResampleFilter::ProbeGridPointInAMR
int ProbeGridPointInAMR(double q[3], unsigned int &donorLevel, unsigned int &donorGridId, vtkOverlappingAMR *amrds, unsigned int maxLevel, bool useCached)
target
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:828
q
VTKWRAPPINGJAVA_EXPORT jlong q(JNIEnv *env, jobject obj)
vtkAMRResampleFilter
Definition: vtkAMRResampleFilter.h:55
vtkAMRResampleFilter::NumberOfTimesLevelDown
int NumberOfTimesLevelDown
Definition: vtkAMRResampleFilter.h:168
vtkAMRResampleFilter::ProbeGridPointInAMRGraph
int ProbeGridPointInAMRGraph(double q[3], unsigned int &donorLevel, unsigned int &donorGridId, vtkOverlappingAMR *amrds, unsigned int maxLevel, bool useCached)
vtkAMRResampleFilter::vtkAMRResampleFilter
vtkAMRResampleFilter()
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843
vtkAMRResampleFilter::New
static vtkAMRResampleFilter * New()
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:32