Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkDataSetSurfaceFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDataSetSurfaceFilter.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 __vtkDataSetSurfaceFilter_h
00044 #define __vtkDataSetSurfaceFilter_h
00045 
00046 #include "vtkDataSetToPolyDataFilter.h"
00047 
00048 
00049 class vtkPointData;
00050 class vtkPoints;
00051 //BTX
00052 // Helper structure for hashing faces.
00053 struct vtkFastGeomQuadStruct
00054 {
00055   vtkIdType p0;
00056   vtkIdType p1;
00057   vtkIdType p2;
00058   vtkIdType p3;
00059   vtkIdType SourceId;
00060   struct vtkFastGeomQuadStruct *Next;
00061 };
00062 typedef struct vtkFastGeomQuadStruct vtkFastGeomQuad;
00063 //ETX
00064 
00065 class VTK_GRAPHICS_EXPORT vtkDataSetSurfaceFilter : public vtkDataSetToPolyDataFilter
00066 {
00067 public:
00068   static vtkDataSetSurfaceFilter *New();
00069   vtkTypeRevisionMacro(vtkDataSetSurfaceFilter,vtkDataSetToPolyDataFilter);
00070   void PrintSelf(ostream& os, vtkIndent indent);
00071 
00073 
00076   vtkSetMacro(UseStrips, int);
00077   vtkGetMacro(UseStrips, int);
00078   vtkBooleanMacro(UseStrips, int);
00080 
00081 protected:
00082   vtkDataSetSurfaceFilter();
00083   ~vtkDataSetSurfaceFilter();
00084 
00085   int UseStrips;
00086   
00087   void ComputeInputUpdateExtents(vtkDataObject *output);
00088 
00089   void Execute();
00090   void StructuredExecute(vtkDataSet *input, int *ext);
00091   void UnstructuredGridExecute();
00092   void DataSetExecute();
00093   void ExecuteInformation();
00094 
00095   // Helper methods.
00096   void ExecuteFaceStrips(vtkDataSet *input, int maxFlag, int *ext,
00097                          int aAxis, int bAxis, int cAxis);
00098   void ExecuteFaceQuads(vtkDataSet *input, int maxFlag, int *ext,
00099                         int aAxis, int bAxis, int cAxis);
00100 
00101   void InitializeQuadHash(vtkIdType numPoints);
00102   void DeleteQuadHash();
00103   void InsertQuadInHash(vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d,
00104                         vtkIdType sourceId);
00105   void InsertTriInHash(vtkIdType a, vtkIdType b, vtkIdType c,
00106                        vtkIdType sourceId);
00107   void InitQuadHashTraversal();
00108   vtkFastGeomQuad *GetNextVisibleQuadFromHash();
00109 
00110   vtkFastGeomQuad **QuadHash;
00111   vtkIdType QuadHashLength;
00112   vtkFastGeomQuad *QuadHashTraversal;
00113   vtkIdType QuadHashTraversalIndex;
00114 
00115   vtkIdType *PointMap;
00116   vtkIdType GetOutputPointId(vtkIdType inPtId, vtkDataSet *input, 
00117                              vtkPoints *outPts, vtkPointData *outPD);
00118   
00119   vtkIdType NumberOfNewCells;
00120   
00121   // Better memory allocation for faces (hash)
00122   void InitFastGeomQuadAllocation(int numberOfCells);
00123   vtkFastGeomQuad* NewFastGeomQuad();
00124   void DeleteAllFastGeomQuads();
00125   // -----
00126   int FastGeomQuadArrayLength;
00127   int NumberOfFastGeomQuadArrays;
00128   vtkFastGeomQuad** FastGeomQuadArrays;
00129   // These indexes allow us to find the next available face.
00130   int NextArrayIndex;
00131   int NextQuadIndex;
00132 
00133 private:
00134   vtkDataSetSurfaceFilter(const vtkDataSetSurfaceFilter&);  // Not implemented.
00135   void operator=(const vtkDataSetSurfaceFilter&);  // Not implemented.
00136 };
00137 
00138 #endif
00139 
00140