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

vtkNonLinearCell.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkNonLinearCell.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00039 #ifndef __vtkNonLinearCell_h
00040 #define __vtkNonLinearCell_h
00041 
00042 #include "vtkCell.h"
00043 
00044 #include "vtkPointLocator.h" // Needed for inline method
00045 #include "vtkPoints.h" // Needed for inline method
00046 
00047 class vtkPolyData;
00048 class vtkDataSet;
00049 class vtkUnstructuredGrid;
00050 
00051 class VTK_COMMON_EXPORT vtkNonLinearCell : public vtkCell
00052 {
00053 public:
00054   vtkTypeRevisionMacro(vtkNonLinearCell,vtkCell);  
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00058 
00060   vtkSetClampMacro(Error,float,0.001f,1.0f);
00061   vtkGetMacro(Error,float);
00063 
00067   virtual int IsLinear() {return 0;}
00068   
00070 
00080   virtual void Tesselate(vtkIdType cellId, 
00081                          vtkDataSet *input, vtkPolyData *output, 
00082                          vtkPointLocator *locator=NULL);
00084   
00086 
00096   virtual void Tesselate(vtkIdType cellId, 
00097                          vtkDataSet *input, vtkUnstructuredGrid *output, 
00098                          vtkPointLocator *locator=NULL);
00100   
00101 
00102 protected:
00103   vtkNonLinearCell();
00104   ~vtkNonLinearCell() {}
00105 
00106   float Error;
00107 
00108   // inline helper for tesselation- used by subclasses
00109   vtkIdType InsertPoint(vtkPointLocator *locator, vtkPoints *pts, float *x)
00110     {
00111       if ( locator != NULL ) 
00112         {
00113         vtkIdType p;
00114         locator->InsertUniquePoint(x,p);
00115         return p;
00116         }
00117       else
00118         {
00119         return pts->InsertNextPoint(x);
00120         }
00121     }
00122   
00123 private:
00124   vtkNonLinearCell(const vtkNonLinearCell&);  // Not implemented.
00125   void operator=(const vtkNonLinearCell&);  // Not implemented.
00126 };
00127 
00128 #endif
00129 
00130