/*************************************************************************************************************************************/ /* */ /* C O N S T R U C T I O N D E L ' E S C A L I E R I N F E R N A L */ /* A L ' A I D E D ' U N E S T R U C T U R E P A R A D O X A L E : */ /* */ /* */ /* */ /* 72******77*****63 */ /* * ** */ /* * * 64******77******63 */ /* * * * ** */ /* * * * * * */ /* * * * * * */ /* * * * * 76 */ /* * * 61****74 * * */ /* * * * * * * */ /* * * * * * * */ /* * 61**66 * * 75 */ /* * * * * * */ /* * 65*****66 * * * */ /* 78 ** * * * */ /* * * * * * * */ /* * * 64*********67 78 * */ /* * * * * * * */ /* * 71*68**63 * * * */ /* * ** * * 78 */ /* * * * * * * */ /* * * 64**79 * * */ /* * * * * * */ /* * * * * * */ /* * * * * * */ /* * * * * * */ /* * * 61*****77*****62 * */ /* * * * * * */ /* * 61**66 * * */ /* * * 76 * */ /* Depart -> 61*******77********66 * * */ /* * * * */ /* * ** */ /* 73*****************77******************69 */ /* */ /* */ /* */ /* Author of '$xri/escalier.11$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 20110429165718). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* I N T E R F A C E ' listG ' : */ /* */ /* */ /* :Debut_listG: */ /* :Fin_listG: */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D I R E C T I V E S S P E C I F I Q U E S D E C O M P I L A T I O N : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* F I C H I E R S D ' I N C L U D E S : */ /* */ /*************************************************************************************************************************************/ #include INCLUDES_BASE #include image_image_CONTOURS_EXT /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #define LOCALISER_A_L_ORIGINE \ FAUX \ /* Faut-il localiser l'escalier a l'origine (indicateur introduit le 20110420165648) ? */ #define ANTI_ALIASING \ VRAI \ /* Faut-il faire de l'anti-aliasing ('VRAI') ou pas ('FAUX') ? Cela fut introduit le */ \ /* 20110501164510... */ #define ECHELLE_K \ DEUX #define ECHELLE_X \ NEUF #define ECHELLE_Y \ NEUF /* Definition des echelles (introduites le 20110429092239). */ #define EPAISSEUR \ UN \ /* Nombre d'epaississement des contours. */ #define COLOR_C \ BLANC \ /* Couleur des contours, */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ #define gC \ gA \ /* Afin de laisser en place les 'gB's remplaces par des 'gC's neutres... */ #define BEGIN_SEQUENCE_1 \ Bblock \ CALS(FgMIK()); \ EGAL(vecteurs_____scale_globale,DIVI(vecteurs_____scale_globale,FLOT(TAILLE_DU_PAVE_DES_ELEMENTS_PARADOXAUX))); \ /* Les motifs de type impossible sont inscrits dans une matrice 6x6 et debutent dans le */ \ /* coin bas-gauche... */ \ Eblock #define END_SEQUENCE_1 \ Bblock \ CALS(FgMOK()); \ Eblock #define BEGIN_SEQUENCE_2 \ Bblock \ CALS(FgMIC()); \ BEGIN_SEQUENCE_1; \ Eblock #define END_SEQUENCE_2 \ Bblock \ END_SEQUENCE_1; \ CALS(FgMOC()); \ Eblock #define SEQUENCE_61 \ Bblock \ BEGIN_SEQUENCE_2; \ g1;g1;gA;g2;g2;g2;gB;g1;g1;g1;g1;gB;g4;gA;g3;g3;g3;gB;g4;g4;gB; \ g1;gA;g2;g2;gB;g3;g3;g2;gA;g1;g1;g1;g1;g2;g2;g2;g2;gB; \ g4;gA;g3;g3;g4;g4;gB;g1;g1;gB;g3;gA;g1;g1;g2;g2;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_62 \ Bblock \ BEGIN_SEQUENCE_2; \ g1;g1;gA;g2;g2;gB;g3;g3;gB;g2;gA;g1;g1;g1;gB;g1;g1;g1;g2;g2;g2;gB; \ g2;gA;g3;g3;g3;g4;g4;g4;gB;g3;g3;g3;gB; \ g4;g4;g4;g4;g1;g1;g1;gA;g2;g2;g2;gB;g1;g4;g4;g4;gA;g2;g2;g2;gB;g1;g1;g1;g2;g2;g2;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_63 \ Bblock \ BEGIN_SEQUENCE_2; \ gA;g1;g1;g1;g1;g2;g2;g2;g2;gB;g3;g3;g3;g3;gB;g4;gA;g1;g1;gB; \ g3;g3;g3;g4;g4;g4;gB;g1;g2;g2;gA;g1;gB;g4;g4;g4;g3;gA;g1;g1;g1;g2;g2;g2;gB; \ g4;g4;gB;g3;gA;g2;gB;g1;g1;g4;gA;g2;g2;g2;g2;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_64 \ Bblock \ BEGIN_SEQUENCE_2; \ gA;g1;g1;g1;g2;g2;g2;gB;g3;gB;g3;g3;g3;g4;g4;g4;gB; \ g1;g4;gA;g1;g1;g1;g2;g2;g2;gB;g2;g2;g2;g2;gB;g3;gA;g4;g4;g4;gB; \ g1;gA;g1;g1;g1;gB;g4;gA;g3;g3;g3;gB;g2;gA;g1;g2;gB;g1;g1;gB;g3;g3;gA;g2;g2; \ g2;g2;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_65 \ Bblock \ BEGIN_SEQUENCE_2; \ gA;g1;g1;g1;g2;g2;g2;gB;g4;g4;g4;gB;g3;gA;g2;gB; \ g1;g2;gA;g3;g3;g3;g4;g4;g4;gB;g3;g2;gA;g1;g1;g1;g1;g2;g2;g2;g2;gB; \ g1;g1;g1;gB;g4;gA;g3;g3;g3;gB;g4;gA;g1;g1;g1;gB;g3;g3;gA;g4;g4;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_66 \ Bblock \ BEGIN_SEQUENCE_2; \ g2;g2;gA;g1;g1;g1;g1;gB;g2;g2;g2;g2;gB;g3;gA;g4;g4;g4;gB; \ g3;g3;g3;gB;g2;gA;g1;g1;gB;g1;g4;gB;g3;g2;gA;g2;g2;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_67 \ Bbl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2;gA;g1;g1;g1;g1;g2;g2;g2;g2;gB; \ g1;g1;g1;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_73 \ Bblock \ BEGIN_SEQUENCE_2; \ g1;g1;g2;g2;gA;g1;g1;g1;g1;gB;g3;g3;g3;g3;gA;g2;g2;g2;g2;gB; \ g1;gA;g4;g4;g4;gB;g1;g1;g1;gB;g2;gA;g3;g3;gB;g2;g2;gB;g4;g4;gA;g3;g4;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_74 \ Bblock \ BEGIN_SEQUENCE_2; \ gA;g1;g1;g1;g1;g2;g2;g2;g2;gB;g4;gB;g3;g3;g3;g3;g4;g4;g4;g4;gB; \ g3;g2;gA;g1;g1;g1;g2;g2;g2;gB;g3;g3;gB;g4;gA;g1;gB; \ g3;g2;g2;gA;g1;g1;g1;g1;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_75 \ Bblock \ BEGIN_SEQUENCE_2; \ gA;g1;g1;g1;g2;g2;g2;gB;g3;gB;g3;g3;g3;g4;g4;g4;gB; \ g1;g4;gA;g1;g1;g1;g1;g2;g2;g2;g2;gB;g2;g2;g2;gB;g3;gA;g4;g4;g4;gB; \ g3;gA;g2;g2;g2;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_76 \ Bblock \ BEGIN_SEQUENCE_2; \ g1;g1;gA;g2;g2;g2;g2;g2;g2;gB;g1;gA;g4;g4;g4;g4;g4;g4;gB; \ g1;gA;g2;g2;g2;g2;g2;g2;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_77 \ Bblock \ BEGIN_SEQUENCE_2; \ g2;g2;gA;g1;g1;g1;g1;g1;g1;gB;g2;gA;g3;g3;g3;g3;g3;g3;gB; \ g2;gA;g1;g1;g1;g1;g1;g1;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_78 \ Bblock \ BEGIN_SEQUENCE_2; \ gA;g1;g1;g1;g1;g1;g1;g2;g2;g2;g2;g2;g2;gB; \ g2;gA;g3;g3;g3;g3;g3;g3;g3;g4;g4;g4;g4;g4;g4;g4;gB; \ g1;g4;gA;g1;g1;g1;g1;g1;g1;g1;g2;g2;g2;g2;g2;g2;g2;gB; \ END_SEQUENCE_2; \ Eblock #define SEQUENCE_79 \ Bblock \ BEGIN_SEQUENCE_2; \ g2;g2;gA;g1;g1;g1;gB;g2;gB;g4;gA;g1;g1;g1;g1;g2;g2;g2;g2;gB; \ g3;gA;g3;g3;g3;g4;g4;g4;gB;g3;g3;g3;gB; \ g2;gA;g1;g1;g1;gB;g1;g1;g1;g2;g2;g2;gB; \ END_SEQUENCE_2; \ Eblock #define MARQUEUR \ Bblock \ SET_COULEURS(NOIR,DIVI(COLOR_C,QUATRE)); \ g1;gA;g3;g2;gB;g3;g4;gB;g1;g4;gB;g1;g2;gB;g3; \ SET_COULEURS(NOIR,COLOR_C); \ CALS(Imove(ImageR,ImageG)); \ CALi(Iupdate_image(nom_imageR,ImageR)); \ Exit(OK); \ Eblock \ /* Procedure destinee a la visualisation au centre d'un carre rouge tourne de pi/4 du */ \ /* curseur graphique courant (utilisee durant la mise au point et donc inutile ensuite, */ \ /* mais on ne sait jamais, au cas ou il y aurait un jour de nouvelles modifications...). */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* C O N S T R U C T I O N D E L ' E S C A L I E R I N F E R N A L */ /* A L ' A I D E D ' U N E S T R U C T U R E P A R A D O X A L E : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(CHAR,INIC(POINTERc(nom_imageR),NOM_PIPE)); DEFV(Logical,INIT(localiser_a_l_origine,LOCALISER_A_L_ORIGINE)); /* Faut-il localiser l'escalier a l'origine (indicateur introduit le 20110420165648) ? */ DEFV(Logical,INIT(anti_aliasing,ANTI_ALIASING)); /* Faut-il faire de l'anti-aliasing ('VRAI') ou pas ('FAUX') ? Cela fut introduit le */ /* 20110501164510... */ DEFV(Float,INIT(echelle_K,ECHELLE_K)); DEFV(Float,INIT(echelle_X,ECHELLE_X)); DEFV(Float,INIT(echelle_Y,ECHELLE_Y)); /* Definition des echelles (introduites le 20110429092239). */ DEFV(Float,INIT(Z_minimum,FLOT__UNDEF)); DEFV(Float,INIT(Z_maximum,FLOT__UNDEF)); /* Pour le "depth-cueing". */ /*..............................................................................................................................*/ GET_ARGUMENTSv(nombre_d_arguments ,BLOC(GET_ARGUMENT_L("SX_SY_SZ_____compatibilite_20070416=""compatibilite_20070416=" ,SX_SY_SZ_____compatibilite_20070416 ); /* Parametre introduit le 20070416161826... */ GET_ARGUMENT_L("Ipoint_anti_aliase_segment_____compatibilite_20110420=""compatibilite_20110420=" ,Ipoint_anti_aliase_segment_____compatibilite_20110420 ); /* Parametre introduit le 20110420145753... */ GET_ARGUMENT_C("imageR=""R=",nom_imageR); GET_ARGUMENT_P("NOIR=",Inoir_____NOIR); /* Parametre introduit le 20110501163614 lors de la mise au point de 'v $xiia/ESCA.E1'... */ GET_ARGUMENT_L("anti_aliaser=""anti_aliasing=",anti_aliasing); /* Parametre introduit le 20110501164510... */ GET_ARGUMENT_L("entourer_points_non_isoles=""epni=" ,Ipoint_segment_____si__anti_aliasing__entourer_meme_les_points_non_isoles ); /* Parametre introduit le 20110501171604... */ GET_ARGUMENT_L("origine=",localiser_a_l_origine); /* Parametre introduit le 20110420165648... */ GET_ARGUMENT_F("K=""SK=",echelle_K); GET_ARGUMENT_F("X=""SX=",echelle_X); GET_ARGUMENT_F("Y=""SY=",echelle_Y); /* Parametres introduits le 20110429092239... */ GET_ARGUMENT_L("editer_vecteur_2D=""ev2D=",IFsegment_____editer_le_vecteur_bidimensionnel); GET_ARGUMENT_L("editer_vecteur_3D=""ev3D=",IFseg3D_____editer_le_vecteur_tridimensionnel); /* Parametres introduits le 20110419172132... */ ) ); SET_ECHANTILLONNAGE(PasX,PasY); CALS(Iinit_Z_Buffer()); SET_ANTI_ALIASING(anti_aliasing); SET_COULEURS(NOIR,COLOR_C); CALS(FgERASE()); SK(echelle_K);SX(echelle_X);SY(echelle_Y); Test(IL_FAUT(localiser_a_l_origine)) Bblock DO(1,BLOC(g2;)); /* On notera qu'alors : */ /* */ /* XYmaxNe 462 246 */ /* */ /* fait que l'escalier est juste inscrit dans le cadre de l'image (avec une petite "marge" */ /* suffisante pour qu'il ne touche pas les bords de l'image...). */ Eblock ATes Bblock DO(1,BLOC(g1;)); DO(10,BLOC(g2;)); Eblock ETes BEGIN_SEQUENCE_1; Test(IL_FAUT(localiser_a_l_origine)) Bblock g3;g4; /* Afin d'etre compatible avec 'v $xri/escalier.01$K 20110501091312'... */ Eblock ATes Bblock g3;g3;g3;g4;g4;g4; /* Afin d'etre compatible avec 'v $xri/escalier.01$K 20110501091312'... */ Eblock ETes END_SEQUENCE_1; /* Trace des contours de l'escalier infernal. */ DO(EPAISSEUR ,BLOC(WCG(vecteurs_____Gcon_01); SEQUENCE_61; gA;g4;gC; SEQUENCE_73; DO(15,BLOC(g1;SEQUENCE_77;));g1;gC; SEQUENCE_69;g2; SEQUENCE_76;g2; SEQUENCE_76;g2; SEQUENCE_62; WCG(vecteurs_____Gcon_10);gC; DO(5,BLOC(g3;SEQUENCE_77;));g3;gC; SEQUENCE_61; g4;gC; SEQUENCE_66; g3;SEQUENCE_77;g3;gC; SEQUENCE_61; g4;gC; SEQUENCE_66; DO(7,BLOC(g3;SEQUENCE_77;));g3;gC; /* Generation de la face avant (vecteurs_____Gcon_10). */ DO(5,BLOC(g1;g2;SEQUENCE_78;)); g1;WCG(vecteurs_____Gcon_11);g3; DO(6,BLOC(g1;g2;SEQUENCE_78;));g1;g2;gC; SEQUENCE_72; DO(5,BLOC(g1;SEQUENCE_77;));g1;gC; WCG(vecteurs_____Gcon_30); /* Generation du palier gauche (vecteurs_____Gcon_11). */ SEQUENCE_63; g4;gC; SEQUENCE_64; DO(3,BLOC(g1;SEQUENCE_77;)); g4;WCG(vecteurs_____Gcon_12);g2; DO(3,BLOC(g1;SEQUENCE_77;));g1;gC; SEQUENCE_63; DO(8,BLOC(g3;g4;SEQUENCE_78;));g3;g4;gC; /* Generation du palier droit (vecteurs_____Gcon_12). */ g4; g1;WCG(vecteurs_____Gcon_13);g3; g4;g4;gA; DO(8,BLOC(g1;g2;SEQUENCE_78;));g1;g2;gC; SEQUENCE_75; g2;SEQUENCE_76;g2;SEQUENCE_76;g2;gC; /* Generation du bord droit (vecteurs_____Gcon_13). */ RCG(vecteurs_____Gcon_30);gA; DO(3,BLOC(g3;g4;SEQUENCE_78;));g3;g4;SEQUENCE_61;gC; g4;SEQUENCE_66;gC; g1;WCG(vecteurs_____Gcon_14);g3; /* Generation de la face interne arriere (vecteurs_____Gcon_14). */ g3;SEQUENCE_77;g3;SEQUENCE_77;g3;SEQUENCE_65;gC; g3;g4;SEQUENCE_78; CALS(FgMIC());CALS(FgMIX());CALS(FgXDIVI());g1;WCG(vecteurs_____Gcon_15);CALS(FgMOX());CALS(FgMOC());g3; g4;gC; /* Generation de la face interne gauche (vecteurs_____Gcon_15). */ SEQUENCE_71;g1;SEQUENCE_68;g1;SEQUENCE_77;g1;SEQUENCE_63;gC; DO(3,BLOC(g3;g4;SEQUENCE_78;));g3;g4;gC; g1;CALS(FgMIC());CALS(FgMIY());CALS(FgYDIVI());g2;WCG(vecteurs_____Gcon_16);CALS(FgMOY());CALS(FgMOC()); g1;g2;gA; /* Generation de la marche avant (vecteurs_____Gcon_16). */ g1;g2;SEQUENCE_78;g1;g2;SEQUENCE_64;gC;WCG(vecteurs_____Gcon_31); g2;gC; g3;g3;gA; g1;g2;SEQUENCE_64;gC; g2;gC; g4;gA; g1;SEQUENCE_77;g1;SEQUENCE_77;g1;SEQUENCE_77;g1;SEQUENCE_77;g1;SEQUENCE_67;gC; /* Generation du bord interieur du bas. */ RCG(vecteurs_____Gcon_31);gA; g1;SEQUENCE_77;g1;SEQUENCE_79;gC; g1;g2;SEQUENCE_78;g1;g2;g1;g2;SEQUENCE_78;g1;g2;SEQUENCE_78;g1;g2;SEQUENCE_74; g3;SEQUENCE_77;g3;SEQUENCE_77;g3;SEQUENCE_61;gC; g4;SEQUENCE_66;gC; /* Generation du bord interieur du haut. */ g3;SEQUENCE_77; CALS(FgMIC());CALS(FgMIY());CALS(FgYDIVI());g2;WCG(vecteurs_____Gcon_17);CALS(FgMOY());CALS(FgMOC()); g3;gC; /* Generation de la marche arriere (vecteurs_____Gcon_17). */ g1;g1;g2;gA; g1;g2;SEQUENCE_78;g1;g2;gC; WCG(vecteurs_____Gcon_02); RCG(vecteurs_____Gcon_01); SK(1);SX(1);SY(1); CALS(FgTRZ1()); g1;CALS(FgMIC()); WCG(vecteurs_____Gcon_01); RCG(vecteurs_____Gcon_02); CALS(FgMOC()); ) ); CALS(Imove(ImageR,ImageG)); CALi(Iupdate_image(nom_imageR,ImageR)); RETU_Commande; Eblock ECommande