IDS peak ICV v1.1.0
Loading...
Searching...
No Matches
Size Class Reference

Public Member Functions

 __init__ (self, Union[int, float] width, Union[int, float] height)
 Size constructor from width and height.
 
bool __eq__ (self, Any other)
 Check if two Size objects are equal.
 
bool __ne__ (self, Any other)
 Check if two Size objects are not equal.
 
str __str__ (self)
 Returns a string representation of the Size object.
 
str __repr__ (self)
 Return an unambiguous string of the Size object.
 
Union[int, float] width (self)
 Get the width of the size.
 
Union[int, float] height (self)
 Get the height of the size.
 
Size transposed (self)
 

Data Fields

 width = 2:
 
 height
 

Protected Attributes

Union[int, float] _width = width
 
Union[int, float] _height = height
 

Detailed Description

A size consists of width and height where width and height have to be greater than or equal to zero.

Definition at line 9 of file size.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
Union[int, float] width,
Union[int, float] height )

Size constructor from width and height.

Parameters
widthWidth of the size.
heightHeight of the size.
Exceptions
OutOfRangeExceptionIf width or height is less than zero.

Definition at line 17 of file size.py.

Member Function Documentation

◆ __eq__()

bool __eq__ ( self,
Any other )

Check if two Size objects are equal.

Parameters
otherAnother Size object OR List of width and height [width, height] OR Tuple of width and height (width, height)
Returns
True if both objects are equal, False otherwise.

Definition at line 36 of file size.py.

◆ __ne__()

bool __ne__ ( self,
Any other )

Check if two Size objects are not equal.

Parameters
otherAnother Size object OR List/Tuple with width and height.
Returns
True if both objects are not equal, False otherwise.

Definition at line 54 of file size.py.

◆ __repr__()

str __repr__ ( self)

Return an unambiguous string of the Size object.

Definition at line 74 of file size.py.

◆ __str__()

str __str__ ( self)

Returns a string representation of the Size object.

Returns
String representation of the Size object.

Definition at line 65 of file size.py.

◆ height()

Union[int, float] height ( self)

Get the height of the size.

Returns
The height value.

Definition at line 92 of file size.py.

◆ transposed()

Size transposed ( self)

Definition at line 101 of file size.py.

◆ width()

Union[int, float] width ( self)

Get the width of the size.

Returns
The width value.

Definition at line 82 of file size.py.

Field Documentation

◆ _height

Union[int, float] _height = height
protected

Definition at line 34 of file size.py.

◆ _width

Union[int, float] _width = width
protected

Definition at line 33 of file size.py.

◆ height

height

Definition at line 46 of file size.py.

◆ width

width = 2:

Definition at line 46 of file size.py.