VTK  9.3.0
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
108 #include "vtkDataObjectAlgorithm.h"
109 #include "vtkFiltersCoreModule.h" // For export macro
110 
111 VTK_ABI_NAMESPACE_BEGIN
112 class vtkPolyData;
113 class vtkUnstructuredGrid;
114 class vtkScalarTree;
115 struct vtkScalarTreeMap;
116 
117 class VTKFILTERSCORE_EXPORT vtkContour3DLinearGrid : public vtkDataObjectAlgorithm
118 {
119 public:
121 
126  void PrintSelf(ostream& os, vtkIndent indent) override;
128 
130 
133  void SetValue(int i, double value);
134  double GetValue(int i);
135  double* GetValues();
136  void GetValues(double* contourValues);
137  void SetNumberOfContours(int number);
138  vtkIdType GetNumberOfContours();
139  void GenerateValues(int numContours, double range[2]);
140  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
142 
144 
149  vtkSetMacro(MergePoints, vtkTypeBool);
150  vtkGetMacro(MergePoints, vtkTypeBool);
151  vtkBooleanMacro(MergePoints, vtkTypeBool);
153 
155 
159  vtkSetMacro(InterpolateAttributes, vtkTypeBool);
160  vtkGetMacro(InterpolateAttributes, vtkTypeBool);
161  vtkBooleanMacro(InterpolateAttributes, vtkTypeBool);
163 
165 
170  vtkSetMacro(ComputeNormals, vtkTypeBool);
171  vtkGetMacro(ComputeNormals, vtkTypeBool);
172  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
174 
176 
182  vtkSetMacro(ComputeScalars, vtkTypeBool);
183  vtkGetMacro(ComputeScalars, vtkTypeBool);
184  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
186 
188 
193  vtkSetMacro(OutputPointsPrecision, int);
194  vtkGetMacro(OutputPointsPrecision, int);
196 
201  vtkMTimeType GetMTime() override;
202 
204 
209  vtkSetMacro(UseScalarTree, vtkTypeBool);
210  vtkGetMacro(UseScalarTree, vtkTypeBool);
211  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
213 
215 
219  virtual void SetScalarTree(vtkScalarTree*);
220  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
222 
224 
232  vtkSetMacro(SequentialProcessing, vtkTypeBool);
233  vtkGetMacro(SequentialProcessing, vtkTypeBool);
234  vtkBooleanMacro(SequentialProcessing, vtkTypeBool);
236 
241  int GetNumberOfThreadsUsed() { return this->NumberOfThreadsUsed; }
242 
251  bool GetLargeIds() { return this->LargeIds; }
252 
259  static bool CanFullyProcessDataObject(vtkDataObject* object, const char* scalarArrayName);
260 
261 protected:
264 
273  bool LargeIds; // indicate whether integral ids are large(==true) or not
274 
275  // Manage scalar trees, including mapping scalar tree to input dataset
278  struct vtkScalarTreeMap* ScalarTreeMap;
279 
280  // Process the data: input unstructured grid and output polydata
281  void ProcessPiece(vtkUnstructuredGrid* input, vtkDataArray* inScalars, vtkPolyData* output);
282 
284  vtkInformationVector* outputVector) override;
285  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
286  vtkInformationVector* outputVector) override;
288 
289 private:
291  void operator=(const vtkContour3DLinearGrid&) = delete;
292 };
293 
298 inline void vtkContour3DLinearGrid::SetValue(int i, double value)
299 {
300  this->ContourValues->SetValue(i, value);
301 }
302 
307 {
308  return this->ContourValues->GetValue(i);
309 }
310 
316 {
317  return this->ContourValues->GetValues();
318 }
319 
325 inline void vtkContour3DLinearGrid::GetValues(double* contourValues)
326 {
327  this->ContourValues->GetValues(contourValues);
328 }
329 
336 {
337  this->ContourValues->SetNumberOfContours(number);
338 }
339 
344 {
345  return this->ContourValues->GetNumberOfContours();
346 }
347 
352 inline void vtkContour3DLinearGrid::GenerateValues(int numContours, double range[2])
353 {
354  this->ContourValues->GenerateValues(numContours, range);
355 }
356 
362  int numContours, double rangeStart, double rangeEnd)
363 {
364  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
365 }
366 
367 VTK_ABI_NAMESPACE_END
368 #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.
vtkMTimeType GetMTime() override
Overloaded GetMTime() because of delegation to the internal vtkContourValues class.
double * GetValues()
Get a pointer to an array of contour values.
static vtkContour3DLinearGrid * New()
Standard methods for construction, type info, and printing.
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
vtkContourValues * ContourValues
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
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:54
Superclass for algorithms that produce only data object as output.
general representation of visualization data
Definition: vtkDataObject.h:64
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:44
dataset represents arbitrary combinations of all possible cell types
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270