OpenXcom  1.0
Open-source clone of the original X-Com
Public Member Functions | List of all members
OpenXcom::Polyline Class Reference

Represents a polyline in the world map. More...

#include <Polyline.h>

Public Member Functions

 Polyline (int points)
 Creates a polyline with a number of points. More...
 
 ~Polyline ()
 Cleans up the polyline. More...
 
void load (const YAML::Node &node)
 Loads the polyline from YAML. More...
 
double getLatitude (int i) const
 Gets the latitude of a point. More...
 
void setLatitude (int i, double lat)
 Sets the latitude of a point. More...
 
double getLongitude (int i) const
 Gets the longitude of a point. More...
 
void setLongitude (int i, double lon)
 Sets the longitude of a point. More...
 
int getPoints () const
 Gets the number of points of the polyline. More...
 

Detailed Description

Represents a polyline in the world map.

Polylines constitute the detail portions of the X-Com globe and typically represent borders and rivers.

Constructor & Destructor Documentation

◆ Polyline()

OpenXcom::Polyline::Polyline ( int  points)

Creates a polyline with a number of points.

Initializes the polyline with arrays to store each point's coordinates.

Parameters
pointsNumber of points.

◆ ~Polyline()

OpenXcom::Polyline::~Polyline ( )

Cleans up the polyline.

Deletes the arrays from memory.

Member Function Documentation

◆ getLatitude()

double OpenXcom::Polyline::getLatitude ( int  i) const

Gets the latitude of a point.

Returns the latitude (X) of a given point.

Parameters
iPoint number (0-max).
Returns
Point's latitude.

◆ getLongitude()

double OpenXcom::Polyline::getLongitude ( int  i) const

Gets the longitude of a point.

Returns the longitude (Y) of a given point.

Parameters
iPoint number (0-max).
Returns
Point's longitude.

◆ getPoints()

int OpenXcom::Polyline::getPoints ( ) const

Gets the number of points of the polyline.

Returns the number of points (vertexes) that make up the polyline.

Returns
Number of points.

◆ load()

void OpenXcom::Polyline::load ( const YAML::Node &  node)

Loads the polyline from YAML.

Loads the polyline from a YAML file.

Parameters
nodeYAML node.

◆ setLatitude()

void OpenXcom::Polyline::setLatitude ( int  i,
double  lat 
)

Sets the latitude of a point.

Changes the latitude of a given point.

Parameters
iPoint number (0-max).
latPoint's latitude.

◆ setLongitude()

void OpenXcom::Polyline::setLongitude ( int  i,
double  lon 
)

Sets the longitude of a point.

Changes the latitude of a given point.

Parameters
iPoint number (0-max).
lonPoint's longitude.

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