VTK
dox/Infovis/vtkConvexHull2D.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003  Program:   Visualization Toolkit
00004  Module:    vtkConvexHull2D.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  =========================================================================*/
00015 
00050 #ifndef __vtkConvexHull2D_h
00051 #define __vtkConvexHull2D_h
00052 
00053 #include "vtkPolyDataAlgorithm.h"
00054 #include "vtkSmartPointer.h" // needed for ivars
00055 
00056 class vtkCoordinate;
00057 class vtkPoints;
00058 class vtkPolygon;
00059 class vtkPolyLine;
00060 class vtkRenderer;
00061 class vtkTransform;
00062 class vtkTransformPolyDataFilter;
00063 
00064 class VTK_INFOVIS_EXPORT vtkConvexHull2D: public vtkPolyDataAlgorithm
00065 {
00066 public:
00067   static vtkConvexHull2D *New();
00068   vtkTypeMacro(vtkConvexHull2D, vtkPolyDataAlgorithm);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00072 
00073   vtkGetMacro(ScaleFactor, double);
00074   vtkSetMacro(ScaleFactor, double);
00076 
00078 
00079   vtkGetMacro(Outline, bool);
00080   vtkSetMacro(Outline, bool);
00081   vtkBooleanMacro(Outline, bool);
00083 
00084   enum HullShapes {
00085     BoundingRectangle = 0,
00086     ConvexHull
00087   };
00088 
00090 
00091   vtkGetMacro(HullShape, int);
00092   vtkSetClampMacro(HullShape, int, 0, 1);
00094 
00096 
00098   vtkSetClampMacro(MinHullSizeInWorld, double, 0.0, VTK_DOUBLE_MAX);
00099   vtkGetMacro(MinHullSizeInWorld, double);
00101 
00102 
00104 
00106   vtkSetClampMacro(MinHullSizeInDisplay, int, 0, VTK_INT_MAX);
00107   vtkGetMacro(MinHullSizeInDisplay, int);
00109 
00111 
00113   void SetRenderer(vtkRenderer* renderer);
00114   vtkRenderer* GetRenderer();
00116 
00118   virtual unsigned long GetMTime();
00119 
00121 
00123   static void CalculateBoundingRectangle(vtkPoints* inPoints,
00124     vtkPoints* outPoints, double minimumHullSize=1.0);
00125   static void CalculateConvexHull(vtkPoints* inPoints, vtkPoints* outPoints,
00126     double minimumHullSize=1.0);
00128 
00129 protected:
00130   vtkConvexHull2D();
00131   ~vtkConvexHull2D();
00132 
00134 
00136   int RequestData(vtkInformation *, vtkInformationVector **,
00137     vtkInformationVector *);
00139 
00140 private:
00141   vtkConvexHull2D(const vtkConvexHull2D&); // Not implemented.
00142   void operator=(const vtkConvexHull2D&); // Not implemented.
00143 
00144   void ResizeHullToMinimumInDisplay(vtkPolyData* hullPolyData);
00145 
00146   double ScaleFactor;
00147   bool Outline;
00148   int HullShape;
00149   int MinHullSizeInDisplay;
00150   double MinHullSizeInWorld;
00151   vtkRenderer* Renderer;
00152 
00153   vtkSmartPointer<vtkCoordinate> Coordinate;
00154   vtkSmartPointer<vtkTransform> Transform;
00155   vtkSmartPointer<vtkTransform> OutputTransform;
00156   vtkSmartPointer<vtkTransformPolyDataFilter> OutputTransformFilter;
00157   vtkSmartPointer<vtkPolyLine> OutlineSource;
00158   vtkSmartPointer<vtkPolygon> HullSource;
00159 };
00160 
00161 #endif // __vtkConvexHull2D_h