VTK  9.3.20240424
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
40VTK_ABI_NAMESPACE_BEGIN
41class vtkBitArray;
42class vtkCellData;
44class vtkDataArray;
46class vtkIdList;
48class vtkLine;
49class vtkPixel;
51class vtkVoxel;
54
55class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridContour : public vtkHyperTreeGridAlgorithm
56{
57public:
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
63
68 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
70
76
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
126protected:
129
134
139
144
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
206private:
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
221inline 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
248inline 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
275inline 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
290VTK_ABI_NAMESPACE_END
291#endif // vtkHyperTreeGridContour_h
dynamic, self-adjusting array of bits
Definition vtkBitArray.h:29
object to represent cell connectivity
represent and manipulate cell attribute data
A utility class used by various contour filters.
helper object to manage setting and generating contour values
double * GetValues()
Return a pointer to a list of 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.
abstract superclass for arrays of numeric data
general representation of visualization data
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.
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
static vtkHyperTreeGridContour * New()
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:133
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
cell represents a 1D line
Definition vtkLine.h:132
a cell that represents an orthogonal quadrilateral
Definition vtkPixel.h:66
represent and manipulate point attribute data
dynamic, self-adjusting array of unsigned char
a cell that represents a 3D orthogonal parallelepiped
Definition vtkVoxel.h:80
int vtkIdType
Definition vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270