Added a EditorSocial.
[UnsignedByte.git] / src / Resource / Path.h
blob2250e07138f61ed11916ad814906c9014ae34c73
1 /***************************************************************************
2 * Copyright (C) 2007 by Daniel Brody *
3 * erasnode@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #pragma once
22 /**
23 * @file Path.h
24 * This file contains the Path class.
26 * @see Path
27 */
29 #include <vector>
31 #include "Coordinate.h"
33 class Path
35 public:
36 /**
37 * \brief Constructor
38 * \param from Starting point
39 * \param to Destination
41 Path(const Coordinate& from, const Coordinate& to);
43 /**
44 * \brief Destructor
46 ~Path() {};
48 /**
49 * \brief Getter
50 * \return Returns our start point
52 const Coordinate& getFrom() const;
54 /**
55 * \brief Getter
56 * \return Returns our destination
58 const Coordinate& getTo() const;
60 /**
61 * \brief Setter
62 * \param from Sets our start point
64 void setFrom(const Coordinate& from);
66 /**
67 * \brief Setter
68 * \param to Sets our destination
70 void setTo(const Coordinate& to);
72 /**
73 * \brief Gets the length of the largest component since all other components can be combined into the largest
74 * \return The largest component
76 long length() const; //returns distance between coords
78 /**
79 * \brief The direction one should travel in from 'from' to reach 'to'
80 * \return Unit coord for approx direction
82 const Coordinate& direction() const;
84 /**
85 * \brief Retreives the exact path between From to To.
86 * \return Set of exact directions
88 std::vector<Coordinate> route() const;
90 private:
91 Coordinate m_from; /**< The coordinate that defines the start point of this Path. */
92 Coordinate m_to; /**< The coordinate that defines the end point of this Path. */
94 long m_xcomponent; /**< The current x component of this Path. */
95 long m_ycomponent; /**< The current y component of this Path. */
96 long m_zcomponent; /**< The current z component of this Path. */
98 /**
99 * \brief Resets internal coordinates
101 void reset();