ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/vct_arete.cpp
Revision: 363
Committed: Thu Oct 18 22:12:03 2012 UTC (12 years, 6 months ago) by francois
File size: 2067 byte(s)
Log Message:
Mise a jour pour publi sur la comparaison

File Contents

# User Rev Content
1 francois 283 //---------------------------------------------------------------------------
2     #include "gestionversion.h"
3     //---------------------------------------------------------------------------
4    
5    
6     #pragma hdrstop
7     #include "vct_arete.h"
8     #include "vct_courbe.h"
9     #include "mg_courbe.h"
10     #include "mg_arete.h"
11     #include <iomanip>
12     #include<math.h>
13     #include "ot_mathematique.h"
14     //---------------------------------------------------------------------------
15    
16     #pragma package(smart_init)
17    
18    
19    
20     VCT_ARETE::VCT_ARETE(MG_ARETE* arete):VCT_ELEMENT_TOPOLOGIQUE(arete)
21     {
22     double2 ZERO=0.;
23     int indx_premier_ptctr;
24     OT_VECTEUR_4DD V1,V2,V;
25    
26     TPL_LISTE_ENTITE<double> nurbs_params;
27     arete->get_param_NURBS(indx_premier_ptctr,nurbs_params);
28     int nb_points=1/4.*(nurbs_params.get_nb()-indx_premier_ptctr);
29    
30     OT_VECTEUR_4DD VCT_NUL(0.,0.,0.,0.);
31    
32     for (int s=0;s<nb_points-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    
39     if (s==0)
40     lst_points.insert(lst_points.end(),V1);
41    
42     V2[0]=nurbs_params.get(indx_premier_ptctr+ 4 * (s + 1));
43     V2[1]=nurbs_params.get(indx_premier_ptctr+ 4 * (s + 1) + 1);
44     V2[2]=nurbs_params.get(indx_premier_ptctr+ 4 * (s + 1) + 2);
45     V2[3]=nurbs_params.get(indx_premier_ptctr+ 4 * (s + 1) + 3);
46    
47     lst_points.insert(lst_points.end(),V2);
48    
49     V=V2-V1;
50 francois 363 /*
51 francois 283 double2 norm_au_carre=(V[0]*V[0])+(V[1]*V[1])+(V[2]*V[2])+(V[3]*V[3]);
52     double2 norm=norm_au_carre^0.5;
53 francois 363 */
54     V=V.vecteur_norme_3d();
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     // }
63 francois 283
64     }
65    
66     construire_forme_tensorielle();
67     }
68    
69     VCT_ARETE::VCT_ARETE(VCT_ARETE& mdd):VCT_ELEMENT_TOPOLOGIQUE(mdd.elem_topo)
70     {
71     }
72    
73    
74     VCT_ARETE::~ VCT_ARETE()
75     {
76    
77     }
78    
79