VTK  9.3.1
vtkContextPolygon.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
4 #ifndef vtkContextPolygon_h
5 #define vtkContextPolygon_h
6 
7 #include "vtkChartsCoreModule.h"
8 #include "vtkType.h" // For vtkIdType
9 #include "vtkVector.h" // For vtkVector2f
10 
11 VTK_ABI_NAMESPACE_BEGIN
12 class vtkTransform2D;
13 class vtkContextPolygonPrivate;
14 
15 class VTKCHARTSCORE_EXPORT vtkContextPolygon
16 {
17 public:
18  // Description:
19  // Creates a new, empty polygon.
21 
22  // Description:
23  // Creates a new copy of \p polygon.
24  vtkContextPolygon(const vtkContextPolygon& polygon);
25 
26  // Description:
27  // Destroys the polygon.
29 
30  // Description:
31  // Adds a point to the polygon.
32  void AddPoint(const vtkVector2f& point);
33 
34  // Description:
35  // Adds a point to the polygon.
36  void AddPoint(float x, float y);
37 
38  // Description:
39  // Returns the point at index.
41 
42  // Description:
43  // Returns the number of points in the polygon.
44  vtkIdType GetNumberOfPoints() const;
45 
46  // Description:
47  // Clears all the points from the polygon.
48  void Clear();
49 
50  // Description:
51  // Returns \c true if the polygon contains \p point.
52  bool Contains(const vtkVector2f& point) const;
53 
54  // Description:
55  // Returns a new polygon with each point transformed by \p transform.
56  vtkContextPolygon Transformed(vtkTransform2D* transform) const;
57 
58  // Description:
59  // Copies the values from \p other to this polygon.
60  vtkContextPolygon& operator=(const vtkContextPolygon& other);
61 
62 private:
63  vtkContextPolygonPrivate* const d;
64 };
65 
66 VTK_ABI_NAMESPACE_END
67 #endif // vtkContextPolygon_h
68 // VTK-HeaderTest-Exclude: vtkContextPolygon.h
int vtkIdType
Definition: vtkType.h:315
describes linear transformations via a 3x3 matrix
void GetPoint(int i, int j, int k, double pnt[3])