VTK  9.2.6
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 =========================================================================*/
116 #ifndef vtkContour3DLinearGrid_h
117 #define vtkContour3DLinearGrid_h
118 
119 #include "vtkContourValues.h" // Needed for inline methods
120 #include "vtkDataObjectAlgorithm.h"
121 #include "vtkFiltersCoreModule.h" // For export macro
122 
123 class vtkPolyData;
124 class vtkUnstructuredGrid;
125 class vtkScalarTree;
126 struct vtkScalarTreeMap;
127 
128 class VTKFILTERSCORE_EXPORT vtkContour3DLinearGrid : public vtkDataObjectAlgorithm
129 {
130 public:
132 
135  static vtkContour3DLinearGrid* New();
137  void PrintSelf(ostream& os, vtkIndent indent) override;
139 
141 
144  void SetValue(int i, double value);
145  double GetValue(int i);
146  double* GetValues();
147  void GetValues(double* contourValues);
148  void SetNumberOfContours(int number);
149  vtkIdType GetNumberOfContours();
150  void GenerateValues(int numContours, double range[2]);
151  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
153 
155 
160  vtkSetMacro(MergePoints, vtkTypeBool);
161  vtkGetMacro(MergePoints, vtkTypeBool);
162  vtkBooleanMacro(MergePoints, vtkTypeBool);
164 
166 
170  vtkSetMacro(InterpolateAttributes, vtkTypeBool);
171  vtkGetMacro(InterpolateAttributes, vtkTypeBool);
172  vtkBooleanMacro(InterpolateAttributes, vtkTypeBool);
174 
176 
181  vtkSetMacro(ComputeNormals, vtkTypeBool);
182  vtkGetMacro(ComputeNormals, vtkTypeBool);
183  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
185 
187 
193  vtkSetMacro(ComputeScalars, vtkTypeBool);
194  vtkGetMacro(ComputeScalars, vtkTypeBool);
195  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
197 
199 
204  void SetOutputPointsPrecision(int precision);
205  int GetOutputPointsPrecision() const;
207 
212  vtkMTimeType GetMTime() override;
213 
215 
220  vtkSetMacro(UseScalarTree, vtkTypeBool);
221  vtkGetMacro(UseScalarTree, vtkTypeBool);
222  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
224 
226 
230  virtual void SetScalarTree(vtkScalarTree*);
231  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
233 
235 
243  vtkSetMacro(SequentialProcessing, vtkTypeBool);
244  vtkGetMacro(SequentialProcessing, vtkTypeBool);
245  vtkBooleanMacro(SequentialProcessing, vtkTypeBool);
247 
252  int GetNumberOfThreadsUsed() { return this->NumberOfThreadsUsed; }
253 
262  bool GetLargeIds() { return this->LargeIds; }
263 
270  static bool CanFullyProcessDataObject(vtkDataObject* object, const char* scalarArrayName);
271 
272 protected:
274  ~vtkContour3DLinearGrid() override;
275 
284  bool LargeIds; // indicate whether integral ids are large(==true) or not
285 
286  // Manage scalar trees, including mapping scalar tree to input dataset
289  struct vtkScalarTreeMap* ScalarTreeMap;
290 
291  // Process the data: input unstructured grid and output polydata
292  void ProcessPiece(vtkUnstructuredGrid* input, vtkDataArray* inScalars, vtkPolyData* output);
293 
294  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
295  vtkInformationVector* outputVector) override;
296  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
297  vtkInformationVector* outputVector) override;
298  int FillInputPortInformation(int port, vtkInformation* info) override;
299 
300 private:
302  void operator=(const vtkContour3DLinearGrid&) = delete;
303 };
304 
309 inline void vtkContour3DLinearGrid::SetValue(int i, double value)
310 {
311  this->ContourValues->SetValue(i, value);
312 }
313 
318 {
319  return this->ContourValues->GetValue(i);
320 }
321 
327 {
328  return this->ContourValues->GetValues();
329 }
330 
336 inline void vtkContour3DLinearGrid::GetValues(double* contourValues)
337 {
338  this->ContourValues->GetValues(contourValues);
339 }
340 
347 {
348  this->ContourValues->SetNumberOfContours(number);
349 }
350 
355 {
356  return this->ContourValues->GetNumberOfContours();
357 }
358 
363 inline void vtkContour3DLinearGrid::GenerateValues(int numContours, double range[2])
364 {
365  this->ContourValues->GenerateValues(numContours, range);
366 }
367 
373  int numContours, double rangeStart, double rangeEnd)
374 {
375  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
376 }
377 
378 #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:287
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:332
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
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:39
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
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:65
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.