VTK
vtkExtractCTHPart.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkExtractCTHPart.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 =========================================================================*/
28 #ifndef __vtkExtractCTHPart_h
29 #define __vtkExtractCTHPart_h
30 
32 
33 class vtkAppendPolyData;
34 class vtkBoundingBox;
35 class vtkClipPolyData;
36 class vtkContourFilter;
37 class vtkCutter;
38 class vtkDataArray;
39 class vtkDataSet;
41 class vtkDoubleArray;
42 class vtkExtractCTHPartInternal;
43 class vtkImageData;
47 class vtkPlane;
48 class vtkPolyData;
49 class vtkRectilinearGrid;
50 class vtkUniformGrid;
52 
53 //#define EXTRACT_USE_IMAGE_DATA 1
54 
56 {
57 public:
59  void PrintSelf(ostream& os, vtkIndent indent);
60 
62  static vtkInformationDoubleVectorKey *BOUNDS();
63 
66  static vtkExtractCTHPart *New();
67 
69 
70  void RemoveDoubleVolumeArrayNames();
71  void RemoveFloatVolumeArrayNames();
72  void RemoveUnsignedCharVolumeArrayNames();
73  int GetNumberOfVolumeArrayNames();
74  const char* GetVolumeArrayName(int idx);
75  // for backwards compatibility
76  void RemoveAllVolumeArrayNames();
78 
80 
84  void AddDoubleVolumeArrayName(char* arrayName);
85  void AddFloatVolumeArrayName(char* arrayName);
86  void AddUnsignedCharVolumeArrayName(char* arrayName);
87  //for backwards compatibility
88  void AddVolumeArrayName(char* arrayName);
90 
92 
93  void SetClipPlane(vtkPlane *clipPlane);
94  vtkGetObjectMacro(ClipPlane, vtkPlane);
96 
98  unsigned long GetMTime();
99 
101  void SetController(vtkMultiProcessController* controller);
102 
104 
106  vtkGetObjectMacro(Controller,vtkMultiProcessController);
108 
110 
112  vtkSetClampMacro(VolumeFractionSurfaceValue, double, 0.0, 1.0);
113  vtkGetMacro(VolumeFractionSurfaceValue, double);
115 
116 protected:
119 
120  virtual int RequestInformation(vtkInformation *request,
121  vtkInformationVector **inputVector,
122  vtkInformationVector *outputVector);
123 
126 
134  void ComputeBounds(vtkCompositeDataSet *input,
135  int processNumber,
136  int numProcessors);
138 
139  void ExecutePart(const char *arrayName,
140  vtkCompositeDataSet *input,
141  vtkAppendPolyData *appendSurface,
142  vtkAppendPolyData *append,
143  float minProgress,
144  float maxProgress);
145 
146  void ExecutePartOnUniformGrid(const char *arrayName,
147 #ifdef EXTRACT_USE_IMAGE_DATA
148  vtkImageData *input,
149 #else
150  vtkUniformGrid *input,
151 #endif
152  vtkAppendPolyData *appendSurface,
153  vtkAppendPolyData *append,
154  float minProgress,
155  float maxProgress);
156 
157  void ExecutePartOnRectilinearGrid(const char *arrayName,
158  vtkRectilinearGrid *input,
159  vtkAppendPolyData *appendSurface,
160  vtkAppendPolyData *append,
161  float minProgress,
162  float maxProgress);
163 
164  void ExecuteCellDataToPointData(vtkDataArray *cellVolumeFraction,
165  vtkDoubleArray *pointVolumeFraction,
166  int *dims,
167  float minProgress,
168  float maxProgress,
169  int reportProgress);
170 
171  virtual int FillInputPortInformation(int port,
173 
174  void CreateInternalPipeline();
175  void DeleteInternalPipeline();
176 
178 
181  int ExtractUniformGridSurface(
182 #ifdef EXTRACT_USE_IMAGE_DATA
183  vtkImageData *input,
184 #else
185  vtkUniformGrid *input,
186 #endif
187  vtkPolyData *output);
189 
191 
194  int ExtractRectilinearGridSurface(vtkRectilinearGrid *input,
195  vtkPolyData *output);
197 
198  void ExecuteFaceQuads(vtkDataSet *input,
199  vtkPolyData *output,
200  int maxFlag,
201  int originExtents[3],
202  int ext[6],
203  int aAxis,
204  int bAxis,
205  int cAxis);
206 
208 
210  int IsGhostFace(int axis0,
211  int maxFlag,
212  int dims[3],
213  vtkUnsignedCharArray *ghostArray);
215 
217  vtkExtractCTHPartInternal* Internals;
218 
219  // Internal Pipeline elements
221 
222 #ifdef EXTRACT_USE_IMAGE_DATA
223  vtkImageData *Data;
224 #else
226 #endif
227 
233 
237 
244 
245  void EvaluateVolumeFractionType(vtkRectilinearGrid* rg,
246  vtkCompositeDataSet* input);
251 
252  vtkBoundingBox *Bounds; // Whole bounds (dataset over all the processors)
253 
255 private:
256  vtkExtractCTHPart(const vtkExtractCTHPart&); // Not implemented.
257  void operator=(const vtkExtractCTHPart&); // Not implemented.
258 };
259 #endif