main.c 898 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <a2ri/io.h>
  4. #include <a2ri/topology.h>
  5. int
  6. main(int argc, char* argv[])
  7. {
  8. vf_model m;
  9. if(argc!=2)
  10. {
  11. printf("usage: %s <fichier modele>\n",argv[0]);
  12. return EXIT_FAILURE;
  13. }
  14. a2ri_vf_init(&m);
  15. a2ri_vf_open_file(argv[1],&m);
  16. int *list=NULL,size=0;
  17. //printf("nombre de trou : %d\n",a2ri_vf_nb_hole(&m));
  18. printf("nombre de partie connexes : %d\n",a2ri_vf_nb_connected_part(&m,&list));
  19. free(list);
  20. list=NULL;
  21. for(int i=0;i<m.nbface;i++)
  22. {
  23. list_int_add(&list,&size,m.fa[i].ve1,WITHOUT_REDUNDANCE);
  24. list_int_add(&list,&size,m.fa[i].ve2,WITHOUT_REDUNDANCE);
  25. list_int_add(&list,&size,m.fa[i].ve3,WITHOUT_REDUNDANCE);
  26. }
  27. list_int_sort(list,size,ASC);
  28. printf("nombre de sommets isoles : %d\n",(list[size-1]-size)+1);
  29. free(list);
  30. a2ri_vf_free(&m);
  31. return EXIT_SUCCESS;
  32. }