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 |
francois |
743 |
if (V.est_nul_3d()) continue; |
50 |
|
|
V.vecteur_norme_3d(); |
51 |
francois |
363 |
/* |
52 |
francois |
283 |
double2 norm_au_carre=(V[0]*V[0])+(V[1]*V[1])+(V[2]*V[2])+(V[3]*V[3]); |
53 |
|
|
double2 norm=norm_au_carre^0.5; |
54 |
francois |
363 |
*/ |
55 |
francois |
283 |
if (V==VCT_NUL) |
56 |
|
|
lst_vecteurs.insert(lst_vecteurs.end(),VCT_NUL); |
57 |
|
|
|
58 |
francois |
363 |
//if (norm!=ZERO) //{ |
59 |
|
|
// V=1./norm*V; |
60 |
|
|
else lst_vecteurs.insert(lst_vecteurs.end(),V); |
61 |
|
|
//} |
62 |
francois |
283 |
|
63 |
|
|
|
64 |
|
|
} |
65 |
|
|
construire_forme_tensorielle(); |
66 |
|
|
} |
67 |
|
|
|
68 |
|
|
|
69 |
|
|
VCT_COURBE::VCT_COURBE(VCT_COURBE& mdd):VCT_ELEMENT_GEOMETRIQUE(mdd.elem_geo) |
70 |
|
|
{ |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
|
74 |
|
|
VCT_COURBE::~VCT_COURBE() |
75 |
|
|
{ |
76 |
|
|
} |
77 |
|
|
|
78 |
|
|
|
79 |
|
|
|