ALBULA  4.0.1
 All Classes Namespaces Functions Variables Pages
dectris.albula.DRect Class Reference

The DRect class defines a rectangle in the plane using integer precision. More...

Public Member Functions

def DRect
 Default constructor. More...
 
def DRect
 Construct DRect with its upper left corner at (left,top) and width and height. More...
 
def DRect
 Copy constructor. More...
 
def left
 
def right
 Same as left() + width() More...
 
def top
 
def bottom
 Same as top() + height() More...
 
def width
 
def height
 
def setLeft
 Sets the left edge of the rectangle to the given x coordinate holding width() and height() constant. More...
 
def setRight
 Sets the right edge of the rectangle to the given x coordinate holding width() and height() constant. More...
 
def setTop
 Sets the top edge of the rectangle to the given y-coordinate holding width() and height() constant. More...
 
def setBottom
 Sets the bottom edge of the rectangle to the given y-coordinate holding width() and height() constant. More...
 
def setWidth
 Sets the rectangle's width holding left() constant. More...
 
def setHeight
 Sets the rectangle's height holding top() constant. More...
 
def move
 move the rectangle by dx, dy holding width() and height() constant. More...
 

Detailed Description

The DRect class defines a rectangle in the plane using integer precision.

class DRect provides the following operations:

DRect == rectComparison operator
Returns
true if the rectangle is equal to rect else false
DRect != rect
Returns
true if the rectangle is different from rect else false

Constructor & Destructor Documentation

def dectris.albula.DRect.DRect ( )

Default constructor.

def dectris.albula.DRect.DRect (   left,
  top,
  width,
  height 
)

Construct DRect with its upper left corner at (left,top) and width and height.

Parameters
leftInteger defining the left edge of the rectangle
topInteger defining the top edge of the rectangle
widthInteger defining the width of the rectangle
heightInteger defining the height of the rectangle
def dectris.albula.DRect.DRect (   rect)

Copy constructor.

Parameters
rectConstruct rectangle from an existing DRect rect.

Member Function Documentation

def dectris.albula.DRect.bottom ( )

Same as top() + height()

Returns
y coordinate of the bottom side
def dectris.albula.DRect.height ( )
Returns
rectangle's height
def dectris.albula.DRect.left ( )
Returns
x coordinate of the left side
def dectris.albula.DRect.move (   dx,
  dy 
)

move the rectangle by dx, dy holding width() and height() constant.

Parameters
dxmove in x direction by dx
dymove in y direction by dy
def dectris.albula.DRect.right ( )

Same as left() + width()

Returns
x coordinate of the right side
def dectris.albula.DRect.setBottom (   y)

Sets the bottom edge of the rectangle to the given y-coordinate holding width() and height() constant.

Parameters
yy-coordinate of the bottom edge
def dectris.albula.DRect.setHeight (   height)

Sets the rectangle's height holding top() constant.

Parameters
heightheight of the rectangle
def dectris.albula.DRect.setLeft (   x)

Sets the left edge of the rectangle to the given x coordinate holding width() and height() constant.

Parameters
xx-coordinate of the left edge
def dectris.albula.DRect.setRight (   x)

Sets the right edge of the rectangle to the given x coordinate holding width() and height() constant.

Parameters
xx-coordinate of the right edge
def dectris.albula.DRect.setTop (   y)

Sets the top edge of the rectangle to the given y-coordinate holding width() and height() constant.

Parameters
yy-coordinate of the top edge
def dectris.albula.DRect.setWidth (   width)

Sets the rectangle's width holding left() constant.

Parameters
widthwidth of the rectangle
def dectris.albula.DRect.top ( )
Returns
y coordinate of the top side
def dectris.albula.DRect.width ( )
Returns
rectangle's width