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 =========================================================================*/
46 #ifndef __vtkBandedPolyDataContourFilter_h
47 #define __vtkBandedPolyDataContourFilter_h
48 
49 #include "vtkPolyDataAlgorithm.h"
50 
51 #include "vtkContourValues.h" // Needed for inline methods
52 
53 class vtkPoints;
54 class vtkCellArray;
55 class vtkPointData;
56 class vtkDataArray;
57 class vtkFloatArray;
58 class vtkDoubleArray;
59 
60 #define VTK_SCALAR_MODE_INDEX 0
61 #define VTK_SCALAR_MODE_VALUE 1
62 
64 {
65 public:
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
71 
73 
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 
92  vtkSetMacro(Clipping,int);
93  vtkGetMacro(Clipping,int);
94  vtkBooleanMacro(Clipping,int);
96 
98 
102  vtkSetClampMacro(ScalarMode,int,VTK_SCALAR_MODE_INDEX,VTK_SCALAR_MODE_VALUE);
103  vtkGetMacro(ScalarMode,int);
105  {this->SetScalarMode(VTK_SCALAR_MODE_INDEX);}
107  {this->SetScalarMode(VTK_SCALAR_MODE_VALUE);}
109 
111 
115  vtkSetMacro(GenerateContourEdges,int);
116  vtkGetMacro(GenerateContourEdges,int);
117  vtkBooleanMacro(GenerateContourEdges,int);
119 
122  vtkPolyData *GetContourEdgesOutput();
123 
126  unsigned long GetMTime();
127 
128 protected:
131 
133 
134  int ComputeScalarIndex(double);
135  int IsContourValue(double val);
136  int ClipEdge(int v1, int v2, vtkPoints *pts, vtkDataArray *inScalars,
137  vtkDoubleArray *outScalars,
138  vtkPointData *inPD, vtkPointData *outPD);
139  int InsertCell(vtkCellArray *cells, int npts, vtkIdType *pts,
140  int cellId, double s, vtkFloatArray *newS);
141 
142  // data members
144 
145  int Clipping;
147 
148  // sorted and cleaned contour values
149  double *ClipValues;
151  int ClipIndex[2]; //indices outside of this range (inclusive) are clipped
152  double ClipTolerance; //used to clean up numerical problems
153 
154  //the second output
156 
157 private:
159  void operator=(const vtkBandedPolyDataContourFilter&); // Not implemented.
160 };
161 
163 
166  {this->ContourValues->SetValue(i,value);}
168 
170 
172  {return this->ContourValues->GetValue(i);}
174 
176 
179  {return this->ContourValues->GetValues();}
181 
183 
186 inline void vtkBandedPolyDataContourFilter::GetValues(double *contourValues)
187  {this->ContourValues->GetValues(contourValues);}
189 
191 
195  {this->ContourValues->SetNumberOfContours(number);}
197 
199 
201  {return this->ContourValues->GetNumberOfContours();}
203 
205 
208  double range[2])
209  {this->ContourValues->GenerateValues(numContours, range);}
211 
213 
216  double rangeStart,
217  double rangeEnd)
218  {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
220 
221 
222 #endif