geometry2d.h

    Description:

    Defines attributes of 2D geometries (including points, lines, rectangles, and polygons) of the lightweight graphics system and provides functions for performing operations on the geometries.

    Since:

    1.0

    Version:

    1.0

    Function Name

    Description

    OHOS::Intersect (const Line &a, const Line &b, Vector2< int16_t > &out)

    bool 

    Checks whether line segment a and line segment b intersect, and returns the intersection point (if available).

    (const Line &a, const Line &b)

    Chekcs whether line segment a and line segment b intersect.

    OHOS::Clip (Polygon &poly, const Line &line)

    void 

    Clips a polygon by using a line segment.

    (const Rect &clipRect, const Polygon &polygon)

    Polygon 

    Implements Sutherland-Hodgman, an algorithm used for clipping polygons.

    (const Line &line, const Polygon &poly, Vector2< int16_t > pOut, uint8_t pNum)

    void 

    Clips a polygon by using a line segment and obtains the intersections.