Table Of Contents

Previous topic

PlatformInfo

Next topic

Point2DDouble

This Page

phoenix_title Point

A Point is a useful data structure for graphics operations.

It contains integer x and y members. See RealPoint for a floating point version.

Note that the width and height stored inside a Point object may be negative and that Point functions do not perform any check against negative values (this is used to e.g. store the special -1 value in DefaultPosition instance).

See also

RealPoint


class_hierarchy Inheritance Diagram

Inheritance diagram for class Point

Inheritance diagram of Point


method_summary Methods Summary

__init__ Constructs a point.
Get Return the x and y properties as a tuple.
IsFullySpecified Returns True if neither of the point components is equal to DefaultCoord.
SetDefaults Combine this object with another one replacing the uninitialized values.
__getitem__  
__len__  
__nonzero__  
__reduce__  
__repr__  
__setitem__  
__str__  
__iadd__  
__isub__  

api Class API



class Point(object)

A Point is a useful data structure for graphics operations.

Possible constructors:

Point()

Point(x, y)

Point(pt)

Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Constructs a point.

Initializes the internal x and y coordinates to zero.



__init__ (self, x, y)

Initializes the point object with the given x and y coordinates.

Parameters:
  • x (int) –
  • y (int) –



__init__ (self, pt)

Converts the given RealPoint (with floating point coordinates) to a Point instance.

Parameters:pt (RealPoint) –





Get(self)

Return the x and y properties as a tuple.

Return type:tuple
Returns:( x, y )


IsFullySpecified(self)

Returns True if neither of the point components is equal to DefaultCoord.

This method is typically used before calling SetDefaults .

Return type:bool

New in version 2.9.2.



SetDefaults(self, pt)

Combine this object with another one replacing the uninitialized values.

It is typically used like this:

if not pos.IsFullySpecified():

    pos.SetDefaults(GetDefaultPosition())
Parameters:pt (Point) –

New in version 2.9.2.

See also

IsFullySpecified



__getitem__(self, idx)


__len__(self)


__nonzero__(self)


__reduce__(self)


__repr__(self)


__setitem__(self, idx, val)


__str__(self)


__iadd__(self, *args, **kw)

overload Overloaded Implementations:



__iadd__ (self)

Parameters:sz (Size) –



__iadd__ (self)

Parameters:pt (Point) –





__isub__(self, *args, **kw)

overload Overloaded Implementations:



__isub__ (self)

Parameters:sz (Size) –



__isub__ (self)

Parameters:pt (Point) –