VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkCubicLine.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 =========================================================================*/ 00035 #ifndef __vtkCubicLine_h 00036 #define __vtkCubicLine_h 00037 00038 #include "vtkNonLinearCell.h" 00039 00040 class vtkLine; 00041 class vtkDoubleArray; 00042 00043 class VTK_FILTERING_EXPORT vtkCubicLine : public vtkNonLinearCell 00044 { 00045 public: 00046 static vtkCubicLine *New(); 00047 vtkTypeMacro(vtkCubicLine,vtkNonLinearCell); 00048 void PrintSelf(ostream& os, vtkIndent indent); 00049 00051 00052 int GetCellType() {return VTK_CUBIC_LINE;}; 00053 int GetCellDimension() {return 1;}; 00054 int GetNumberOfEdges() {return 0;}; 00055 int GetNumberOfFaces() {return 0;}; 00056 vtkCell *GetEdge(int) {return 0;}; 00057 vtkCell *GetFace(int) {return 0;}; 00058 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00059 void Contour(double value, vtkDataArray *cellScalars, 00060 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00061 vtkCellArray *lines, vtkCellArray *polys, 00062 vtkPointData *inPd, vtkPointData *outPd, 00063 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00064 int EvaluatePosition(double x[3], double* closestPoint, 00065 int& subId, double pcoords[3], 00066 double& dist2, double *weights); 00067 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00068 double *weights); 00069 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00070 void Derivatives(int subId, double pcoords[3], double *values, 00071 int dim, double *derivs); 00072 virtual double *GetParametricCoords(); 00074 00077 double GetParametricDistance(double pcoords[3]); 00078 00080 00082 void Clip(double value, vtkDataArray *cellScalars, 00083 vtkIncrementalPointLocator *locator, vtkCellArray *lines, 00084 vtkPointData *inPd, vtkPointData *outPd, 00085 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00086 int insideOut); 00088 00090 int GetParametricCenter(double pcoords[3]); 00091 00093 00095 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00096 double x[3], double pcoords[3], int& subId); 00098 00099 00100 00103 static void InterpolationFunctions(double pcoords[3], double weights[4]); 00105 static void InterpolationDerivs(double pcoords[3], double derivs[4]); 00107 00109 virtual void InterpolateFunctions(double pcoords[3], double weights[4]) 00110 { 00111 vtkCubicLine::InterpolationFunctions(pcoords,weights); 00112 } 00113 virtual void InterpolateDerivs(double pcoords[3], double derivs[4]) 00114 { 00115 vtkCubicLine::InterpolationDerivs(pcoords,derivs); 00116 } 00118 00119 protected: 00120 vtkCubicLine(); 00121 ~vtkCubicLine(); 00122 00123 vtkLine *Line; 00124 vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping 00125 00126 private: 00127 vtkCubicLine(const vtkCubicLine&); // Not implemented. 00128 void operator=(const vtkCubicLine&); // Not implemented. 00129 }; 00130 00131 //---------------------------------------------------------------------------- 00132 inline int vtkCubicLine::GetParametricCenter(double pcoords[3]) 00133 { 00134 00135 pcoords[0]=pcoords[1] = pcoords[2] = 0.0; 00136 return 0; 00137 } 00138 00139 #endif 00140 00141 00142