ParaView
vtkFlashContour.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkFlashContour.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 =========================================================================*/
23 #ifndef vtkFlashContour_h
24 #define vtkFlashContour_h
25 
26 #include "vtkMultiBlockDataSetAlgorithm.h"
27 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
28 
29 class vtkImageData;
30 class vtkPoints;
31 class vtkCellArray;
32 class vtkUnsignedCharArray;
33 class vtkPolyData;
34 class vtkDoubleArray;
35 class vtkIntArray;
36 
37 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkFlashContour : public vtkMultiBlockDataSetAlgorithm
38 {
39 public:
40  static vtkFlashContour* New();
41  vtkTypeMacro(vtkFlashContour, vtkMultiBlockDataSetAlgorithm);
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
44  vtkSetMacro(IsoValue, double);
45  vtkGetMacro(IsoValue, double);
46 
47  vtkSetStringMacro(PassAttribute);
48  vtkGetStringMacro(PassAttribute);
49 
50 protected:
52  ~vtkFlashContour();
53 
54  double IsoValue;
56  vtkDoubleArray* PassArray;
57 
58  // Just for debugging.
59  vtkIntArray* BlockIdCellArray;
61  // A couple cell arrays to help determine where I should refine.
62  vtkUnsignedCharArray* LevelCellArray;
63  unsigned char CurrentLevel;
64  // Instead of maximum depth, compute the different between the
65  // maximum depth and the current depth.
66  vtkUnsignedCharArray* RemainingDepthCellArray;
67  unsigned char RemainingDepth;
68  unsigned char ComputeBranchDepth(int globalBlockId);
69 
70  vtkPoints* Points;
71  vtkCellArray* Faces;
72  vtkPolyData* Mesh;
73 
75  vtkSetStringMacro(CellArrayNameToProcess);
76 
77  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
78  virtual int FillInputPortInformation(int port, vtkInformation* info);
79  virtual int FillOutputPortInformation(int port, vtkInformation* info);
80  void PropogateNeighbors(int neighbors[3][3][3], int x, int y, int z);
81 
82  // Save some ivars to reduce arguments to recursive methods.
88 
89  void RecurseTree(int neighborhood[3][3][3], vtkMultiBlockDataSet* input);
90  void ProcessBlock(vtkImageData* block);
91  void ProcessCell(const double* origin, const double* spacing, const double* cornerValues,
92  const double* passValues);
93  void ProcessNeighborhoodSharedRegion(
94  int neighborhood[3][3][3], int r[3], vtkMultiBlockDataSet* input);
95  void ProcessSharedRegion(int regionDims[3], double* cornerPtrs[8], int incs[3],
96  double cornerPoints[32], double cornerSpacings[32], int cornerLevelDiffs[8],
97  double* passPtrs[8]);
98  void ProcessDegenerateCell(double cornerPoints[32], double* cornerPtrs[8], double* passPtrs[8]);
99  void ProcessCellFinal(const double cornerPoints[32], const double cornerValues[8], int cubeCase,
100  const double passValues[8]);
101 
102 private:
103  vtkFlashContour(const vtkFlashContour&) VTK_DELETE_FUNCTION;
104  void operator=(const vtkFlashContour&) VTK_DELETE_FUNCTION;
105 };
106 
107 #endif
unsigned char CurrentLevel
char * CellArrayNameToProcess
vtkUnsignedCharArray * LevelCellArray
vtkCellArray * Faces
vtkPoints * Points
Contour of a flash AMR volume.
vtkDoubleArray * PassArray
vtkPolyData * Mesh
vtkUnsignedCharArray * RemainingDepthCellArray
unsigned char RemainingDepth
vtkIntArray * BlockIdCellArray