User Tools

Site Tools


k25:k25.2:start

25.2.0 Clipper component

The gb.clipper component implements clipping procedures in six classes based on the Clipper library.

ClassDescription
ClipperThis (static) class implements different clipping methods.
PointThis class describes a point with two integer coordinates.
PointFThis class describes a point whose coordinates are two floating point numbers.
PolygonThis class represents a polygon.
RectThis class represents a rectangle with four integer values for the two coordinates and the extent (width and height).
RectFThis class represents a rectangle with four floating point numbers for the two coordinates and the extent (width and height).

Table 25.2.0.1 : Classes of the Clipper component

The methods of the classes of the gb.clipper component can be used to perform operations on polygons. These operations include:

  • Creating polygons,
  • Simplifying complex polygons,
  • Union, intersection, exclusive or, difference formation and shifting of polygons.

B1

Figure 25.2.0.1: Example: Intersection of two polygons PolyRed and PolyBlue

Conclusion

You cannot draw with the classes of the gb.clipper component, but you can calculate and link objects with the methods of the six classes, which you can then draw. To do this, you use the Paint.Polygon() method (gb.qt4) and the Polygon[iIndex] syntax (gb.clipper) to save all the points of a polygon in an array. This allows you to use the classes of the gb.clipper component as the basis for drawing programmes.

The component can be useful for mathematical applications in geometry - if you work specifically with polygons.

The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k25/k25.2/start.txt · Last modified: 21.02.2024 by emma

Page Tools