VTK  9.7.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
86 #ifndef vtkContour3DLinearGrid_h
87 #define vtkContour3DLinearGrid_h
88 
89 #include "vtkContourValues.h" // Needed for inline methods
90 #include "vtkDataObjectAlgorithm.h"
91 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_7_0
92 #include "vtkFiltersCoreModule.h" // For export macro
93 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
94 
95 VTK_ABI_NAMESPACE_BEGIN
96 class vtkPolyData;
98 class vtkScalarTree;
99 struct vtkScalarTreeMap;
100 
102 {
103 public:
105 
108  static vtkContour3DLinearGrid* New();
110  void PrintSelf(ostream& os, vtkIndent indent) override;
112 
114 
117  void SetValue(int i, double value);
118  double GetValue(int i);
119  double* GetValues();
120  void GetValues(double* contourValues);
121  void SetNumberOfContours(int number);
122  vtkIdType GetNumberOfContours();
123  void GenerateValues(int numContours, double range[2]);
124  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
126 
128 
133  VTK_DEPRECATED_IN_9_7_0("No longer needed, points are always merged")
134  vtkSetMacro(MergePoints, vtkTypeBool);
135  VTK_DEPRECATED_IN_9_7_0("No longer needed, points are always merged")
136  vtkGetMacro(MergePoints, vtkTypeBool);
137  VTK_DEPRECATED_IN_9_7_0("No longer needed, points are always merged")
138  virtual void SetMergePointsOn();
139  VTK_DEPRECATED_IN_9_7_0("No longer needed, points are always merged")
140  virtual void SetMergePointsOff();
142 
144 
148  vtkSetMacro(InterpolateAttributes, vtkTypeBool);
149  vtkGetMacro(InterpolateAttributes, vtkTypeBool);
150  vtkBooleanMacro(InterpolateAttributes, vtkTypeBool);
152 
154 
159  vtkSetMacro(ComputeNormals, vtkTypeBool);
160  vtkGetMacro(ComputeNormals, vtkTypeBool);
161  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
163 
165 
171  vtkSetMacro(ComputeScalars, vtkTypeBool);
172  vtkGetMacro(ComputeScalars, vtkTypeBool);
173  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
175 
177 
182  vtkSetMacro(OutputPointsPrecision, int);
183  vtkGetMacro(OutputPointsPrecision, int);
185 
190  vtkMTimeType GetMTime() override;
191 
193 
198  vtkSetMacro(UseScalarTree, vtkTypeBool);
199  vtkGetMacro(UseScalarTree, vtkTypeBool);
200  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
202 
204 
208  virtual void SetScalarTree(vtkScalarTree*);
209  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
211 
213 
221  vtkSetMacro(SequentialProcessing, vtkTypeBool);
222  vtkGetMacro(SequentialProcessing, vtkTypeBool);
223  vtkBooleanMacro(SequentialProcessing, vtkTypeBool);
225 
227 
233  vtkSetMacro(GenerateTriangles, vtkTypeBool);
234  vtkGetMacro(GenerateTriangles, vtkTypeBool);
235  vtkBooleanMacro(GenerateTriangles, 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 
262 protected:
264  ~vtkContour3DLinearGrid() override;
265 
275  bool LargeIds; // indicate whether integral ids are large(==true) or not
276 
277  // Manage scalar trees, including mapping scalar tree to input dataset
280  struct vtkScalarTreeMap* ScalarTreeMap;
281 
282  // Process the data: input unstructured grid and output polydata
283  void ProcessPiece(vtkUnstructuredGrid* input, vtkDataArray* inScalars, vtkPolyData* output);
284 
285  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
286  vtkInformationVector* outputVector) override;
287  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
288  vtkInformationVector* outputVector) override;
289  int FillInputPortInformation(int port, vtkInformation* info) override;
290 
291 private:
293  void operator=(const vtkContour3DLinearGrid&) = delete;
294 };
295 
300 inline void vtkContour3DLinearGrid::SetValue(int i, double value)
301 {
302  this->ContourValues->SetValue(i, value);
303 }
304 
309 {
310  return this->ContourValues->GetValue(i);
311 }
312 
318 {
319  return this->ContourValues->GetValues();
320 }
321 
327 inline void vtkContour3DLinearGrid::GetValues(double* contourValues)
328 {
329  this->ContourValues->GetValues(contourValues);
330 }
331 
338 {
339  this->ContourValues->SetNumberOfContours(number);
340 }
341 
346 {
347  return this->ContourValues->GetNumberOfContours();
348 }
349 
354 inline void vtkContour3DLinearGrid::GenerateValues(int numContours, double range[2])
355 {
356  this->ContourValues->GenerateValues(numContours, range);
357 }
358 
364  int numContours, double rangeStart, double rangeEnd)
365 {
366  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
367 }
368 
369 VTK_ABI_NAMESPACE_END
370 #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:318
static vtkDataObjectAlgorithm * New()
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
int vtkIdType
Definition: vtkType.h:363
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
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.
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.
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.
#define VTK_MARSHALAUTO
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:55
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
#define VTK_DEPRECATED_IN_9_7_0(reason)
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.