VTK
vtkContextPolygon.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContextPolygon.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 #ifndef vtkContextPolygon_h
17 #define vtkContextPolygon_h
18 
19 #include "vtkChartsCoreModule.h"
20 #include "vtkVector.h" // For vtkVector2f
21 #include "vtkType.h" // For vtkIdType
22 
23 class vtkTransform2D;
24 class vtkContextPolygonPrivate;
25 
26 class VTKCHARTSCORE_EXPORT vtkContextPolygon
27 {
28 public:
29  // Description:
30  // Creates a new, empty polygon.
32 
33  // Description:
34  // Creates a new copy of \p polygon.
35  vtkContextPolygon(const vtkContextPolygon &polygon);
36 
37  // Description:
38  // Destroys the polygon.
40 
41  // Description:
42  // Adds a point to the polygon.
43  void AddPoint(const vtkVector2f &point);
44 
45  // Description:
46  // Adds a point to the polygon.
47  void AddPoint(float x, float y);
48 
49  // Description:
50  // Returns the point at index.
52 
53  // Description:
54  // Returns the number of points in the polygon.
55  vtkIdType GetNumberOfPoints() const;
56 
57  // Description:
58  // Clears all the points from the polygon.
59  void Clear();
60 
61  // Description:
62  // Returns \c true if the polygon contains \p point.
63  bool Contains(const vtkVector2f &point) const;
64 
65  // Description:
66  // Returns a new polygon with each point transformed by \p transform.
67  vtkContextPolygon Transformed(vtkTransform2D *transform) const;
68 
69  // Description:
70  // Copies the values from \p other to this polygon.
71  vtkContextPolygon& operator=(const vtkContextPolygon &other);
72 
73 private:
74  vtkContextPolygonPrivate* const d;
75 };
76 
77 #endif // vtkContextPolygon_h
78 // VTK-HeaderTest-Exclude: vtkContextPolygon.h
int vtkIdType
Definition: vtkType.h:347
void GetPoint(const int i, const int j, const int k, double pnt[3])
describes linear transformations via a 3x3 matrix