VTK  9.3.0
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:
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
68  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
70 
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:
115 
120 
125 
130 
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
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:29
object to represent cell connectivity
Definition: vtkCellArray.h:176
represent and manipulate cell attribute data
Definition: vtkCellData.h:31
A utility class used by various contour filters.
helper object to manage setting and generating contour values
int GetNumberOfContours()
Return the number of contours in the.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetValue(int i, double value)
Set the ith contour value.
double GetValue(int i)
Get the ith contour value.
double * GetValues()
Return a pointer to a list of contour values.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:45
general representation of visualization data
Definition: vtkDataObject.h:55
Superclass for algorithms that produce a hyper tree grid as output.
Extract cells from a hyper tree grid where selected scalar value is within given range.
vtkBitArray ** CellSigns
Sign of isovalue if cell not treated.
void CreateDefaultLocator()
Create default locator.
static vtkHyperTreeGridContour * New()
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
void SetValue(int, double)
Methods (inlined) to set / get contour values.
vtkIdType CurrentId
Keep track of current index in output polydata.
vtkPixel * Pixel
Pointers needed to perform isocontouring.
double GetValue(int)
Get the ith contour value.
vtkMTimeType GetMTime() override
Modified GetMTime Because we delegate to vtkContourValues.
int FillOutputPortInformation(int, vtkInformation *) override
For this algorithm the output is a vtkPolyData instance.
vtkIncrementalPointLocator * Locator
Spatial locator to merge points.
std::vector< bool > Signs
Storage for signs relative to current contour value.
vtkDataArray * InScalars
Keep track of selected input scalars.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetNumberOfContours(int)
Set the number of contours to place into the list.
vtkDataArray * CellScalars
Pointers needed to perform isocontouring.
vtkIdList * Leaves
Pointers needed to perform isocontouring.
double * GetValues()
Get a pointer to an array of contour values.
vtkVoxel * Voxel
Pointers needed to perform isocontouring.
bool RecursivelyPreProcessTree(vtkHyperTreeGridNonOrientedCursor *)
Recursively decide whether a cell is intersected by a contour.
void RecursivelyProcessTree(vtkHyperTreeGridNonOrientedMooreSuperCursor *, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *dualPointData)
Recursively descend into the tree down to the leaves to construct the contour (verts,...
vtkLine * Line
Pointers needed to perform isocontouring.
vtkContourValues * ContourValues
Storage for contour values.
void SetLocator(vtkIncrementalPointLocator *)
Set / get a spatial locator for merging points.
int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *) override
Main routine to generate isocontours of hyper tree grid.
vtkBitArray * SelectedCells
Storage for pre-selected cells to be processed.
~vtkHyperTreeGridContour() override
vtkContourHelper * Helper
Pointers needed to perform isocontouring.
vtkUnsignedCharArray * InGhostArray
void GenerateValues(int, double[2])
Generate numContours equally spaced contour values between specified range.
Objects for traversal a HyperTreeGrid.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
list of point or cell ids
Definition: vtkIdList.h:23
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:29
Store vtkAlgorithm input/output information.
cell represents a 1D line
Definition: vtkLine.h:23
a cell that represents an orthogonal quadrilateral
Definition: vtkPixel.h:27
represent and manipulate point attribute data
Definition: vtkPointData.h:30
dynamic, self-adjusting array of unsigned char
a cell that represents a 3D orthogonal parallelepiped
Definition: vtkVoxel.h:31
@ value
Definition: vtkX3D.h:220
@ range
Definition: vtkX3D.h:238
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270