Go to the first, previous, next, last section, table of contents.


CNICoord -- 2-Dimensional Integer Coordinates

SYNOPSIS

#include <CNCL/ICoord.h>

TYPE

CN_ICOORD

BASE CLASSES

CNObject

DERIVED CLASSES

None

RELATED CLASSES

CNCoord

DESCRIPTION

CNICoord is a data type for managing 2-dimensional integer coordinates. It is typically used with CNCoord for pixel coordinates and world coordinates respectively.
A CNICoord has int x and y members which are public accessible.
CNICoords can be automatically converted to CNCoords and vice versa. This is done by applying the conversion factor CNCoord::scale.

Constructors:

CNICoord();
CNICoord(CNParam *param);
CNICoord(int vx, int vy);
CNICoord(const CNCoord &v);
CNICoord(const CNICoord &v);
Initializes the integer coordinates object and optionally sets x and y components.

Public accessible members:

int x;
int y;
The x and y components of CNICoord.

In addition to the member functions required by CNCL, CNICoord provides:

CNICoord &operator += (const CNICoord &v);
CNICoord &operator -= (const CNICoord &v);
Defines the operators += and -= for integer coordinates, applying the standard C/C++ operators to the x and y components.

The following static member functions are provided to manipulate the conversion scale setting:

static double CNICoord::get_scale();
static double CNICoord::set_scale(double new_scale);
Gets/sets the scale setting.

Global operators:

CNICoord operator + (const CNICoord &a, const CNICoord &b);
CNICoord operator - (const CNICoord &a, const CNICoord &b);
Adds/substracts integer coordinates by adding/subtracting the x and y components.


Go to the first, previous, next, last section, table of contents.