VTK  9.3.1
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 
124  static vtkContour3DLinearGrid* New();
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:
263  ~vtkContour3DLinearGrid() override;
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 
283  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
284  vtkInformationVector* outputVector) override;
285  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
286  vtkInformationVector* outputVector) override;
287  int FillInputPortInformation(int port, vtkInformation* info) 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
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
helper object to manage setting and generating contour values
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
static vtkDataObjectAlgorithm * New()
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
int vtkIdType
Definition: vtkType.h:315
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
double GetValue(int i)
Get the ith contour value.
int vtkTypeBool
Definition: vtkABI.h:64
struct vtkScalarTreeMap * ScalarTreeMap
fast generation of isosurface from 3D linear cells
double * GetValues()
Return a pointer to a list of contour values.
int GetNumberOfThreadsUsed()
Return the number of threads actually used during execution.
a simple class to control print indentation
Definition: vtkIndent.h:28
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
void SetValue(int i, double value)
Methods to set / get contour values.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:43
Superclass for algorithms that produce only data object as output.
double GetValue(int i)
Get the ith contour value.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Store zero or more vtkInformation instances.
int GetNumberOfContours()
Return the number of contours in the.
bool GetLargeIds()
Inform the user as to whether large ids were used during filter execution.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
double * GetValues()
Get a pointer to an array of contour values.
vtkContourValues * ContourValues
general representation of visualization data
Definition: vtkDataObject.h:54
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
void SetValue(int i, double value)
Set the ith contour value.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.