Rect Class Reference
[ECMAScript/QtScript - Native Objects]

Qt Rect type. More...

Inheritance diagram for Rect:

Object List of all members.

Properties

Number bottom
Point center
Number height
Number left
Number right
Number top
Number width
Number x
Number y

Methods

Boolean contains (Rect rect)
Rect intersection (Rect rect)
Boolean intersects (Rect rect)
Boolean isEmpty ()
Boolean isNull ()
void moveBottom (Number pos)
void moveBy (Number dx, Number dy)
void moveLeft (Number pos)
void moveRight (Number pos)
void moveTop (Number pos)
void normalize ()
void normalize ()
Rect union (Rect rect)

Constructors

 Rect (Rect rect)
 Rect (Number xVal, Number yVal, Number wVal, Number hVal)
 Rect ()

Detailed Description

Qt Rect type.

This is the DAZ Script counterpart of the QRect type used in the DAZ Studio SDK. A Rect object is a two dimensional representation of a rectangle.


Constructor & Destructor Documentation

Rect::Rect (  ) 

Default Constructor.

Rect::Rect ( Number  xVal,
Number  yVal,
Number  wVal,
Number  hVal 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
xVal The x coordinate of the rectangle
yVal The y coordiante of the rectangle
wVal The width of the rectangle
hVal The height of the rectangle

Rect::Rect ( Rect  rect  ) 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
rect The rectangle to copy


Member Function Documentation

Boolean Rect::contains ( Rect  rect  ) 

Parameters:
rect The rectangle to test against this rectangle
Returns:
True if this rectangle contains the given rectangle

Rect Rect::intersection ( Rect  rect  ) 

Parameters:
rect The rectangle to intersect with this rectangle
Returns:
The intersection of this rectangle with the given rectangle, or an empty rectangle if the two do not intersect.

Boolean Rect::intersects ( Rect  rect  ) 

Parameters:
rect The rectangle to test against this rectangle
Returns:
True if this rectangle intersects with the given rectangle

Boolean Rect::isEmpty (  ) 

Returns:
True if the rectangle is empty, i.e the width and height of the rectangle are negative.

Boolean Rect::isNull (  ) 

Returns:
True if the width and height of the rectangle are 0.

void Rect::moveBottom ( Number  pos  ) 

Moves the rectangle so its bottom property is equal to pos.

Parameters:
pos The new bottom boundary of the triangle

void Rect::moveBy ( Number  dx,
Number  dy 
)

Translates the rectangle by dx and dy, the width and height remain unchanged.

Parameters:
dx The distance in x to move the rectangle
dy The distance in y to move the rectangle

void Rect::moveLeft ( Number  pos  ) 

Moves the rectangle so its left property is equal to pos.

Parameters:
pos The new left boundary of the triangle

void Rect::moveRight ( Number  pos  ) 

Moves the rectangle so its right property is equal to pos.

Parameters:
pos The new right boundary of the triangle

void Rect::moveTop ( Number  pos  ) 

Moves the rectangle so its top property is equal to pos.

Parameters:
pos The new top boundary of the triangle

void Rect::normalize (  ) 

Normalizes the rectangle - changes the prefix of width/height if they are negative. The rectangle will no longer be empty after it is normalized.

void Rect::normalize (  ) 

Normalizes the rectangle - changes the prefix of width/height if they are negative. The rectangle will no longer be empty after it is normalized.

Rect Rect::union ( Rect  rect  ) 

Parameters:
rect The rectangle to add to this rectangle
Returns:
The union of this rectangle with the given rectangle, i.e. a rectangle that contains both rectangles.


Member Data Documentation

Number Rect::bottom

The rectangle's bottom

Point Rect::center

The rectangle's center

Number Rect::height

The rectangle's height

Number Rect::left

The rectangle's left

Number Rect::right

The rectangle's right

Number Rect::top

The rectangle's top

Number Rect::width

The rectangle's width

Number Rect::x

The rectangle's x position

Number Rect::y

The rectangle's y position


Generated on Thu Sep 24 12:21:16 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.