.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.Rect2D:
==========================================================================================================================================
|phoenix_title| **wx.Rect2D**
==========================================================================================================================================
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
Rect2D:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.Rect2D.__init__`
:meth:`~wx.Rect2D.ConstrainTo`
:meth:`~wx.Rect2D.Contains`
:meth:`~wx.Rect2D.CreateIntersection`
:meth:`~wx.Rect2D.CreateUnion`
:meth:`~wx.Rect2D.Get` Get() . (x, y, width, height)
:meth:`~wx.Rect2D.GetBottom`
:meth:`~wx.Rect2D.GetCentre`
:meth:`~wx.Rect2D.GetIM` Returns an immutable representation of the ``wx.Rect2D`` object, based on ``namedtuple``.
:meth:`~wx.Rect2D.GetLeft`
:meth:`~wx.Rect2D.GetLeftBottom`
:meth:`~wx.Rect2D.GetLeftTop`
:meth:`~wx.Rect2D.GetOutCode`
:meth:`~wx.Rect2D.GetOutcode`
:meth:`~wx.Rect2D.GetPosition`
:meth:`~wx.Rect2D.GetRight`
:meth:`~wx.Rect2D.GetRightBottom`
:meth:`~wx.Rect2D.GetRightTop`
:meth:`~wx.Rect2D.GetSize`
:meth:`~wx.Rect2D.GetTop`
:meth:`~wx.Rect2D.HaveEqualSize`
:meth:`~wx.Rect2D.Inset`
:meth:`~wx.Rect2D.Interpolate`
:meth:`~wx.Rect2D.Intersect`
:meth:`~wx.Rect2D.Intersects`
:meth:`~wx.Rect2D.IsEmpty`
:meth:`~wx.Rect2D.MoveBottomTo`
:meth:`~wx.Rect2D.MoveCentreTo`
:meth:`~wx.Rect2D.MoveLeftBottomTo`
:meth:`~wx.Rect2D.MoveLeftTo`
:meth:`~wx.Rect2D.MoveLeftTopTo`
:meth:`~wx.Rect2D.MoveRightBottomTo`
:meth:`~wx.Rect2D.MoveRightTo`
:meth:`~wx.Rect2D.MoveRightTopTo`
:meth:`~wx.Rect2D.MoveTopTo`
:meth:`~wx.Rect2D.Offset`
:meth:`~wx.Rect2D.Scale`
:meth:`~wx.Rect2D.SetBottom`
:meth:`~wx.Rect2D.SetCentre`
:meth:`~wx.Rect2D.SetLeft`
:meth:`~wx.Rect2D.SetLeftBottom`
:meth:`~wx.Rect2D.SetLeftTop`
:meth:`~wx.Rect2D.SetRight`
:meth:`~wx.Rect2D.SetRightBottom`
:meth:`~wx.Rect2D.SetRightTop`
:meth:`~wx.Rect2D.SetTop`
:meth:`~wx.Rect2D.Union`
:meth:`~wx.Rect2D.__bool__`
:meth:`~wx.Rect2D.__getitem__`
:meth:`~wx.Rect2D.__len__`
:meth:`~wx.Rect2D.__nonzero__`
:meth:`~wx.Rect2D.__reduce__`
:meth:`~wx.Rect2D.__repr__`
:meth:`~wx.Rect2D.__setitem__`
:meth:`~wx.Rect2D.__str__`
:meth:`~wx.Rect2D.__ne__`
:meth:`~wx.Rect2D.__eq__`
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.Rect2D.Bottom` See :meth:`~wx.Rect2D.GetBottom` and :meth:`~wx.Rect2D.SetBottom`
:attr:`~wx.Rect2D.Centre` See :meth:`~wx.Rect2D.GetCentre` and :meth:`~wx.Rect2D.SetCentre`
:attr:`~wx.Rect2D.IM` See :meth:`~wx.Rect2D.GetIM`
:attr:`~wx.Rect2D.Left` See :meth:`~wx.Rect2D.GetLeft` and :meth:`~wx.Rect2D.SetLeft`
:attr:`~wx.Rect2D.LeftBottom` See :meth:`~wx.Rect2D.GetLeftBottom` and :meth:`~wx.Rect2D.SetLeftBottom`
:attr:`~wx.Rect2D.LeftTop` See :meth:`~wx.Rect2D.GetLeftTop` and :meth:`~wx.Rect2D.SetLeftTop`
:attr:`~wx.Rect2D.Position` See :meth:`~wx.Rect2D.GetPosition`
:attr:`~wx.Rect2D.Right` See :meth:`~wx.Rect2D.GetRight` and :meth:`~wx.Rect2D.SetRight`
:attr:`~wx.Rect2D.RightBottom` See :meth:`~wx.Rect2D.GetRightBottom` and :meth:`~wx.Rect2D.SetRightBottom`
:attr:`~wx.Rect2D.RightTop` See :meth:`~wx.Rect2D.GetRightTop` and :meth:`~wx.Rect2D.SetRightTop`
:attr:`~wx.Rect2D.Size` See :meth:`~wx.Rect2D.GetSize`
:attr:`~wx.Rect2D.Top` See :meth:`~wx.Rect2D.GetTop` and :meth:`~wx.Rect2D.SetTop`
:attr:`~wx.Rect2D.m_height` A public C++ attribute of type `~wx.Double` .
:attr:`~wx.Rect2D.m_width` A public C++ attribute of type `~wx.Double` .
:attr:`~wx.Rect2D.m_x` A public C++ attribute of type `~wx.Double` .
:attr:`~wx.Rect2D.m_y` A public C++ attribute of type `~wx.Double` .
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.Rect2D(object)
**Possible constructors**::
Rect2DDouble() -> None
Rect2DDouble(x : float, y : float, w : float, h : float) -> None
.. method:: __init__(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**__init__** `(self)`
:rtype: `None`
:html:`
`
**__init__** `(self, x : float, y : float, w : float, h : float)`
:param `x`:
:type `x`: wx.Double
:param `y`:
:type `y`: wx.Double
:param `w`:
:type `w`: wx.Double
:param `h`:
:type `h`: wx.Double
:rtype: `None`
:html:`
`
.. method:: ConstrainTo(self, rect : Rect2DDouble)
:param `rect`:
:type `rect`: Rect2DDouble
:rtype: `None`
.. method:: Contains(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**Contains** `(self, pt : Point2DDouble)`
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `bool`
:html:`
`
**Contains** `(self, rect : Rect2DDouble)`
:param `rect`:
:type `rect`: Rect2DDouble
:rtype: `bool`
:html:`
`
.. method:: CreateIntersection(self, otherRect : Rect2DDouble)
:param `otherRect`:
:type `otherRect`: Rect2DDouble
:rtype: `Rect2DDouble`
.. method:: CreateUnion(self, otherRect : Rect2DDouble)
:param `otherRect`:
:type `otherRect`: Rect2DDouble
:rtype: `Rect2DDouble`
.. method:: Get(self)
Get() . (x, y, width, height)
Return the rectangle's properties as a tuple.
:rtype: `Any`
.. method:: GetBottom(self)
:rtype: `float`
.. method:: GetCentre(self)
:rtype: `Point2DDouble`
.. method:: GetIM(self)
Returns an immutable representation of the ``wx.Rect2D`` object, based on ``namedtuple``.
This new object is hashable and can be used as a dictionary key,
be added to sets, etc. It can be converted back into a real ``wx.Rect2D``
with a simple statement like this: ``obj = wx.Rect2D(imObj)``.
.. method:: GetLeft(self)
:rtype: `float`
.. method:: GetLeftBottom(self)
:rtype: `Point2DDouble`
.. method:: GetLeftTop(self)
:rtype: `Point2DDouble`
.. method:: GetOutCode(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: :ref:`wx.OutCode`
.. method:: GetOutcode(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: :ref:`wx.OutCode`
.. method:: GetPosition(self)
:rtype: `Point2DDouble`
.. method:: GetRight(self)
:rtype: `float`
.. method:: GetRightBottom(self)
:rtype: `Point2DDouble`
.. method:: GetRightTop(self)
:rtype: `Point2DDouble`
.. method:: GetSize(self)
:rtype: :ref:`wx.Size`
.. method:: GetTop(self)
:rtype: `float`
.. method:: HaveEqualSize(self, rect : Rect2DDouble)
:param `rect`:
:type `rect`: Rect2DDouble
:rtype: `bool`
.. method:: Inset(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**Inset** `(self, x : float, y : float)`
:param `x`:
:type `x`: wx.Double
:param `y`:
:type `y`: wx.Double
:rtype: `None`
:html:`
`
**Inset** `(self, left : float, top : float, right : float, bottom : float)`
:param `left`:
:type `left`: wx.Double
:param `top`:
:type `top`: wx.Double
:param `right`:
:type `right`: wx.Double
:param `bottom`:
:type `bottom`: wx.Double
:rtype: `None`
:html:`
`
.. method:: Interpolate(self, widthfactor : int, heightfactor : int)
:param `widthfactor`:
:type `widthfactor`: wx.int
:param `heightfactor`:
:type `heightfactor`: wx.int
:rtype: `Point2DDouble`
.. method:: Intersect(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**Intersect** `(self, otherRect : Rect2DDouble)`
:param `otherRect`:
:type `otherRect`: Rect2DDouble
:rtype: `None`
:html:`
`
**Intersect** `(src1 : Rect2DDouble, src2 : Rect2DDouble, dest : Rect2DDouble)`
:param `src1`:
:type `src1`: Rect2DDouble
:param `src2`:
:type `src2`: Rect2DDouble
:param `dest`:
:type `dest`: Rect2DDouble
:rtype: `None`
:html:`
`
.. method:: Intersects(self, rect : Rect2DDouble)
:param `rect`:
:type `rect`: Rect2DDouble
:rtype: `bool`
.. method:: IsEmpty(self)
:rtype: `bool`
.. method:: MoveBottomTo(self, n : float)
:param `n`:
:type `n`: wx.Double
:rtype: `None`
.. method:: MoveCentreTo(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: MoveLeftBottomTo(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: MoveLeftTo(self, n : float)
:param `n`:
:type `n`: wx.Double
:rtype: `None`
.. method:: MoveLeftTopTo(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: MoveRightBottomTo(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: MoveRightTo(self, n : float)
:param `n`:
:type `n`: wx.Double
:rtype: `None`
.. method:: MoveRightTopTo(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: MoveTopTo(self, n : float)
:param `n`:
:type `n`: wx.Double
:rtype: `None`
.. method:: Offset(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: Scale(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**Scale** `(self, f : float)`
:param `f`:
:type `f`: wx.Double
:rtype: `None`
:html:`
`
**Scale** `(self, num : int, denum : int)`
:param `num`:
:type `num`: wx.int
:param `denum`:
:type `denum`: wx.int
:rtype: `None`
:html:`
`
.. method:: SetBottom(self, n : float)
:param `n`:
:type `n`: wx.Double
:rtype: `None`
.. method:: SetCentre(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: SetLeft(self, n : float)
:param `n`:
:type `n`: wx.Double
:rtype: `None`
.. method:: SetLeftBottom(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: SetLeftTop(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: SetRight(self, n : float)
:param `n`:
:type `n`: wx.Double
:rtype: `None`
.. method:: SetRightBottom(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: SetRightTop(self, pt : Point2DDouble)
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
.. method:: SetTop(self, n : float)
:param `n`:
:type `n`: wx.Double
:rtype: `None`
.. method:: Union(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**Union** `(self, otherRect : Rect2DDouble)`
:param `otherRect`:
:type `otherRect`: Rect2DDouble
:rtype: `None`
:html:`
`
**Union** `(self, pt : Point2DDouble)`
:param `pt`:
:type `pt`: Point2DDouble
:rtype: `None`
:html:`
`
**Union** `(src1 : Rect2DDouble, src2 : Rect2DDouble, dest : Rect2DDouble)`
:param `src1`:
:type `src1`: Rect2DDouble
:param `src2`:
:type `src2`: Rect2DDouble
:param `dest`:
:type `dest`: Rect2DDouble
:rtype: `None`
:html:`
`
.. method:: __bool__(self)
.. method:: __getitem__(self, idx)
.. method:: __len__(self)
.. method:: __nonzero__(self)
.. method:: __reduce__(self)
.. method:: __repr__(self)
.. method:: __setitem__(self, idx, val)
.. method:: __str__(self)
.. method:: __ne__(self)
:param `rect`:
:type `rect`: Rect2DDouble
.. method:: __eq__(self)
:param `rect`:
:type `rect`: Rect2DDouble
.. attribute:: Bottom
See :meth:`~wx.Rect2D.GetBottom` and :meth:`~wx.Rect2D.SetBottom`
.. attribute:: Centre
See :meth:`~wx.Rect2D.GetCentre` and :meth:`~wx.Rect2D.SetCentre`
.. attribute:: IM
See :meth:`~wx.Rect2D.GetIM`
.. attribute:: Left
See :meth:`~wx.Rect2D.GetLeft` and :meth:`~wx.Rect2D.SetLeft`
.. attribute:: LeftBottom
See :meth:`~wx.Rect2D.GetLeftBottom` and :meth:`~wx.Rect2D.SetLeftBottom`
.. attribute:: LeftTop
See :meth:`~wx.Rect2D.GetLeftTop` and :meth:`~wx.Rect2D.SetLeftTop`
.. attribute:: Position
See :meth:`~wx.Rect2D.GetPosition`
.. attribute:: Right
See :meth:`~wx.Rect2D.GetRight` and :meth:`~wx.Rect2D.SetRight`
.. attribute:: RightBottom
See :meth:`~wx.Rect2D.GetRightBottom` and :meth:`~wx.Rect2D.SetRightBottom`
.. attribute:: RightTop
See :meth:`~wx.Rect2D.GetRightTop` and :meth:`~wx.Rect2D.SetRightTop`
.. attribute:: Size
See :meth:`~wx.Rect2D.GetSize`
.. attribute:: Top
See :meth:`~wx.Rect2D.GetTop` and :meth:`~wx.Rect2D.SetTop`
.. attribute:: m_height
A public C++ attribute of type `~wx.Double` .
.. attribute:: m_width
A public C++ attribute of type `~wx.Double` .
.. attribute:: m_x
A public C++ attribute of type `~wx.Double` .
.. attribute:: m_y
A public C++ attribute of type `~wx.Double` .