/*************************************************************************************************************************************/ /* */ /* R E D U C T I O N D ' U N S E G M E N T [ g1 , d1 ] E N U N */ /* S E G M E N T [ g2 , d2 ] E N G E N E R A L I N C L U S ( E T C E N T R E ) D A N S [ g1 , d1 ] : */ /* */ /* */ /* Author of '$xcg/SegReduct.01$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 20110821094703). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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_MINI /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #define BORNE_GAUCHE \ COORDONNEE_BARYCENTRIQUE_MINIMALE #define BORNE_DROITE \ COORDONNEE_BARYCENTRIQUE_MAXIMALE /* Definition du segment initial. */ #define FACTEUR_DE_REDUCTION \ FDU \ /* Facteur de reduction. */ #define TRANSLATION \ FZERO \ /* Translation du resultat. */ #define CALCULER_LA_NOUVELLE_BORNE_GAUCHE \ VRAI \ /* Que faut-il calculer : la nouvelle borne gauche ('VRAI') ou la nouvelle borne */ \ /* droite ('FAUX') ? */ #include xcg/ARIT.01.I" #include xci/valeurs.01.I" /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ #include xci/valeurs.02.I" _____FORCER_UN_CHANGEMENT_DE_LIGNE_EN_PASSE_2_____ /* ATTENTION : ce changement de ligne est obligatoire car sinon, le "#include" qui suit */ /* n'est pas interprete correctement (un simple saut de ligne entre les deux '#include's */ /* ci-dessus semble suffire, mais le '_____FORCER_UN_CHANGEMENT_DE_LIGNE_EN_PASSE_2_____' */ /* est plus prudent, on ne sait jamais ce qu'il peut se passer plus tard...). */ #include xcg/SegReduct.01.I" /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* R E D U C T I O N D ' U N S E G M E N T [ g1 , d1 ] E N U N */ /* S E G M E N T [ g2 , d2 ] E N G E N E R A L I N C L U S ( E T C E N T R E ) D A N S [ g1 , d1 ] : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(Float,INIT(borne_gauche,BORNE_GAUCHE)); DEFV(Float,INIT(borne_droite,BORNE_DROITE)); /* Definition du segment initial. */ DEFV(Float,INIT(facteur_de_reduction,FACTEUR_DE_REDUCTION)); /* Facteur de reduction. */ DEFV(Float,INIT(translation,TRANSLATION)); /* Translation du resultat. */ DEFV(Logical,INIT(calculer_la_nouvelle_borne_gauche,CALCULER_LA_NOUVELLE_BORNE_GAUCHE)); /* Que faut-il calculer : la nouvelle borne gauche ('VRAI') ou la nouvelle borne */ \ /* droite ('FAUX') ? */ #include xci/valeurs.03.I" /*..............................................................................................................................*/ GET_ARGUMENTS_(nombre_d_arguments ,BLOC(GET_ARGUMENT_F("borne_gauche=""bg=",borne_gauche); GET_ARGUMENT_F("borne_droite=""bd=",borne_droite); GET_ARGUMENT_F("facteur=""reduction=""f=",facteur_de_reduction); GET_ARGUMENT_F("translation=""t=",translation); GET_ARGUMENT_L("calculer_borne_gauche=""cbg=",calculer_la_nouvelle_borne_gauche); GET_ARGUMENT_N("calculer_borne_droite=""cbd=",calculer_la_nouvelle_borne_gauche); PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_1; PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_2; ) ); EDITION_DE_LA_VALEUR_DE_L_OPERATEUR(REDUCTION_D_UN_SEGMENT(borne_gauche,borne_droite)); /* Edition de la nouvelle borne demandee : */ /* */ /* G+D */ /* G' = ----- - f.(D-G) + t */ /* 2 */ /* */ /* pour la "Gauche" et : */ /* */ /* G+D */ /* D' = ----- + f.(D-G) + t */ /* 2 */ /* */ /* pour la "Droite"... */ /* */ /* */ /* ATTENTION : on notera la presence incontournable de 'REDUCTION_D_UN_SEGMENT(...)' */ /* definie dans 'v $xcg/SegReduct.01$I' a cause de l'operateur 'OPC1(...)' que cette */ /* definition contient et qui ne peut figurer au premier niveau (celui d'un '$K'...). */ RETU_Commande; Eblock ECommande