VTK  9.2.6
vtkBandedPolyDataContourFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBandedPolyDataContourFilter.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 =========================================================================*/
44 #ifndef vtkBandedPolyDataContourFilter_h
45 #define vtkBandedPolyDataContourFilter_h
46 
47 #include "vtkFiltersModelingModule.h" // For export macro
48 #include "vtkPolyDataAlgorithm.h"
49 
50 #include "vtkContourValues.h" // Needed for inline methods
51 
52 class vtkPoints;
53 class vtkCellArray;
54 class vtkPointData;
55 class vtkDataArray;
56 class vtkFloatArray;
57 class vtkDoubleArray;
58 struct vtkBandedPolyDataContourFilterInternals;
59 
60 #define VTK_SCALAR_MODE_INDEX 0
61 #define VTK_SCALAR_MODE_VALUE 1
62 
63 class VTKFILTERSMODELING_EXPORT vtkBandedPolyDataContourFilter : public vtkPolyDataAlgorithm
64 {
65 public:
67  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
73 
75 
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 
92 
98  vtkSetMacro(Clipping, vtkTypeBool);
99  vtkGetMacro(Clipping, vtkTypeBool);
100  vtkBooleanMacro(Clipping, vtkTypeBool);
102 
104 
110  vtkSetClampMacro(ScalarMode, int, VTK_SCALAR_MODE_INDEX, VTK_SCALAR_MODE_VALUE);
111  vtkGetMacro(ScalarMode, int);
112  void SetScalarModeToIndex() { this->SetScalarMode(VTK_SCALAR_MODE_INDEX); }
113  void SetScalarModeToValue() { this->SetScalarMode(VTK_SCALAR_MODE_VALUE); }
115 
117 
123  vtkSetMacro(GenerateContourEdges, vtkTypeBool);
124  vtkGetMacro(GenerateContourEdges, vtkTypeBool);
125  vtkBooleanMacro(GenerateContourEdges, vtkTypeBool);
127 
129 
135  vtkSetMacro(ClipTolerance, double);
136  vtkGetMacro(ClipTolerance, double);
138 
140 
144  vtkSetMacro(Component, int);
145  vtkGetMacro(Component, int);
147 
152  vtkPolyData* GetContourEdgesOutput();
153 
158  vtkMTimeType GetMTime() override;
159 
160 protected:
162  ~vtkBandedPolyDataContourFilter() override;
163 
165 
166  int ClipEdge(int v1, int v2, vtkPoints* pts, vtkDataArray* inScalars, vtkDoubleArray* outScalars,
167  vtkPointData* inPD, vtkPointData* outPD, vtkIdType edgePts[]);
168  int InsertCell(
169  vtkCellArray* cells, int npts, const vtkIdType* pts, int cellId, double s, vtkFloatArray* newS);
170  int InsertLine(
171  vtkCellArray* cells, vtkIdType pt1, vtkIdType pt2, int cellId, double s, vtkFloatArray* newS);
172  int ComputeClippedIndex(double s);
173  int InsertNextScalar(vtkFloatArray* scalars, int cellId, int idx);
174  // data members
176 
180  double ClipTolerance; // specify numerical accuracy during clipping
181  // the second output
183 
184  vtkBandedPolyDataContourFilterInternals* Internal;
185 
186 private:
188  void operator=(const vtkBandedPolyDataContourFilter&) = delete;
189 };
190 
196 {
197  this->ContourValues->SetValue(i, value);
198 }
199 
204 {
205  return this->ContourValues->GetValue(i);
206 }
207 
213 {
214  return this->ContourValues->GetValues();
215 }
216 
222 inline void vtkBandedPolyDataContourFilter::GetValues(double* contourValues)
223 {
224  this->ContourValues->GetValues(contourValues);
225 }
226 
233 {
234  this->ContourValues->SetNumberOfContours(number);
235 }
236 
241 {
242  return this->ContourValues->GetNumberOfContours();
243 }
244 
249 inline void vtkBandedPolyDataContourFilter::GenerateValues(int numContours, double range[2])
250 {
251  this->ContourValues->GenerateValues(numContours, range);
252 }
253 
259  int numContours, double rangeStart, double rangeEnd)
260 {
261  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
262 }
263 
264 #endif
helper object to manage setting and generating contour values
represent and manipulate point attribute data
Definition: vtkPointData.h:41
generate filled contours for vtkPolyData
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.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:41
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
int vtkIdType
Definition: vtkType.h:332
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
double GetValue(int i)
Get the ith contour value.
double GetValue(int i)
Get the ith contour value.
void SetValue(int i, double value)
Methods to set / get contour values.
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SCALAR_MODE_VALUE
double * GetValues()
Return a pointer to a list of contour values.
Superclass for algorithms that produce only polydata as output.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
virtual vtkMTimeType GetMTime()
Return this object's modified time.
double * GetValues()
Get a pointer to an array of contour values.
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
vtkBandedPolyDataContourFilterInternals * Internal
#define VTK_SCALAR_MODE_INDEX
void SetScalarModeToValue()
Control whether the cell scalars are output as an integer index or a scalar value.
void SetScalarModeToIndex()
Control whether the cell scalars are output as an integer index or a scalar value.
object to represent cell connectivity
Definition: vtkCellArray.h:186
Store zero or more vtkInformation instances.
int GetNumberOfContours()
Return the number of contours in the.
void SetValue(int i, double value)
Set the ith contour value.
represent and manipulate 3D points
Definition: vtkPoints.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.