VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
11 
12 VTK_ABI_NAMESPACE_BEGIN
13 class vtkTransform2D;
14 class vtkContextPolygonPrivate;
15 
16 class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkContextPolygon
17 {
18 public:
19  // Description:
20  // Creates a new, empty polygon.
22 
23  // Description:
24  // Creates a new copy of \p polygon.
25  vtkContextPolygon(const vtkContextPolygon& polygon);
26 
27  // Description:
28  // Destroys the polygon.
30 
31  // Description:
32  // Adds a point to the polygon.
33  void AddPoint(const vtkVector2f& point);
34 
35  // Description:
36  // Adds a point to the polygon.
37  void AddPoint(float x, float y);
38 
39  // Description:
40  // Returns the point at index.
42 
43  // Description:
44  // Returns the number of points in the polygon.
45  vtkIdType GetNumberOfPoints() const;
46 
47  // Description:
48  // Clears all the points from the polygon.
49  void Clear();
50 
51  // Description:
52  // Returns \c true if the polygon contains \p point.
53  bool Contains(const vtkVector2f& point) const;
54 
55  // Description:
56  // Returns a new polygon with each point transformed by \p transform.
57  vtkContextPolygon Transformed(vtkTransform2D* transform) const;
58 
59  // Description:
60  // Copies the values from \p other to this polygon.
61  vtkContextPolygon& operator=(const vtkContextPolygon& other);
62 
63 private:
64  vtkContextPolygonPrivate* const d;
65 };
66 
67 VTK_ABI_NAMESPACE_END
68 #endif // vtkContextPolygon_h
69 // VTK-HeaderTest-Exclude: vtkContextPolygon.h
int vtkIdType
Definition: vtkType.h:363
describes linear transformations via a 3x3 matrix
void GetPoint(int i, int j, int k, double pnt[3])
#define VTK_MARSHALAUTO