VTK  9.0.1
vtkContourGrid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContourGrid.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 =========================================================================*/
53 #ifndef vtkContourGrid_h
54 #define vtkContourGrid_h
55 
56 #include "vtkFiltersCoreModule.h" // For export macro
57 #include "vtkPolyDataAlgorithm.h"
58 
59 #include "vtkContourValues.h" // Needed for inline methods
60 
61 class vtkEdgeTable;
62 class vtkScalarTree;
64 
65 class VTKFILTERSCORE_EXPORT vtkContourGrid : public vtkPolyDataAlgorithm
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
75  static vtkContourGrid* New();
76 
78 
81  void SetValue(int i, double value);
82  double GetValue(int i);
83  double* GetValues();
84  void GetValues(double* contourValues);
85  void SetNumberOfContours(int number);
86  vtkIdType GetNumberOfContours();
87  void GenerateValues(int numContours, double range[2]);
88  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
90 
94  vtkMTimeType GetMTime() override;
95 
97 
103  vtkSetMacro(ComputeNormals, vtkTypeBool);
104  vtkGetMacro(ComputeNormals, vtkTypeBool);
105  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
107 
109 
119 #ifndef VTK_LEGACY_REMOVE
120  vtkSetMacro(ComputeGradients, vtkTypeBool);
121  vtkGetMacro(ComputeGradients, vtkTypeBool);
122  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
123 #endif
124 
125 
127 
130  vtkSetMacro(ComputeScalars, vtkTypeBool);
131  vtkGetMacro(ComputeScalars, vtkTypeBool);
132  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
134 
136 
139  vtkSetMacro(UseScalarTree, vtkTypeBool);
140  vtkGetMacro(UseScalarTree, vtkTypeBool);
141  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
143 
145 
149  void SetScalarTree(vtkScalarTree* sTree);
150  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
152 
154 
158  void SetLocator(vtkIncrementalPointLocator* locator);
159  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
161 
163 
170  vtkSetMacro(GenerateTriangles, vtkTypeBool);
171  vtkGetMacro(GenerateTriangles, vtkTypeBool);
172  vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
174 
179  void CreateDefaultLocator();
180 
182 
187  void SetOutputPointsPrecision(int precision);
188  int GetOutputPointsPrecision() const;
190 
191 protected:
192  vtkContourGrid();
193  ~vtkContourGrid() override;
194 
196  int FillInputPortInformation(int port, vtkInformation* info) override;
197 
200 #ifndef VTK_LEGACY_REMOVE
202 #endif
205 
207 
210 
213 
214 private:
215  vtkContourGrid(const vtkContourGrid&) = delete;
216  void operator=(const vtkContourGrid&) = delete;
217 };
218 
223 inline void vtkContourGrid::SetValue(int i, double value)
224 {
225  this->ContourValues->SetValue(i, value);
226 }
227 
231 inline double vtkContourGrid::GetValue(int i)
232 {
233  return this->ContourValues->GetValue(i);
234 }
235 
241 {
242  return this->ContourValues->GetValues();
243 }
244 
250 inline void vtkContourGrid::GetValues(double* contourValues)
251 {
252  this->ContourValues->GetValues(contourValues);
253 }
254 
260 inline void vtkContourGrid::SetNumberOfContours(int number)
261 {
262  this->ContourValues->SetNumberOfContours(number);
263 }
264 
269 {
270  return this->ContourValues->GetNumberOfContours();
271 }
272 
277 inline void vtkContourGrid::GenerateValues(int numContours, double range[2])
278 {
279  this->ContourValues->GenerateValues(numContours, range);
280 }
281 
286 inline void vtkContourGrid::GenerateValues(int numContours, double rangeStart, double rangeEnd)
287 {
288  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
289 }
290 
291 #endif
vtkEdgeTable * EdgeTable
vtkTypeBool GenerateTriangles
helper object to manage setting and generating contour values
generate isosurfaces/isolines from scalar values (specialized for unstructured grids)
vtkTypeBool ComputeNormals
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkContourValues * ContourValues
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Abstract class in support of both point location and point insertion.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
int vtkIdType
Definition: vtkType.h:338
double GetValue(int i)
Get the ith contour value.
keep track of edges (edge is pair of integer id's)
Definition: vtkEdgeTable.h:40
void SetValue(int i, double value)
Methods to set / get contour values.
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
double * GetValues()
Return a pointer to a list of contour values.
Superclass for algorithms that produce only polydata as output.
double * GetValues()
Get a pointer to an array of contour values.
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual vtkMTimeType GetMTime()
Return this object's modified time.
double GetValue(int i)
Get the ith contour value.
vtkTypeBool ComputeGradients
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:54
vtkTypeBool ComputeScalars
vtkIncrementalPointLocator * Locator
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.
vtkScalarTree * ScalarTree
Store zero or more vtkInformation instances.
int GetNumberOfContours()
Return the number of contours in the.
vtkTypeBool UseScalarTree
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 GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.