/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        G E N E R A T I O N   D ' U N   A L B U M   A   P A R T I R   D E   T R O I S                                              */
/*        L I S T E S   D E   C O O R D O N N E E S   C A R T E S I E N N E S  :                                                     */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Nota :                                                                                                                     */
/*                                                                                                                                   */
/*                    Il est possible de "simuler" le chainage                                                                       */
/*                  des points {X,Y,Z} arguments en utilisant au                                                                     */
/*                  prealable 'v $xci/interpole.01$K' qui interpole                                                                  */
/*                  lineairement entre deux points consecutifs.                                                                      */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Author of '$xrv/store_album$K' :                                                                                           */
/*                                                                                                                                   */
/*                    Jean-Francois COLONNA (LACTAMME, 20111112081220).                                                              */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        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

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        V A L E U R S   I M P L I C I T E S   D E S   P A R A M E T R E S  :                                                       */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#include  xci/sequence.01.I"
                                        /* ATTENTION, on definit ainsi le symbole 'DERNIERE_IMAGE' qui ne sert a rien ici, puisque   */
                                        /* c'est en effet 'Zmax' qui joue ce role...                                                 */

#define   INVERSER_L_AXE_OZ                                                                                                             \
                    FAUX                                                                                                                \
                                        /* Introduit le 20120806144954 afin de permettre d'inverser l'axe 'OZ' (initialement pour    */ \
                                        /* 'v $xiirf/FRB3.E4.2'...).                                                                 */

#define   FACTEUR_DES_COORDONNEES_X                                                                                                     \
                    FU
#define   TRANSLATION_DES_COORDONNEES_X                                                                                                 \
                    FZERO
#define   FACTEUR_DES_COORDONNEES_Y                                                                                                     \
                    FU
#define   TRANSLATION_DES_COORDONNEES_Y                                                                                                 \
                    FZERO
#define   FACTEUR_DES_COORDONNEES_Z                                                                                                     \
                    FU
#define   TRANSLATION_DES_COORDONNEES_Z                                                                                                 \
                    FZERO
#define   FACTEUR_DES_NIVEAUX______                                                                                                     \
                    FU
#define   TRANSLATION_DES_NIVEAUX______                                                                                                 \
                    FZERO
                                        /* Introduit le 20231104111032...                                                            */

#define   DISPERSER_LES_NIVEAUX_AUX_HUIT_COINS_DES_CUBES_ELEMENTAIRES                                                                   \
                    FAUX
#define   ECRASER_LES_NIVEAUX_ANTERIEURS                                                                                                \
                    FAUX
                                        /* Introduit le 20140101101115 afin de permettre la dispersion "interpole" de chaque niveau  */ \
                                        /* aux huit coins des cubes elementaires...                                                  */

#define   CUMULER_LES_NIVEAUX                                                                                                           \
                    FAUX
#define   PONDERATION_CUMULER_LES_NIVEAUX_ADD2                                                                                          \
                    FU
#define   PONDERATION_CUMULER_LES_NIVEAUX_MAX2                                                                                          \
                    FZERO
                                        /* Introduit le 20190118112521 afin de permettre de choisir entre ranger les niveaux avec    */
                                        /* "ecrasement" ('FAUX') ou bien les cumuler ('VRAI') ? Les ponderations de choix de la      */
                                        /* methode de cumul ont des valeurs par defaut qui garantissent la compatibilite anterieure. */

#define   FAIRE_UN_EPAISSISSEMENT_SPHERIQUE                                                                                             \
                    FAUX                                                                                                                \
                                        /* Introduit le 20120517082349 afin de permettre de choisir entre un epaississement cubique  */ \
                                        /* ('FAUX') et un epaississement spherique ('VRAI').                                         */
#define   DEMI_PAVE_X                                                                                                                   \
                    ZERO
#define   DEMI_PAVE_Y                                                                                                                   \
                    ZERO
#define   DEMI_PAVE_Z                                                                                                                   \
                    ZERO
                                        /* Introduit le 20120429165655 afin de pouvoir epaissir les points...                        */
#define   DEMI_PAVE_XG                                                                                                                  \
                    ZERO
#define   DEMI_PAVE_YG                                                                                                                  \
                    ZERO
#define   DEMI_PAVE_ZG                                                                                                                  \
                    ZERO

#define   DEMI_PAVE_XD                                                                                                                  \
                    ZERO
#define   DEMI_PAVE_YD                                                                                                                  \
                    ZERO
#define   DEMI_PAVE_ZD                                                                                                                  \
                    ZERO
                                        /* Introduit le 20120430184502 afin de generaliser le processus d'epaississement symetrique  */
                                        /* precedent, sans perdre la compatibilite avec lui...                                       */

#define   FAIRE_DES_PAVES_HOMOTHETIQUES                                                                                                 \
                    FAUX                                                                                                                \
                                        /* Introduit le 20170322095146 pour permettre de faire des paves "homothetiques",            */ \
                                        /* c'est-a-dire des paves dont la taille est fonction de '$formatI'...                       */

#define   TESTER_LES_HORS_BORNES_NATURELLES                                                                                             \
                    FAUX                                                                                                                \
                                        /* Introduit le 20111113112752 pour ne pas tester les "hors bornes naturelles"...            */ \
                                        /*                                                                                           */ \
                                        /* La valeur par defaut est passee de 'VRAI' a 'FAUX' le 20120417134325, depuis que          */ \
                                        /* 'SUPER_cDENORMALISE_O(...)' ont ete introduits car, en effet, ces procedures peuvent      */ \
                                        /* generer des valeurs hors bornes naturelles...                                             */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        D E F I N I T I O N   D E S   F I C H I E R S  :                                                                           */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#include  xrv/ARITHMET.1d.I"
#include  xrv/ARITHMET.21.I"
#include  xrv/champs_5.41.I"

#define   X_IMPLICITE                                                                                                                   \
                    FZERO
#define   Y_IMPLICITE                                                                                                                   \
                    FZERO
#define   Z_IMPLICITE                                                                                                                   \
                    FZERO

gGENERATION_D_UN_FICHIER(fichier_LISTE_X,liste_initiale_des_X);
gGENERATION_D_UN_FICHIER(fichier_LISTE_Y,liste_initiale_des_Y);
gGENERATION_D_UN_FICHIER(fichier_LISTE_Z,liste_initiale_des_Z);
                                        /* Definition en memoire des fichiers de coordonnees cartesiennes.                           */

#define   ELEMENT_DU_FICHIER_LISTE_X(index)                                                                                             \
                    gELEMENT_DU_FICHIER(liste_initiale_des_X,index)
#define   ELEMENT_DU_FICHIER_LISTE_Y(index)                                                                                             \
                    gELEMENT_DU_FICHIER(liste_initiale_des_Y,index)
#define   ELEMENT_DU_FICHIER_LISTE_Z(index)                                                                                             \
                    gELEMENT_DU_FICHIER(liste_initiale_des_Z,index)
                                        /* Acces a un element courant des fichiers de coordonnees cartesiennes.                      */

#define   NIVEAU_IMPLICITE                                                                                                              \
                    FU

gGENERATION_D_UN_FICHIER(fichier_LISTE_NIVEAU,liste_initiale_des_NIVEAU);
                                        /* Definition en memoire du fichier des niveaux...                                           */

#define   ELEMENT_DU_FICHIER_LISTE_NIVEAU(index)                                                                                        \
                    gELEMENT_DU_FICHIER(liste_initiale_des_NIVEAU,index)
                                        /* Acces a un element courant du fichier des niveaux...                                      */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        D E F I N I T I O N   D E   L ' E P A I S S I S S E M E N T  :                                                             */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#define   DEMI_PAVE_X_IMPLICITE                                                                                                         \
                    FLOT(DEMI_PAVE_X)
#define   DEMI_PAVE_Y_IMPLICITE                                                                                                         \
                    FLOT(DEMI_PAVE_Y)
#define   DEMI_PAVE_Z_IMPLICITE                                                                                                         \
                    FLOT(DEMI_PAVE_Z)

gGENERATION_D_UN_FICHIER(fichier_LISTE_DEMI_PAVE_X,liste_initiale_des_DEMI_PAVE_X);
gGENERATION_D_UN_FICHIER(fichier_LISTE_DEMI_PAVE_Y,liste_initiale_des_DEMI_PAVE_Y);
gGENERATION_D_UN_FICHIER(fichier_LISTE_DEMI_PAVE_Z,liste_initiale_des_DEMI_PAVE_Z);
                                        /* Definition en memoire des fichiers des "demi-paves" (introduits le 20160428093113).       */

#define   ELEMENT_DU_FICHIER_DEMI_PAVE_X(index)                                                                                         \
                    INTE(gELEMENT_DU_FICHIER(liste_initiale_des_DEMI_PAVE_X,index))
#define   ELEMENT_DU_FICHIER_DEMI_PAVE_Y(index)                                                                                         \
                    INTE(gELEMENT_DU_FICHIER(liste_initiale_des_DEMI_PAVE_Y,index))
#define   ELEMENT_DU_FICHIER_DEMI_PAVE_Z(index)                                                                                         \
                    INTE(gELEMENT_DU_FICHIER(liste_initiale_des_DEMI_PAVE_Z,index))
                                        /* Acces a un element courant des fichiers des "demi-paves" (introduits le 20160428093113).  */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        P R O C E D U R E   G E N E R A L E   D E                                                                                  */
/*        G E N E R A T I O N   D ' U N   A L B U M   A   P A R T I R   D E   T R O I S                                              */
/*        L I S T E S   D E   C O O R D O N N E E S   C A R T E S I E N N E S  :                                                     */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#define   GENERATION_D_UN_ALBUM(type_album,sequence_initialisation,sequence_de_rangement,fonction_de_rangement)                         \
                    Bblock                                                                                                              \
                    BDEFV(type_album,album_d_imagesR);                                                                                  \
                                        /* Definition de l'album Resultat...                                                         */ \
                                                                                                                                        \
                    BLOC(sequence_initialisation);                                                                                      \
                                        /* Initialisation de l'album Resultat.                                                       */ \
                                                                                                                                        \
                    DoIn(index                                                                                                          \
                        ,PREMIER_ELEMENT_D_UN_FICHIER                                                                                   \
                        ,DERNIER_ELEMENT_D_UN_FICHIER                                                                                   \
                        ,I                                                                                                              \
                         )                                                                                                              \
                         Bblock                                                                                                         \
                         DEFV(Float,INIT(coordonnee_X_normalisee                                                                        \
                                        ,AXPB(facteur_des_coordonnees_X                                                                 \
                                             ,ELEMENT_DU_FICHIER_LISTE_X(index)                                                         \
                                             ,translation_des_coordonnees_X                                                             \
                                              )                                                                                         \
                                         )                                                                                              \
                              );                                                                                                        \
                         DEFV(Float,INIT(coordonnee_Y_normalisee                                                                        \
                                        ,AXPB(facteur_des_coordonnees_Y                                                                 \
                                             ,ELEMENT_DU_FICHIER_LISTE_Y(index)                                                         \
                                             ,translation_des_coordonnees_Y                                                             \
                                              )                                                                                         \
                                         )                                                                                              \
                              );                                                                                                        \
                         DEFV(Float,INIT(coordonnee_Z_normalisee                                                                        \
                                        ,AXPB(facteur_des_coordonnees_Z                                                                 \
                                             ,ELEMENT_DU_FICHIER_LISTE_Z(index)                                                         \
                                             ,translation_des_coordonnees_Z                                                             \
                                              )                                                                                         \
                                         )                                                                                              \
                              );                                                                                                        \
                         DEFV(Float,INIT(coordonnee_X_denormalisee_precise,FLOT__UNDEF));                                               \
                         DEFV(Float,INIT(coordonnee_Y_denormalisee_precise,FLOT__UNDEF));                                               \
                         DEFV(Float,INIT(coordonnee_Z_denormalisee_precise,FLOT__UNDEF));                                               \
                         DEFV(Int,INIT(coordonnee_X_denormalisee,UNDEF));                                                               \
                         DEFV(Int,INIT(coordonnee_Y_denormalisee,UNDEF));                                                               \
                         DEFV(Int,INIT(coordonnee_Z_denormalisee,UNDEF));                                                               \
                                        /* Recuperation des coordonnees {X,Y,Z} courantes dans les fichiers.                         */ \
                         DEFV(Float,INIT(niveau_courant_normalise                                                                       \
                                        ,AXPB(facteur_des_niveaux______                                                                 \
                                             ,ELEMENT_DU_FICHIER_LISTE_NIVEAU(index)                                                    \
                                             ,translation_des_niveaux______                                                             \
                                              )                                                                                         \
                                         )                                                                                              \
                              );                                                                                                        \
                         DEFV(genere_p,INIT(niveau_courant_denormalise,NIVEAU_UNDEF));                                                  \
                                        /* Recuperation du niveau du point courant {X,Y,Z} dans le fichier.                          */ \
                                                                                                                                        \
                         DEFV(Int,INIT(demi_pave_XG_effectif                                                                            \
                                      ,GRANDEURS_HOMOTHETIQUES_OX(MAX2(ELEMENT_DU_FICHIER_DEMI_PAVE_X(index),demi_pave_XG)              \
                                                                 ,faire_des_paves_homothetiques                                         \
                                                                 ,INTE                                                                  \
                                                                  )                                                                     \
                                       )                                                                                                \
                              );                                                                                                        \
                         DEFV(Int,INIT(demi_pave_YG_effectif                                                                            \
                                      ,GRANDEURS_HOMOTHETIQUES_OY(MAX2(ELEMENT_DU_FICHIER_DEMI_PAVE_Y(index),demi_pave_YG)              \
                                                                 ,faire_des_paves_homothetiques                                         \
                                                                 ,INTE                                                                  \
                                                                  )                                                                     \
                                       )                                                                                                \
                              );                                                                                                        \
                         DEFV(Int,INIT(demi_pave_ZG_effectif                                                                            \
                                      ,GRANDEURS_HOMOTHETIQUES_OZ(MAX2(ELEMENT_DU_FICHIER_DEMI_PAVE_Z(index),demi_pave_ZG)              \
                                                                 ,faire_des_paves_homothetiques                                         \
                                                                 ,INTE                                                                  \
                                                                  )                                                                     \
                                       )                                                                                                \
                              );                                                                                                        \
                         DEFV(Int,INIT(demi_pave_XD_effectif                                                                            \
                                      ,GRANDEURS_HOMOTHETIQUES_OX(MAX2(ELEMENT_DU_FICHIER_DEMI_PAVE_X(index),demi_pave_XD)              \
                                                                 ,faire_des_paves_homothetiques                                         \
                                                                 ,INTE                                                                  \
                                                                  )                                                                     \
                                       )                                                                                                \
                              );                                                                                                        \
                         DEFV(Int,INIT(demi_pave_YD_effectif                                                                            \
                                      ,GRANDEURS_HOMOTHETIQUES_OY(MAX2(ELEMENT_DU_FICHIER_DEMI_PAVE_Y(index),demi_pave_YD)              \
                                                                 ,faire_des_paves_homothetiques                                         \
                                                                 ,INTE                                                                  \
                                                                  )                                                                     \
                                       )                                                                                                \
                              );                                                                                                        \
                         DEFV(Int,INIT(demi_pave_ZD_effectif                                                                            \
                                      ,GRANDEURS_HOMOTHETIQUES_OZ(MAX2(ELEMENT_DU_FICHIER_DEMI_PAVE_Z(index),demi_pave_ZD)              \
                                                                 ,faire_des_paves_homothetiques                                         \
                                                                 ,INTE                                                                  \
                                                                  )                                                                     \
                                       )                                                                                                \
                              );                                                                                                        \
                                                                                                                                        \
                         DEFV(Float,INIT(demi_diametre_du_pave,FLOT__UNDEF));                                                           \
                         EGAL(demi_diametre_du_pave                                                                                     \
                             ,MIN3(FLOT(MIN2(demi_pave_XG_effectif,demi_pave_XD_effectif))                                              \
                                  ,FLOT(MIN2(demi_pave_YG_effectif,demi_pave_YD_effectif))                                              \
                                  ,FLOT(MIN2(demi_pave_ZG_effectif,demi_pave_ZD_effectif))                                              \
                                   )                                                                                                    \
                              );                                                                                                        \
                                        /* Demi-diametre du pave calcule a priori...                                                 */ \
                                                                                                                                        \
                         EGAL(coordonnee_X_denormalisee_precise,F__cDENORMALISE_OX(SUPER_ECHELLE_OX(coordonnee_X_normalisee)));         \
                         EGAL(coordonnee_Y_denormalisee_precise,F__cDENORMALISE_OY(SUPER_ECHELLE_OY(coordonnee_Y_normalisee)));         \
                         EGAL(coordonnee_Z_denormalisee_precise,F__cDENORMALISE_OZ(SUPER_ECHELLE_OZ(coordonnee_Z_normalisee)));         \
                                        /* Coordonnees denormalisees precises introduites pour 'Astore_point_continu_lineaire(...)'  */ \
                                        /* et 'AstoreF_point_continu_lineaire(...)' le 20140101120415...                             */ \
                                                                                                                                        \
                         EGAL(coordonnee_X_denormalisee,SUPER_cDENORMALISE_OX(coordonnee_X_normalisee));                                \
                         EGAL(coordonnee_Y_denormalisee,SUPER_cDENORMALISE_OY(coordonnee_Y_normalisee));                                \
                         EGAL(coordonnee_Z_denormalisee,SUPER_cDENORMALISE_OZ(coordonnee_Z_normalisee));                                \
                         EGAL(niveau_courant_denormalise,__DENORMALISE_NIVEAU(niveau_courant_normalise));                               \
                                        /* Denormalisation des 4 informations {X,Y,Z,NIVEAU}...                                      */ \
                                        /*                                                                                           */ \
                                        /* Le 20120417134518, '_cDENORMALISE_O?(...)' a ete remplace par 'SUPER_cDENORMALISE_O(...)' */ \
                                        /* afin de permettre de conserver, si besoin est, les proportions...                         */ \
                                                                                                                                        \
                         Test(IL_FAUT(inverser_l_axe_OZ))                                                                               \
                                        /* Test introduit le 20120806144954...                                                       */ \
                              Bblock                                                                                                    \
                              EGAL(coordonnee_Z_denormalisee,RENZ(coordonnee_Z_denormalisee));                                          \
                                        /* Inversion eventuelle de l'axe 'OZ'...                                                     */ \
                              Eblock                                                                                                    \
                         ATes                                                                                                           \
                              Bblock                                                                                                    \
                              Eblock                                                                                                    \
                         ETes                                                                                                           \
                                                                                                                                        \
                         Test(IFOU(IL_NE_FAUT_PAS(tester_les_hors_bornes_naturelles)                                                    \
                                  ,IFET(IL_FAUT(tester_les_hors_bornes_naturelles)                                                      \
                                       ,IFET(TEST_DANS_L_ALBUM(coordonnee_X_denormalisee                                                \
                                                              ,coordonnee_Y_denormalisee                                                \
                                                              ,coordonnee_Z_denormalisee                                                \
                                                               )                                                                        \
                                            ,IFINff(niveau_courant_normalise                                                            \
                                                   ,______________NOIR_NORMALISE                                                        \
                                                   ,______________BLANC_NORMALISE                                                       \
                                                    )                                                                                   \
                                             )                                                                                          \
                                        )                                                                                               \
                                   )                                                                                                    \
                              )                                                                                                         \
                              Bblock                                                                                                    \
                              begin_albumQ(DoIn                                                                                         \
                                          ,COZA(SOUS(COZR(coordonnee_Z_denormalisee),demi_pave_ZG_effectif))                            \
                                          ,COZA(ADD2(COZR(coordonnee_Z_denormalisee),demi_pave_ZD_effectif))                            \
                                          ,PasZ                                                                                         \
                                          ,DoIn                                                                                         \
                                          ,COYA(SOUS(COYR(coordonnee_Y_denormalisee),demi_pave_YG_effectif))                            \
                                          ,COYA(ADD2(COYR(coordonnee_Y_denormalisee),demi_pave_YD_effectif))                            \
                                          ,PasY                                                                                         \
                                          ,DoIn                                                                                         \
                                          ,COXA(SOUS(COXR(coordonnee_X_denormalisee),demi_pave_XG_effectif))                            \
                                          ,COXA(ADD2(COXR(coordonnee_X_denormalisee),demi_pave_XD_effectif))                            \
                                          ,PasX                                                                                         \
                                           )                                                                                            \
                                        /* Introduit le 20120429165655 afin de pouvoir epaissir les points et generalise de facon    */ \
                                        /* potentiellement dissymetrique le 20120430184502...                                        */ \
                                   Bblock                                                                                               \
                                   DEFV(Logical,INIT(ranger_le_niveau,VRAI));                                                           \
                                        /* A priori, le niveau sera range systematiquement (indicateur introduit le 20120517083301). */ \
                                                                                                                                        \
                                   Test(IL_FAUT(faire_un_epaississement_spherique))                                                     \
                                        /* Test introduit le 20120517083301...                                                       */ \
                                        Bblock                                                                                          \
                                        DEFV(Float,INIT(distance_au_centre_du_pave                                                      \
                                                       ,RdisF3D(FLOT(coordonnee_X_denormalisee)                                         \
                                                               ,FLOT(coordonnee_Y_denormalisee)                                         \
                                                               ,FLOT(coordonnee_Z_denormalisee)                                         \
                                                               ,FLOT(X)                                                                 \
                                                               ,FLOT(Y)                                                                 \
                                                               ,FLOT(Z)                                                                 \
                                                                )                                                                       \
                                                        )                                                                               \
                                             );                                                                                         \
                                        /* Distance au centre du pave...                                                             */ \
                                        Test(IFLE(distance_au_centre_du_pave,demi_diametre_du_pave))                                    \
                                             Bblock                                                                                     \
                                             EGAL(ranger_le_niveau,VRAI);                                                               \
                                             Eblock                                                                                     \
                                        ATes                                                                                            \
                                             Bblock                                                                                     \
                                             EGAL(ranger_le_niveau,FAUX);                                                               \
                                             Eblock                                                                                     \
                                        ETes                                                                                            \
                                        Eblock                                                                                          \
                                   ATes                                                                                                 \
                                        Bblock                                                                                          \
                                        Eblock                                                                                          \
                                   ETes                                                                                                 \
                                                                                                                                        \
                                   Test(IL_FAUT(ranger_le_niveau))                                                                      \
                                        /* Test introduit le 20120517083301...                                                       */ \
                                        Bblock                                                                                          \
                                        BLOC(sequence_de_rangement);                                                                    \
                                        /* Rangement du point courant {X,Y,Z}...                                                     */ \
                                        Eblock                                                                                          \
                                   ATes                                                                                                 \
                                        Bblock                                                                                          \
                                        Eblock                                                                                          \
                                   ETes                                                                                                 \
                                   Eblock                                                                                               \
                              end_albumQ(EDoI,EDoI,EDoI)                                                                                \
                              Eblock                                                                                                    \
                         ATes                                                                                                           \
                              Bblock                                                                                                    \
                              PRINT_ERREUR("l'une au moins des trois valeurs associees a un point est hors de ses bornes naturelles");  \
                              CAL1(Prer5("(il s'agit du point d'index %d : X=%+.^^^ Y=%+.^^^ Z=%+.^^^ niveau=%+.^^^"                    \
                                        ,index                                                                                          \
                                        ,coordonnee_X_normalisee                                                                        \
                                        ,coordonnee_Y_normalisee                                                                        \
                                        ,coordonnee_Z_normalisee                                                                        \
                                        ,niveau_courant_normalise                                                                       \
                                         )                                                                                              \
                                   );                                                                                                   \
                              CAL1(Prer0(" -ces trois valeurs sont normalisees-)\n"));                                                  \
                              Eblock                                                                                                    \
                         ETes                                                                                                           \
                         Eblock                                                                                                         \
                    EDoI                                                                                                                \
                                                                                                                                        \
                    CALi(fonction_de_rangement(nom_imageR                                                                               \
                                              ,nom_postfixe                                                                             \
                                              ,premiere_image                                                                           \
                                              ,pas_des_images                                                                           \
                                              ,album_d_imagesR                                                                          \
                                              ,nombre_de_chiffres                                                                       \
                                              ,FAUX                                                                                     \
                                               )                                                                                        \
                         );                                                                                                             \
                                                                                                                                        \
                    EDEFV(type_album,album_d_imagesR);                                                                                  \
                                        /* Definition de l'album Resultat...                                                         */ \
                    Eblock                                                                                                              \
                                        /* Procedure generale introduite le 20121110121036...                                        */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        G E N E R A T I O N   D ' U N   A L B U M   A   P A R T I R   D E   T R O I S                                              */
/*        L I S T E S   D E   C O O R D O N N E E S   C A R T E S I E N N E S  :                                                     */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
BCommande(nombre_d_arguments,arguments)
/*-----------------------------------------------------------------------------------------------------------------------------------*/
     Bblock
#include  xrv/ARITHMET.22.I"
#include  xci/valeurs.03.I"

     DEFV(CHAR,INIT(POINTERc(nom_imageR),NOM_PIPE_Local));
                                        /* Nom de la sequence a generer...                                                           */
     DEFV(CHAR,INIC(POINTERc(nom_postfixe),NOM_UNDEF_VIDE));
                                        /* Nom d'un eventuel postfixe a placer derriere <nom_imageA><numero> (par exemple '$ROUGE'). */
     DEFV(Int,INIT(premiere_image,PREMIERE_IMAGE));
                                        /* Numero de la premiere image,                                                              */
     DEFV(Int,INIT(pas_des_images,PAS_DES_IMAGES));
                                        /* Pas de passage d'un numero d'image a une autre.                                           */
     DEFV(Int,INIT(nombre_de_chiffres,NOMBRE_DE_CHIFFRES));
                                        /* Nombre de chiffres codant le numero des images de la serie...                             */

     DEFV(Logical,INIT(inverser_l_axe_OZ,INVERSER_L_AXE_OZ));
                                        /* Introduit le 20120806144954 afin de permettre d'inverser l'axe 'OZ' (initialement pour    */
                                        /* 'v $xiirf/FRB3.E4.2'...).                                                                 */

     DEFV(Float,INIT(facteur_des_coordonnees_X,FACTEUR_DES_COORDONNEES_X));
     DEFV(Float,INIT(translation_des_coordonnees_X,TRANSLATION_DES_COORDONNEES_X));
     DEFV(Float,INIT(facteur_des_coordonnees_Y,FACTEUR_DES_COORDONNEES_Y));
     DEFV(Float,INIT(translation_des_coordonnees_Y,TRANSLATION_DES_COORDONNEES_Y));
     DEFV(Float,INIT(facteur_des_coordonnees_Z,FACTEUR_DES_COORDONNEES_Z));
     DEFV(Float,INIT(translation_des_coordonnees_Z,TRANSLATION_DES_COORDONNEES_Z));
     DEFV(Float,INIT(facteur_des_niveaux______,FACTEUR_DES_NIVEAUX______));
     DEFV(Float,INIT(translation_des_niveaux______,TRANSLATION_DES_NIVEAUX______));
                                        /* Introduit le 20231104111032...                                                            */

     DEFV(Logical,INIT(disperser_les_niveaux_aux_huit_coins_des_cubes_elementaires
                      ,DISPERSER_LES_NIVEAUX_AUX_HUIT_COINS_DES_CUBES_ELEMENTAIRES
                       )
          );
     DEFV(Logical,INIT(ecraser_les_niveaux_anterieurs,ECRASER_LES_NIVEAUX_ANTERIEURS));
                                        /* Introduit le 20140101101115 afin de permettre la dispersion "interpole" de chaque niveau  */
                                        /* aux huit coins des cubes elementaires...                                                  */

     DEFV(Logical,INIT(cumuler_les_niveaux,CUMULER_LES_NIVEAUX));
     DEFV(Float,INIT(ponderation_cumuler_les_niveaux_ADD2,PONDERATION_CUMULER_LES_NIVEAUX_ADD2));
     DEFV(Float,INIT(ponderation_cumuler_les_niveaux_MAX2,PONDERATION_CUMULER_LES_NIVEAUX_MAX2));
                                        /* Introduit le 20190118112521 afin de permettre de choisir entre ranger les niveaux avec    */
                                        /* "ecrasement" ('FAUX') ou bien les cumuler ('VRAI') ? Les ponderations de choix de la      */
                                        /* methode de cumul ont des valeurs par defaut qui garantissent la compatibilite anterieure. */

     DEFV(Logical,INIT(faire_un_epaississement_spherique,FAIRE_UN_EPAISSISSEMENT_SPHERIQUE));
                                        /* Introduit le 20120517082349 afin de permettre de choisir entre un epaississement cubique  */
                                        /* ('FAUX') et un epaississement spherique ('VRAI').                                         */
     DEFV(Int,INIT(demi_pave_XG,DEMI_PAVE_XG));
     DEFV(Int,INIT(demi_pave_YG,DEMI_PAVE_YG));
     DEFV(Int,INIT(demi_pave_ZG,DEMI_PAVE_ZG));
     DEFV(Int,INIT(demi_pave_XD,DEMI_PAVE_XD));
     DEFV(Int,INIT(demi_pave_YD,DEMI_PAVE_YD));
     DEFV(Int,INIT(demi_pave_ZD,DEMI_PAVE_ZD));
                                        /* Introduit le 20120430184502 afin de generaliser le processus d'epaississement symetrique  */
                                        /* precedent, sans perdre la compatibilite avec lui...                                       */
     DEFV(Logical,INIT(faire_des_paves_homothetiques,FAIRE_DES_PAVES_HOMOTHETIQUES));
                                        /* Introduit le 20170322095146 pour permettre de faire des paves "homothetiques",            */
                                        /* c'est-a-dire des paves dont la taille est fonction de '$formatI'...                       */

     DEFV(Logical,INIT(tester_les_hors_bornes_naturelles,TESTER_LES_HORS_BORNES_NATURELLES));
                                        /* Introduit le 20111113112752 pour ne pas tester les "hors bornes naturelles"...            */
                                        /*                                                                                           */
                                        /* La valeur par defaut est passee de 'VRAI' a 'FAUX' le 20120417134325, depuis que          */
                                        /* 'SUPER_cDENORMALISE_O(...)' ont ete introduits car, en effet, ces procedures peuvent      */
                                        /* generer des valeurs hors bornes naturelles...                                             */
     /*..............................................................................................................................*/
     GET_ARGUMENTSi(nombre_d_arguments
                   ,BLOC(PROCESS_ARGUMENT_I("nombre_elements=""ne=",nombre_d_elements
                                           ,BLOC(VIDE;)
                                           ,BLOC(Bblock
                                                 PRINT_AVERTISSEMENT("'ne=' doit etre defini avant toute entree de fichiers");
                                                 Eblock
                                                 )
                                            );

                         PROCESS_ARGUMENTS_DE_DEFINITION_DES_FICHIERS_01;

                         PROKESF_ARGUMENT_FICHIER("LISTE_X="
                                                 ,fichier_LISTE_X
                                                 ,liste_initiale_des_X
                                                 ,X_IMPLICITE
                                                 ,lTRANSFORMAT_0d
                                                 ,iGENERATION_D_UN_FICHIER
                                                  );
                         PROKESF_ARGUMENT_FICHIER("LISTE_Y="
                                                 ,fichier_LISTE_Y
                                                 ,liste_initiale_des_Y
                                                 ,Y_IMPLICITE
                                                 ,lTRANSFORMAT_0d
                                                 ,iGENERATION_D_UN_FICHIER
                                                  );
                         PROKESF_ARGUMENT_FICHIER("LISTE_Z="
                                                 ,fichier_LISTE_Z
                                                 ,liste_initiale_des_Z
                                                 ,Z_IMPLICITE
                                                 ,lTRANSFORMAT_0d
                                                 ,iGENERATION_D_UN_FICHIER
                                                  );

                         PROKESF_ARGUMENT_FICHIER("LISTE_NIVEAU="
                                                 ,fichier_LISTE_NIVEAU
                                                 ,liste_initiale_des_NIVEAU
                                                 ,NIVEAU_IMPLICITE
                                                 ,lTRANSFORMAT_0d
                                                 ,iGENERATION_D_UN_FICHIER
                                                  );

                         PROKESF_ARGUMENT_FICHIER("LISTE_DEMI_PAVE_X=""demi_pave_X=""dpX="
                                                 ,fichier_LISTE_DEMI_PAVE_X
                                                 ,liste_initiale_des_DEMI_PAVE_X
                                                 ,DEMI_PAVE_X_IMPLICITE
                                                 ,lTRANSFORMAT_0d
                                                 ,iGENERATION_D_UN_FICHIER
                                                  );
                         PROKESF_ARGUMENT_FICHIER("LISTE_DEMI_PAVE_Y=""demi_pave_Y=""dpY="
                                                 ,fichier_LISTE_DEMI_PAVE_Y
                                                 ,liste_initiale_des_DEMI_PAVE_Y
                                                 ,DEMI_PAVE_Y_IMPLICITE
                                                 ,lTRANSFORMAT_0d
                                                 ,iGENERATION_D_UN_FICHIER
                                                  );
                         PROKESF_ARGUMENT_FICHIER("LISTE_DEMI_PAVE_Z=""demi_pave_Z=""dpZ="
                                                 ,fichier_LISTE_DEMI_PAVE_Z
                                                 ,liste_initiale_des_DEMI_PAVE_Z
                                                 ,DEMI_PAVE_Z_IMPLICITE
                                                 ,lTRANSFORMAT_0d
                                                 ,iGENERATION_D_UN_FICHIER
                                                  );

                         GET_ARGUMENT_C("imageR=""R=",nom_imageR);
                         GET_ARGUMENT_C("postfixe=",nom_postfixe);
                         GET_ARGUMENT_I("premiere=",premiere_image);
                         GET_ARGUMENT_I("pas=",pas_des_images);
                         GET_ARGUMENT_I("chiffres=",nombre_de_chiffres);

                         GET_ARGUMENT_L("standard=",les_images_sont_standards);
                                        /* Argument introduit le 20121110121036...                                                   */

                         GET_ARGUMENT_L("inverser_Z=""inv_Z=",inverser_l_axe_OZ);
                                        /* Arguments introduits le 20120806144954...                                                 */

                         GET_ARGUMENT_F("facteur_X=""fX=",facteur_des_coordonnees_X);
                         GET_ARGUMENT_F("translation_X=""tX=",translation_des_coordonnees_X);
                         GET_ARGUMENT_F("facteur_Y=""fY=",facteur_des_coordonnees_Y);
                         GET_ARGUMENT_F("translation_Y=""tY=",translation_des_coordonnees_Y);
                         GET_ARGUMENT_F("facteur_Z=""fZ=",facteur_des_coordonnees_Z);
                         GET_ARGUMENT_F("translation_Z=""tZ=",translation_des_coordonnees_Z);
                         GET_ARGUMENT_F("facteur_niveaux=""fn=",facteur_des_niveaux______);
                         GET_ARGUMENT_F("translation_niveaux=""tn=",translation_des_niveaux______);
                                        /* Arguments introduits le 20231104111032...                                                 */

                         GET_ARGUMENT_L("disperser=",disperser_les_niveaux_aux_huit_coins_des_cubes_elementaires);
                         GET_ARGUMENT_N("concentrer=",disperser_les_niveaux_aux_huit_coins_des_cubes_elementaires);
                         GET_ARGUMENT_L("ecraser_niveaux=""ecraser=",ecraser_les_niveaux_anterieurs);
                                        /* Arguments introduits le 20140101101115...                                                 */
                                        /*                                                                                           */
                                        /* Le 20190118114344, les arguments :                                                        */
                                        /*                                                                                           */
                                        /*        GET_ARGUMENT_N("cumuler_niveaux=""cumuler=",ecraser_les_niveaux_anterieurs);       */
                                        /*                                                                                           */
                                        /* ont ete supprimes a cause de ce qui suit...                                               */

                         GET_ARGUMENT_L("cumuler_niveaux=""cumuler=""cumul=",cumuler_les_niveaux);
                         GET_ARGUMENT_F("cumuler_ADD2=""ADD2=",ponderation_cumuler_les_niveaux_ADD2);
                         GET_ARGUMENT_F("cumuler_MAX2=""MAX2=",ponderation_cumuler_les_niveaux_MAX2);
                                        /* Argument introduit le 20190118112521 et complete le 20190116141516 par les ponderations.  */

                         GET_ARGUMENT_L("epaississement_spherique=""espherique=""spherique=",faire_un_epaississement_spherique);
                         GET_ARGUMENT_N("epaississement_cubique=""ecubique=",faire_un_epaississement_spherique);
                                        /* Arguments introduits le 20120517082349. On notera l'absence de "cubique=" par             */
                                        /* symetrie avec 'v $xrv/store_image$K ecarre='...                                           */
                         GET_ARGUMENT_I("demi_pave_XG=""dpXG=",demi_pave_XG);
                         GET_ARGUMENT_I("demi_pave_YG=""dpYG=",demi_pave_YG);
                         GET_ARGUMENT_I("demi_pave_ZG=""dpZG=",demi_pave_ZG);
                         GET_ARGUMENT_I("demi_pave_XD=""dpXD=",demi_pave_XD);
                         GET_ARGUMENT_I("demi_pave_YD=""dpYD=",demi_pave_YD);
                         GET_ARGUMENT_I("demi_pave_ZD=""dpZD=",demi_pave_ZD);
                                        /* Arguments introduits le 20120430184502...                                                 */
                         GET_ARGUMENT_L("paves_homothetiques=""ph=",faire_des_paves_homothetiques);
                                        /* Arguments introduits le 20170322095146...                                                 */

                         GET_ARGUMENT_L("tester_hors_bornes_naturelles=""hors_bornes_naturelles=""hbn="
                                       ,tester_les_hors_bornes_naturelles
                                        );
                                        /* Argument introduit le 20111113112752...                                                   */
                         )
                    );

     Test(IFET(IL_FAUT(disperser_les_niveaux_aux_huit_coins_des_cubes_elementaires)
              ,IL_FAUT(cumuler_les_niveaux)
               )
          )
          Bblock
          PRINT_ATTENTION("les options de dispersion et de cumul sont incompatibles et c'est cette derniere qui l'emporte");

          EGAL(disperser_les_niveaux_aux_huit_coins_des_cubes_elementaires,FAUX);
                                        /* Et la dispersion est inhibee...                                                           */
          Eblock
     ATes
          Bblock
          Eblock
     ETes

     begin_nouveau_block
          Bblock
          Test(EST_VRAI(les_images_sont_standards))
                                        /* Test introduit le 20121110121036...                                                       */
               Bblock
               GENERATION_D_UN_ALBUM(album
                                    ,BLOC(Bblock
                                          CALS(dAnoir(album_d_imagesR));
                                        /* Initialisation de l'album Resultat.                                                       */
                                          Eblock
                                          )
                                    ,BLOC(Bblock
                                          Test(IL_FAUT(disperser_les_niveaux_aux_huit_coins_des_cubes_elementaires))
                                               Bblock
                                               Astore_point_continu_lineaire(niveau_courant_denormalise
                                                                            ,album_d_imagesR
                                                                            ,ADD2(coordonnee_X_denormalisee_precise
                                                                                 ,FLOT(SOUS(X,Xmin_begin_ligneQ))
                                                                                  )
                                                                            ,ADD2(coordonnee_Y_denormalisee_precise
                                                                                 ,FLOT(SOUS(Y,Ymin_begin_colonneQ))
                                                                                  )
                                                                            ,ADD2(coordonnee_Z_denormalisee_precise
                                                                                 ,FLOT(SOUS(Z,Zmin_begin_fuiteQ))
                                                                                  )
                                                                            ,ecraser_les_niveaux_anterieurs
                                                                             );
                                        /* Possibilite introduite le 20140101101115...                                               */
                                               Eblock
                                          ATes
                                               Bblock
                                               DEFV(genere_p,INIT(niveau_courant_denormalise_effectif,niveau_courant_denormalise));

                                               Test(IL_FAUT(cumuler_les_niveaux))
                                        /* Test introduit le 20190118112521...                                                       */
                                                    Bblock
                                                    DEFV(genere_p,INIT(niveau_anterieur_denormalise
                                                                      ,Aload_point_valide(album_d_imagesR,X,Y,Z)
                                                                       )
                                                         );

                                                    EGAL(niveau_courant_denormalise_effectif
                                                        ,GENP(NIVA(LIZ2(ponderation_cumuler_les_niveaux_ADD2
                                                                       ,FLOT(ADD2(NIVR(niveau_anterieur_denormalise)
                                                                                 ,NIVR(niveau_courant_denormalise_effectif)
                                                                                  )
                                                                             )
                                                                       ,ponderation_cumuler_les_niveaux_MAX2
                                                                       ,FLOT(MAX2(NIVR(niveau_anterieur_denormalise)
                                                                                 ,NIVR(niveau_courant_denormalise_effectif)
                                                                                  )
                                                                             )
                                                                        )
                                                                   )
                                                              )
                                                         );
                                        /* On notera au passage qu'il peut y avoir ici un debordement, mais que faire d'autre que    */
                                        /* de l'accepter...                                                                          */
                                                    Eblock
                                               ATes
                                                    Bblock
                                                    Eblock
                                               ETes

                                               Astore_point_valide(niveau_courant_denormalise_effectif
                                                                  ,album_d_imagesR
                                                                  ,X
                                                                  ,Y
                                                                  ,Z
                                                                   );
                                               Eblock
                                          ETes
                                        /* Rangement du point courant {X,Y,Z}...                                                     */
                                          Eblock
                                          )
                                    ,dAupdate_album
                                     );
               Eblock
          ATes
               Bblock
               GENERATION_D_UN_ALBUM(albumF
                                    ,BLOC(Bblock
                                          CALS(dAFinitialisation(album_d_imagesR,FZERO));
                                        /* Initialisation de l'album Resultat.                                                       */
                                          Eblock
                                          )
                                    ,BLOC(Bblock
                                          Test(IL_FAUT(disperser_les_niveaux_aux_huit_coins_des_cubes_elementaires))
                                               Bblock
                                               AstoreF_point_continu_lineaire(niveau_courant_normalise
                                                                             ,album_d_imagesR
                                                                             ,ADD2(coordonnee_X_denormalisee_precise
                                                                                  ,FLOT(SOUS(X,Xmin_begin_ligneQ))
                                                                                   )
                                                                             ,ADD2(coordonnee_Y_denormalisee_precise
                                                                                  ,FLOT(SOUS(Y,Ymin_begin_colonneQ))
                                                                                   )
                                                                             ,ADD2(coordonnee_Z_denormalisee_precise
                                                                                  ,FLOT(SOUS(Z,Zmin_begin_fuiteQ))
                                                                                   )
                                                                             ,ecraser_les_niveaux_anterieurs
                                                                              );
                                        /* Possibilite introduite le 20140101101115...                                               */
                                               Eblock
                                          ATes
                                               Bblock
                                               DEFV(genere_Float,INIT(niveau_courant_normalise_effectif,niveau_courant_normalise));

                                               Test(IL_FAUT(cumuler_les_niveaux))
                                        /* Test introduit le 20190118112521...                                                       */
                                                    Bblock
                                                    DEFV(genere_Float,INIT(niveau_anterieur_normalise
                                                                          ,AloadF_point_valide(album_d_imagesR,X,Y,Z)
                                                                           )
                                                         );

                                                    EGAL(niveau_courant_normalise_effectif
                                                        ,LIZ2(ponderation_cumuler_les_niveaux_ADD2
                                                             ,ADD2(niveau_anterieur_normalise,niveau_courant_normalise_effectif)
                                                             ,ponderation_cumuler_les_niveaux_MAX2
                                                             ,MAX2(niveau_anterieur_normalise,niveau_courant_normalise_effectif)
                                                              )
                                                         );
                                                    Eblock
                                               ATes
                                                    Bblock
                                                    Eblock
                                               ETes

                                               AstoreF_point_valide(niveau_courant_normalise_effectif
                                                                   ,album_d_imagesR
                                                                   ,X
                                                                   ,Y
                                                                   ,Z
                                                                    );
                                               Eblock
                                          ETes
                                        /* Rangement du point courant {X,Y,Z}...                                                     */
                                          Eblock
                                          )
                                    ,dAupdateF_album
                                     );
               Eblock
          ETes
          Eblock
     end_nouveau_block

     lGENERATION_D_UN_FICHIER(liste_initiale_des_DEMI_PAVE_Z,DEMI_PAVE_Z_IMPLICITE);
     lGENERATION_D_UN_FICHIER(liste_initiale_des_DEMI_PAVE_Y,DEMI_PAVE_Y_IMPLICITE);
     lGENERATION_D_UN_FICHIER(liste_initiale_des_DEMI_PAVE_X,DEMI_PAVE_X_IMPLICITE);
     lGENERATION_D_UN_FICHIER(liste_initiale_des_NIVEAU,NIVEAU_IMPLICITE);
     lGENERATION_D_UN_FICHIER(liste_initiale_des_Z,Z_IMPLICITE);
     lGENERATION_D_UN_FICHIER(liste_initiale_des_Y,Y_IMPLICITE);
     lGENERATION_D_UN_FICHIER(liste_initiale_des_X,X_IMPLICITE);

     RETU_Commande;
     Eblock
ECommande



Copyright © Jean-François COLONNA, 2019-2024.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2019-2024.