CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
CGeom2DIPoint Class Reference

Geometry class used to represent 2D point objects with integer coordinates. More...

#include <2di_point.h>

Public Member Functions

 CGeom2DIPoint (void)
 Constructor with no parameters (the X and Y coordinates of the CGeom2DIPoint object are set to zero in an initialization list)
 
 CGeom2DIPoint (int const, int const)
 Constructor with two integer parameters, for the X and Y coordinates of the CGeom2DIPoint object.
 
int nGetX (void) const
 Returns the CGeom2DIPoint object's integer X coordinate.
 
int nGetY (void) const
 Returns the CGeom2DIPoint object's integer Y coordinate.
 
int * pnGetX ()
 Returns a reference to the CGeom2DIPoint object's integer X coordinate.
 
int * pnGetY ()
 Returns a reference to the CGeom2DIPoint object's integer Y coordinate.
 
void SetX (int const)
 The integer parameter sets a value for the CGeom2DIPoint object's X coordinate.
 
void SetY (int const)
 The integer parameter sets a value for the CGeom2DIPoint object's Y coordinate.
 
void SetXY (int const, int const)
 The two integer parameters set values for the CGeom2DIPoint object's X and Y coordinates.
 
void AddXAddY (int const, int const)
 The parameter is a pointer to a CGeom2DIPoint object, this is used to set values for the CGeom2DIPoint object's X and Y coordinates.
 
void AddXAddY (double const, double const)
 Adds the first double parameter (rounded) to the CGeom2DIPoint object's X coordinate, adds the second double parameter (rounded) to the CGeom2DIPoint object's Y coordinate.
 
void DivXDivY (double const, double const)
 Divides the CGeom2DIPoint object's X coordinate by the first double parameter (rounded), divides the CGeom2DIPoint object's Y coordinate by the second double parameter (rounded)
 
void operator= (CGeom2DIPoint const *)
 Sets one CGeom2DIPoint object to be the same as another.
 
bool operator== (CGeom2DIPoint const *) const
 Compares two CGeom2DIPoint objects for equality.
 
bool operator== (CGeom2DIPoint) const
 Compares two CGeom2DIPoint objects for equality.
 
bool operator!= (CGeom2DIPoint const *) const
 Compares two CGeom2DIPoint objects for inequality.
 
bool operator!= (CGeom2DIPoint) const
 Compares two CGeom2DIPoint objects for inequality.
 

Private Attributes

int nX
 The integer x coordinate.
 
int nY
 The integer y coordinate.
 

Detailed Description

Geometry class used to represent 2D point objects with integer coordinates.

The CGeom2DIPoint geometry class is used to represent 2D points where the x and y coordinates are integer values (e.g. for the raster grid coordinate reference system)

Author
David Favis-Mortlock
Andres Payo
Date
2025

Definition at line 28 of file 2di_point.h.

Constructor & Destructor Documentation

◆ CGeom2DIPoint() [1/2]

CGeom2DIPoint::CGeom2DIPoint ( void )

Constructor with no parameters (the X and Y coordinates of the CGeom2DIPoint object are set to zero in an initialization list)

Definition at line 28 of file 2di_point.cpp.

Referenced by operator!=(), operator!=(), operator=(), operator==(), and operator==().

◆ CGeom2DIPoint() [2/2]

CGeom2DIPoint::CGeom2DIPoint ( int const nNewX,
int const nNewY )

Constructor with two integer parameters, for the X and Y coordinates of the CGeom2DIPoint object.

Definition at line 35 of file 2di_point.cpp.

Member Function Documentation

◆ AddXAddY() [1/2]

void CGeom2DIPoint::AddXAddY ( double const dXToAdd,
double const dYToAdd )

Adds the first double parameter (rounded) to the CGeom2DIPoint object's X coordinate, adds the second double parameter (rounded) to the CGeom2DIPoint object's Y coordinate.

Definition at line 99 of file 2di_point.cpp.

◆ AddXAddY() [2/2]

void CGeom2DIPoint::AddXAddY ( int const nXToAdd,
int const nYToAdd )

The parameter is a pointer to a CGeom2DIPoint object, this is used to set values for the CGeom2DIPoint object's X and Y coordinates.

Adds the first integer parameter to the CGeom2DIPoint object's X coordinate, adds the second integer parameter to the CGeom2DIPoint object's Y coordinate

Definition at line 92 of file 2di_point.cpp.

Referenced by CSimulation::PtiPolygonCentroid().

◆ DivXDivY()

void CGeom2DIPoint::DivXDivY ( double const dXDiv,
double const dYDiv )

Divides the CGeom2DIPoint object's X coordinate by the first double parameter (rounded), divides the CGeom2DIPoint object's Y coordinate by the second double parameter (rounded)

Definition at line 106 of file 2di_point.cpp.

Referenced by CSimulation::PtiPolygonCentroid().

◆ nGetX()

int CGeom2DIPoint::nGetX ( void ) const

◆ nGetY()

int CGeom2DIPoint::nGetY ( void ) const

◆ operator!=() [1/2]

bool CGeom2DIPoint::operator!= ( CGeom2DIPoint const * pPti) const

Compares two CGeom2DIPoint objects for inequality.

Definition at line 146 of file 2di_point.cpp.

◆ operator!=() [2/2]

bool CGeom2DIPoint::operator!= ( CGeom2DIPoint Pti) const

Compares two CGeom2DIPoint objects for inequality.

Definition at line 155 of file 2di_point.cpp.

◆ operator=()

void CGeom2DIPoint::operator= ( CGeom2DIPoint const * pPti)

Sets one CGeom2DIPoint object to be the same as another.

Definition at line 121 of file 2di_point.cpp.

◆ operator==() [1/2]

bool CGeom2DIPoint::operator== ( CGeom2DIPoint const * pPti) const

Compares two CGeom2DIPoint objects for equality.

Definition at line 128 of file 2di_point.cpp.

◆ operator==() [2/2]

bool CGeom2DIPoint::operator== ( CGeom2DIPoint Pti) const

Compares two CGeom2DIPoint objects for equality.

Definition at line 137 of file 2di_point.cpp.

◆ pnGetX()

int * CGeom2DIPoint::pnGetX ( void )

Returns a reference to the CGeom2DIPoint object's integer X coordinate.

Definition at line 54 of file 2di_point.cpp.

Referenced by CSimulation::KeepWithinValidGrid().

◆ pnGetY()

int * CGeom2DIPoint::pnGetY ( void )

Returns a reference to the CGeom2DIPoint object's integer Y coordinate.

Definition at line 60 of file 2di_point.cpp.

Referenced by CSimulation::KeepWithinValidGrid().

◆ SetX()

void CGeom2DIPoint::SetX ( int const nNewX)

◆ SetXY()

void CGeom2DIPoint::SetXY ( int const nNewX,
int const nNewY )

The two integer parameters set values for the CGeom2DIPoint object's X and Y coordinates.

Definition at line 78 of file 2di_point.cpp.

Referenced by CSimulation::nGetCoastNormalEndPoint(), and CSimulation::PtiFindClosestCoastPoint().

◆ SetY()

void CGeom2DIPoint::SetY ( int const nNewY)

Field Documentation

◆ nX

int CGeom2DIPoint::nX
private

◆ nY

int CGeom2DIPoint::nY
private

The documentation for this class was generated from the following files: