float bassin(vec3 p) { //sol avec un trou float v = cylindre(p, vec3(0,-5,0), vec3(0,-3,0), 10.0,1.0,1.0); v = Difference(v, cylindre(p, vec3(0,-4,0), vec3(0,-3,0), 5.0,1.0,1.0)); //vague dans le trou v = Blend(v, vague(warp(vec3(p)), vec3(0,-3.5,0), 5.5, 0.15, 0.15,1.0,1.0)); //piliers v = Union(v, colonne(p, vec3(8,-1.8,0), vec3(8,3.0,0), 0.5, 1.0, 0.6)); v = Union(v, colonne(p, vec3(0,-1.8,8), vec3(0,3.0,8), 0.5, 1.0, 0.6)); v = Union(v, colonne(p, vec3(-8,-1.8,0), vec3(-8,3.0,0), 0.5, 1.0, 0.6)); v = Union(v, colonne(p, vec3(0,-1.8,-8), vec3(0,3.0,-8), 0.5, 1.0, 0.6)); //toit v = Union(v, cylindre(p, vec3(0,4.2,0), vec3(0,5,0), 10.0,1.0,1.0)); return v; }
Dependancies* dependances(Set_Of_Attrs* agree, Line_data* tab_data, int nb_lignes, int nb_colonnes) { Dependancies* dump = NULL; Dependancies* temp_dep; Dependancies* param; Set_Of_Attrs* courant_agree = agree; Chaine* courant_chaine; Entier* temp_tuple; Entier* tuples; Couples* couples = NULL; Couples* courant_couple; Chaine* determinant; Chaine* soumis; while (courant_agree != NULL) { courant_chaine = courant_agree->attributs; if (taille_chaine(courant_chaine) >= 2) { tuples = NULL; while (courant_chaine != NULL) { temp_tuple = (Entier*)malloc(sizeof(Entier)); temp_tuple->val = colonne(courant_chaine->attribut, tab_data, nb_colonnes); temp_tuple->suiv = NULL; tuples = append_tuple(tuples, temp_tuple); courant_chaine = courant_chaine->suiv; } couples = getCouplesCombinaisons(tuples); courant_couple = couples; // Pour les dépendances fonctionnelles élémentaires while (courant_couple != NULL) { if (dependanceFonctionnelle(courant_couple->cpl[0], courant_couple->cpl[1], tab_data, nb_lignes) ) { determinant = (Chaine*)malloc(sizeof(Chaine)); determinant->attribut = (char*)malloc(sizeof(char)*NMAX); strcpy( determinant->attribut, attribut(courant_couple->cpl[0], tab_data)); determinant->suiv = NULL; soumis = (Chaine*)malloc(sizeof(Chaine)); soumis->attribut = (char*)malloc(sizeof(char)*NMAX); strcpy( soumis->attribut, attribut(courant_couple->cpl[1], tab_data)); soumis->suiv = NULL; temp_dep = createCellDependance(determinant, soumis); dump = appendDependance(dump, temp_dep); } if (dependanceFonctionnelle(courant_couple->cpl[1], courant_couple->cpl[0], tab_data, nb_lignes) ) { determinant = (Chaine*)malloc(sizeof(Chaine)); determinant->attribut = (char*)malloc(sizeof(char)*NMAX); strcpy( determinant->attribut, attribut(courant_couple->cpl[1], tab_data)); determinant->suiv = NULL; soumis = (Chaine*)malloc(sizeof(Chaine)); soumis->attribut = (char*)malloc(sizeof(char)*NMAX); strcpy( soumis->attribut, attribut(courant_couple->cpl[0], tab_data)); soumis->suiv = NULL; temp_dep = createCellDependance(determinant, soumis); dump = appendDependance(dump, temp_dep); } courant_couple = courant_couple->suiv; } } courant_agree = courant_agree->suiv; } return dump; }