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

vtkGenericSubdivisionErrorMetric.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGenericSubdivisionErrorMetric.h,v $
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 =========================================================================*/
00043 #ifndef __vtkGenericSubdivisionErrorMetric_h
00044 #define __vtkGenericSubdivisionErrorMetric_h
00045 
00046 #include "vtkObject.h"
00047 
00048 class vtkGenericAttributeCollection;
00049 class vtkGenericAdaptorCell;
00050 class vtkGenericDataSet;
00051 
00052 class VTK_FILTERING_EXPORT vtkGenericSubdivisionErrorMetric : public vtkObject
00053 {
00054 public:
00056   static vtkGenericSubdivisionErrorMetric *New();
00057   
00059 
00060   vtkTypeRevisionMacro(vtkGenericSubdivisionErrorMetric,vtkObject);
00061   void PrintSelf(ostream& os, vtkIndent indent);
00063   
00065 
00067   vtkGetMacro(GeometricTolerance, double);
00069  
00075   void SetAbsoluteGeometricTolerance(double value);
00076   
00078 
00082   void SetRelativeGeometricTolerance(double value,
00083                                      vtkGenericDataSet *ds);
00085   
00087 
00093   vtkGetMacro(PixelTolerance, double);
00095   
00098   void SetPixelTolerance(double value);
00099   
00101 
00106   vtkGetMacro(AttributeTolerance, double);
00108   
00112   void SetAttributeTolerance(double value);
00113 
00116   virtual bool EvaluateEdge( double* e1, double* e2 );
00117   
00119 
00121   virtual void SetGenericCell(vtkGenericAdaptorCell*);
00122   vtkGetObjectMacro(GenericCell,vtkGenericAdaptorCell);
00124   
00126 
00127   virtual void SetAttributeCollection(vtkGenericAttributeCollection*);
00128   vtkGetObjectMacro(AttributeCollection,vtkGenericAttributeCollection);
00130   
00132 
00137   virtual double EvaluateScreenError(double *vtkNotUsed(e1), 
00138                                      double *vtkNotUsed(e2))
00139     {return 0.0;}
00141 
00142 protected:
00143   vtkGenericSubdivisionErrorMetric();
00144   virtual ~vtkGenericSubdivisionErrorMetric();
00145   
00148   void ComputeAbsoluteAttributeTolerance();
00149   
00150   
00152 
00156   void ComputeCoordinates(double *e1,
00157                           double *e2);
00159   
00161 
00164   double Distance2LinePoint(double x[3],
00165                             double y[3],
00166                             double z[3]);
00168   
00169   double GeometricTolerance;
00170   double PixelTolerance;
00171   double AttributeTolerance;
00172   
00173   double AbsoluteAttributeTolerance; // cached value computed from
00174   // AttributeTolerance and active attribute/component
00175   vtkTimeStamp AbsoluteAttributeToleranceComputeTime;
00176   
00177   vtkGenericAttributeCollection *AttributeCollection;
00178   vtkGenericAdaptorCell *GenericCell;
00179   vtkTimeStamp SubdivisionMTime;
00180 
00181   // Format: Edge1Cache = xyz abc abc abc ...
00182   double *Edge1Cache;
00183   double *Edge2Cache;
00184   
00185   // Format: xyz
00186   double RealCenterCache[3];
00187   double InterpolatedCenterCache[3];
00188   
00189   double EvaluateGeometricError(double *e1, double *e2);
00190   double EvaluateAttributesError(double *e1, double *e2);
00191 
00192 private:
00193   vtkGenericSubdivisionErrorMetric(const vtkGenericSubdivisionErrorMetric&);  // Not implemented.
00194   void operator=(const vtkGenericSubdivisionErrorMetric&);  // Not implemented.
00195 };
00196 
00197 #endif
00198