VTK  9.7.20261119
vtkCellGridIsocontour.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
60
61#ifndef vtkCellGridIsocontour_h
62#define vtkCellGridIsocontour_h
63
65#include "vtkCellGridQuery.h" // For inheritance
66#include "vtkFiltersCellGridModule.h" // For export macro
67#include "vtkNew.h" // For ivar
68#include "vtkSmartPointer.h" // For vtkSmartPointer
69#include "vtkStringToken.h" // For vtkStringToken
70
71#include <unordered_map> // For unordered_map
72
73VTK_ABI_NAMESPACE_BEGIN
74
76class vtkIdTypeArray;
77class vtkPolyData;
78
79class VTKFILTERSCELLGRID_EXPORT vtkCellGridIsocontour : public vtkCellGridAlgorithm
80{
81public:
90 class Query : public vtkCellGridQuery
91 {
92 public:
93 static Query* New();
95 void PrintSelf(ostream& os, vtkIndent indent) override;
96
98 using CandidateCells = std::unordered_map<vtkStringToken, vtkSmartPointer<vtkIdTypeArray>>;
99
101 bool Initialize() override;
102
106 vtkGetObjectMacro(CellAttribute, vtkCellAttribute);
108
111 vtkSetMacro(Isovalue, double);
112 vtkGetMacro(Isovalue, double);
114
118 void AddCandidateCells(vtkStringToken cellType, vtkIdTypeArray* cellIds, int order);
119
121 const CandidateCells& GetCandidateCells() const { return this->Candidates; }
122
125 int GetMaximumOrder() const { return this->MaximumOrder; }
126
127 protected:
128 Query() = default;
129 ~Query() override;
130
132 double Isovalue{ 0. };
134 int MaximumOrder{ 0 };
135
136 private:
137 Query(const Query&) = delete;
138 void operator=(const Query&) = delete;
139 };
140
143 void PrintSelf(ostream& os, vtkIndent indent) override;
144
147 void SetIsovalue(double isovalue);
148 double GetIsovalue() { return this->Request->GetIsovalue(); }
150
156 vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
157 vtkGetMacro(Tolerance, double);
159
167 vtkSetClampMacro(SubdivisionLevel, int, -1, VTK_INT_MAX);
168 vtkGetMacro(SubdivisionLevel, int);
170
177 vtkSetMacro(OutputIsocontourPoints, bool);
178 vtkGetMacro(OutputIsocontourPoints, bool);
179 vtkBooleanMacro(OutputIsocontourPoints, bool);
181
184
190 vtkSetClampMacro(ParticleRelaxationIterations, int, 0, 1000);
193
197 vtkSetMacro(InterpolateAttributes, bool);
198 vtkGetMacro(InterpolateAttributes, bool);
199 vtkBooleanMacro(InterpolateAttributes, bool);
201
202protected:
204 ~vtkCellGridIsocontour() override = default;
205
206 int FillOutputPortInformation(int port, vtkInformation* info) override;
208 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* ouInfo) override;
209
212 double Tolerance{ 1e-6 };
216
217private:
219 void operator=(const vtkCellGridIsocontour&) = delete;
220};
221
222VTK_ABI_NAMESPACE_END
223#endif // vtkCellGridIsocontour_h
A function defined over the physical domain of a vtkCellGrid.
A cell-grid query for the cells that may hold an isocontour.
const CandidateCells & GetCandidateCells() const
Return the cells that may hold the isocontour, by cell type.
int GetMaximumOrder() const
Return the highest order of the attribute's basis among the cell types that have candidate cells (0 w...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool Initialize() override
Forget the cells found by a previous run.
virtual void SetCellAttribute(vtkCellAttribute *)
std::unordered_map< vtkStringToken, vtkSmartPointer< vtkIdTypeArray > > CandidateCells
The IDs of the cells that may hold the isocontour, by cell type.
void AddCandidateCells(vtkStringToken cellType, vtkIdTypeArray *cellIds, int order)
Called by a responder: the cells cellIds of type cellType may hold the isocontour,...
Extract an isosurface of a scalar cell-attribute of curved cells.
vtkPolyData * GetIsocontourPointsOutput()
Return the second output: the isocontour points (see OutputIsocontourPoints).
void SetIsovalue(double isovalue)
int RequestData(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *ouInfo) override
This is called by the superclass.
static vtkCellGridIsocontour * New()
~vtkCellGridIsocontour() override=default
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCellGridQuery()=default
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:168
concrete dataset represents vertices, lines, polygons, and triangle strips
Represent a string by its integer hash.
#define VTK_INT_MAX
Definition vtkType.h:195