UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
u_bspl3_curve1d.hpp
1 /* u_bspl3_curve1d.hpp */
2 /* $Id$ */
3 #ifndef __u_bspl3_curve1d_hpp
4 #define __u_bspl3_curve1d_hpp
5 
6 #include <mth/u_curve1d.hpp>
7 #include <mth/u3d_bspl3_matrices.hpp>
8 #include <mth/u3d_bspl3_primitives.hpp>
9 
13 {
14 public:
15 
17  UBspl3Curve1d();
18 
22 
26  const std::vector<double> &ps);
27 
29  UBspl3Curve1d(const UBspl3Curve1d &obj);
30 
32  virtual ~UBspl3Curve1d();
33 
34 
37  void approximate(const U3dBspl3AbstractMatrix &bm,
38  const std::vector<double> &ps);
39 
41  void approximate(const std::vector<double> &ps);
42 
44  double operator()(double p) const;
45 
47  double getFirstDerivative(double p) const;
48 
50  double getSecondDerivative(double p) const;
51 
52 
54  bool ready() const
55  {return m_is_ready;}
56 
57 
60  U3dBspl3MatrixType getBMType() const;
61 
62 
65  virtual void addNode(double x, int id = -1);
66 
69  virtual bool removeNode(int id);
70 
71 
73  void info() const;
74 
75 
77  static void update_index (int &i, int m, int bm) {
78  if (i <= bm)
79  i = 0;
80  else if (i >= m + bm - 1)
81  i = m - 1;
82  else
83  i -= bm;
84  }
85 
87  static int get_bp_num(U3dBspl3MatrixType type);
88 
90  static void find_element(double p, int n, int &nn, double &pp);
91 
92 protected:
93 
95  std::vector<U3dSimpleBspl3Curve> m_bspls;
96 
99 
101  std::vector<double> m_ps;
102 
105 
107  void clear();
108 
111  void construct_segment(int id, int n, int bpnum, U3dSimpleBspl3Curve &curve);
112 };
113 
114 
115 #endif /* u_bspl3_curve1d.hpp */
std::vector< double > m_ps
Definition: u_bspl3_curve1d.hpp:101
Definition: u_bspl3_curve1d.hpp:12
U3dBspl3MatrixType getBMType() const
static int get_bp_num(U3dBspl3MatrixType type)
static void update_index(int &i, int m, int bm)
Definition: u_bspl3_curve1d.hpp:77
double getSecondDerivative(double p) const
static void find_element(double p, int n, int &nn, double &pp)
void info() const
std::vector< U3dSimpleBspl3Curve > m_bspls
Definition: u_bspl3_curve1d.hpp:95
Definition: u3d_bspl3_primitives.hpp:11
virtual ~UBspl3Curve1d()
void approximate(const U3dBspl3AbstractMatrix &bm, const std::vector< double > &ps)
void construct_segment(int id, int n, int bpnum, U3dSimpleBspl3Curve &curve)
double operator()(double p) const
bool m_is_ready
Definition: u_bspl3_curve1d.hpp:104
Definition: u3d_bspl3_matrices.hpp:24
virtual void addNode(double x, int id=-1)
double getFirstDerivative(double p) const
bool ready() const
Definition: u_bspl3_curve1d.hpp:54
U3dBspl3AbstractMatrix * m_bm
Definition: u_bspl3_curve1d.hpp:98
virtual bool removeNode(int id)