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=========================================================================*/
53#ifndef vtkBandedPolyDataContourFilter_h
54#define vtkBandedPolyDataContourFilter_h
55
56#include "vtkFiltersModelingModule.h" // For export macro
58
59#include "vtkContourValues.h" // Needed for inline methods
60
61class vtkPoints;
62class vtkCellArray;
63class vtkPointData;
64class vtkDataArray;
65class vtkFloatArray;
66class vtkDoubleArray;
67struct vtkBandedPolyDataContourFilterInternals;
68
69#define VTK_SCALAR_MODE_INDEX 0
70#define VTK_SCALAR_MODE_VALUE 1
71
72class VTKFILTERSMODELING_EXPORT vtkBandedPolyDataContourFilter : public vtkPolyDataAlgorithm
73{
74public:
76 void PrintSelf(ostream& os, vtkIndent indent) override;
77
82
84
90 void SetValue(int i, double value);
91 double GetValue(int i);
92 double* GetValues();
93 void GetValues(double* contourValues);
94 void SetNumberOfContours(int number);
95 vtkIdType GetNumberOfContours();
96 void GenerateValues(int numContours, double range[2]);
97 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
99
101
107 vtkSetMacro(Clipping, vtkTypeBool);
108 vtkGetMacro(Clipping, vtkTypeBool);
109 vtkBooleanMacro(Clipping, vtkTypeBool);
111
113
119 vtkSetClampMacro(ScalarMode, int, VTK_SCALAR_MODE_INDEX, VTK_SCALAR_MODE_VALUE);
120 vtkGetMacro(ScalarMode, int);
121 void SetScalarModeToIndex() { this->SetScalarMode(VTK_SCALAR_MODE_INDEX); }
122 void SetScalarModeToValue() { this->SetScalarMode(VTK_SCALAR_MODE_VALUE); }
124
126
132 vtkSetMacro(GenerateContourEdges, vtkTypeBool);
133 vtkGetMacro(GenerateContourEdges, vtkTypeBool);
134 vtkBooleanMacro(GenerateContourEdges, vtkTypeBool);
136
138
144 vtkSetMacro(ClipTolerance, double);
145 vtkGetMacro(ClipTolerance, double);
147
149
153 vtkSetMacro(Component, int);
154 vtkGetMacro(Component, int);
156
162
168
169protected:
172
174
175 int ClipEdge(int v1, int v2, vtkPoints* pts, vtkDataArray* inScalars, vtkDoubleArray* outScalars,
176 vtkPointData* inPD, vtkPointData* outPD, vtkIdType edgePts[]);
178 vtkCellArray* cells, int npts, const vtkIdType* pts, int cellId, double s, vtkFloatArray* newS);
180 vtkCellArray* cells, vtkIdType pt1, vtkIdType pt2, int cellId, double s, vtkFloatArray* newS);
181 int ComputeClippedIndex(double s);
182 int InsertNextScalar(vtkFloatArray* scalars, int cellId, int idx);
183 // data members
185
189 double ClipTolerance; // specify numerical accuracy during clipping
190 // the second output
192
193 vtkBandedPolyDataContourFilterInternals* Internal;
194
195private:
197 void operator=(const vtkBandedPolyDataContourFilter&) = delete;
198};
199
204inline void vtkBandedPolyDataContourFilter::SetValue(int i, double value)
205{
206 this->ContourValues->SetValue(i, value);
207}
208
213{
214 return this->ContourValues->GetValue(i);
215}
216
222{
223 return this->ContourValues->GetValues();
224}
225
231inline void vtkBandedPolyDataContourFilter::GetValues(double* contourValues)
232{
233 this->ContourValues->GetValues(contourValues);
234}
235
242{
243 this->ContourValues->SetNumberOfContours(number);
244}
245
250{
251 return this->ContourValues->GetNumberOfContours();
252}
253
258inline void vtkBandedPolyDataContourFilter::GenerateValues(int numContours, double range[2])
259{
260 this->ContourValues->GenerateValues(numContours, range);
261}
262
268 int numContours, double rangeStart, double rangeEnd)
269{
270 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
271}
272
273#endif
generate filled contours for vtkPolyData
vtkMTimeType GetMTime() override
Overload GetMTime because we delegate to vtkContourValues so its modified time must be taken into acc...
double * GetValues()
Get a pointer to an array of contour values.
double GetValue(int i)
Get the ith contour value.
int InsertLine(vtkCellArray *cells, vtkIdType pt1, vtkIdType pt2, int cellId, double s, vtkFloatArray *newS)
int InsertCell(vtkCellArray *cells, int npts, const vtkIdType *pts, int cellId, double s, vtkFloatArray *newS)
void SetScalarModeToIndex()
Control whether the cell scalars are output as an integer index or a scalar value.
~vtkBandedPolyDataContourFilter() override
vtkPolyData * GetContourEdgesOutput()
Get the second output which contains the edges dividing the contour bands.
static vtkBandedPolyDataContourFilter * New()
Construct object with no contours defined.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetScalarModeToValue()
Control whether the cell scalars are output as an integer index or a scalar value.
int InsertNextScalar(vtkFloatArray *scalars, int cellId, int idx)
int ClipEdge(int v1, int v2, vtkPoints *pts, vtkDataArray *inScalars, vtkDoubleArray *outScalars, vtkPointData *inPD, vtkPointData *outPD, vtkIdType edgePts[])
void SetValue(int i, double value)
Methods to set / get contour values.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkBandedPolyDataContourFilterInternals * Internal
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
object to represent cell connectivity
helper object to manage setting and generating contour values
double * GetValues()
Return a pointer to a list of contour values.
int GetNumberOfContours()
Return the number of contours in the.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
void SetValue(int i, double value)
Set the ith contour value.
double GetValue(int i)
Get the ith contour value.
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of double
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
represent and manipulate 3D points
Definition vtkPoints.h:49
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_SCALAR_MODE_VALUE
#define VTK_SCALAR_MODE_INDEX
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287