VTK  9.3.1
vtkHyperTreeGridContour.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
28 #ifndef vtkHyperTreeGridContour_h
29 #define vtkHyperTreeGridContour_h
30 
31 #include "vtkCellArray.h" // For vtkCellArray
32 #include "vtkContourValues.h" // Needed for inline methods
33 #include "vtkFiltersHyperTreeModule.h" // For export macro
35 #include "vtkNew.h" // For vtkNew
36 #include "vtkPointData.h" // For vtkPointData
37 
38 #include <vector> // For STL
39 
40 VTK_ABI_NAMESPACE_BEGIN
41 class vtkBitArray;
42 class vtkCellData;
43 class vtkContourHelper;
44 class vtkDataArray;
45 class vtkHyperTreeGrid;
46 class vtkIdList;
48 class vtkLine;
49 class vtkPixel;
51 class vtkVoxel;
54 
55 class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridContour : public vtkHyperTreeGridAlgorithm
56 {
57 public:
58  static vtkHyperTreeGridContour* New();
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
67  void SetLocator(vtkIncrementalPointLocator*);
68  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
70 
75  void CreateDefaultLocator();
76 
80  vtkMTimeType GetMTime() override;
81 
83 
86  void SetValue(int, double);
87  double GetValue(int);
88  double* GetValues();
89  void GetValues(double*);
90  void SetNumberOfContours(int);
91  vtkIdType GetNumberOfContours();
92  void GenerateValues(int, double[2]);
93  void GenerateValues(int, double, double);
95 
97  {
99  USE_DECOMPOSED_POLYHEDRA
100  };
110  vtkSetClampMacro(Strategy3D, int, USE_VOXELS, USE_DECOMPOSED_POLYHEDRA);
111 
112 protected:
114  ~vtkHyperTreeGridContour() override;
115 
119  int FillOutputPortInformation(int, vtkInformation*) override;
120 
125 
129  bool RecursivelyPreProcessTree(vtkHyperTreeGridNonOrientedCursor*);
130 
136  void RecursivelyProcessTree(vtkHyperTreeGridNonOrientedMooreSuperCursor*, vtkCellArray* verts,
137  vtkCellArray* lines, vtkCellArray* polys, vtkPointData* dualPointData);
138 
143 
148 
153 
158 
160 
170 
174  std::vector<bool> Signs;
175 
180 
185 
188 
189  // Strategy used to represent dual cells in 3D
190  int Strategy3D = USE_VOXELS;
191 
192 private:
194  void operator=(const vtkHyperTreeGridContour&) = delete;
195 
196  struct vtkInternals;
197  std::unique_ptr<vtkInternals> Internals;
198 };
199 
204 inline void vtkHyperTreeGridContour::SetValue(int i, double value)
205 {
206  this->ContourValues->SetValue(i, value);
207 }
208 
213 {
214  return this->ContourValues->GetValue(i);
215 }
216 
222 {
223  return this->ContourValues->GetValues();
224 }
225 
231 inline void vtkHyperTreeGridContour::GetValues(double* contourValues)
232 {
233  this->ContourValues->GetValues(contourValues);
234 }
235 
242 {
243  this->ContourValues->SetNumberOfContours(number);
244 }
245 
250 {
251  return this->ContourValues->GetNumberOfContours();
252 }
253 
258 inline void vtkHyperTreeGridContour::GenerateValues(int numContours, double range[2])
259 {
260  this->ContourValues->GenerateValues(numContours, range);
261 }
262 
268  int numContours, double rangeStart, double rangeEnd)
269 {
270  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
271 }
272 
273 VTK_ABI_NAMESPACE_END
274 #endif // vtkHyperTreeGridContour_h
vtkBitArray * SelectedCells
Storage for pre-selected cells to be processed.
helper object to manage setting and generating contour values
represent and manipulate point attribute data
Definition: vtkPointData.h:29
double * GetValues()
Get a pointer to an array of contour values.
vtkBitArray ** CellSigns
Sign of isovalue if cell not treated.
int FillOutputPortInformation(int, vtkInformation *) override
Define default input and output port types.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
represent and manipulate cell attribute data
Definition: vtkCellData.h:30
a cell that represents an orthogonal quadrilateral
Definition: vtkPixel.h:26
Abstract class in support of both point location and point insertion.
vtkDataArray * InScalars
Keep track of selected input scalars.
vtkUnsignedCharArray * InGhostArray
std::vector< bool > Signs
Storage for signs relative to current contour value.
vtkContourHelper * Helper
Pointers needed to perform isocontouring.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
int vtkIdType
Definition: vtkType.h:315
double GetValue(int i)
Get the ith contour value.
void SetNumberOfContours(int)
Set the number of contours to place into the list.
Objects for traversal a HyperTreeGrid.
void GenerateValues(int, double[2])
Generate numContours equally spaced contour values between specified range.
vtkIdList * Leaves
Pointers needed to perform isocontouring.
vtkContourValues * ContourValues
Storage for contour values.
cell represents a 1D line
Definition: vtkLine.h:22
double * GetValues()
Return a pointer to a list of contour values.
a cell that represents a 3D orthogonal parallelepiped
Definition: vtkVoxel.h:30
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkPixel * Pixel
Pointers needed to perform isocontouring.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
list of point or cell ids
Definition: vtkIdList.h:22
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void SetValue(int, double)
Methods (inlined) to set / get contour values.
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:175
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:28
Extract cells from a hyper tree grid where selected scalar value is within given range.
vtkIdType CurrentId
Keep track of current index in output polydata.
Superclass for algorithms that produce a hyper tree grid as output.
static vtkAlgorithm * New()
int GetNumberOfContours()
Return the number of contours in the.
double GetValue(int)
Get the ith contour value.
vtkIncrementalPointLocator * Locator
Spatial locator to merge points.
vtkLine * Line
Pointers needed to perform isocontouring.
general representation of visualization data
Definition: vtkDataObject.h:54
vtkDataArray * CellScalars
Pointers needed to perform isocontouring.
A utility class used by various contour filters.
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
void SetValue(int i, double value)
Set the ith contour value.
vtkVoxel * Voxel
Pointers needed to perform isocontouring.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
virtual int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *)=0
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...