UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
u3d_bspl3_family.hpp
1 // u3d_bspl3_family.hpp
2 // $Id: u3d_bspl3_family.hpp,v 1.13 2007/08/22 10:13:58 guser1 Exp $
3 #ifndef U3D_BSPL3_FAMILY_
4 #define U3D_BSPL3_FAMILY_
5 
6 #include <vector>
7 #include <u3d_point.hpp>
8 
9 using namespace std;
10 
12 #define U3D_MATH_BSPL_PARAM_PREC 1.e-10
13 
14 //------------------------------------------------------------------------------------------
19 {
20 public:
21 
23  U3dBspl3AbstractMatrix(){m_is_constructed = false;};
24 
27 
30 
33  virtual double getB(int i, double t) const;
34 
36  virtual void info() const;
37 
39  bool isConstructed() const
40  {return m_is_constructed;}
41 
43  const double (&get() const)[4][4];
44 
45 protected:
46 
48  bool m_is_constructed;
49 
51  double m_bm[4][4];
52 };
53 
54 //------------------------------------------------------------------------------------------
57 {
58 public:
59 
61  U3dBspl3BetaMatrix(double beta1, double beta2);
62 
65 
67  virtual ~U3dBspl3BetaMatrix(){};
68 
69 protected:
70 
72  void reconstruct(double beta1, double beta2);
73 };
74 
75 //------------------------------------------------------------------------------------------
78 {
79 public:
80 
82  U3dBspl3CRomMatrix(double t);
83 
86 
88  virtual ~U3dBspl3CRomMatrix(){};
89 
90 protected:
91 
93  void reconstruct(double t);
94 };
95 
96 //------------------------------------------------------------------------------------------
99 {
100 public:
101 
104 
107 
109  virtual ~U3dBspl3BSMatrix(){};
110 
111 protected:
112 
114  void reconstruct();
115 };
116 
117 //------------------------------------------------------------------------------------------
120 {
121 public:
122 
125 
128 
131 
132 protected:
133 
135  void reconstruct();
136 };
137 
138 
139 //------------------------------------------------------------------------------------------
142 {
143 public:
144 
148  U3dSimpleBspl3Curve(const U3dBspl3AbstractMatrix *bm, const double (&cp)[4]);
149 
151  virtual ~U3dSimpleBspl3Curve(){};
152 
154  double get(double p) const;
155 
157  double getSp(double p) const;
158 
160  double getSpp(double p) const;
161 
163  void getCoeffs(double (&c)[4]) const {
164  c[0] = m_rv[0];
165  c[1] = m_rv[1];
166  c[2] = m_rv[2];
167  c[3] = m_rv[3];
168  }
169 
171  double getLineDeviation(double k, double b, double p);
172 
173 protected:
174 
176  const U3dBspl3AbstractMatrix *m_bm;
177 
179  double m_rv[4];
180 
181 private:
182 
184  void cp2rv(const U3dBspl3AbstractMatrix *bm, const double (&cp)[4]);
185 };
186 
188 typedef vector<U3dSimpleBspl3Curve*> U3dSimpleBspl3CurveAr;
189 
190 //------------------------------------------------------------------------------------------
194 {
195 public:
196 
200  U3dSimpleBspl3Surface(const U3dBspl3AbstractMatrix *bm, const double (&cp)[4][4]);
201 
204 
206  double get(double p, double q) const;
207 
209  double getSp(double p, double q) const;
210 
212  double getSq(double p, double q) const;
213 
215  double getSpp(double p, double q) const;
216 
218  double getSqq(double p, double q) const;
219 
221  double getSpq(double p, double q) const;
222 
223 protected:
224 
226  const U3dBspl3AbstractMatrix *m_bm;
227 
229  double m_rm[4][4];
230 
232  double calc(double *pp, double *qq) const;
233 
234 private:
235 
237  void cp2rm(const U3dBspl3AbstractMatrix *bm, const double (&cp)[4][4]);
238 };
239 
240 
241 //------------------------------------------------------------------------------------------
245 {
246 public:
247 
251  U3dSimpleBspl3Surf3d(const U3dBspl3AbstractMatrix *bm, const double (&cp)[4][4][4]);
252 
255 
257  double get(double p, double q, double r) const;
258 
259 protected:
260 
262  double m_rt[4][4][4];
263 
265  const U3dBspl3AbstractMatrix *m_bm;
266 
268  void make_tensor(const U3dBspl3AbstractMatrix *bm, const double (&cp)[4][4][4]);
269 
271  double calc(double *pp, double *qq, double *rr) const;
272 };
273 
274 
275 //------------------------------------------------------------------------------------------
279 {
280 public:
282  U3dBspl3Curve (const U3dBspl3AbstractMatrix *bm, const std::vector<double> &ps);
283 
285  virtual ~U3dBspl3Curve();
286 
288  double get(double p) const;
289 
290 protected:
291 
293  U3dSimpleBspl3CurveAr m_spline;
294 
297 
298 private:
299 
301  bool ips2spline(const U3dBspl3AbstractMatrix *bm, const std::vector<double> &ps);
302 };
303 
304 #endif /*U3D_BSPL3_FAMILY_*/
virtual ~U3dBspl3AbstractMatrix()
Definition: u3d_bspl3_family.hpp:29
Definition: u3d_bspl3_primitives.hpp:117
U3dBspl3AbstractMatrix()
Definition: u3d_bspl3_family.hpp:23
bool isConstructed() const
Definition: u3d_bspl3_family.hpp:39
U3dSimpleBspl3CurveAr m_spline
Definition: u3d_bspl3_family.hpp:293
void getCoeffs(double(&c)[4]) const
Definition: u3d_bspl3_family.hpp:163
Definition: u3d_bspl3_matrices.hpp:131
virtual ~U3dSimpleBspl3Surface()
Definition: u3d_bspl3_family.hpp:203
Definition: u3d_bspl3_primitives.hpp:11
virtual ~U3dBspl3CRomMatrix()
Definition: u3d_bspl3_family.hpp:88
Definition: u3d_bspl3_family.hpp:278
virtual ~U3dSimpleBspl3Surf3d()
Definition: u3d_bspl3_family.hpp:254
Definition: u3d_bspl3_matrices.hpp:24
Definition: u3d_bspl3_primitives.hpp:66
virtual ~U3dBspl3BSMatrix()
Definition: u3d_bspl3_family.hpp:109
Definition: u3d_bspl3_matrices.hpp:110
virtual ~U3dSimpleBspl3Curve()
Definition: u3d_bspl3_family.hpp:151
virtual ~U3dBspl3BetaMatrix()
Definition: u3d_bspl3_family.hpp:67
Definition: u3d_bspl3_family.hpp:119
bool m_is_interpolated
Definition: u3d_bspl3_family.hpp:296
virtual ~U3dBspl3BezierMatrix()
Definition: u3d_bspl3_family.hpp:130
Definition: u3d_bspl3_matrices.hpp:153