VTK  9.0.1
vtkContour3DLinearGrid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContour3DLinearGrid.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
113 #ifndef vtkContour3DLinearGrid_h
114 #define vtkContour3DLinearGrid_h
115 
116 #include "vtkContourValues.h" // Needed for inline methods
117 #include "vtkDataObjectAlgorithm.h"
118 #include "vtkFiltersCoreModule.h" // For export macro
119 
120 class vtkPolyData;
121 class vtkUnstructuredGrid;
122 class vtkScalarTree;
123 struct vtkScalarTreeMap;
124 
125 class VTKFILTERSCORE_EXPORT vtkContour3DLinearGrid : public vtkDataObjectAlgorithm
126 {
127 public:
129 
132  static vtkContour3DLinearGrid* New();
134  void PrintSelf(ostream& os, vtkIndent indent) override;
136 
138 
141  void SetValue(int i, double value);
142  double GetValue(int i);
143  double* GetValues();
144  void GetValues(double* contourValues);
145  void SetNumberOfContours(int number);
146  vtkIdType GetNumberOfContours();
147  void GenerateValues(int numContours, double range[2]);
148  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
150 
152 
157  vtkSetMacro(MergePoints, vtkTypeBool);
158  vtkGetMacro(MergePoints, vtkTypeBool);
159  vtkBooleanMacro(MergePoints, vtkTypeBool);
161 
163 
167  vtkSetMacro(InterpolateAttributes, vtkTypeBool);
168  vtkGetMacro(InterpolateAttributes, vtkTypeBool);
169  vtkBooleanMacro(InterpolateAttributes, vtkTypeBool);
171 
173 
178  vtkSetMacro(ComputeNormals, vtkTypeBool);
179  vtkGetMacro(ComputeNormals, vtkTypeBool);
180  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
182 
184 
189  void SetOutputPointsPrecision(int precision);
190  int GetOutputPointsPrecision() const;
192 
197  vtkMTimeType GetMTime() override;
198 
200 
205  vtkSetMacro(UseScalarTree, vtkTypeBool);
206  vtkGetMacro(UseScalarTree, vtkTypeBool);
207  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
209 
211 
215  virtual void SetScalarTree(vtkScalarTree*);
216  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
218 
220 
228  vtkSetMacro(SequentialProcessing, vtkTypeBool);
229  vtkGetMacro(SequentialProcessing, vtkTypeBool);
230  vtkBooleanMacro(SequentialProcessing, vtkTypeBool);
232 
237  int GetNumberOfThreadsUsed() { return this->NumberOfThreadsUsed; }
238 
247  bool GetLargeIds() { return this->LargeIds; }
248 
255  static bool CanFullyProcessDataObject(vtkDataObject* object, const char* scalarArrayName);
256 
257 protected:
259  ~vtkContour3DLinearGrid() override;
260 
268  bool LargeIds; // indicate whether integral ids are large(==true) or not
269 
270  // Manage scalar trees, including mapping scalar tree to input dataset
273  struct vtkScalarTreeMap* ScalarTreeMap;
274 
275  // Process the data: input unstructured grid and output polydata
276  void ProcessPiece(vtkUnstructuredGrid* input, vtkDataArray* inScalars, vtkPolyData* output);
277 
278  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
279  vtkInformationVector* outputVector) override;
280  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
281  vtkInformationVector* outputVector) override;
282  int FillInputPortInformation(int port, vtkInformation* info) override;
283 
284 private:
286  void operator=(const vtkContour3DLinearGrid&) = delete;
287 };
288 
293 inline void vtkContour3DLinearGrid::SetValue(int i, double value)
294 {
295  this->ContourValues->SetValue(i, value);
296 }
297 
302 {
303  return this->ContourValues->GetValue(i);
304 }
305 
311 {
312  return this->ContourValues->GetValues();
313 }
314 
320 inline void vtkContour3DLinearGrid::GetValues(double* contourValues)
321 {
322  this->ContourValues->GetValues(contourValues);
323 }
324 
331 {
332  this->ContourValues->SetNumberOfContours(number);
333 }
334 
339 {
340  return this->ContourValues->GetNumberOfContours();
341 }
342 
347 inline void vtkContour3DLinearGrid::GenerateValues(int numContours, double range[2])
348 {
349  this->ContourValues->GenerateValues(numContours, range);
350 }
351 
357  int numContours, double rangeStart, double rangeEnd)
358 {
359  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
360 }
361 
362 #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:293
static vtkDataObjectAlgorithm * New()
void SetNumberOfContours(const 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.
int vtkIdType
Definition: vtkType.h:338
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
double GetValue(int i)
Get the ith contour value.
int vtkTypeBool
Definition: vtkABI.h:69
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:33
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
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:54
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:59
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.