MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLCoord Class Reference

Detailed Description

This class represents a single coordinate in internal TMC coordinate space.

Public Member Functions

void translate (const TSLCoord &delta)
 
TSLCoordoperator+= (const TSLCoord &delta)
 
TSLCoordoperator-= (const TSLCoord &delta)
 
bool validateTranslation (TSLTMC dx, TSLTMC dy)
 
 TSLCoord ()
 
 TSLCoord (TSLTMC x, TSLTMC y)
 
TSLCoord operator+ (const TSLCoord &anotherCoord) const
 
TSLCoord operator- (const TSLCoord &anotherCoord) const
 
TSLCoordoperator= (const TSLCoord &anotherCoord)
 
bool operator> (const TSLCoord &anotherCoord) const
 
bool operator< (const TSLCoord &anotherCoord) const
 
bool operator== (const TSLCoord &anotherCoord) const
 
bool operator!= (const TSLCoord &anotherCoord) const
 
double distance (const TSLCoord &anotherCoord) const
 
double squareDistance (const TSLCoord &anotherCoord) const
 
void translate (TSLTMC dx, TSLTMC dy)
 
TSLTMC x () const
 
void x (TSLTMC xcoord)
 
TSLTMC y () const
 
void y (TSLTMC ycoord)
 

Public Attributes

TSLTMC m_x
 
TSLTMC m_y
 

Constructor & Destructor Documentation

◆ TSLCoord() [1/2]

TSLCoord::TSLCoord ( )
inline

◆ TSLCoord() [2/2]

TSLCoord::TSLCoord ( TSLTMC x,
TSLTMC y )
inline

Constructor by argument of a Coord class object.

Parameters
xThe x coordinate value
yThe y coordinate value

Member Function Documentation

◆ distance()

double TSLCoord::distance ( const TSLCoord & anotherCoord) const
inline

Calculate the distance between this coordinate and another.

Parameters
anotherCoordSource for calculation.
Returns
the distance between the coordinates in TMC units.

◆ operator!=()

bool TSLCoord::operator!= ( const TSLCoord & anotherCoord) const
inline

Compares two coordinates.

Parameters
anotherCoordSource for comparison.
Returns
true if x and/or y values are different.

◆ operator+()

TSLCoord TSLCoord::operator+ ( const TSLCoord & anotherCoord) const
inline

Adds two coordinates.

Translates the coordinate by the specified delta coordinate.

Parameters
anotherCoordDelta coordinate.
Returns
a TSLCoord containing the summed value.

◆ operator+=()

TSLCoord & TSLCoord::operator+= ( const TSLCoord & delta)
inline

Add AND Assignment operator.

Translates the coordinate by the specified delta coordinate and assigns it.

Parameters
deltaDelta coordinate.
Returns
reference to updated value.

◆ operator-()

TSLCoord TSLCoord::operator- ( const TSLCoord & anotherCoord) const
inline

Subtracts two coordinates.

Translates the coordinate by the negative of the specified delta coordinate.

Parameters
anotherCoordDelta coordinate.
Returns
a TSLCoord containing the subtracted value.

◆ operator-=()

TSLCoord & TSLCoord::operator-= ( const TSLCoord & delta)
inline

Subtract AND Assignment operator.

Translates the coordinate by the negative of the specified delta coordinate and assigns it.

Parameters
deltaDelta coordinate.
Returns
reference to updated value.

◆ operator<()

bool TSLCoord::operator< ( const TSLCoord & anotherCoord) const
inline

Less than operator.

Performs a comparison between two coordinates.

Parameters
anotherCoordSource for comparison.
Returns
true if the y coordinate is less, or the y coordinate is equal and the x coordinate is less.

◆ operator=()

TSLCoord & TSLCoord::operator= ( const TSLCoord & anotherCoord)
inline

Assignment operator.

Assigns the x and y values of the argument coordinate to those of this coordinate.

Parameters
anotherCoordSource for new value.
Returns
reference to updated value.

◆ operator==()

bool TSLCoord::operator== ( const TSLCoord & anotherCoord) const
inline

Compares two coordinates.

Parameters
anotherCoordSource for comparison.
Returns
true if both x and y values are equal.

◆ operator>()

bool TSLCoord::operator> ( const TSLCoord & anotherCoord) const
inline

Greater than operator.

Performs a comparison between two coordinates.

Parameters
anotherCoordSource comparison.
Returns
true if the y coordinate is greater, or the y coordinate is equal and the x coordinate is greater.

◆ squareDistance()

double TSLCoord::squareDistance ( const TSLCoord & anotherCoord) const
inline

Calculate the square distance between this coordinate and another.

Parameters
anotherCoordSource for calculation.
Returns
the square distance between the coordinates in TMC units.

◆ translate() [1/2]

void TSLCoord::translate ( const TSLCoord & delta)
inline

◆ translate() [2/2]

void TSLCoord::translate ( TSLTMC dx,
TSLTMC dy )
inline

Translates the coordinate by the specified delta values.

Parameters
dxDelta in X direction.
dyDelta in Y direction.

◆ validateTranslation()

bool TSLCoord::validateTranslation ( TSLTMC dx,
TSLTMC dy )
inline

◆ x() [1/2]

TSLTMC TSLCoord::x ( ) const
inline

Query the x value of the coordinate.

◆ x() [2/2]

void TSLCoord::x ( TSLTMC xcoord)
inline

Set the x value of the coordinate.

Parameters
xcoordNew value

◆ y() [1/2]

TSLTMC TSLCoord::y ( ) const
inline

Query the y value of the coordinate.

◆ y() [2/2]

void TSLCoord::y ( TSLTMC ycoord)
inline

Set the y value of the coordinate.

Parameters
ycoordNew value

Member Data Documentation

◆ m_x

TSLTMC TSLCoord::m_x

◆ m_y

TSLTMC TSLCoord::m_y