00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __vtkTessellatorFilter_h
00016 #define __vtkTessellatorFilter_h
00017
00061 #include "vtkUnstructuredGridAlgorithm.h"
00062
00063 class vtkDataArray;
00064 class vtkDataSet;
00065 class vtkDataSetEdgeSubdivisionCriterion;
00066 class vtkPointLocator;
00067 class vtkPoints;
00068 class vtkStreamingTessellator;
00069 class vtkEdgeSubdivisionCriterion;
00070 class vtkUnstructuredGrid;
00071
00072 class VTK_GRAPHICS_EXPORT vtkTessellatorFilter : public vtkUnstructuredGridAlgorithm
00073 {
00074 public:
00075 vtkTypeMacro(vtkTessellatorFilter,vtkUnstructuredGridAlgorithm);
00076 void PrintSelf( ostream& os, vtkIndent indent );
00077
00078 static vtkTessellatorFilter* New();
00079
00080 virtual void SetTessellator( vtkStreamingTessellator* );
00081 vtkGetObjectMacro(Tessellator, vtkStreamingTessellator);
00082
00083 virtual void SetSubdivider( vtkDataSetEdgeSubdivisionCriterion* );
00084 vtkGetObjectMacro(Subdivider, vtkDataSetEdgeSubdivisionCriterion);
00085
00086 virtual unsigned long GetMTime();
00087
00089
00094 vtkSetClampMacro(OutputDimension,int,1,3);
00095 vtkGetMacro(OutputDimension,int);
00096
00097 int GetOutputDimension() const;
00098
00100
00102
00105 virtual void SetMaximumNumberOfSubdivisions( int num_subdiv_in );
00106 int GetMaximumNumberOfSubdivisions();
00107 virtual void SetChordError( double ce );
00108 double GetChordError();
00110
00112
00113 virtual void ResetFieldCriteria();
00114 virtual void SetFieldCriterion( int field, double chord );
00116
00118
00122 vtkGetMacro(MergePoints,int);
00123 vtkSetMacro(MergePoints,int);
00124 vtkBooleanMacro(MergePoints,int);
00126
00127 protected:
00128 vtkTessellatorFilter();
00129 ~vtkTessellatorFilter();
00130
00131 virtual int FillInputPortInformation(int port, vtkInformation* info);
00132
00136 void SetupOutput( vtkDataSet* input, vtkUnstructuredGrid* output );
00137
00139 void MergeOutputPoints( vtkUnstructuredGrid* input, vtkUnstructuredGrid* output );
00140
00143 void Teardown();
00144
00146
00147 virtual int RequestData(vtkInformation* request,
00148 vtkInformationVector** inputVector,
00149 vtkInformationVector* outputVector);
00151
00152
00153 vtkStreamingTessellator* Tessellator;
00154 vtkDataSetEdgeSubdivisionCriterion* Subdivider;
00155 int OutputDimension;
00156 int MergePoints;
00157 vtkPointLocator* Locator;
00158
00160
00162 vtkUnstructuredGrid* OutputMesh;
00163 vtkPoints* OutputPoints;
00164 vtkDataArray** OutputAttributes;
00165 int* OutputAttributeIndices;
00167
00168 static void AddAPoint( const double*,
00169 vtkEdgeSubdivisionCriterion*,
00170 void*,
00171 const void* );
00172 static void AddALine( const double*,
00173 const double*,
00174 vtkEdgeSubdivisionCriterion*,
00175 void*,
00176 const void* );
00177 static void AddATriangle( const double*,
00178 const double*,
00179 const double*,
00180 vtkEdgeSubdivisionCriterion*,
00181 void*,
00182 const void* );
00183 static void AddATetrahedron( const double*,
00184 const double*,
00185 const double*,
00186 const double*,
00187 vtkEdgeSubdivisionCriterion*,
00188 void*,
00189 const void* );
00190 void OutputPoint( const double* );
00191 void OutputLine( const double*, const double* );
00192 void OutputTriangle( const double*, const double*, const double* );
00193 void OutputTetrahedron( const double*,
00194 const double*,
00195 const double*,
00196 const double* );
00197
00198
00199 private:
00200 vtkTessellatorFilter( const vtkTessellatorFilter& );
00201 void operator = ( const vtkTessellatorFilter& );
00202 };
00203
00204
00205 inline int vtkTessellatorFilter::GetOutputDimension() const
00206 {
00207 return this->OutputDimension;
00208 }
00209
00210
00211 #endif // __vtkTessellatorFilter_h