08.10.2022

k25:k25.2:start

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

Class | Description |
---|---|

Clipper | This (static) class implements different clipping methods. |

Point | This class describes a point with two integer coordinates. |

PointF | This class describes a point whose coordinates are two floating point numbers. |

Polygon | This class represents a polygon. |

Rect | This class represents a rectangle with four integer values for the two coordinates and the extent (width and height). |

RectF | This 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.

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

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial 3.0 Unported