VTK  9.5.20250905
vtkContour3DLinearGrid.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
104#ifndef vtkContour3DLinearGrid_h
105#define vtkContour3DLinearGrid_h
106
107#include "vtkContourValues.h" // Needed for inline methods
109#include "vtkFiltersCoreModule.h" // For export macro
110#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
111
112VTK_ABI_NAMESPACE_BEGIN
113class vtkPolyData;
115class vtkScalarTree;
116struct vtkScalarTreeMap;
117
119{
120public:
122
127 void PrintSelf(ostream& os, vtkIndent indent) override;
129
131
134 void SetValue(int i, double value);
135 double GetValue(int i);
136 double* GetValues();
137 void GetValues(double* contourValues);
138 void SetNumberOfContours(int number);
139 vtkIdType GetNumberOfContours();
140 void GenerateValues(int numContours, double range[2]);
141 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
143
145
150 vtkSetMacro(MergePoints, vtkTypeBool);
151 vtkGetMacro(MergePoints, vtkTypeBool);
152 vtkBooleanMacro(MergePoints, vtkTypeBool);
154
156
160 vtkSetMacro(InterpolateAttributes, vtkTypeBool);
161 vtkGetMacro(InterpolateAttributes, vtkTypeBool);
162 vtkBooleanMacro(InterpolateAttributes, vtkTypeBool);
164
166
171 vtkSetMacro(ComputeNormals, vtkTypeBool);
172 vtkGetMacro(ComputeNormals, vtkTypeBool);
173 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
175
177
183 vtkSetMacro(ComputeScalars, vtkTypeBool);
184 vtkGetMacro(ComputeScalars, vtkTypeBool);
185 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
187
189
194 vtkSetMacro(OutputPointsPrecision, int);
195 vtkGetMacro(OutputPointsPrecision, int);
197
203
205
210 vtkSetMacro(UseScalarTree, vtkTypeBool);
211 vtkGetMacro(UseScalarTree, vtkTypeBool);
212 vtkBooleanMacro(UseScalarTree, vtkTypeBool);
214
216
221 vtkGetObjectMacro(ScalarTree, vtkScalarTree);
223
225
233 vtkSetMacro(SequentialProcessing, vtkTypeBool);
234 vtkGetMacro(SequentialProcessing, vtkTypeBool);
235 vtkBooleanMacro(SequentialProcessing, vtkTypeBool);
237
242 int GetNumberOfThreadsUsed() { return this->NumberOfThreadsUsed; }
243
252 bool GetLargeIds() { return this->LargeIds; }
253
260 static bool CanFullyProcessDataObject(vtkDataObject* object, const char* scalarArrayName);
261
262protected:
265
274 bool LargeIds; // indicate whether integral ids are large(==true) or not
275
276 // Manage scalar trees, including mapping scalar tree to input dataset
279 struct vtkScalarTreeMap* ScalarTreeMap;
280
281 // Process the data: input unstructured grid and output polydata
282 void ProcessPiece(vtkUnstructuredGrid* input, vtkDataArray* inScalars, vtkPolyData* output);
283
285 vtkInformationVector* outputVector) override;
287 vtkInformationVector* outputVector) override;
288 int FillInputPortInformation(int port, vtkInformation* info) override;
289
290private:
292 void operator=(const vtkContour3DLinearGrid&) = delete;
293};
294
299inline void vtkContour3DLinearGrid::SetValue(int i, double value)
300{
301 this->ContourValues->SetValue(i, value);
302}
303
308{
309 return this->ContourValues->GetValue(i);
310}
311
317{
318 return this->ContourValues->GetValues();
319}
320
326inline void vtkContour3DLinearGrid::GetValues(double* contourValues)
327{
328 this->ContourValues->GetValues(contourValues);
329}
330
337{
338 this->ContourValues->SetNumberOfContours(number);
339}
340
345{
346 return this->ContourValues->GetNumberOfContours();
347}
348
353inline void vtkContour3DLinearGrid::GenerateValues(int numContours, double range[2])
354{
355 this->ContourValues->GenerateValues(numContours, range);
356}
357
363 int numContours, double rangeStart, double rangeEnd)
364{
365 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
366}
367
368VTK_ABI_NAMESPACE_END
369#endif
fast generation of isosurface from 3D linear cells
static bool CanFullyProcessDataObject(vtkDataObject *object, const char *scalarArrayName)
Returns true if the data object passed in is fully supported by this filter, i.e.,...
bool GetLargeIds()
Inform the user as to whether large ids were used during filter execution.
static vtkContour3DLinearGrid * New()
Standard methods for construction, type info, and printing.
vtkMTimeType GetMTime() override
Overloaded GetMTime() because of delegation to the internal vtkContourValues class.
double * GetValues()
Get a pointer to an array of contour values.
virtual void SetScalarTree(vtkScalarTree *)
Specify the scalar tree to use.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
void ProcessPiece(vtkUnstructuredGrid *input, vtkDataArray *inScalars, vtkPolyData *output)
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
void SetValue(int i, double value)
Methods to set / get contour values.
struct vtkScalarTreeMap * ScalarTreeMap
~vtkContour3DLinearGrid() override
double GetValue(int i)
Get the ith contour value.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for construction, type info, and printing.
int GetNumberOfThreadsUsed()
Return the number of threads actually used during execution.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
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
Superclass for algorithms that produce only data object as output.
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete dataset represents vertices, lines, polygons, and triangle strips
organize data according to scalar values (used to accelerate contouring operations)
dataset represents arbitrary combinations of all possible cell types
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_MARSHALAUTO