.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.Rect2D:

==========================================================================================================================================
|phoenix_title|  **wx.Rect2D**
==========================================================================================================================================





|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>Rect2D</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/Rect2DDouble_inheritance.png" alt="Inheritance diagram of Rect2D" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="Rect2DDouble.html" title="Rect2DDouble" alt="" coords="4,5,115,35"/> </map> 
   </p>

|


|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 :ref:`~wx.Double`.
:attr:`~wx.Rect2D.m_width`                                                       A public C++ attribute of type :ref:`~wx.Double`.
:attr:`~wx.Rect2D.m_x`                                                           A public C++ attribute of type :ref:`~wx.Double`.
:attr:`~wx.Rect2D.m_y`                                                           A public C++ attribute of type :ref:`~wx.Double`.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.Rect2D(object)

   **Possible constructors**::

       Rect2DDouble()
       
       Rect2DDouble(x, y, w, h)
       



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **__init__** `(self)`
      
      
      
      
      
      **~~~**

      
      **__init__** `(self, x, y, w, h)`
      
      
      
      
      :param `x`: 
      :type `x`: wx.Double
      :param `y`: 
      :type `y`: wx.Double
      :param `w`: 
      :type `w`: wx.Double
      :param `h`: 
      :type `h`: wx.Double
      
      
      
      
      
      
      **~~~**






   .. method:: ConstrainTo(self, rect)




      :param `rect`: 
      :type `rect`: Rect2DDouble







   .. method:: Contains(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **Contains** `(self, pt)`
      
      
      
      
      :param `pt`: 
      :type `pt`: Point2DDouble
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      **~~~**

      
      **Contains** `(self, rect)`
      
      
      
      
      :param `rect`: 
      :type `rect`: Rect2DDouble
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      **~~~**






   .. method:: CreateIntersection(self, otherRect)




      :param `otherRect`: 
      :type `otherRect`: Rect2DDouble




      :rtype: :ref:`Rect2DDouble`








   .. method:: CreateUnion(self, otherRect)




      :param `otherRect`: 
      :type `otherRect`: Rect2DDouble




      :rtype: :ref:`Rect2DDouble`








   .. method:: Get(self)

                      Get() . (x, y, width, height)

                      Return the rectangle's properties as a tuple. 

      :rtype: :ref:`PyObject`








   .. method:: GetBottom(self)



      :rtype: :ref:`wx.Double`








   .. method:: GetCentre(self)



      :rtype: :ref:`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: :ref:`wx.Double`








   .. method:: GetLeftBottom(self)



      :rtype: :ref:`Point2DDouble`








   .. method:: GetLeftTop(self)



      :rtype: :ref:`Point2DDouble`








   .. method:: GetOutCode(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble




      :rtype: :ref:`wx.OutCode`








   .. method:: GetOutcode(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble




      :rtype: :ref:`wx.OutCode`








   .. method:: GetPosition(self)



      :rtype: :ref:`Point2DDouble`








   .. method:: GetRight(self)



      :rtype: :ref:`wx.Double`








   .. method:: GetRightBottom(self)



      :rtype: :ref:`Point2DDouble`








   .. method:: GetRightTop(self)



      :rtype: :ref:`Point2DDouble`








   .. method:: GetSize(self)



      :rtype: :ref:`wx.Size`








   .. method:: GetTop(self)



      :rtype: :ref:`wx.Double`








   .. method:: HaveEqualSize(self, rect)




      :param `rect`: 
      :type `rect`: Rect2DDouble




      :rtype: `bool`








   .. method:: Inset(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **Inset** `(self, x, y)`
      
      
      
      
      :param `x`: 
      :type `x`: wx.Double
      :param `y`: 
      :type `y`: wx.Double
      
      
      
      
      
      
      **~~~**

      
      **Inset** `(self, left, top, right, bottom)`
      
      
      
      
      :param `left`: 
      :type `left`: wx.Double
      :param `top`: 
      :type `top`: wx.Double
      :param `right`: 
      :type `right`: wx.Double
      :param `bottom`: 
      :type `bottom`: wx.Double
      
      
      
      
      
      
      **~~~**






   .. method:: Interpolate(self, widthfactor, heightfactor)




      :param `widthfactor`: 
      :type `widthfactor`: wx.int
      :param `heightfactor`: 
      :type `heightfactor`: wx.int




      :rtype: :ref:`Point2DDouble`








   .. method:: Intersect(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **Intersect** `(self, otherRect)`
      
      
      
      
      :param `otherRect`: 
      :type `otherRect`: Rect2DDouble
      
      
      
      
      
      
      **~~~**

      
      **Intersect** `(src1, src2, dest)`
      
      
      
      
      :param `src1`: 
      :type `src1`: Rect2DDouble
      :param `src2`: 
      :type `src2`: Rect2DDouble
      :param `dest`: 
      :type `dest`: Rect2DDouble
      
      
      
      
      
      
      **~~~**






   .. method:: Intersects(self, rect)




      :param `rect`: 
      :type `rect`: Rect2DDouble




      :rtype: `bool`








   .. method:: IsEmpty(self)



      :rtype: `bool`








   .. method:: MoveBottomTo(self, n)




      :param `n`: 
      :type `n`: wx.Double







   .. method:: MoveCentreTo(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: MoveLeftBottomTo(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: MoveLeftTo(self, n)




      :param `n`: 
      :type `n`: wx.Double







   .. method:: MoveLeftTopTo(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: MoveRightBottomTo(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: MoveRightTo(self, n)




      :param `n`: 
      :type `n`: wx.Double







   .. method:: MoveRightTopTo(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: MoveTopTo(self, n)




      :param `n`: 
      :type `n`: wx.Double







   .. method:: Offset(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: Scale(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **Scale** `(self, f)`
      
      
      
      
      :param `f`: 
      :type `f`: wx.Double
      
      
      
      
      
      
      **~~~**

      
      **Scale** `(self, num, denum)`
      
      
      
      
      :param `num`: 
      :type `num`: wx.int
      :param `denum`: 
      :type `denum`: wx.int
      
      
      
      
      
      
      **~~~**






   .. method:: SetBottom(self, n)




      :param `n`: 
      :type `n`: wx.Double







   .. method:: SetCentre(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: SetLeft(self, n)




      :param `n`: 
      :type `n`: wx.Double







   .. method:: SetLeftBottom(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: SetLeftTop(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: SetRight(self, n)




      :param `n`: 
      :type `n`: wx.Double







   .. method:: SetRightBottom(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: SetRightTop(self, pt)




      :param `pt`: 
      :type `pt`: Point2DDouble







   .. method:: SetTop(self, n)




      :param `n`: 
      :type `n`: wx.Double







   .. method:: Union(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **Union** `(self, otherRect)`
      
      
      
      
      :param `otherRect`: 
      :type `otherRect`: Rect2DDouble
      
      
      
      
      
      
      **~~~**

      
      **Union** `(self, pt)`
      
      
      
      
      :param `pt`: 
      :type `pt`: Point2DDouble
      
      
      
      
      
      
      **~~~**

      
      **Union** `(src1, src2, dest)`
      
      
      
      
      :param `src1`: 
      :type `src1`: Rect2DDouble
      :param `src2`: 
      :type `src2`: Rect2DDouble
      :param `dest`: 
      :type `dest`: Rect2DDouble
      
      
      
      
      
      
      **~~~**






   .. 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 :ref:`~wx.Double`.


   .. attribute:: m_width

      A public C++ attribute of type :ref:`~wx.Double`.


   .. attribute:: m_x

      A public C++ attribute of type :ref:`~wx.Double`.


   .. attribute:: m_y

      A public C++ attribute of type :ref:`~wx.Double`.

