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.
31 #include "Coordinate.h"
38 * \param from Starting point
39 * \param to Destination
41 Path(const Coordinate
& from
, const Coordinate
& to
);
50 * \return Returns our start point
52 const Coordinate
& getFrom() const;
56 * \return Returns our destination
58 const Coordinate
& getTo() const;
62 * \param from Sets our start point
64 void setFrom(const Coordinate
& from
);
68 * \param to Sets our destination
70 void setTo(const Coordinate
& to
);
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
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;
85 * \brief Retreives the exact path between From to To.
86 * \return Set of exact directions
88 std::vector
<Coordinate
> route() const;
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. */
99 * \brief Resets internal coordinates