C++ Java Unity
C++ Reference
Rectangle Class Reference

Detailed Description

A 2D rectangular area, expressed in real (float) coordinates.

Inheritance diagram for Rectangle:
Area

Public Member Functions

 Rectangle ()
 
 Rectangle (const Rectangle &other)
 
 Rectangle (float leftTopX, float leftTopY, float rightBottomX, float rightBottomY)
 
virtual ~Rectangle ()
 
Rectangleoperator= (const Rectangle &other)
 
float getLeftTopX () const
 
float getLeftTopY () const
 
float getRightBottomX () const
 
float getRightBottomY () const
 
float getWidth () const
 
float getHeight () const
 
float getAreaSize () const
 
virtual TYPE getType () const
 Get the TYPE of area this instance represents. More...
 
- Public Member Functions inherited from Area
virtual ~Area ()
 

Protected Attributes

float left
 
float top
 
float right
 
float bottom
 

Additional Inherited Members

- Public Types inherited from Area
enum  TYPE {
  RECTANGLE,
  RECTANGLE_INT,
  INVALID
}
 The types of area that a given instance of Area can represent. More...
 

Constructor & Destructor Documentation

Rectangle ( )
Rectangle ( const Rectangle other)
Rectangle ( float  leftTopX,
float  leftTopY,
float  rightBottomX,
float  rightBottomY 
)
virtual ~Rectangle ( )
virtual

Member Function Documentation

Rectangle& operator= ( const Rectangle other)
float getLeftTopX ( ) const
float getLeftTopY ( ) const
float getRightBottomX ( ) const
float getRightBottomY ( ) const
float getWidth ( ) const
float getHeight ( ) const
float getAreaSize ( ) const
virtual TYPE getType ( ) const
virtual

Get the TYPE of area this instance represents.

Implements Area.

Member Data Documentation

float left
protected
float top
protected
float right
protected
float bottom
protected