#include "gtypes.h"

class GDimension

This class contains real-valued width and height fields. It is used to indicate the size of a graphical object.
Constructor
GDimension()
GDimension(widthheight) 
Creates a GDimension object with the specified width and height coordinates.
Methods
getHeight() Returns the height component of the GDimension object.
getWidth() Returns the width component of the GDimension object.
toString() Converts the GDimension to a string in the form "(width, height)".

Constructor detail


GDimension();
GDimension(double width, double height);
Creates a GDimension object with the specified width and height coordinates. If the coordinates are not supplied, the default constructor sets these fields to 0.

Usage:

GDimension empty;
GDimension dim(width, height);

Method detail


double getWidth() const;
Returns the width component of the GDimension object.

Usage:

double width = dim.getWidth();

double getHeight() const;
Returns the height component of the GDimension object.

Usage:

double height = dim.getHeight();

string toString() const;
Converts the GDimension to a string in the form "(width, height)".

Usage:

string str = dim.toString();