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 "vtkCommonDataModelModule.h" // For export macro 00039 #include "vtkNonLinearCell.h" 00040 00041 class vtkLine; 00042 class vtkDoubleArray; 00043 00044 class VTKCOMMONDATAMODEL_EXPORT vtkCubicLine : public vtkNonLinearCell 00045 { 00046 public: 00047 static vtkCubicLine *New(); 00048 vtkTypeMacro(vtkCubicLine,vtkNonLinearCell); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00050 00052 00053 int GetCellType() {return VTK_CUBIC_LINE;}; 00054 int GetCellDimension() {return 1;}; 00055 int GetNumberOfEdges() {return 0;}; 00056 int GetNumberOfFaces() {return 0;}; 00057 vtkCell *GetEdge(int) {return 0;}; 00058 vtkCell *GetFace(int) {return 0;}; 00059 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00060 void Contour(double value, vtkDataArray *cellScalars, 00061 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00062 vtkCellArray *lines, vtkCellArray *polys, 00063 vtkPointData *inPd, vtkPointData *outPd, 00064 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00065 int EvaluatePosition(double x[3], double* closestPoint, 00066 int& subId, double pcoords[3], 00067 double& dist2, double *weights); 00068 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00069 double *weights); 00070 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00071 void Derivatives(int subId, double pcoords[3], double *values, 00072 int dim, double *derivs); 00073 virtual double *GetParametricCoords(); 00075 00078 double GetParametricDistance(double pcoords[3]); 00079 00081 00083 void Clip(double value, vtkDataArray *cellScalars, 00084 vtkIncrementalPointLocator *locator, vtkCellArray *lines, 00085 vtkPointData *inPd, vtkPointData *outPd, 00086 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00087 int insideOut); 00089 00091 int GetParametricCenter(double pcoords[3]); 00092 00094 00096 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00097 double x[3], double pcoords[3], int& subId); 00099 00100 00101 00104 static void InterpolationFunctions(double pcoords[3], double weights[4]); 00106 static void InterpolationDerivs(double pcoords[3], double derivs[4]); 00108 00110 virtual void InterpolateFunctions(double pcoords[3], double weights[4]) 00111 { 00112 vtkCubicLine::InterpolationFunctions(pcoords,weights); 00113 } 00114 virtual void InterpolateDerivs(double pcoords[3], double derivs[4]) 00115 { 00116 vtkCubicLine::InterpolationDerivs(pcoords,derivs); 00117 } 00119 00120 protected: 00121 vtkCubicLine(); 00122 ~vtkCubicLine(); 00123 00124 vtkLine *Line; 00125 vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping 00126 00127 private: 00128 vtkCubicLine(const vtkCubicLine&); // Not implemented. 00129 void operator=(const vtkCubicLine&); // Not implemented. 00130 }; 00131 00132 //---------------------------------------------------------------------------- 00133 inline int vtkCubicLine::GetParametricCenter(double pcoords[3]) 00134 { 00135 00136 pcoords[0]=pcoords[1] = pcoords[2] = 0.0; 00137 return 0; 00138 } 00139 00140 #endif 00141 00142 00143