ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/poly_occ/src/polycristal.cpp
(Generate patch)

Comparing poly_occ/src/polycristal.cpp (file contents):
Revision 979 by francois, Thu Oct 18 23:40:32 2018 UTC vs.
Revision 1007 by francois, Mon Mar 25 16:36:48 2019 UTC

# Line 4 | Line 4
4   #include "poly_point.h"
5  
6   #include <stdio.h>
7 #include <iostream>
7   #include <random>
8   #include <vector>
9  
10 < Polycristal::Polycristal(char* fichier)
10 > Polycristal::Polycristal(char* fichier,double dgval):POLY_AFFICHE(),nomfichier("resultat.brep"),dg(dgval)
11   {
12      FILE *input = fopen(fichier, "rt");
13      char chaine[500];
# Line 16 | Line 15 | Polycristal::Polycristal(char* fichier)
15      int nb_point, nTetra;
16      sscanf(chaine,"%d %d", &nb_point, &nTetra);
17  
19    std::vector<Poly_Point*> list_points;
18      
19      for (int i=0; i<nb_point; i++)
20      {
# Line 29 | Line 27 | Polycristal::Polycristal(char* fichier)
27      }
28      fclose(input);
29  
30 <    Poly_Voro* voro = new Poly_Voro(list_points);
31 <    voro->fusion_noeuds();
34 <    Poly_Build_OCC build_occ(voro);
30 >  
31 >  
32   }
33  
34  
35 < Polycristal::Polycristal(int nbParticules)
35 > Polycristal::Polycristal(std::vector<double> &listepoint,std::string nom,double dgval):POLY_AFFICHE(),nomfichier(nom),dg(dgval)
36   {
37 <  std::vector<Poly_Point*> list_points = random_particules(nbParticules);
38 <  Poly_Voro* voro = new Poly_Voro(list_points);
39 <  voro->fusion_noeuds();
40 <  Poly_Build_OCC build_occ(voro);
37 >    int nb_point=listepoint.size()/3.;
38 >    for (int i=0; i<nb_point; i++)
39 >    {
40 >      Poly_Point* pnt_xyz = new Poly_Point(listepoint[3*i],listepoint[3*i+1],listepoint[3*i+2]);
41 >      list_points.push_back(pnt_xyz);
42 >    }
43 >    
44 >
45 > }
46 >
47 > Polycristal::Polycristal(int nbParticules,double dgval):POLY_AFFICHE(),nomfichier("resultat.brep"),dg(dgval)
48 > {
49 >  list_points = random_particules(nbParticules);
50 >
51   }
52  
53 +
54 + void Polycristal::construit(bool avecstep)
55 + {
56 +  Poly_Voro voro(list_points,dg);
57 +  if (affichageactif) voro.active_affichage(affiche2);
58 +  voro.construit();
59 +  voro.fusion_noeuds();
60 +  Poly_Build_OCC build_occ(&voro,nomfichier);
61 + if (affichageactif)  build_occ.active_affichage(affiche2);
62 + build_occ.construit(avecstep);
63 + }
64 +
65 +
66 +
67 + Polycristal::Polycristal(Polycristal& mdd)
68 + {
69 + }
70 +
71 +
72   Polycristal::~Polycristal()
73   {
74   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines