VTK
dox/Charts/Core/vtkContextPolygon.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkContextPolygon.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 
00016 #ifndef _vtkContextPolygon_h
00017 #define _vtkContextPolygon_h
00018 
00019 #include "vtkChartsCoreModule.h"
00020 #include "vtkVector.h" // For vtkVector2f
00021 #include "vtkType.h" // For vtkIdType
00022 
00023 class vtkTransform2D;
00024 class vtkContextPolygonPrivate;
00025 
00026 class VTKCHARTSCORE_EXPORT vtkContextPolygon
00027 {
00028 public:
00029   // Description:
00030   // Creates a new, empty polygon.
00031   vtkContextPolygon();
00032 
00033   // Description:
00034   // Creates a new copy of \p polygon.
00035   vtkContextPolygon(const vtkContextPolygon &polygon);
00036 
00037   // Description:
00038   // Destroys the polygon.
00039   ~vtkContextPolygon();
00040 
00041   // Description:
00042   // Adds a point to the polygon.
00043   void AddPoint(const vtkVector2f &point);
00044 
00045   // Description:
00046   // Adds a point to the polygon.
00047   void AddPoint(float x, float y);
00048 
00049   // Description:
00050   // Returns the point at index.
00051   vtkVector2f GetPoint(vtkIdType index) const;
00052 
00053   // Description:
00054   // Returns the number of points in the polygon.
00055   vtkIdType GetNumberOfPoints() const;
00056 
00057   // Description:
00058   // Clears all the points from the polygon.
00059   void Clear();
00060 
00061   // Description:
00062   // Returns \c true if the polygon contains \p point.
00063   bool Contains(const vtkVector2f &point) const;
00064 
00065   // Description:
00066   // Returns a new polygon with each point transformed by \p transform.
00067   vtkContextPolygon Transformed(vtkTransform2D *transform) const;
00068 
00069   // Description:
00070   // Copies the values from \p other to this polygon.
00071   vtkContextPolygon& operator=(const vtkContextPolygon &other);
00072 
00073 private:
00074   vtkContextPolygonPrivate* const d;
00075 };
00076 
00077 #endif // _vtkContextPolygon_h
00078 // VTK-HeaderTest-Exclude: vtkContextPolygon.h