VTK
dox/Filtering/vtkConvexPointSet.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkConvexPointSet.h
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 =========================================================================*/
00032 #ifndef __vtkConvexPointSet_h
00033 #define __vtkConvexPointSet_h
00034 
00035 #include "vtkCell3D.h"
00036 
00037 class vtkUnstructuredGrid;
00038 class vtkCellArray;
00039 class vtkTriangle;
00040 class vtkTetra;
00041 class vtkDoubleArray;
00042 
00043 class VTK_FILTERING_EXPORT vtkConvexPointSet : public vtkCell3D
00044 {
00045 public:
00046   static vtkConvexPointSet *New();
00047   vtkTypeMacro(vtkConvexPointSet,vtkCell3D);
00048   void PrintSelf(ostream& os, vtkIndent indent);
00049 
00051   virtual int HasFixedTopology() {return 0;}
00052 
00054 
00055   virtual void GetEdgePoints(int vtkNotUsed(edgeId), int* &vtkNotUsed(pts)) {}
00056   virtual void GetFacePoints(int vtkNotUsed(faceId), int* &vtkNotUsed(pts)) {}
00057   virtual double *GetParametricCoords();
00059 
00061   virtual int GetCellType() {return VTK_CONVEX_POINT_SET;}
00062 
00064 
00065   virtual int RequiresInitialization() {return 1;}
00066   virtual void Initialize();
00068 
00070 
00079   virtual int GetNumberOfEdges() {return 0;}
00080   virtual vtkCell *GetEdge(int) {return NULL;}
00081   virtual int GetNumberOfFaces();
00082   virtual vtkCell *GetFace(int faceId);
00084 
00086 
00088   virtual void Contour(double value, vtkDataArray *cellScalars,
00089                        vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00090                        vtkCellArray *lines, vtkCellArray *polys,
00091                        vtkPointData *inPd, vtkPointData *outPd,
00092                        vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00094 
00096 
00099   virtual void Clip(double value, vtkDataArray *cellScalars,
00100                     vtkIncrementalPointLocator *locator, vtkCellArray *connectivity,
00101                     vtkPointData *inPd, vtkPointData *outPd,
00102                     vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00103                     int insideOut);
00105 
00107 
00110   virtual int EvaluatePosition(double x[3], double* closestPoint,
00111                                int& subId, double pcoords[3],
00112                                double& dist2, double *weights);
00114 
00116 
00117   virtual void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00118                                 double *weights);
00120 
00122 
00124   virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00125                                 double x[3], double pcoords[3], int& subId);
00127 
00129   virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00130 
00132 
00134   virtual void Derivatives(int subId, double pcoords[3], double *values,
00135                            int dim, double *derivs);
00137 
00141   virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00142 
00144   virtual int GetParametricCenter(double pcoords[3]);
00145 
00148   int IsPrimaryCell() {return 0;}
00149 
00151 
00153   virtual void InterpolateFunctions(double pcoords[3], double *sf);
00154   virtual void InterpolateDerivs(double pcoords[3], double *derivs);
00156 
00157 protected:
00158   vtkConvexPointSet();
00159   ~vtkConvexPointSet();
00160 
00161   vtkTetra       *Tetra;
00162   vtkIdList      *TetraIds;
00163   vtkPoints      *TetraPoints;
00164   vtkDoubleArray *TetraScalars;
00165 
00166   vtkCellArray   *BoundaryTris;
00167   vtkTriangle    *Triangle;
00168   vtkDoubleArray *ParametricCoords;
00169 
00170 private:
00171   vtkConvexPointSet(const vtkConvexPointSet&);  // Not implemented.
00172   void operator=(const vtkConvexPointSet&);  // Not implemented.
00173 };
00174 
00175 //----------------------------------------------------------------------------
00176 inline int vtkConvexPointSet::GetParametricCenter(double pcoords[3])
00177 {
00178   pcoords[0] = pcoords[1] = pcoords[2] = 0.5;
00179   return 0;
00180 }
00181 
00182 #endif
00183 
00184 
00185