1 |
francois |
283 |
#include "gestionversion.h" |
2 |
|
|
|
3 |
|
|
//--------------------------------------------------------------------------- |
4 |
|
|
|
5 |
|
|
|
6 |
|
|
#pragma hdrstop |
7 |
|
|
#include<math.h> |
8 |
|
|
#include "vct_courbe.h" |
9 |
|
|
#include "mg_courbe.h" |
10 |
|
|
#include "mg_arete.h" |
11 |
|
|
#include <iomanip> |
12 |
|
|
//--------------------------------------------------------------------------- |
13 |
|
|
|
14 |
|
|
#pragma package(smart_init) |
15 |
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
VCT_COURBE::VCT_COURBE(MG_COURBE* elemgeo):VCT_ELEMENT_GEOMETRIQUE(elemgeo) |
19 |
|
|
{ |
20 |
|
|
int indx_premier_ptctr; |
21 |
|
|
OT_VECTEUR_4DD V1,V2,V; |
22 |
|
|
TPL_LISTE_ENTITE<double> nurbs_params; |
23 |
|
|
elem_geo->get_param_NURBS(indx_premier_ptctr,nurbs_params); |
24 |
|
|
int nb_points=1/4.*(nurbs_params.get_nb()-indx_premier_ptctr); |
25 |
|
|
double2 ZERO=0.; |
26 |
|
|
OT_VECTEUR_4DD VCT_NUL(0.,0.,0.,0.); |
27 |
|
|
|
28 |
|
|
|
29 |
|
|
int nb_u=nurbs_params.get(3); |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
for (int s=0;s<nb_u-1;s++) |
33 |
|
|
{ |
34 |
|
|
V1[0]=nurbs_params.get(indx_premier_ptctr+ 4 * s); |
35 |
|
|
V1[1]=nurbs_params.get(indx_premier_ptctr+ 4 * s + 1); |
36 |
|
|
V1[2]=nurbs_params.get(indx_premier_ptctr+ 4 * s + 2); |
37 |
|
|
V1[3]=nurbs_params.get(indx_premier_ptctr+ 4 * s + 3); |
38 |
|
|
if (s==0) |
39 |
|
|
lst_points.insert(lst_points.end(),V1); |
40 |
|
|
|
41 |
|
|
V2[0]=nurbs_params.get(indx_premier_ptctr+ 4 * (s + 1)); |
42 |
|
|
V2[1]=nurbs_params.get(indx_premier_ptctr+ 4 * (s + 1) + 1); |
43 |
|
|
V2[2]=nurbs_params.get(indx_premier_ptctr+ 4 * (s + 1) + 2); |
44 |
|
|
V2[3]=nurbs_params.get(indx_premier_ptctr+ 4 * (s + 1) + 3); |
45 |
|
|
|
46 |
|
|
lst_points.insert(lst_points.end(),V2); |
47 |
|
|
|
48 |
|
|
V=V2-V1; |
49 |
|
|
|
50 |
|
|
double2 norm_au_carre=(V[0]*V[0])+(V[1]*V[1])+(V[2]*V[2])+(V[3]*V[3]); |
51 |
|
|
double2 norm=norm_au_carre^0.5; |
52 |
|
|
|
53 |
|
|
if (V==VCT_NUL) |
54 |
|
|
lst_vecteurs.insert(lst_vecteurs.end(),VCT_NUL); |
55 |
|
|
|
56 |
|
|
if (norm!=ZERO) { |
57 |
|
|
V=1./norm*V; |
58 |
|
|
lst_vecteurs.insert(lst_vecteurs.end(),V); |
59 |
|
|
} |
60 |
|
|
|
61 |
|
|
|
62 |
|
|
} |
63 |
|
|
construire_forme_tensorielle(); |
64 |
|
|
} |
65 |
|
|
|
66 |
|
|
|
67 |
|
|
VCT_COURBE::VCT_COURBE(VCT_COURBE& mdd):VCT_ELEMENT_GEOMETRIQUE(mdd.elem_geo) |
68 |
|
|
{ |
69 |
|
|
} |
70 |
|
|
|
71 |
|
|
|
72 |
|
|
VCT_COURBE::~VCT_COURBE() |
73 |
|
|
{ |
74 |
|
|
} |
75 |
|
|
|
76 |
|
|
|
77 |
|
|
|