1 /***************************************************************************
2 * Copyright (C) 2007 by Daniel Brody *
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. *
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. *
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 ***************************************************************************/
24 * This file contains the Path class.
30 #include "Coordinate.h"
37 * \param from Starting point
38 * \param to Destination
40 Path(const Coordinate
& from
, const Coordinate
& to
);
49 * \return Returns our start point
51 const Coordinate
& getFrom() const;
55 * \return Returns our destination
57 const Coordinate
& getTo() const;
61 * \param from Sets our start point
63 void setFrom(const Coordinate
& from
);
67 * \param to Sets our destination
69 void setTo(const Coordinate
& to
);
72 * \brief Gets the length of the largest component since all other components can be combined into the largest
73 * \return The largest component
75 long length() const; //returns distance between coords
78 * \brief The direction one should travel in from 'from' to reach 'to'
79 * \return Unit coord for approx direction
81 const Coordinate
& direction() const;
84 * \brief Retreives the exact path between From to To.
85 * \return Set of exact directions
87 std::vector
<Coordinate
> route() const;
90 Coordinate m_from
; /**< The coordinate that defines the start point of this Path. */
91 Coordinate m_to
; /**< The coordinate that defines the end point of this Path. */
93 long m_xcomponent
; /**< The current x component of this Path. */
94 long m_ycomponent
; /**< The current y component of this Path. */
95 long m_zcomponent
; /**< The current z component of this Path. */
98 * \brief Resets internal coordinates