gtypes.h
Types | |
This type contains real-valued x and y fields. | |
This type contains real-valued width and height fields. | |
This type contains real-valued x, y, width, and height fields. | |
Functions | |
Creates a GPoint structure with the specified x and y coordinates. | |
Returns the x component of the GPoint . | |
Returns the y component of the GPoint . | |
Creates a GDimension value with the specified width and height coordinates. | |
Returns the width component of the GDimension . | |
Returns the width component of the GDimension . | |
Creates a GRectangle value with the specified components. | |
Returns the x component of the rectangle. | |
Returns the y component of the rectangle. | |
Returns the width component of the GRectangle . | |
Returns the width component of the GRectangle . | |
Returns true if the rectangle is empty. | |
Returns true if the rectangle contains the given point. |
typedef struct { double x; double y; } GPoint;
typedef struct { double width; double height; } GDimension;
typedef struct { double x; double y; double width; double height; } GRectangle;
GPoint createGPoint(double x, double y);
GPoint
structure with the specified x
and y
coordinates.
Usage:
pt = createGPoint(x, y);
double getX(GPoint pt);
GPoint
.
Usage:
x = getX(pt);
double getY(GPoint pt);
GPoint
.
Usage:
y = getY(pt);
GDimension createGDimension(double width, double height);
GDimension
value with the specified
width
and height
coordinates.
Usage:
dim = createGDimension(width, height);
double getWidth(GDimension dim);
GDimension
.
Usage:
width = getWidth(dim);
double getHeight(GDimension dim);
GDimension
.
Usage:
width = getHeight(dim);
GRectangle createGRectangle(double x, double y, double width, double height);
GRectangle
value with the specified components.
Usage:
r = createGRectangle(x, y, width, height);
double getX(GRectangle r);
Usage:
double x = getX(r);
double getY(GRectangle r);
Usage:
double y = getY(r);
double getWidth(GRectangle r);
GRectangle
.
Usage:
width = getWidth(r);
double getHeight(GRectangle r);
GRectangle
.
Usage:
width = getHeight(r);
bool isEmpty(GRectangle r);
true
if the rectangle is empty.
Usage:
if (isEmpty(r)) . . .
bool contains(GRectangle r, GPoint pt);
true
if the rectangle contains the given point.
Usage:
if (contains(r, pt)) . . .