Changeset 1592 in Sophya


Ignore:
Timestamp:
Jul 23, 2001, 5:41:15 PM (24 years ago)
Author:
ansari
Message:

Info resolution ecran/preparation pour calcul facteur d'echelle pour fontes ds PSFile - Reza 23/7/2001

Location:
trunk/SophyaPI/PI
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/piapplgen.cc

    r135 r1592  
    136136// void  PIApplicationPrefCompSize(int& szx, int& szy)
    137137//      Fonction globale
    138 // void  PrefCompSz(int& szx, int& szy)
     138// void  PrefCompSize(int& szx, int& szy)
    139139//      Renvoie la taille préférée pour les composantes standard. "szx,szy"
    140140//      est la taille (en pixels) pour un champ texte, ou un bouton "(PIText, PIButton)"
    141141//      avec l'étiquette ou un contenu de 6 caractères (Ex: Cancel).
    142142//
    143 // void  PIApplicationScreenSize()
     143// void  PIApplicationScreenSize(int& szx, int& szy)
    144144//      Fonction globale
    145 // void  ScreenSz(int& szx, int& szy)
    146 //      Renvoie la taille en pixels de l'écran
     145// void  ScreenSize(int& szx, int& szy)
     146//      Renvoie la taille de l'écran en pixels
     147//
     148// void  PIApplicationScreenSizeMM(int& szx, int& szy)
     149//      Fonction globale
     150// void  ScreenSizeMM(int& szx, int& szy)
     151//      Renvoie la taille de l'écran en mm
     152//
     153// void  PIApplicationScreenResolution(int& resolx, int& resoly)
     154//      Fonction globale
     155// void  ScreenResolution(int& resolx, int& resoly)
     156//      Renvoie la resolution de l'ecran en pixels / cm
    147157// 
    148158//--
     
    151161{
    152162szx = szy = 10;
    153 if (curapp)  curapp->PrefCompSz(szx, szy);
     163if (curapp)  curapp->PrefCompSize(szx, szy);
    154164return;
    155165}
     
    157167{
    158168szx = szy = 500;
    159 if (curapp)  curapp->ScreenSz(szx, szy);
     169if (curapp)  curapp->ScreenSize(szx, szy);
    160170return;
    161171}
     172void     PIApplicationScreenSizeMM(int& szx, int& szy)
     173{
     174szx = szy = 400;
     175if (curapp)  curapp->ScreenSizeMM(szx, szy);
     176return;
     177}
     178void     PIApplicationScreenResolution(int& resolx, int& resoly)
     179{
     180resolx = resoly = 30;
     181if (curapp)  curapp->ScreenResolution(resolx, resoly);
     182return;
     183}
  • trunk/SophyaPI/PI/piapplgen.h

    r138 r1592  
    3030        virtual void              AppendMenu(PIMenu *pdm);
    3131
    32         virtual void              PrefCompSz(int& szx, int& szy) = 0;
    33         virtual void              ScreenSz(int& szx, int& szy) = 0;
     32        virtual void              PrefCompSize(int& szx, int& szy) = 0;
     33        virtual void              ScreenSize(int& szx, int& szy) = 0;
     34        virtual void              ScreenSizeMM(int& szx, int& szy) = 0;
     35        virtual void              ScreenResolution(int& resolx, int& resoly) = 0;
    3436
    3537        virtual void              RedirectOutStream(PIConsole* cons, unsigned char va= PIVA_Def)  = 0;
     
    4547void     PIApplicationPrefCompSize(int& szx, int& szy); 
    4648void     PIApplicationScreenSize(int& szx, int& szy); 
     49void     PIApplicationScreenSizeMM(int& szx, int& szy); 
     50void     PIApplicationScreenResolution(int& resolx, int& resoly);
    4751
    4852#endif
  • trunk/SophyaPI/PI/piapplx.cc

    r1263 r1592  
    117117
    118118int msx,msy;
    119 PrefCompSz(msx, msy);
     119PrefCompSize(msx, msy);
    120120msy+=5;
    121121topwdg->SetSize(sx, sy+msy);
     
    279279
    280280/* --Methode-- */
    281 void PIApplicationX::PrefCompSz(int& szx, int& szy)
     281void PIApplicationX::PrefCompSize(int& szx, int& szy)
    282282{
    283283int szf;
     
    287287
    288288/* --Methode-- */
    289 void PIApplicationX::ScreenSz(int& szx, int& szy)
     289void PIApplicationX::ScreenSize(int& szx, int& szy)
    290290{
    291291Display * dsp = PIXDisplay();
     
    293293szy = DisplayHeight(dsp, DefaultScreen(dsp));
    294294}
     295
     296/* --Methode-- */
     297void PIApplicationX::ScreenSizeMM(int& szx, int& szy)
     298{
     299Display * dsp = PIXDisplay();
     300szx = DisplayWidthMM(dsp, DefaultScreen(dsp));
     301szy = DisplayHeightMM(dsp, DefaultScreen(dsp));
     302}
     303
     304/* --Methode-- */
     305void PIApplicationX::ScreenResolution(int& resolx, int& resoly)
     306{
     307Display * dsp = PIXDisplay();
     308resolx = (int)((double)DisplayWidth(dsp, DefaultScreen(dsp))*10./
     309  (double)DisplayWidthMM(dsp, DefaultScreen(dsp)));
     310resoly = (int)((double)DisplayHeight(dsp, DefaultScreen(dsp))*10./
     311  (double)DisplayHeightMM(dsp, DefaultScreen(dsp)));
     312}
     313
     314
    295315
    296316
  • trunk/SophyaPI/PI/piapplx.h

    r128 r1592  
    1919  virtual void              SetBlocked();
    2020
    21   virtual void              PrefCompSz(int& szx, int& szy);
    22   virtual void              ScreenSz(int& szx, int& szy);
     21  virtual void              PrefCompSize(int& szx, int& szy);
     22  virtual void              ScreenSize(int& szx, int& szy);
     23  virtual void              ScreenSizeMM(int& szx, int& szy);
     24  virtual void              ScreenResolution(int& resolx, int& resoly);
    2325
    2426  virtual void              RedirectOutStream(PIConsole* cons, unsigned char va= PIVA_Def);
  • trunk/SophyaPI/PI/piaxestools.cc

    r1589 r1592  
    8080// On definit la taille a partir de la taille par defaut des composantes
    8181// PIApplicationPrefCompSize(bsx, bsy);
    82 par->PrefCompSz(bsx, bsy);
     82par->PrefCompSize(bsx, bsy);
    8383spx = bsx/10;
    8484spy = bsy/4;
  • trunk/SophyaPI/PI/pidrwtools.cc

    r1589 r1592  
    9797// On definit la taille a partir de la taille par defaut des composantes
    9898// PIApplicationPrefCompSize(bsx, bsy);
    99 par->PrefCompSz(bsx, bsy);
     99par->PrefCompSize(bsx, bsy);
    100100spx = bsx/10;
    101101spy = bsy/4;
  • trunk/SophyaPI/PI/pigraphgen.cc

    r316 r1592  
    112112//      Trace la chaîne de caractères "s" à la position "x,y",
    113113//      en utilisant la couleur d'avant-plan (Foreground)
     114//      La chaine est trace avec une justification a gauche, ou droite,
     115//      ou centree (horzontal) - bas, haut, milieu (vertical), en fonction de
     116//      de la valeur du flag "pos"
     117//|     PI_HorizontalLeft PI_HorizontalCenter PI_HorizontalRight
     118//|     PI_VerticalBottom PI_VerticalCenter PI_VerticalTop
    114119// void  DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0)
    115120//      Trace la chaîne de caractères "s" à la position "x,y" . La couleur d'
    116121//      arrière-plan est utilisée pour remplir la zone rectangulaire occupée par
    117122//      le tracé de texte.
     123//      La chaine est trace avec une justification a gauche, ou droite,
     124//      ou centree (horzontal) - bas, haut, milieu (vertical), en fonction de
     125//      de la valeur du flag "pos"
     126//|     PI_HorizontalLeft PI_HorizontalCenter PI_HorizontalRight
     127//|     PI_VerticalBottom PI_VerticalCenter PI_VerticalTop
    118128//--
    119129
  • trunk/SophyaPI/PI/pigraphgen.h

    r1034 r1592  
    2727                 PI_TriangleMarker=7, PI_FTriangleMarker=8,
    2828                 PI_StarMarker=9, PI_FStarMarker=10 };
     29
     30enum PIGrPosHorizontal { PI_HorizontalLeft = 0, PI_HorizontalCenter = 1,
     31                         PI_HorizontalRight = 2 };
     32enum PIGrPosVertical { PI_VerticalBottom = 32, PI_VerticalCenter = 36,
     33                       PI_VerticalTop = 40 };
    2934
    3035enum PIGOMode { PI_GOCopy = 0, PI_GOXOR = 1, PI_GOInvert = 2 };
  • trunk/SophyaPI/PI/piimgtools.cc

    r1512 r1592  
    6363// On definit la taille a partir de la taille par defaut des composantes
    6464// PIApplicationPrefCompSize(bsx, bsy);
    65 par->PrefCompSz(bsx, bsy);
     65par->PrefCompSize(bsx, bsy);
    6666spx = bsx/10;
    6767spy = bsy/4;
  • trunk/SophyaPI/PI/piversion.h

    r1564 r1592  
    22#define PIVERSION_H_SEEN
    33
    4 #define PI_VERSIONNUMBER  2.98
     4#define PI_VERSIONNUMBER  3.1
    55
    66#endif
  • trunk/SophyaPI/PI/psfile.cc

    r1573 r1592  
    293293
    294294/*
     295   Utilisation de la resolution coordonnees utilisateur (resolution ecran)
     296   pour definir correctement la taille des fontes
     297                                      R. Ansari - Juillet 2001
     298*/
     299/* Definition de la resolution coordonnees user par defaut (point/cm ou pixels/cm) */
     300
     301int PSFile::def_user_resol_X = 30;
     302int PSFile::def_user_resol_Y = 30;
     303void PSFile::SetDefaultUserResolution(int resx, int resy)
     304{
     305  if ((resx < 1) || (resy < 1)) return;
     306  def_user_resol_X = resx;
     307  def_user_resol_Y = resy;
     308}
     309void PSFile::GetDefaultUserResolution(int& resx, int& resy)
     310{
     311  if ((resx < 1) || (resy < 1)) return;
     312  resx = def_user_resol_X;
     313  resy = def_user_resol_Y;
     314}
     315
     316
     317/*
    295318 *   PostScript encapsule...
    296319 *
  • trunk/SophyaPI/PI/psfile.h

    r440 r1592  
    2727#include "pifontgen.h"
    2828
    29 #include "pigraphgen.h"      // Types enumeres repris de Peida:PIFontSize...
     29#include "pigraphgen.h"      // Types enumeres repris de PI:PIFontSize...
    3030#include PICMAP_H
    3131
     
    7171
    7272public:
     73    /* Definition de la resolution coordonnees user par defaut (point/cm) */
     74    static void SetDefaultUserResolution(int resx, int resy);
     75    static void GetDefaultUserResolution(int & resx, int & resy);
     76
    7377    /* Production fichier eps */
    7478    PSFile (const char * FileName, double sc = 1.0);
     
    201205    int              mMarkerSize; /* Taille (en points) du marker courant */
    202206    bool setFontDone ; /* Pour forcer la selection de Marker apres DrawString() */
     207
     208  /* resolution coordonnees user (point/cm - pixels/cm) */
     209    static int  def_user_resol_X, def_user_resol_Y;
    203210} ;
    204211
Note: See TracChangeset for help on using the changeset viewer.