VTK  9.7.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 
113 
121  vtkSetMacro(UseImplicitArrays, bool);
122  vtkGetMacro(UseImplicitArrays, bool);
123  vtkBooleanMacro(UseImplicitArrays, bool);
125 
126 protected:
128  ~vtkHyperTreeGridContour() override;
129 
133  int FillOutputPortInformation(int, vtkInformation*) override;
134 
139 
143  bool RecursivelyPreProcessTree(vtkHyperTreeGridNonOrientedCursor*);
144 
150  void RecursivelyProcessTree(vtkHyperTreeGridNonOrientedMooreSuperCursor*, vtkCellArray* verts,
151  vtkCellArray* lines, vtkCellArray* polys, vtkPointData* dualPointData);
152 
157 
162 
167 
172 
174 
184 
188  std::vector<bool> Signs;
189 
194 
199 
202 
203  // Strategy used to represent dual cells in 3D
204  int Strategy3D = USE_VOXELS;
205 
206 private:
208  void operator=(const vtkHyperTreeGridContour&) = delete;
209 
210  // Use implicit arrays to store contour values
211  bool UseImplicitArrays = false;
212 
213  struct vtkInternals;
214  std::unique_ptr<vtkInternals> Internals;
215 };
216 
221 inline void vtkHyperTreeGridContour::SetValue(int i, double value)
222 {
223  this->ContourValues->SetValue(i, value);
224 }
225 
230 {
231  return this->ContourValues->GetValue(i);
232 }
233 
239 {
240  return this->ContourValues->GetValues();
241 }
242 
248 inline void vtkHyperTreeGridContour::GetValues(double* contourValues)
249 {
250  this->ContourValues->GetValues(contourValues);
251 }
252 
259 {
260  this->ContourValues->SetNumberOfContours(number);
261 }
262 
267 {
268  return this->ContourValues->GetNumberOfContours();
269 }
270 
275 inline void vtkHyperTreeGridContour::GenerateValues(int numContours, double range[2])
276 {
277  this->ContourValues->GenerateValues(numContours, range);
278 }
279 
285  int numContours, double rangeStart, double rangeEnd)
286 {
287  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
288 }
289 
290 VTK_ABI_NAMESPACE_END
291 #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:30
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:318
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
represent and manipulate cell attribute data
Definition: vtkCellData.h:31
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:363
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:25
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:177
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:32
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:55
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...