VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkBandedPolyDataContourFilter.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00043 #ifndef __vtkBandedPolyDataContourFilter_h 00044 #define __vtkBandedPolyDataContourFilter_h 00045 00046 #include "vtkPolyDataAlgorithm.h" 00047 00048 #include "vtkContourValues.h" // Needed for inline methods 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 // data members 00140 vtkContourValues *ContourValues; 00141 00142 int Clipping; 00143 int ScalarMode; 00144 00145 // sorted and cleaned contour values 00146 double *ClipValues; 00147 int NumberOfClipValues; 00148 int ClipIndex[2]; //indices outside of this range (inclusive) are clipped 00149 double ClipTolerance; //used to clean up numerical problems 00150 00151 //the second output 00152 int GenerateContourEdges; 00153 00154 private: 00155 vtkBandedPolyDataContourFilter(const vtkBandedPolyDataContourFilter&); // Not implemented. 00156 void operator=(const vtkBandedPolyDataContourFilter&); // Not implemented. 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