00001 /* 00002 ** Curve_3D.h 00003 ** 00004 ** Made by damien 00005 ** Login <damien@ortie.inrialpes.fr> 00006 ** 00007 ** Started on Wed Mar 26 16:22:43 2008 damien 00008 ** Last update Wed Mar 26 16:22:43 2008 damien 00009 */ 00010 00011 #ifndef CURVE_3D_H_ 00012 # define CURVE_3D_H_ 00013 00014 #include <stdlib.h> 00015 #include <iostream> 00016 #include <cmath> 00017 #include <string> 00018 #include <errno.h> 00019 #include <stdio.h> 00020 #include <vector> 00021 using namespace std; 00022 00023 #include <V_3D.h> 00024 00025 00026 class Curve_3D 00027 { 00028 public: 00029 Curve_3D(); 00030 Curve_3D(const Curve_3D& _curve); 00031 ~Curve_3D(); 00032 00033 int add_point(const V_3D& point); 00034 int add(const V_3D& point); 00035 int add(const Curve_3D& _curve); 00036 00038 int add_first(const V_3D& point); 00039 00040 int size() const; 00041 int destroy(); 00042 00043 V_3D& get(int k_index); 00044 V_3D get(int k_index) const; 00045 V_3D& operator[](int k_index); 00046 V_3D operator[](int k_index) const; 00047 00049 int set(const std::vector <V_3D>& _curve); 00051 int set(const std::vector <double>& _curve); 00052 00053 double length() const; 00054 00055 Curve_3D& operator=(const Curve_3D&); 00056 Curve_3D& operator=(const std::vector <V_3D>&); 00057 00058 int resample_closed(int N); 00059 int resample(int N); 00060 00061 std::vector <V_3D> get_diff_closed_curve() const; 00062 std::vector <V_3D> get_diff2_closed_curve() const; 00063 std::vector <double> get_curvature_closed_curve() const; 00064 00065 std::vector <V_3D>& to_vector(); 00066 const std::vector <V_3D>& to_vector() const; 00067 00069 Curve_3D part(int k_0,int k_1) const; 00071 Curve_3D part_closed(int k_0,int k_1) const; 00072 00074 Curve_3D resample_part_closed(int k_0,int k_1,int N); 00075 00077 int load_curve(const char* filename); 00079 int save_curve(const char* filename) const; 00080 00081 00083 friend bool operator==(const Curve_3D&, const Curve_3D& ); 00085 friend bool operator!=(const Curve_3D&, const Curve_3D& ); 00086 00087 private: 00088 00089 std::vector <V_3D> data; 00090 00091 }; 00092 00093 00094 #endif /* !CURVE_3D_H_ */
1.5.6