![]() |
OpenXcom
1.0
Open-source clone of the original X-Com
|
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... | |
Represents a polyline in the world map.
Polylines constitute the detail portions of the X-Com globe and typically represent borders and rivers.
| OpenXcom::Polyline::Polyline | ( | int | points | ) |
Creates a polyline with a number of points.
Initializes the polyline with arrays to store each point's coordinates.
| points | Number of points. |
| OpenXcom::Polyline::~Polyline | ( | ) |
Cleans up the polyline.
Deletes the arrays from memory.
| double OpenXcom::Polyline::getLatitude | ( | int | i | ) | const |
Gets the latitude of a point.
Returns the latitude (X) of a given point.
| i | Point number (0-max). |
| double OpenXcom::Polyline::getLongitude | ( | int | i | ) | const |
Gets the longitude of a point.
Returns the longitude (Y) of a given point.
| i | Point number (0-max). |
| int OpenXcom::Polyline::getPoints | ( | ) | const |
Gets the number of points of the polyline.
Returns the number of points (vertexes) that make up the polyline.
| void OpenXcom::Polyline::load | ( | const YAML::Node & | node | ) |
Loads the polyline from YAML.
Loads the polyline from a YAML file.
| node | YAML node. |
| void OpenXcom::Polyline::setLatitude | ( | int | i, |
| double | lat | ||
| ) |
Sets the latitude of a point.
Changes the latitude of a given point.
| i | Point number (0-max). |
| lat | Point's latitude. |
| void OpenXcom::Polyline::setLongitude | ( | int | i, |
| double | lon | ||
| ) |
Sets the longitude of a point.
Changes the latitude of a given point.
| i | Point number (0-max). |
| lon | Point's longitude. |
1.8.14