OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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...
 
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 textured land portions of the X-Com globe and typically have 3-4 points.

Constructor & Destructor Documentation

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.
OpenXcom::Polyline::~Polyline ( )

Cleans up the polyline.

Deletes the arrays from memory.

Member Function Documentation

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.
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.
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.
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.
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: