VTK
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 =========================================================================*/
41 #ifndef vtkBandedPolyDataContourFilter_h
42 #define vtkBandedPolyDataContourFilter_h
43 
44 #include "vtkFiltersModelingModule.h" // For export macro
45 #include "vtkPolyDataAlgorithm.h"
46 
47 #include "vtkContourValues.h" // Needed for inline methods
48 
49 class vtkPoints;
50 class vtkCellArray;
51 class vtkPointData;
52 class vtkDataArray;
53 class vtkFloatArray;
54 class vtkDoubleArray;
55 
56 #define VTK_SCALAR_MODE_INDEX 0
57 #define VTK_SCALAR_MODE_VALUE 1
58 
59 class VTKFILTERSMODELING_EXPORT vtkBandedPolyDataContourFilter : public vtkPolyDataAlgorithm
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
69 
71 
77  void SetValue(int i, double value);
78  double GetValue(int i);
79  double *GetValues();
80  void GetValues(double *contourValues);
81  void SetNumberOfContours(int number);
82  int GetNumberOfContours();
83  void GenerateValues(int numContours, double range[2]);
84  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
86 
88 
94  vtkSetMacro(Clipping,vtkTypeBool);
95  vtkGetMacro(Clipping,vtkTypeBool);
96  vtkBooleanMacro(Clipping,vtkTypeBool);
98 
100 
106  vtkSetClampMacro(ScalarMode,int,VTK_SCALAR_MODE_INDEX,VTK_SCALAR_MODE_VALUE);
107  vtkGetMacro(ScalarMode,int);
109  {this->SetScalarMode(VTK_SCALAR_MODE_INDEX);}
111  {this->SetScalarMode(VTK_SCALAR_MODE_VALUE);}
113 
115 
121  vtkSetMacro(GenerateContourEdges,vtkTypeBool);
122  vtkGetMacro(GenerateContourEdges,vtkTypeBool);
123  vtkBooleanMacro(GenerateContourEdges,vtkTypeBool);
125 
127 
133  vtkSetMacro(ClipTolerance,double);
134  vtkGetMacro(ClipTolerance,double);
136 
138 
142  vtkSetMacro(Component,int);
143  vtkGetMacro(Component,int);
145 
150  vtkPolyData *GetContourEdgesOutput();
151 
156  vtkMTimeType GetMTime() override;
157 
158 protected:
160  ~vtkBandedPolyDataContourFilter() override;
161 
163 
164  int ComputeScalarIndex(double);
165  int IsContourValue(double val);
166  int ClipEdge(int v1, int v2, vtkPoints *pts, vtkDataArray *inScalars,
167  vtkDoubleArray *outScalars,
168  vtkPointData *inPD, vtkPointData *outPD, vtkIdType edgePts[]);
169  int InsertCell(vtkCellArray *cells, int npts, vtkIdType *pts,
170  int cellId, double s, vtkFloatArray *newS);
171  int InsertLine(vtkCellArray *cells, vtkIdType pt1, vtkIdType pt2,
172  int cellId, double s, vtkFloatArray *newS);
173  int ComputeClippedIndex(double s);
174  int InsertNextScalar(vtkFloatArray* scalars, int cellId, int idx);
175  // data members
177 
181 
182  // sorted and cleaned contour values
183  double *ClipValues;
185  int ClipIndex[2]; //indices outside of this range (inclusive) are clipped
186  double ClipTolerance; //specify numerical accuracy during clipping
187  double InternalClipTolerance; //used to clean up numerical problems
188 
189  //the second output
191 
192 private:
194  void operator=(const vtkBandedPolyDataContourFilter&) = delete;
195 };
196 
202  {this->ContourValues->SetValue(i,value);}
203 
208  {return this->ContourValues->GetValue(i);}
209 
215  {return this->ContourValues->GetValues();}
216 
222 inline void vtkBandedPolyDataContourFilter::GetValues(double *contourValues)
223  {this->ContourValues->GetValues(contourValues);}
224 
231  {this->ContourValues->SetNumberOfContours(number);}
232 
237  {return this->ContourValues->GetNumberOfContours();}
238 
244  double range[2])
245  {this->ContourValues->GenerateValues(numContours, range);}
246 
252  double rangeStart,
253  double rangeEnd)
254  {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
255 
256 
257 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkBandedPolyDataContourFilter::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkBandedPolyDataContourFilter.h:214
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkBandedPolyDataContourFilter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkBandedPolyDataContourFilter.h:243
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkX3D::value
Definition: vtkX3D.h:220
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkBandedPolyDataContourFilter::SetScalarModeToIndex
void SetScalarModeToIndex()
Definition: vtkBandedPolyDataContourFilter.h:108
VTK_SCALAR_MODE_INDEX
#define VTK_SCALAR_MODE_INDEX
Definition: vtkBandedPolyDataContourFilter.h:56
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkX3D::range
Definition: vtkX3D.h:238
vtkBandedPolyDataContourFilter::NumberOfClipValues
int NumberOfClipValues
Definition: vtkBandedPolyDataContourFilter.h:184
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
vtkBandedPolyDataContourFilter::ScalarMode
int ScalarMode
Definition: vtkBandedPolyDataContourFilter.h:179
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBandedPolyDataContourFilter::GenerateContourEdges
vtkTypeBool GenerateContourEdges
Definition: vtkBandedPolyDataContourFilter.h:190
vtkBandedPolyDataContourFilter::GetNumberOfContours
int GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkBandedPolyDataContourFilter.h:236
vtkBandedPolyDataContourFilter::ClipValues
double * ClipValues
Definition: vtkBandedPolyDataContourFilter.h:183
vtkPolyDataAlgorithm.h
vtkBandedPolyDataContourFilter::SetScalarModeToValue
void SetScalarModeToValue()
Definition: vtkBandedPolyDataContourFilter.h:110
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkBandedPolyDataContourFilter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkBandedPolyDataContourFilter.h:207
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:35
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:44
vtkBandedPolyDataContourFilter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkBandedPolyDataContourFilter.h:230
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkContourValues::GetValue
double GetValue(int i)
Get the ith contour value.
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkBandedPolyDataContourFilter::ClipTolerance
double ClipTolerance
Definition: vtkBandedPolyDataContourFilter.h:186
vtkContourValues.h
vtkBandedPolyDataContourFilter::ContourValues
vtkContourValues * ContourValues
Definition: vtkBandedPolyDataContourFilter.h:176
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkBandedPolyDataContourFilter::InternalClipTolerance
double InternalClipTolerance
Definition: vtkBandedPolyDataContourFilter.h:187
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkBandedPolyDataContourFilter::SetValue
void SetValue(int i, double value)
Methods to set / get contour values.
Definition: vtkBandedPolyDataContourFilter.h:201
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkBandedPolyDataContourFilter::Component
int Component
Definition: vtkBandedPolyDataContourFilter.h:180
vtkBandedPolyDataContourFilter
generate filled contours for vtkPolyData
Definition: vtkBandedPolyDataContourFilter.h:59
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
VTK_SCALAR_MODE_VALUE
#define VTK_SCALAR_MODE_VALUE
Definition: vtkBandedPolyDataContourFilter.h:57
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkBandedPolyDataContourFilter::Clipping
vtkTypeBool Clipping
Definition: vtkBandedPolyDataContourFilter.h:178
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41