ParaView
vtkResampledAMRImageSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
34 #ifndef vtkResampledAMRImageSource_h
35 #define vtkResampledAMRImageSource_h
36 
37 #include "vtkPVVTKExtensionsRenderingModule.h" // needed for export macro
38 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
39 #include "vtkTrivialProducer.h"
40 
41 class vtkAMRBox;
42 class vtkImageData;
43 class vtkIntArray;
44 class vtkOverlappingAMR;
45 class vtkPointData;
46 
47 class VTKPVVTKEXTENSIONSRENDERING_EXPORT vtkResampledAMRImageSource : public vtkTrivialProducer
48 {
49 public:
50  static vtkResampledAMRImageSource* New();
51  vtkTypeMacro(vtkResampledAMRImageSource, vtkTrivialProducer);
52  void PrintSelf(ostream& os, vtkIndent indent);
53 
55 
58  vtkSetVector3Macro(MaxDimensions, int);
59  vtkGetVector3Macro(MaxDimensions, int);
61 
63 
69  vtkSetVector6Macro(SpatialBounds, double);
70  vtkGetVector6Macro(SpatialBounds, double);
72 
77  void Reset();
78 
83  void UpdateResampledVolume(vtkOverlappingAMR*);
84 
89  bool NeedsInitialization() const { return (this->MTime > this->InitializationTime); }
90 
91 protected:
94 
95  bool Initialize(vtkOverlappingAMR* amr);
96  bool UpdateResampledVolume(
97  const unsigned int& level, const unsigned& index, const vtkAMRBox& box, vtkImageData* data);
98 
99  int MaxDimensions[3];
100  double SpatialBounds[6];
101 
102  vtkSmartPointer<vtkImageData> ResampledAMR;
103  vtkSmartPointer<vtkPointData> ResampledAMRPointData;
104 
105  vtkSmartPointer<vtkIntArray> DonorLevel;
106 
107 private:
108  vtkResampledAMRImageSource(const vtkResampledAMRImageSource&) VTK_DELETE_FUNCTION;
109  void operator=(const vtkResampledAMRImageSource&) VTK_DELETE_FUNCTION;
110 
111  vtkTimeStamp InitializationTime;
112 };
113 
114 #endif
vtkSmartPointer< vtkImageData > ResampledAMR
image data source that resamples an AMR dataset to produce the image data.
vtkSmartPointer< vtkPointData > ResampledAMRPointData
vtkSmartPointer< vtkIntArray > DonorLevel
bool NeedsInitialization() const
Returns true if the resampler will reinitialize the volume in the next call to UpdateResampledVolume(...