SGL
Public Member Functions | Public Attributes | List of all members
GDimension Struct Reference

This struct contains real-valued width and height fields. More...

#include "gtypes.h"

Public Member Functions

 GDimension(double width, double height)
 Creates a GDimension object with the specified width and height coordinates. More...
 
 GDimension()
 
string toString() const
 Converts the GDimension to a string in the form "(</code><i>width</i><code>,</code>&nbsp;<i>height</i><code>)". More...
 

Public Attributes

double height
 
double width
 

Detailed Description

This struct contains real-valued width and height fields.

It is used to indicate the size of a graphical object.

Constructor & Destructor Documentation

◆ GDimension() [1/2]

GDimension ( double  width,
double  height 
)

Creates a GDimension object with the specified width and height coordinates.

◆ GDimension() [2/2]

Member Function Documentation

◆ toString()

string toString ( ) const

Converts the GDimension to a string in the form "(</code><i>width</i><code>,</code>&nbsp;<i>height</i><code>)".

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const GDimension d1,
const GDimension d2 
)
friend

Compares two GDimension objects for inequality.

◆ operator*

GDimension operator* ( const GDimension d,
double  scale 
)
friend

Multiplies the width and height of the given GDimension object by the given scale factor and returns the scaled dimension object.

◆ operator<

bool operator< ( const GDimension d1,
const GDimension d2 
)
friend

Relational operators that compare two GDimension objects by width and then by height.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const GDimension dim 
)
friend

Writes the GDimension to the given output stream.

◆ operator<=

bool operator<= ( const GDimension d1,
const GDimension d2 
)
friend

Relational operators that compare two GDimension objects by width and then by height.

◆ operator==

bool operator== ( const GDimension d1,
const GDimension d2 
)
friend

Compares two GDimension objects for equality.

◆ operator>

bool operator> ( const GDimension d1,
const GDimension d2 
)
friend

Relational operators that compare two GDimension objects by width and then by height.

◆ operator>=

bool operator>= ( const GDimension d1,
const GDimension d2 
)
friend

Relational operators that compare two GDimension objects by width and then by height.

Member Data Documentation

◆ height

double height

◆ width

double width