VTK
dox/Rendering/Core/vtkViewDependentErrorMetric.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkViewDependentErrorMetric.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 =========================================================================*/
00031 #ifndef __vtkViewDependentErrorMetric_h
00032 #define __vtkViewDependentErrorMetric_h
00033 
00034 #include "vtkRenderingCoreModule.h" // For export macro
00035 #include "vtkGenericSubdivisionErrorMetric.h"
00036 
00037 class vtkViewport;
00038 class vtkCoordinate;
00039 
00040 class VTKRENDERINGCORE_EXPORT vtkViewDependentErrorMetric : public vtkGenericSubdivisionErrorMetric
00041 {
00042 public:
00045   static vtkViewDependentErrorMetric *New();
00046 
00048 
00049   vtkTypeMacro(vtkViewDependentErrorMetric,vtkGenericSubdivisionErrorMetric);
00050   void PrintSelf(ostream& os, vtkIndent indent);
00052 
00054 
00061   vtkGetMacro(PixelTolerance, double);
00063 
00070   void SetPixelTolerance(double value);
00071 
00073 
00075   vtkGetObjectMacro(Viewport,vtkViewport);
00076   void SetViewport(vtkViewport *viewport);
00078 
00080 
00094   int RequiresEdgeSubdivision(double *leftPoint, double *midPoint, double *rightPoint,
00095                               double alpha);
00097 
00099 
00108   double GetError(double *leftPoint, double *midPoint,
00109                   double *rightPoint, double alpha);
00111 
00112 protected:
00113   vtkViewDependentErrorMetric();
00114   ~vtkViewDependentErrorMetric();
00115 
00117 
00120   double Distance2LinePoint(double x[2],
00121                             double y[2],
00122                             double z[2]);
00124 
00125   double PixelTolerance;
00126   vtkViewport *Viewport;
00127   // used to get display coordinates from world coordinates
00128   vtkCoordinate *Coordinate;
00129 
00130 private:
00131   vtkViewDependentErrorMetric(const vtkViewDependentErrorMetric&);  // Not implemented.
00132   void operator=(const vtkViewDependentErrorMetric&);  // Not implemented.
00133 };
00134 
00135 #endif