IDS peak ICV v1.4.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.

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.

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.

◆ __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.

◆ __repr__()

str __repr__ ( self)

Return an unambiguous string of the Size object.

◆ __str__()

str __str__ ( self)

Returns a string representation of the Size object.

Returns
String representation of the Size object.

◆ height()

Union[int, float] height ( self)

Get the height of the size.

Returns
The height value.

◆ transposed()

Size transposed ( self)

◆ width()

Union[int, float] width ( self)

Get the width of the size.

Returns
The width value.

Field Documentation

◆ _height

Union[int, float] _height = height
protected

◆ _width

Union[int, float] _width = width
protected

◆ height

height

◆ width

width = 2: