VTK
dox/Infovis/Core/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 "vtkInfovisCoreModule.h" // For export macro
00054 #include "vtkPolyDataAlgorithm.h"
00055 #include "vtkSmartPointer.h" // needed for ivars
00056 
00057 class vtkCoordinate;
00058 class vtkPoints;
00059 class vtkPolygon;
00060 class vtkPolyLine;
00061 class vtkRenderer;
00062 class vtkTransform;
00063 class vtkTransformPolyDataFilter;
00064 
00065 class VTKINFOVISCORE_EXPORT vtkConvexHull2D: public vtkPolyDataAlgorithm
00066 {
00067 public:
00068   static vtkConvexHull2D *New();
00069   vtkTypeMacro(vtkConvexHull2D, vtkPolyDataAlgorithm);
00070   void PrintSelf(ostream& os, vtkIndent indent);
00071 
00073 
00074   vtkGetMacro(ScaleFactor, double);
00075   vtkSetMacro(ScaleFactor, double);
00077 
00079 
00080   vtkGetMacro(Outline, bool);
00081   vtkSetMacro(Outline, bool);
00082   vtkBooleanMacro(Outline, bool);
00084 
00085   enum HullShapes {
00086     BoundingRectangle = 0,
00087     ConvexHull
00088   };
00089 
00091 
00092   vtkGetMacro(HullShape, int);
00093   vtkSetClampMacro(HullShape, int, 0, 1);
00095 
00097 
00099   vtkSetClampMacro(MinHullSizeInWorld, double, 0.0, VTK_DOUBLE_MAX);
00100   vtkGetMacro(MinHullSizeInWorld, double);
00102 
00103 
00105 
00107   vtkSetClampMacro(MinHullSizeInDisplay, int, 0, VTK_INT_MAX);
00108   vtkGetMacro(MinHullSizeInDisplay, int);
00110 
00112 
00114   void SetRenderer(vtkRenderer* renderer);
00115   vtkRenderer* GetRenderer();
00117 
00119   virtual unsigned long GetMTime();
00120 
00122 
00124   static void CalculateBoundingRectangle(vtkPoints* inPoints,
00125     vtkPoints* outPoints, double minimumHullSize=1.0);
00126   static void CalculateConvexHull(vtkPoints* inPoints, vtkPoints* outPoints,
00127     double minimumHullSize=1.0);
00129 
00130 protected:
00131   vtkConvexHull2D();
00132   ~vtkConvexHull2D();
00133 
00135 
00137   int RequestData(vtkInformation *, vtkInformationVector **,
00138     vtkInformationVector *);
00140 
00141 private:
00142   vtkConvexHull2D(const vtkConvexHull2D&); // Not implemented.
00143   void operator=(const vtkConvexHull2D&); // Not implemented.
00144 
00145   void ResizeHullToMinimumInDisplay(vtkPolyData* hullPolyData);
00146 
00147   double ScaleFactor;
00148   bool Outline;
00149   int HullShape;
00150   int MinHullSizeInDisplay;
00151   double MinHullSizeInWorld;
00152   vtkRenderer* Renderer;
00153 
00154   vtkSmartPointer<vtkCoordinate> Coordinate;
00155   vtkSmartPointer<vtkTransform> Transform;
00156   vtkSmartPointer<vtkTransform> OutputTransform;
00157   vtkSmartPointer<vtkTransformPolyDataFilter> OutputTransformFilter;
00158   vtkSmartPointer<vtkPolyLine> OutlineSource;
00159   vtkSmartPointer<vtkPolygon> HullSource;
00160 };
00161 
00162 #endif // __vtkConvexHull2D_h