Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxLocalInterpol.h

00001 /*
00002  *  Copyright (c) 1998, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Silvia D. Olabarriaga  (silvia@wins.uva.nl)
00008  *  Dennis Koelma (koelma@wins.uva.nl)
00009  */
00010 
00011 #ifndef HxLocalInterpol_h
00012 #define HxLocalInterpol_h
00013 
00014 
00015 #include "HxIoFwd.h"
00016 #include "HxPointSetR2.h"
00017 #include "HxVectorR2.h"
00018 
00019 #include <utility>
00020 using std::pair;
00021 
00022 #include <vector>
00023 using std::vector;
00024 
00025 typedef pair<HxPointR2, HxPointR2> _TwoPoints;
00026 
00027 
00036 class HxLocalInterpol {
00037 public:
00039                         HxLocalInterpol();
00040 
00044                         HxLocalInterpol(int degree,
00045                                         const HxPointSetR2& inputData,
00046                                         int closed=0);
00047 
00049                         ~HxLocalInterpol();
00050 
00051 
00053     HxPointSetR2        allP() const;
00054 
00056     int                 numP() const;
00057 
00059     vector<double>      allKnots() const;
00060 
00062     int                 numKnots() const;
00063 
00064 
00065     STD_OSTREAM&        dump(ostream&) const;
00066 
00067 private:
00068     HxPointSetR2        _points;    // control points
00069     HxPointSetR2        _data;      // given data
00070     vector<double>      _knots;     // knots vector
00071     int                 _n;         // max index in data points (see book)
00072     int                 _degree;
00073     int                 _closed;    // curve type
00074 
00075     void                makeDefault();
00076     void                message( charPtr msg=0 ) const;
00077 
00078     void                _initOpen();
00079     void                _initClosed();
00080     int                 _kInc( int k ) const;
00081     int                 _kDec( int k ) const;
00082     _TwoPoints          _calcP(int k) const;
00083     double              _speed( HxPointR2, HxPointR2,
00084                                 HxVectorR2, HxVectorR2) const;
00085     HxVectorR2          _tangent(int k) const;
00086     double              _linearInterp(int k) const;
00087     HxVectorR2          _q(int k) const;
00088 };
00089 
00090 
00091 inline STD_OSTREAM&
00092 operator<<(STD_OSTREAM& os, const HxLocalInterpol& b)
00093 {
00094     return b.dump(os);
00095 }
00096 
00097 inline HxPointSetR2
00098 HxLocalInterpol::allP() const
00099 {
00100     return _points;
00101 }
00102 
00103 inline int
00104 HxLocalInterpol::numP() const
00105 {
00106     return _points.size();
00107 }
00108 
00109 inline vector<double>
00110 HxLocalInterpol::allKnots() const
00111 {
00112     return _knots;
00113 }
00114 
00115 inline int
00116 HxLocalInterpol::numKnots() const
00117 {
00118     return _knots.size();
00119 }
00120 
00121 
00122 #endif

Generated on Tue Feb 3 14:18:39 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001