VTK  9.2.6
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 =========================================================================*/
56 #ifndef vtkContourGrid_h
57 #define vtkContourGrid_h
58 
59 #include "vtkFiltersCoreModule.h" // For export macro
60 #include "vtkPolyDataAlgorithm.h"
61 
62 #include "vtkContourValues.h" // Needed for inline methods
63 
64 class vtkEdgeTable;
65 class vtkScalarTree;
67 
68 class VTKFILTERSCORE_EXPORT vtkContourGrid : public vtkPolyDataAlgorithm
69 {
70 public:
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
78  static vtkContourGrid* New();
79 
81 
84  void SetValue(int i, double value);
85  double GetValue(int i);
86  double* GetValues();
87  void GetValues(double* contourValues);
88  void SetNumberOfContours(int number);
89  vtkIdType GetNumberOfContours();
90  void GenerateValues(int numContours, double range[2]);
91  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
93 
97  vtkMTimeType GetMTime() override;
98 
100 
106  vtkSetMacro(ComputeNormals, vtkTypeBool);
107  vtkGetMacro(ComputeNormals, vtkTypeBool);
108  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
110 
112 
115  vtkSetMacro(ComputeScalars, vtkTypeBool);
116  vtkGetMacro(ComputeScalars, vtkTypeBool);
117  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
119 
121 
124  vtkSetMacro(UseScalarTree, vtkTypeBool);
125  vtkGetMacro(UseScalarTree, vtkTypeBool);
126  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
128 
130 
134  void SetScalarTree(vtkScalarTree* sTree);
135  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
137 
139 
143  void SetLocator(vtkIncrementalPointLocator* locator);
144  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
146 
148 
155  vtkSetMacro(GenerateTriangles, vtkTypeBool);
156  vtkGetMacro(GenerateTriangles, vtkTypeBool);
157  vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
159 
164  void CreateDefaultLocator();
165 
167 
172  void SetOutputPointsPrecision(int precision);
173  int GetOutputPointsPrecision() const;
175 
176 protected:
177  vtkContourGrid();
178  ~vtkContourGrid() override;
179 
181  int FillInputPortInformation(int port, vtkInformation* info) override;
182 
187 
189 
192 
195 
196 private:
197  vtkContourGrid(const vtkContourGrid&) = delete;
198  void operator=(const vtkContourGrid&) = delete;
199 };
200 
205 inline void vtkContourGrid::SetValue(int i, double value)
206 {
207  this->ContourValues->SetValue(i, value);
208 }
209 
213 inline double vtkContourGrid::GetValue(int i)
214 {
215  return this->ContourValues->GetValue(i);
216 }
217 
223 {
224  return this->ContourValues->GetValues();
225 }
226 
232 inline void vtkContourGrid::GetValues(double* contourValues)
233 {
234  this->ContourValues->GetValues(contourValues);
235 }
236 
242 inline void vtkContourGrid::SetNumberOfContours(int number)
243 {
244  this->ContourValues->SetNumberOfContours(number);
245 }
246 
251 {
252  return this->ContourValues->GetNumberOfContours();
253 }
254 
259 inline void vtkContourGrid::GenerateValues(int numContours, double range[2])
260 {
261  this->ContourValues->GenerateValues(numContours, range);
262 }
263 
268 inline void vtkContourGrid::GenerateValues(int numContours, double rangeStart, double rangeEnd)
269 {
270  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
271 }
272 
273 #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:287
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:332
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:39
virtual vtkMTimeType GetMTime()
Return this object's modified time.
double GetValue(int i)
Get the ith contour value.
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.