Exemplo n.º 1
0
int Mafenetre::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: afficherRes(); break;
        case 1: spin1Res((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: spin2Res((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: comboRes((*reinterpret_cast< QString(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
Exemplo n.º 2
0
int main(int argc, char *argv[])
{
    SDL_Init(SDL_INIT_VIDEO);
    TTF_Init();
    SDL_Surface* ecran = NULL, *ecranSurface = NULL;
    //SDL_Surface *ecran2;
    //ecran = SDL_CreateRGBSurface(0,700,700,32,0xff000000,0x00ff0000,0x0000ff00,0x000000ff);
    SDL_Rect origine;
    origine.x = 0;
    origine.y = 0;

    /*TTF_Font *police = NULL;
    SDL_Color couleurNoire = {0, 0, 0};
    police = TTF_OpenFont("annexes/Arial.ttf", 18);
    texte = TTF_RenderText_Blended(police, "Projet d'info !!!!!!!!!!!!!", couleurNoire);
    position.x = 10;
    position.y = 10;
    SDL_BlitSurface(texte, NULL, ecran, &position);*/

    ecranSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, 0, 0, 32, 0, 0, 0, 0); // On cre notre surface de dpart : un rectangle de taille nulle !
    int i;

    char * nomImages[NB_IMAGES] = { "M", "M1", "M2", "M3","M3b", "M4", "M5", "M6", "M7", "M7b" ,"M8", "M9", "M10", "M11", "M12", "M13", "M14", "T1", "T2", "T3", "RA", "RB", "RC", "RD", "RE", "Val"};
    /*char tmp[TAILLE_NOM] ="";
    SDL_Surface * tabImages[NB_IMAGES];
    for ( i = 0 ; i < NB_IMAGES ; i++ )
    {
    	strcat(tmp,CHEMIN);
    	strcat(tmp,nomImages[i]);
    	strcat(tmp,".png");
    	printf("%s\n",tmp);
    	tabImages[i] = IMG_Load(tmp);
    	strcpy(tmp,"");
    }

    for ( i = 0 ; i < NB_IMAGES ; i++ )
    {
    	//position.x=30*i%610;
    	//position.y=30*i/610;
    	position.x=30*i;
    	position.y=30*i;
    	SDL_BlitSurfaceSecure(tabImages[i], NULL, ecran, &position);
    }*/
    //tabImage[PIETON]

    int nbStation, numDep, numArr;
    char nomDep[TAILLE_NOM], nomArr[TAILLE_NOM];
    char nom[] =  "graphes/metro2012.csv";
    Station * plan = NULL;
    puts("lecture ...");
    plan = lecture(nom, &nbStation);

    ListeRes resultat = NULL;
    ListeChangement final = NULL;

    puts("Choix de la station de départ :");
    fgets(nomDep,TAILLE_NOM,stdin);
    nomDep[strlen(nomDep)-1]='\0';
    numDep = nomToNum(nomDep, plan, nbStation);

    viderBuffer();

    puts("Choix de la station d'arrivée :");
    fgets(nomArr,TAILLE_NOM,stdin);
    nomArr[strlen(nomArr)-1]='\0';
    numArr = nomToNum(nomArr, plan, nbStation);

    puts("aStar ...");
    resultat = aStar(numDep, numArr, plan);
    afficherRes(resultat);

    puts("Changement :");
    final = traitementAffichage(resultat);