VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
50 
51 #include "vtkContourValues.h" // Needed for inline methods
52 
53 VTK_ABI_NAMESPACE_BEGIN
54 class vtkEdgeTable;
55 class vtkScalarTree;
57 
58 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkContourGrid : public vtkPolyDataAlgorithm
59 {
60 public:
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
68  static vtkContourGrid* New();
69 
71 
74  void SetValue(int i, double value);
75  double GetValue(int i);
76  double* GetValues();
77  void GetValues(double* contourValues);
78  void SetNumberOfContours(int number);
79  vtkIdType GetNumberOfContours();
80  void GenerateValues(int numContours, double range[2]);
81  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
83 
87  vtkMTimeType GetMTime() override;
88 
90 
96  vtkSetMacro(ComputeNormals, vtkTypeBool);
97  vtkGetMacro(ComputeNormals, vtkTypeBool);
98  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
100 
102 
105  vtkSetMacro(ComputeScalars, vtkTypeBool);
106  vtkGetMacro(ComputeScalars, vtkTypeBool);
107  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
109 
111 
114  vtkSetMacro(UseScalarTree, vtkTypeBool);
115  vtkGetMacro(UseScalarTree, vtkTypeBool);
116  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
118 
120 
124  void SetScalarTree(vtkScalarTree* sTree);
125  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
127 
129 
133  void SetLocator(vtkIncrementalPointLocator* locator);
134  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
136 
138 
145  vtkSetMacro(GenerateTriangles, vtkTypeBool);
146  vtkGetMacro(GenerateTriangles, vtkTypeBool);
147  vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
149 
154  void CreateDefaultLocator();
155 
157 
162  void SetOutputPointsPrecision(int precision);
163  int GetOutputPointsPrecision() const;
165 
166 protected:
167  vtkContourGrid();
168  ~vtkContourGrid() override;
169 
171  int FillInputPortInformation(int port, vtkInformation* info) override;
172 
177 
179 
182 
185 
186 private:
187  vtkContourGrid(const vtkContourGrid&) = delete;
188  void operator=(const vtkContourGrid&) = delete;
189 };
190 
195 inline void vtkContourGrid::SetValue(int i, double value)
196 {
197  this->ContourValues->SetValue(i, value);
198 }
199 
203 inline double vtkContourGrid::GetValue(int i)
204 {
205  return this->ContourValues->GetValue(i);
206 }
207 
213 {
214  return this->ContourValues->GetValues();
215 }
216 
222 inline void vtkContourGrid::GetValues(double* contourValues)
223 {
224  this->ContourValues->GetValues(contourValues);
225 }
226 
232 inline void vtkContourGrid::SetNumberOfContours(int number)
233 {
234  this->ContourValues->SetNumberOfContours(number);
235 }
236 
241 {
242  return this->ContourValues->GetNumberOfContours();
243 }
244 
249 inline void vtkContourGrid::GenerateValues(int numContours, double range[2])
250 {
251  this->ContourValues->GenerateValues(numContours, range);
252 }
253 
258 inline void vtkContourGrid::GenerateValues(int numContours, double rangeStart, double rangeEnd)
259 {
260  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
261 }
262 
263 VTK_ABI_NAMESPACE_END
264 #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:318
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:363
double GetValue(int i)
Get the ith contour value.
keep track of edges (edge is pair of integer id's)
Definition: vtkEdgeTable.h:30
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.
#define VTK_MARSHALAUTO
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.