Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# Graphics/vtkQuadricDecimation.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkQuadricDecimation.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 =========================================================================*/
    00047 #ifndef __vtkQuadricDecimation_h
    00048 #define __vtkQuadricDecimation_h
    00049
    00050 #include "vtkPolyDataToPolyDataFilter.h"
    00051
    00052 class vtkEdgeTable;
    00053 class vtkIdList;
    00054 class vtkPointData;
    00055 class vtkPriorityQueue;
    00056
    00057 class VTK_GRAPHICS_EXPORT vtkQuadricDecimation : public vtkPolyDataToPolyDataFilter
    00058 {
    00059 public:
    00060   vtkTypeRevisionMacro(vtkQuadricDecimation, vtkPolyDataToPolyDataFilter);
    00061   void PrintSelf(ostream& os, vtkIndent indent);
    00062
    00063   static vtkQuadricDecimation *New();
    00064
    00066
    00067   vtkSetMacro(MaximumCost, float);
    00068   vtkGetMacro(MaximumCost, float);
    00070
    00072
    00073   vtkSetMacro(MaximumCollapsedEdges, int);
    00074   vtkGetMacro(MaximumCollapsedEdges, int);
    00076
    00078   vtkPolyData *GetTestOutput() {return this->GetOutput(1);}
    00079
    00080 protected:
    00081   vtkQuadricDecimation();
    00082   ~vtkQuadricDecimation();
    00083
    00084   void Execute();
    00085
    00087   void ComputeQuadric(vtkIdType pointId);
    00088
    00091   void AddQuadric(vtkIdType oldPtId, vtkIdType newPtId);
    00092
    00095   float ComputeCost(vtkIdType edgeId, float x[3], vtkPointData *pd);
    00096
    00100   void FindAffectedEdges(vtkIdType p1Id, vtkIdType p2Id, vtkIdList *edges);
    00101
    00103   vtkIdType GetEdgeCellId(vtkIdType p1Id, vtkIdType p2Id);
    00104
    00107   void GetAttributeComponents();
    00108
    00109   float MaximumCost;
    00110   int MaximumCollapsedEdges;
    00111   int NumberOfCollapsedEdges;
    00112   vtkEdgeTable *Edges;
    00113   vtkIdList *EndPoint1List;
    00114   vtkIdList *EndPoint2List;
    00115   vtkPriorityQueue *EdgeCosts;
    00116
    00117   //BTX
    00118   class ErrorQuadric
    00119   {
    00120   public:
    00121     float *Quadric;
    00122   };
    00123   //ETX
    00124   ErrorQuadric *ErrorQuadrics;
    00125
    00126   int AttributeComponents[6];
    00127   int NumberOfComponents;
    00128   vtkPolyData *Mesh;
    00129 private:
    00130   vtkQuadricDecimation(const vtkQuadricDecimation&);  // Not implemented.
    00131   void operator=(const vtkQuadricDecimation&);  // Not implemented.
    00132 };
    00133
    00134 #endif