00001 //$Header: /home/ben/Mapper/include/RCS/curve.h,v 6.6 2002/07/14 17:08:52 ben Exp $
00002 #ifndef CURVE_H
00003 #define CURVE_H
00004 // Copyright Benedict Adamson 2002.
00005 // This file is part of Mapper.
00006
00007 // Mapper is free software; you can redistribute it and/or modify
00008 // it under the terms of the GNU General Public License as published by
00009 // the Free Software Foundation; either version 2 of the License, or
00010 // (at your option) any later version.
00011
00012 // Mapper is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015 // GNU General Public License for more details.
00016
00017 // You should have received a copy of the GNU General Public License
00018 // along with Mapper; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00030 #include <vector>
00031
00032
00033
00034 #include "vector2.h"
00035
00036
00037
00043 class curve
00044 {
00045 public: //Constructors and destructors.
00046
00050 curve(void);
00051
00052 virtual ~curve(void);
00053
00054 public: //Attributes
00055
00080 void shape(
00081 const double t,
00082 vector< double > &s, //output
00083 vector< double > &dsdt //output
00084 ) const;
00085
00104 vector<double> shape(
00105 const double t
00106 ) const;
00107
00126 void position(
00127 const double t,
00128 vector2 &p,
00129 vector2 &dpdt
00130 ) const;
00131
00150 vector2 position(
00151 const double t
00152 ) const;
00153
00154 public: //Relationships
00155
00160 vector< vector2 * > param;
00161
00162 public: //Messages
00163
00164 private: //State
00165
00166 };
00167
00168
00169
00216 void nearest_point(
00217 const curve &cu,
00218 const vector2 &p,
00219 const double tol,
00220 const unsigned max_iter,
00221 double &t, //output
00222 double &d2, //output
00223 unsigned &iter //output
00224 );
00225
00226
00227
00228 #endif