ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/vct_arete.cpp
Revision: 743
Committed: Mon Oct 5 15:00:32 2015 UTC (9 years, 7 months ago) by francois
File size: 2096 byte(s)
Log Message:
Suppression des vecteurs nuls dans la vectorisation ca devient applicable pour une sphere complete

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 francois 743 if (V.est_nul_3d()) continue;
55     V.vecteur_norme_3d();
56 francois 283 if (V==VCT_NUL)
57     lst_vecteurs.insert(lst_vecteurs.end(),VCT_NUL);
58    
59 francois 363 //if (norm!=ZERO) {
60     // V=1./norm*V;
61     else lst_vecteurs.insert(lst_vecteurs.end(),V);
62    
63     // }
64 francois 283
65     }
66    
67     construire_forme_tensorielle();
68     }
69    
70     VCT_ARETE::VCT_ARETE(VCT_ARETE& mdd):VCT_ELEMENT_TOPOLOGIQUE(mdd.elem_topo)
71     {
72     }
73    
74    
75     VCT_ARETE::~ VCT_ARETE()
76     {
77    
78     }
79    
80