VTK  9.3.1
vtkContourGrid.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
44 #ifndef vtkContourGrid_h
45 #define vtkContourGrid_h
46 
47 #include "vtkFiltersCoreModule.h" // For export macro
48 #include "vtkPolyDataAlgorithm.h"
49 
50 #include "vtkContourValues.h" // Needed for inline methods
51 
52 VTK_ABI_NAMESPACE_BEGIN
53 class vtkEdgeTable;
54 class vtkScalarTree;
56 
57 class VTKFILTERSCORE_EXPORT vtkContourGrid : public vtkPolyDataAlgorithm
58 {
59 public:
61  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
67  static vtkContourGrid* New();
68 
70 
73  void SetValue(int i, double value);
74  double GetValue(int i);
75  double* GetValues();
76  void GetValues(double* contourValues);
77  void SetNumberOfContours(int number);
78  vtkIdType GetNumberOfContours();
79  void GenerateValues(int numContours, double range[2]);
80  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
82 
86  vtkMTimeType GetMTime() override;
87 
89 
95  vtkSetMacro(ComputeNormals, vtkTypeBool);
96  vtkGetMacro(ComputeNormals, vtkTypeBool);
97  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
99 
101 
104  vtkSetMacro(ComputeScalars, vtkTypeBool);
105  vtkGetMacro(ComputeScalars, vtkTypeBool);
106  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
108 
110 
113  vtkSetMacro(UseScalarTree, vtkTypeBool);
114  vtkGetMacro(UseScalarTree, vtkTypeBool);
115  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
117 
119 
123  void SetScalarTree(vtkScalarTree* sTree);
124  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
126 
128 
132  void SetLocator(vtkIncrementalPointLocator* locator);
133  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
135 
137 
144  vtkSetMacro(GenerateTriangles, vtkTypeBool);
145  vtkGetMacro(GenerateTriangles, vtkTypeBool);
146  vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
148 
153  void CreateDefaultLocator();
154 
156 
161  void SetOutputPointsPrecision(int precision);
162  int GetOutputPointsPrecision() const;
164 
165 protected:
166  vtkContourGrid();
167  ~vtkContourGrid() override;
168 
170  int FillInputPortInformation(int port, vtkInformation* info) override;
171 
176 
178 
181 
184 
185 private:
186  vtkContourGrid(const vtkContourGrid&) = delete;
187  void operator=(const vtkContourGrid&) = delete;
188 };
189 
194 inline void vtkContourGrid::SetValue(int i, double value)
195 {
196  this->ContourValues->SetValue(i, value);
197 }
198 
202 inline double vtkContourGrid::GetValue(int i)
203 {
204  return this->ContourValues->GetValue(i);
205 }
206 
212 {
213  return this->ContourValues->GetValues();
214 }
215 
221 inline void vtkContourGrid::GetValues(double* contourValues)
222 {
223  this->ContourValues->GetValues(contourValues);
224 }
225 
231 inline void vtkContourGrid::SetNumberOfContours(int number)
232 {
233  this->ContourValues->SetNumberOfContours(number);
234 }
235 
240 {
241  return this->ContourValues->GetNumberOfContours();
242 }
243 
248 inline void vtkContourGrid::GenerateValues(int numContours, double range[2])
249 {
250  this->ContourValues->GenerateValues(numContours, range);
251 }
252 
257 inline void vtkContourGrid::GenerateValues(int numContours, double rangeStart, double rangeEnd)
258 {
259  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
260 }
261 
262 VTK_ABI_NAMESPACE_END
263 #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:270
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
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:315
double GetValue(int i)
Get the ith contour value.
keep track of edges (edge is pair of integer id's)
Definition: vtkEdgeTable.h:29
void SetValue(int i, double value)
Methods to set / get contour values.
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
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:28
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:43
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.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.