:right-sidebar: True Quad =================================================================== .. currentmodule:: gi.repository.Graphene .. versionadded:: 1.0 .. class:: Quad(*args, **kwargs) :no-contents-entry: A 4 vertex quadrilateral, as represented by four :obj:`~gi.repository.Graphene.Point`\. The contents of a :obj:`~gi.repository.Graphene.Quad` are private and should never be accessed directly. Constructors ------------ .. rst-class:: interim-class .. class:: Quad :no-index: .. classmethod:: alloc() -> ~gi.repository.Graphene.Quad Allocates a new :obj:`~gi.repository.Graphene.Quad` instance. The contents of the returned instance are undefined. .. versionadded:: 1.0 Methods ------- .. rst-class:: interim-class .. class:: Quad :no-index: .. method:: bounds() -> ~gi.repository.Graphene.Rect Computes the bounding rectangle of ``q`` and places it into ``r``\. .. versionadded:: 1.0 .. method:: contains(p: ~gi.repository.Graphene.Point) -> bool Checks if the given :obj:`~gi.repository.Graphene.Quad` contains the given :obj:`~gi.repository.Graphene.Point`\. .. versionadded:: 1.0 :param p: a :obj:`~gi.repository.Graphene.Point` .. method:: free() -> None Frees the resources allocated by :func:`~gi.repository.Graphene.Quad.alloc` .. versionadded:: 1.0 .. method:: get_point(index_: int) -> ~gi.repository.Graphene.Point Retrieves the point of a :obj:`~gi.repository.Graphene.Quad` at the given index. .. versionadded:: 1.0 :param index_: the index of the point to retrieve .. method:: init(p1: ~gi.repository.Graphene.Point, p2: ~gi.repository.Graphene.Point, p3: ~gi.repository.Graphene.Point, p4: ~gi.repository.Graphene.Point) -> ~gi.repository.Graphene.Quad Initializes a :obj:`~gi.repository.Graphene.Quad` with the given points. .. versionadded:: 1.0 :param p1: the first point of the quadrilateral :param p2: the second point of the quadrilateral :param p3: the third point of the quadrilateral :param p4: the fourth point of the quadrilateral .. method:: init_from_points(points: list[~gi.repository.Graphene.Point]) -> ~gi.repository.Graphene.Quad Initializes a :obj:`~gi.repository.Graphene.Quad` using an array of points. .. versionadded:: 1.2 :param points: an array of 4 :obj:`~gi.repository.Graphene.Point` .. method:: init_from_rect(r: ~gi.repository.Graphene.Rect) -> ~gi.repository.Graphene.Quad Initializes a :obj:`~gi.repository.Graphene.Quad` using the four corners of the given :obj:`~gi.repository.Graphene.Rect`\. .. versionadded:: 1.0 :param r: a :obj:`~gi.repository.Graphene.Rect` Fields ------ .. rst-class:: interim-class .. class:: Quad :no-index: .. attribute:: points