Point_t Struct Reference

Struct representing a point in a 2 dimensional coordinate space. More...

#include <UTGeometry.h>

List of all members.

Public Member Functions

 Point_t ()
 Point_t (float x, float y)
 Point_t (const Point_t &copy)
const Point_toperator= (const Point_t &copy)
bool operator== (const Point_t &other) const
bool operator!= (const Point_t &other) const
Point_t operator+ (const Point_t &add) const
Point_t operator- (const Point_t &subtract) const
const Point_toperator+= (const Point_t &add)
const Point_toperator-= (const Point_t &subtract)

Public Attributes

float x
float y

Detailed Description

Struct representing a point in a 2 dimensional coordinate space. Although it can be used in other ways, the value space which is typically used is that for a monitor, with increasing x values to the right and increasing y values to the bottom. Floating point numbers are used by the UTgfx and UTgui libraries to represent screen display because for scaling, use of floating point computation until final conversion to an integer coordinate is more efficient than use of integers when scaling. That way the same interface can be used to render to the display, printer, and so on. Floats are accurate to within c_dbl_abs_min_denominator out to about 4,000,000.

Some related C API functionality for finding line intercepts is documented in the UTGeometry.h page.

Definition at line 93 of file UTGeometry.h.


Constructor & Destructor Documentation

Point_t::Point_t (  )  [inline]

Constructor for an uninitialized point.

Definition at line 1301 of file UTGeometry.h.

Point_t::Point_t ( float  x,
float  y 
) [inline]

Initializer for a new point at a specific location.

Definition at line 1309 of file UTGeometry.h.

Point_t::Point_t ( const Point_t copy  )  [inline]

Copy constructor.

Definition at line 1317 of file UTGeometry.h.


Member Function Documentation

const Point_t & Point_t::operator= ( const Point_t copy  )  [inline]

Assignment operator.

Definition at line 1325 of file UTGeometry.h.

bool Point_t::operator== ( const Point_t other  )  const

Comparison operator. Because of possible floating point error, if the x and y coordinates are within c_dbl_compare_equality_threshold of each other, returns true. This is adequate for pixels. For very large values, a custom comparison function should be used.

bool Point_t::operator!= ( const Point_t other  )  const

Comparison operator. Because of possible floating point error, if the x and y coordinates are within c_dbl_compare_equality_threshold of each other, returns false. This is adequate for pixels. For very large values, a custom comparison function should be used.

Point_t Point_t::operator+ ( const Point_t add  )  const [inline]

Adds the x and y values of two points in a new point.

Definition at line 1334 of file UTGeometry.h.

Point_t Point_t::operator- ( const Point_t subtract  )  const [inline]

Subtracts the x and y values in subtract from the x and y values in the point on the left side of the expression, with the result in a new point.

Definition at line 1341 of file UTGeometry.h.

const Point_t & Point_t::operator+= ( const Point_t add  )  [inline]

Adds the x and y values in add to the x and y values in this.

Definition at line 1348 of file UTGeometry.h.

const Point_t & Point_t::operator-= ( const Point_t subtract  )  [inline]

Subtracts the x and y values in subtract from the x and y values in this.

Definition at line 1357 of file UTGeometry.h.


Member Data Documentation

float Point_t::x

The coordinate value along the x axis.

Definition at line 114 of file UTGeometry.h.

float Point_t::y

The coordinate value along the y axis.

Definition at line 117 of file UTGeometry.h.


The documentation for this struct was generated from the following file:

Generated on Tue Dec 14 22:35:07 2010 for UT library by  doxygen 1.6.1