00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00043 #ifndef __vtkBandedPolyDataContourFilter_h
00044 #define __vtkBandedPolyDataContourFilter_h
00045
00046 #include "vtkPolyDataAlgorithm.h"
00047
00048 #include "vtkContourValues.h"
00049
00050 class vtkPoints;
00051 class vtkCellArray;
00052 class vtkPointData;
00053 class vtkDataArray;
00054 class vtkFloatArray;
00055 class vtkDoubleArray;
00056
00057 #define VTK_SCALAR_MODE_INDEX 0
00058 #define VTK_SCALAR_MODE_VALUE 1
00059
00060 class VTK_GRAPHICS_EXPORT vtkBandedPolyDataContourFilter : public vtkPolyDataAlgorithm
00061 {
00062 public:
00063 vtkTypeRevisionMacro(vtkBandedPolyDataContourFilter,vtkPolyDataAlgorithm);
00064 void PrintSelf(ostream& os, vtkIndent indent);
00065
00067 static vtkBandedPolyDataContourFilter *New();
00068
00070
00074 void SetValue(int i, double value);
00075 double GetValue(int i);
00076 double *GetValues();
00077 void GetValues(double *contourValues);
00078 void SetNumberOfContours(int number);
00079 int GetNumberOfContours();
00080 void GenerateValues(int numContours, double range[2]);
00081 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
00083
00085
00089 vtkSetMacro(Clipping,int);
00090 vtkGetMacro(Clipping,int);
00091 vtkBooleanMacro(Clipping,int);
00093
00095
00099 vtkSetClampMacro(ScalarMode,int,VTK_SCALAR_MODE_INDEX,VTK_SCALAR_MODE_VALUE);
00100 vtkGetMacro(ScalarMode,int);
00101 void SetScalarModeToIndex()
00102 {this->SetScalarMode(VTK_SCALAR_MODE_INDEX);}
00103 void SetScalarModeToValue()
00104 {this->SetScalarMode(VTK_SCALAR_MODE_VALUE);}
00106
00108
00112 vtkSetMacro(GenerateContourEdges,int);
00113 vtkGetMacro(GenerateContourEdges,int);
00114 vtkBooleanMacro(GenerateContourEdges,int);
00116
00119 vtkPolyData *GetContourEdgesOutput();
00120
00123 unsigned long GetMTime();
00124
00125 protected:
00126 vtkBandedPolyDataContourFilter();
00127 ~vtkBandedPolyDataContourFilter();
00128
00129 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00130
00131 int ComputeScalarIndex(double);
00132 int IsContourValue(double val);
00133 int ClipEdge(int v1, int v2, vtkPoints *pts, vtkDataArray *inScalars,
00134 vtkDoubleArray *outScalars,
00135 vtkPointData *inPD, vtkPointData *outPD);
00136 int InsertCell(vtkCellArray *cells, int npts, vtkIdType *pts,
00137 int cellId, double s, vtkFloatArray *newS);
00138
00139
00140 vtkContourValues *ContourValues;
00141
00142 int Clipping;
00143 int ScalarMode;
00144
00145
00146 double *ClipValues;
00147 int NumberOfClipValues;
00148 int ClipIndex[2];
00149 double ClipTolerance;
00150
00151
00152 int GenerateContourEdges;
00153
00154 private:
00155 vtkBandedPolyDataContourFilter(const vtkBandedPolyDataContourFilter&);
00156 void operator=(const vtkBandedPolyDataContourFilter&);
00157 };
00158
00160
00162 inline void vtkBandedPolyDataContourFilter::SetValue(int i, double value)
00163 {this->ContourValues->SetValue(i,value);}
00165
00167
00168 inline double vtkBandedPolyDataContourFilter::GetValue(int i)
00169 {return this->ContourValues->GetValue(i);}
00171
00173
00175 inline double *vtkBandedPolyDataContourFilter::GetValues()
00176 {return this->ContourValues->GetValues();}
00178
00180
00183 inline void vtkBandedPolyDataContourFilter::GetValues(double *contourValues)
00184 {this->ContourValues->GetValues(contourValues);}
00186
00188
00191 inline void vtkBandedPolyDataContourFilter::SetNumberOfContours(int number)
00192 {this->ContourValues->SetNumberOfContours(number);}
00194
00196
00197 inline int vtkBandedPolyDataContourFilter::GetNumberOfContours()
00198 {return this->ContourValues->GetNumberOfContours();}
00200
00202
00204 inline void vtkBandedPolyDataContourFilter::GenerateValues(int numContours,
00205 double range[2])
00206 {this->ContourValues->GenerateValues(numContours, range);}
00208
00210
00212 inline void vtkBandedPolyDataContourFilter::GenerateValues(int numContours,
00213 double rangeStart,
00214 double rangeEnd)
00215 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00217
00218
00219 #endif