Changeset 190 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Jan 19, 1999, 6:40:15 PM (27 years ago)
Author:
ercodmgr
Message:

Ajout DottedLines ds PIGraphic, PIWdg::Lock/UnLockBinding()
Ajout PIWdg::GetBinding() , Autodoc de qques classes Reza 19/01/99

Location:
trunk/SophyaPI/PI
Files:
17 edited

Legend:

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

    r184 r190  
    1414// ........................  Classe PIDrawer3D ..........................
    1515// ......................................................................
    16 
     16//++
     17// Class        PIDrawer3D
     18// Lib          PI
     19// include      pidrawer.h
     20//
     21//      Classe pour la création d'objets, capables de produire
     22//      un dessin 3D dans une composante graphique.
     23//--
     24//++
     25// Links        Parent
     26// PIDrawer
     27//--
     28//++
     29// Links        Voir aussi
     30// PIGraphic3D
     31// PIDraw3DWdg
     32//--
     33
     34//++
     35// Titre        Constructeur, méthodes
     36//--
     37//++
     38// PIDrawer3D()
     39//      Cosntructeur
     40// void Set3DView_Obs(float xo, float yo, float zo, float teta, float phi, float psi, -
     41//               float dax, float day, float co, float dco=0.2)
     42//      Définition de la vue 3D. Voir "PIGraphic3D::Set3DCS_Obs(...)"
     43// void Set3DView(float xc, float yc, float zc, float xo, float yo, float zo, -
     44//                float dax, float day, float dco=0.2, float psi=0.)
     45//      Définition de la vue 3D. Voir "PIGraphic3D::Set3DCS(...)"
     46// bool Get3DView(float& xc, float& yc, float& zc, float& xo, float& yo, float& zo, -
     47//                float& teta, float& phi, float& psi, float& dax, float& day, float& co, float& dco)
     48//      Renvoie la définition de la Vue-3D. Retourne "true " si définie par "Set3DView_Obs()"
     49// void Draw3DBoxe(PIGraphic3D* g3, float xx1, float xx2, float yy1, float yy2,  -
     50//                 float zz1, float zz2, float xl1, float xl2, -
     51//                 float yl1, float yl2, float zl1, float zl2)
     52//      Trace une boîte avec les coordonnées matérialisant la vue 3D.
     53//--
    1754
    1855/* --Methode-- */
     
    187224// ......................................................................
    188225
     226//++
     227// Class        PIDraw3DWdg
     228// Lib          PI
     229// include      pi3ddrw.h
     230//
     231//      Classe pour la l'affichage et la manipulation d'un ensemble
     232//      de *Drawer3D* avec la gestion de zoom, rotation, déplacement
     233//      d'objet.
     234//      * Bouton-1 : Envoie le message "PIMsg_Active".
     235//      * Bouton-2 : Permet de faire tourner l'observateur (caméra)
     236//      autour de l'objet.
     237//      * Shift-Bouton-2 : Permet de tourner l'objet en maintenant
     238//      la caméra fixe. Cette fonction peut-être réalisée sans le shift
     239//      à partir du centre de l'objet, en l'ayant préalablement activée
     240//      par <Alt>S.
     241//      * Bouton-3 : Gestion de zoom (On approche/ éloigne la caméra, ou
     242//      on change l'angle d'ouverture)
     243//
     244//      Gestion du clavier :
     245//      * <Alt>O : Affichage d'une fenêtre de changement des attributs graphiques
     246//      * <Alt>V : Copier/*Coller* Ajout du texte du buffer copier/coller
     247//      sur l'objet à la position courante de la souris
     248//      * <Alt>Z : Supprime les textes et signes ajoutés au dessin.
     249//      * <Alt>A : Active/desactive l'affichage des axes
     250//      * <Alt>R : Reinitialise la vue 3D
     251//      * <Alt>S : Active/desactive le mode de rotation d'objet sans Shift
     252//
     253//--
     254//++
     255// Links        Parents
     256// PIBaseWdg
     257//--
     258//++
     259// Links        Voir aussi
     260// PIDrawer3D
     261//--
     262
     263//++
     264// Titre        Constructeur, méthodes
     265//--
     266//++
     267// PIDraw3DWdg(PIContainerGen *par, char *nom, int sx=100, int sy=100, int px=0, int py=0)
     268//      Constructeur
     269// long  kind()
     270//      Renvoie le type de l'objet ("=PIDraw3DWdg::ClassId")
     271// int AddDrawer3D(PIDrawer3D*, bool ad=false)
     272//      Ajoute un Drawer3D
     273//--
    189274
    190275/* --Methode-- */
  • trunk/SophyaPI/PI/picmap.cc

    r163 r190  
     1// Module PI : Peida Interactive     PIColorMap
     2// Gestion de table de couleurs        96
     3// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
     4
    15#include "picmap.h"
     6
     7//++
     8// Class        PIColorMap
     9// Lib          PI
     10// include      picmap.h
     11//
     12//      Classe fournissant les services de gestion des tables de couleur.
     13//      Une hiérachie un peu complexe a été mise en place pour
     14//      l'implémentation des tables de couleurs pour chaque système
     15//      (Mac, XWindow, ...) :
     16//|     PIColorMapGen  -----  PIColorMapX     (=PIColorMapNative)
     17//|                      |--  PIColorMapMac   (=PIColorMapNative)
     18//      et la gestion de table de couleurs standard partagée.
     19//|     PIColorMapNative (=X,Mac,...) ----- PIColorMap.
     20//      La seule classe à utiliser est *PIColorMap* qui fournit
     21//      l'ensemble des services de gestion de table de couleurs.
     22//--
    223
    324#define  MXMAPIDS   10
     
    1637static   int NMaxTableAuto = 0;
    1738static   PIColorMap* mMaps[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL };
     39
     40//++
     41// Titre        Constructeurs, méthodes
     42//--
     43//++
     44// PIColorMap(CMapId id)
     45//      Constructeur d'une table de couleur standard, identifiée par "CMapId id"
     46//|     CMAP_GREY32     :  32 niveaux de gris
     47//|     CMAP_GREYINV32  :  32 niveaux gris du blanc au noir
     48//|     CMAP_COLRJ32    :  32 couleurs, du Rouge au Jaune/blanc
     49//|     CMAP_COLBR32    :  32 couleurs du bleu au rouge (arcenciel)
     50//|     CMAP_COLRV32    :  32 couleurs du rouge au violet
     51//|     CMAP_GREY128    :  128 niveaux de gris
     52//|     CMAP_GREYINV128 :  128 niveaux gris inversé
     53//|     CMAP_COLRJ128   :  128 couleurs, du Rouge au Jaune/blanc
     54//|     CMAP_COLBR128   :  128 couleurs du bleu au rouge (arcenciel)
     55//|     CMAP_COL16      :  16 Couleurs arcenciel
     56//|     CMAP_OTHER      :  Table non standard
     57//      Toutes les tables de couleurs standard possèdent 256 cellules de couleurs,
     58//      contenant 16 ou 32 ou 128 couleurs distinctes.
     59//
     60// PIColorMap(string const& nom, int nCol)
     61//      Constructeur d'une table de "nCol" couleurs identifié par la chaîne "nom".
     62// PIColorMap(PIColorMap&)
     63//      Constructeur par copie.
     64// int Type()
     65//      Retourne le type de la table, correspondant à "CMapId id"
     66// int NCol()
     67//      Retourne le nombre de cellules de couleurs dans la table
     68// string const& Nom()
     69//      Renvoie le nom de la table.
     70//--
    1871
    1972PIColorMap::PIColorMap(CMapId id)
     
    95148
    96149
     150//++
     151// Titre        Gestion des couleurs
     152//      Une structure *PIColor* permet la manipulation des couleurs à
     153//      travers 3 champs de type "unsigned short: 0 ... 65535" définissant
     154//      les intensité des couleurs de base: Rouge, Bleue, Vert.
     155//|     struct PIColor {
     156//|       unsigned short red;
     157//|       unsigned short green;
     158//|       unsigned short blue; }
     159//
     160//--
     161//++
     162// PIColor GetColor(int n)     
     163//      Renvoie la couleur de la cellule "n"
     164// bool AllocColor(PIColor const& col, int index)
     165//      Alloue la couleur définie par "col" dans la cellule numéro "index".
     166//      Renvoie "true" si OK, "false" sinon.
     167// void  FreeColors()
     168//      Libère les couleurs allouées par la table
     169// long  TotNbColors()
     170//      Renvoie le nombre total de couleurs disponibles
     171//      (Ex 256 pour un système à 8 plans image, 65536 pour 16 plans, etc ...)
     172// int  NbAllocColors()
     173//      Renvoie le nombre total de couleurs déjà utilisée par l'application
     174//--
    97175
    98176void PIColorMap::CleanColorMaps()
  • trunk/SophyaPI/PI/picmap.h

    r63 r190  
     1// This may look like C code, but it is really -*- C++ -*-
     2// Module PI : Peida Interactive     PIColorMap
     3// Gestion de table de couleurs        96
     4// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
     5
    16#ifndef PICMAP_H_SEEN
    27#define PICMAP_H_SEEN
  • trunk/SophyaPI/PI/pidrwtools.cc

    r163 r190  
    204204mOpt[5]->AppendItem("Dashed-Line", 605);
    205205mOpt[5]->AppendItem("ThickDashed", 606);
     206mOpt[5]->AppendItem("ThinDotted", 607);
     207mOpt[5]->AppendItem("Dotted-Line", 608);
     208mOpt[5]->AppendItem("ThickDotted", 609);
    206209mOpt[5]->SetValue(600);
    207210mOpt[5]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
     
    305308                     PI_TriangleMarker, PI_FTriangleMarker,
    306309                     PI_StarMarker, PI_FStarMarker };
    307 PILineAtt line[7] = { PI_NotDefLineAtt, PI_ThinLine, PI_NormalLine, PI_ThickLine,
    308                                         PI_ThinDashedLine, PI_DashedLine, PI_ThickDashedLine};
     310PILineAtt line[10] = { PI_NotDefLineAtt, PI_ThinLine, PI_NormalLine, PI_ThickLine,
     311                                         PI_ThinDashedLine, PI_DashedLine, PI_ThickDashedLine,
     312                                         PI_ThinDottedLine, PI_DottedLine, PI_ThickDottedLine };
    309313
    310314PIFontAtt fntatt[4] = { PI_NotDefFontAtt, PI_RomanFont, PI_BoldFont, PI_ItalicFont };
     
    363367    drw->SetFontAtt(fntsz[kk], fntatt[kkk]);
    364368    k =  mOpt[5]->GetValue()-600;
    365     if ( (k < 0) || (k > 6) )  k = 0;
     369    if ( (k < 0) || (k > 9) )  k = 0;
    366370    drw->SetLineAtt(line[k]);
    367371    if (msg == 2800) drw->Refresh();
  • trunk/SophyaPI/PI/pievthandler.cc

    r170 r190  
    55
    66#include "pievthandler.h"
     7
     8//++
     9// Class        PIEventHandler
     10// Lib          PI
     11// include      pievthandler.h
     12//
     13//      Classe fournissant les services nécessaires à la création de
     14//      gestionnaire d'événements écran-clavier-souris.
     15//--
     16//++
     17// Links        Parents
     18// PIMsgHandler
     19//--
     20//++
     21// Links        Voir aussi
     22// PIWdg
     23//--
     24//++
     25// Titre        Constructeur, méthodes
     26//--
     27//++
     28// PIEventHandler(PIMsgHandler* par=NULL, PIMessage msg = 0)
     29//      Constructeur. "par" est le gestionnaire de message parent, et
     30//      "msg" le message associé.
     31//
     32// void   SetMsg(PIMessage msg = 0)
     33//      Modification du message associé.
     34// PIMessage  Msg()
     35//      Renvoie le message associé.
     36//--
     37
    738
    839
     
    2556}
    2657
     58//++
     59// Titre        Traitement des événements
     60//--
     61//++
     62// void Draw(PIGraphic* g, int x0, int y0, int dx, int dy)
     63//      Méthode spécialisée appelée pour retracer le contenu
     64//      d'une partie de l'objet "PIWdg" auquel est attaché l'objet
     65//      "PIEventHandler". "PIGraphic* g" fournit les services de
     66//      tracé graphique et "(x0, y0), "dx * dy" définissent le
     67//      rectangle à retracer. L'implementation par défaut ne
     68//      fait rien.
     69//
     70// void ProcessEvent()
     71//      Cette méthode est appelée pour le traitement de tous
     72//      les autres types d'événements. L'implementation par défaut
     73//      ne fait rien.
     74//--
     75
     76
    2777/* --Methode-- */
    2878void PIEventHandler::Draw(PIGraphic*, int, int, int, int)
     
    4494
    4595
     96//++
     97// Titre        Description de l'événement
     98//--
     99//++
     100// PIWdg*  CurrentWdg()
     101//      L'objet "PIWdg" source de l'événement.
     102// PIEventMask EventType()
     103//      Type de l'événement :
     104//|     PIEvent_Draw
     105//|     PIEvent_Resize , PIEvent_Enter , PIEvent_Leave
     106//|     PIEvent_ButxPress , PIEvent_ButxRelease  (x=1,2,3)
     107//|     PIEvent_PtrMove , PIEvent_PtrxMove (x=1,2,3)
     108//|     PIEvent_Keyboard
     109//
     110// int GetPosX()
     111//      Position X de la souris
     112// int GetPosY()
     113//      Position Y de la souris
     114// int GetKey()
     115//      Code touche du clavier. Code ASCII des caractères ordinaires, ou l'une des constantes:
     116//|     PIK_Return , PIK_Enter
     117//|     PIK_BackSpace , PIK_Delete
     118//|     PIK_Tab , PIK_Escape
     119//|     PIK_Up , PIK_Down
     120//|     PIK_Right , PIK_Left
     121//|     PIK_Previous , PIK_Next
     122//
     123// PIKeyModifier GetKeyMod()
     124//      Code d'une des touches <Shift>, <Alt>, <Cntl> si appuyée en même temps.
     125//|     PIKM_Blank , PIKM_Shift , PIKM_Alt , PIKM_Cntl
     126//
     127// unsigned long GetEventTime()
     128//      Temps de l'action en millisecondes.
     129//--
     130
    46131/* --Methode-- */
    47132void PIEventHandler::SetEventInfo(PIEventMask evt, int px, int py,
  • trunk/SophyaPI/PI/pigraphgen.cc

    r180 r190  
    199199//      Choix du type de ligne pour le tracé des lignes et contours
    200200//|     PI_NormalLine, PI_ThinLine , PI_ThickLine
    201 //|     PI_DashedLine, PI_ThinDashedLine , PI_ThickDashedLine
     201//|     PI_DashedLine, PI_ThinDashedLine, PI_ThickDashedLine
     202//|     PI_DottedLine, PI_ThinDottedLine, PI_ThickDottedLine
    202203// void  SelMarker(int msz=3, PIMarker mrk=PI_DotMarker)
    203204//      Choix de la taille et du type de signe pour "DrawMarker() / DrawMarkers()"
  • trunk/SophyaPI/PI/pigraphgen.h

    r180 r190  
    3030enum PILineAtt { PI_NotDefLineAtt = -1,
    3131                 PI_NormalLine = 0, PI_ThinLine = 1, PI_ThickLine = 2 ,
    32                  PI_DashedLine = 128, PI_ThinDashedLine = 129, PI_ThickDashedLine = 130 };
     32                 PI_DashedLine = 64, PI_ThinDashedLine = 65, PI_ThickDashedLine = 66 ,
     33                 PI_DottedLine = 128, PI_ThinDottedLine = 129, PI_ThickDottedLine = 130 };
    3334
    3435enum PIMarker  { PI_NotDefMarker = -1,
  • trunk/SophyaPI/PI/pigraphx.cc

    r180 r190  
    485485unsigned int lt=0;
    486486int lstyle=LineSolid;
     487char dash[2]= {3,3};   
    487488
    488489if (att == mLAtt)  return;
     
    502503    lstyle = LineSolid;
    503504    break;
     505
    504506  case PI_DashedLine :
    505507    lt = 2;
    506508    lstyle = LineOnOffDash;
     509    dash[0] = dash[1] = 6; 
    507510    break;
    508511  case PI_ThickDashedLine :
    509512    lt = 4;
    510513    lstyle = LineOnOffDash;
     514    dash[0] = dash[1] = 6; 
    511515    break;
    512516  case  PI_ThinDashedLine :
    513517    lt = 0;
    514518    lstyle = LineOnOffDash;
     519    dash[0] = dash[1] = 6; 
     520    break;
     521
     522  case PI_DottedLine :
     523    lt = 2;
     524    lstyle = LineOnOffDash;
     525    dash[0] = 2; dash[1] = 6; 
     526    break;
     527  case PI_ThickDottedLine :
     528    lt = 4;
     529    lstyle = LineOnOffDash;
     530    dash[0] = 2; dash[1] = 6; 
     531    break;
     532  case  PI_ThinDottedLine :
     533    lt = 0;
     534    lstyle = LineOnOffDash;
     535    dash[0] = 2; dash[1] = 6; 
    515536    break;
    516537
     
    520541    break;
    521542  }
    522 if (lstyle != LineSolid) {
    523   char dash[2]= {3,3}; 
     543
     544if (lstyle != LineSolid)
    524545  XSetDashes( mDisp, DefGC(), 0, dash, 2);
    525   }
     546 
    526547XSetLineAttributes(mDisp, DefGC(), lt, lstyle, CapButt, JoinMiter);
    527548mLAtt = att;
  • trunk/SophyaPI/PI/piperiodx.cc

    r170 r190  
    3737int szx,szy,szf;
    3838XtAppContext * appctx = PIXtAppCtx(szx, szy, szf);
    39 mTId = XtAppAddTimeOut(*appctx, mDt*1000, xttimer_action, this);
     39mTId = XtAppAddTimeOut(*appctx, Intervalms(), xttimer_action, this);
    4040mFgact = true;
    4141return;
  • trunk/SophyaPI/PI/pipixmapgen.cc

    r128 r190  
    1 /* Fonctions interface XWindow pour affichage d'images */
    2 /*                  Reza   05/95                       */
    3 
    4 /*                  LAL (Orsay) / IN2P3-CNRS           */
     1// Module PI : Peida Interactive     PIPixmap
     2// Classe de base pour affichage de pixmap  Reza 96
     3// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
    54
    65#include <stdlib.h>
     
    98#include "pipixmapgen.h"
    109
    11 // Methodes de la classe PIPixMap  :
     10// --------- Methodes de la classe PIPixMap  ----------
     11//++
     12// Class        PIPixmap
     13// Lib          PI
     14// include      pipixmapgen.h
     15//
     16//      Classe pour la gestion optimisée des pixmap.
     17//      Un pixmap est un tableau d'index dans une table de couleurs.
     18//      Cette classe gére actuellement des pixmaps avec des index
     19//      codés sur 8 bits (256 couleurs).
     20//      Pour des raisons d'optimisation, cette classe a une
     21//      implémentation spécifique pour chaque plateforme.
     22//      La classe "PIPixmapGen" définit l'interface, et ne doit pas
     23//      être instanciée directement.  Les objets instanciés sont de la
     24//      classes "PIPixmap" et le fichier entête correspondant est "PIPIXMAP_H"
     25//      défini dans "pisysdep.h".
     26//--
     27//++
     28// Links        Parents
     29// PIBaseWdg
     30//--
     31//++
     32// Links        Voir aussi
     33// PIColorMap
     34//--
     35
     36//++
     37// Titre        Constructeur, Pixmap
     38//--
     39//++
     40// PIPixmapGen(PIContainerGen *par, char *nom, int sx=10, int sy=10, int px=0, int py=0)
     41//      Constructeur - Création d'un "PIPIxmap".
     42// long  kind()
     43//      Retourne le type ("=PIPixmap::ClassId")
     44// void  SetPixmap(unsigned char *pix, int sx, int sy, bool refr=true, int ox=0, int oy=0)
     45//      Associe un tableau d'index "pix" de taille "sx * sy".
     46//      (ox,oy)" définissent  l'offset d'affichage.
     47//      Si "refr=true", la méthode "Refresh()" est appelée.
     48//--
     49//++
     50// Titre        Gestion de la table de couleur
     51//--
     52//++
     53// void  SetColMap(PIColorMap* cmp, bool refr=true)
     54//      Change la table de couleur associée.
     55//      Si "refr=true", la méthode "Refresh()" est appelée.
     56// void  SetColMapId(CMapId cmapid, bool refr=true)
     57//      Change la table de couleur associée, à l'aide d'un identificateur
     58//      de table de couleur standard. ("CMapId cmapid").
     59//      Si "refr=true", la méthode "Refresh()" est appelée.
     60// PIColorMap* GetColMap()
     61//      Retourne la table de couleur associée.
     62// CMapId GetColMapId()
     63//      Retourne l'identificateur de la table de couleur associée.
     64// int NbCol()
     65//      Retourne le nombre de couleurs de la table de couleur associée.
     66//--
     67
     68//++
     69// Titre        Actions
     70//--
     71//++
     72// void  But1Press(int x, int y)
     73//      L'action sur le bouton 1 déclenche l'envoi d'un message
     74//      avec le modifier PIMsg_Click. La position du bouton-press
     75//      est stocké.
     76// int  XPPos()
     77//      Position X du click
     78// int  YPPos()
     79//      Position Y du click
     80//--
    1281
    1382/* --Methode-- */
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r163 r190  
    77#include "parradapter.h"
    88
     9//++
     10// Class        PIScDrawWdg
     11// Lib          PI
     12// include      piscdrawwdg.h
     13//
     14//      Classe pour la l'affichage et la manipulation d'un ensemble
     15//      de *Drawer* avec la gestion de zoom (agrandissement).
     16//      * Bouton-1 : Envoie le message "PIMsg_Active" et affiche
     17//      les coordonnées courant (User-Coordinates)
     18//      * Bouton-2 : Permet de définir un rectangle pour le zoom.
     19//
     20//      Gestion du clavier :
     21//      * <Alt>O : Affichage d'une fenêtre de changement des attributs graphiques
     22//      * <Alt>V : Copier/*Coller* Ajout du texte du buffer copier/coller
     23//      sur l'objet à la position courante de la souris
     24//      * <Alt>Z : Supprime les textes et signes ajoutés au dessin.
     25//--
     26//++
     27// Links        Parents
     28// PIBaseWdg
     29//--
     30//++
     31// Links        Voir aussi
     32// PIDrawer
     33//--
     34
    935static inline void fl_swap(float& a, float& b) { float tmp = a; a = b; b = tmp;  }
     36
     37//++
     38// Titre        Constructeurs, méthodes
     39//--
     40//++
     41//  PIScDrawWdg(PIContainerGen *par, char *nom, int sx=100, int sy=100, int px=0, int py=0)
     42//      Constructeur. Contient uniquement le traceur de base, responsable du tracé
     43//      des axes et des éléments ajoutés (textes, ...)
     44// long  kind()
     45//      Renvoie le type ("=PIScDrawWdg::ClassId")
     46// void SetLimits(float xmin, float xmax, float ymin, float ymax, -
     47//           int axrl=kAxeDirSame, int ayud=kAxeDirSame, bool tmp=false)
     48//      Définit les limites de coordonnées.
     49// void  UpdateLimits()
     50//      Recalcule les limites de coordonnées à partir du premier Drawer.
     51// void  SetAxesFlags(unsigned int flags=kAxesDflt)
     52//      Définit les attributs des axes.
     53// int  AddScDrawer(PIDrawer*, bool ad=false)
     54//      Ajoute un Drawer.
     55//--
     56
    1057
    1158PIScDrawWdg::PIScDrawWdg(PIContainerGen *par, char *nom,
  • trunk/SophyaPI/PI/pistzwin.cc

    r158 r190  
    1010
    1111// -------------- Classe PIStackLayout --------------
     12
     13//++
     14// Class        PIStackLayout
     15// Lib          PI
     16// include      pistzwin.h
     17//
     18//      Classe de gestionnaire de "PIWdg" dans un conteneur avec un seul
     19//      "PIWdg" visible à un moment donné. Permet d'empiler plusieurs
     20//      objet dans une fenêtre, et passer de l'un à l'autre.
     21//--
     22//++
     23// Links        Parent
     24// PILayoutMgr
     25//--
     26
     27//++
     28// Titre        Constructeur, méthodes
     29//--
     30//++
     31// PIStackLayout()
     32//      Constructeur
     33// PIWdg*  CurrentWdg()
     34//      Retourne l'objet "PIWdg" visible au moment de l'appel.
     35// int NumCurrentWdg()
     36//      Retourne le numéro de l'objet "PIWdg" visible au moment de l'appel.
     37// void  DispNext()
     38//      Affiche l'objet "PIWdg" suivant.
     39// void  DispWdgNum(int n)
     40//      Affiche l'objet "PIWdg" numéro "n".
     41//--
    1242
    1343/* --Methode-- */
     
    79109}
    80110
     111//++
     112// Class        PIStackWindow
     113// Lib          PI
     114// include      pistzwin.h
     115//
     116//      Classe de fenêtre ("PIWindow") avec le "PIStackLayout".
     117//      Le "PILayoutMgr" ne peut être changé.
     118//--
     119//++
     120// Links        Parent
     121// PIWindow
     122//--
     123//++
     124// Links        Voir aussi
     125// PIStackLayout
     126//--
     127//++
     128// Titre        Constructeur, méthodes
     129//--
     130//++
     131// PIStackWindow(PIMsgHandler* par, char* nom, PIWindowKind k=PIWK_normal, int sx=100, int sy=100, int px=0, int py=0)
     132//      Constructeur - identique à celui de "PIWindow"
     133// void  DispNext()
     134//      Affichage du "PIWdg" suivant.
     135// PIWdg* CurrentWdg()
     136//      Retourne l'objet "PIWdg" courant.
     137// void  StartAutoDisp(int dtms=1000)
     138//      Démarre  l'affichage cyclique automatique avec l'intervalle en temps
     139//      "dtms" spécifié en millisecondes.
     140// void  StopAutoDisp()
     141//      Arrête l'affichage cyclique automatique.
     142// void  PSPrint(PSFile *psf, int ofx=0, int ofy=0)
     143//      Rajoute tous les "PIWdg" associés à la fenêtre à l'objet
     144//      "PSFile" (fichier PostScript), un objet par page.
     145//--
     146
    81147/* --Methode-- */
    82148PIStackWindow::PIStackWindow(PIMsgHandler* par, char* nom, PIWindowKind k,
     
    118184
    119185/* --Methode-- */
    120 void PIStackWindow::StartAutoDisp(int dt)
    121 {
    122 mPerad.Start(dt);
     186void PIStackWindow::StartAutoDisp(int dtms)
     187{
     188mPerad.SetIntervalms(dtms);
     189mPerad.Start();
    123190}
    124191
     
    130197
    131198//-------------------- Classe PIZoneLayout ------------------------------
     199//++
     200// Class        PIZoneLayout
     201// Lib          PI
     202// include      pistzwin.h
     203//
     204//      Classe de gestionnaire de "PIWdg" dans un conteneur,
     205//      divisé en cellule horizotale-verticale.
     206//      En cas d'ajout d'un objet dans une cellule déjà occupée,
     207//      l'objet est supprimé si "SetAutoDelChilds(true)",
     208//      sinon "UnManage()" est appelé pour cet objet.
     209//--
     210//++
     211// Links        Parent
     212// PILayoutMgr
     213//--
     214
     215//++
     216// Titre        Constructeur, méthodes
     217//--
     218//++
     219// PIZoneLayout(int nzx, int nzy)
     220//      Constructeur. Subdivision en "nzx" cellules horizontales,
     221//      "nzy" cellules verticales.
     222// void SetZone(int nzx, int nzy)
     223//      Modification du découpage en cellules.
     224// void  NbZone(int& nzx, int& nzy)
     225//      Retourne le nombre de cellules verticale-horizontale.
     226// PIWdg* NextChildPosSize(int& px, int& py, int& sx, int& sy)
     227//      Retourne la position et la taille d'un eventuel objet "PIWdg"
     228//      ajouté. Retourne le "PIWdg" actuellement dans cette cellule.
     229//--
    132230
    133231/* --Methode-- */
     
    180278child->SetSize(sx, sy);
    181279child->SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic, PIBK_elastic);
     280child->LockBinding();
    182281//  Il faut faire le delete a cet endroit, sinon probleme avec widget motif XmForm  Reza 18/08/98
    183282if (mZWdg[mZc])  {
     
    219318
    220319//-------------------- Classe PIZoneWindow ------------------------------
     320//++
     321// Class        PIZoneWindow
     322// Lib          PI
     323// include      pistzwin.h
     324//
     325//      Classe de fenêtre ("PIWindow") avec le "PIZoneLayout".
     326//      Le "PILayoutMgr" ne peut être changé.
     327//--
     328//++
     329// Links        Parent
     330// PIWindow
     331//--
     332//++
     333// Links        Voir aussi
     334// PIZoneLayout
     335//--
     336//++
     337// Titre        Constructeur, méthodes
     338//--
     339//++
     340// PIZoneWindow(PIMsgHandler* par, char* nom, PIWindowKind k=PIWK_normal, -
     341//              int nzx=1, int nzy=1, int sx=100, int sy=100, int px=0, int py=0)
     342//      Constructeur avec spécification de nombre de cellules horizontal "nzx", vertical "nzy".
     343// void  SetZone(int nzx, int nzy)
     344//      Modification du découpage en cellules.
     345// void NbZone(int& nzx, int& nzy)
     346//      Retourne le nombre de cellules verticale-horizontale.
     347// PIWdg* NextChildPosSize(int& px, int& py, int& sx, int& sy)
     348//      Appel à " PIZoneLayout::NextChildPosSize(...) "
     349//--
    221350
    222351/* --Methode-- */
  • trunk/SophyaPI/PI/pistzwin.h

    r158 r190  
    4646  inline  PIWdg* CurrentWdg() { return( ((PIStackLayout*)layout)->CurrentWdg() ); }
    4747
    48   virtual void  StartAutoDisp(int dt);
     48  virtual void  StartAutoDisp(int dtms=1000);
    4949  virtual void  StopAutoDisp();
    5050
  • trunk/SophyaPI/PI/piwdggen.cc

    r180 r190  
    3333// Links        Parents
    3434// PIMsgHandler
     35//--
     36//++
     37// Links        Voir aussi
     38// PIEventHandler
    3539//--
    3640
     
    6569// void  GetScreenPos(int & spx, int & spy)
    6670//      Renvoie la position de l'objet sur l'écran.
     71//--
     72//++
     73// Titre        Gestion des accrochages (Binding)
     74//--
     75//++
    6776// void  SetBinding(PIBindingKind left, PIBindingKind top, PIBindingKind right, PIBindingKind bottom)
    6877//      Permet de contrôler le comportement de l'objet en cas de changement de taille
     
    7079//      attachée à une distance fixe par rapport au bord opposé du conteneur ("PIBK_fixed"),
    7180//      ou à une position proportionnelle à la taille du conteneur parent. ("PIBK_elastic")
     81// bool  GetBinding((PIBindingKind& left, PIBindingKind& top, PIBindingKind& right, PIBindingKind& bottom)
     82//      Permet de connaitre l'état des accrochages. Retourne "true" si les accrochages ont été
     83//      verrouillé (appel à "LockBinding()"), "false" sinon.
     84// void  LockBinding()
     85//      Verrouille l'état des accrochages. Appel à "SetBinding()" sera alors sans effet.
     86//      Permet à certains *LayouMgr* d'imposer une contrôle strict.
     87// void  UnLockBinding()
     88//      Deverrouille les accrochages.
    7289//--
    7390
     
    177194{
    178195parent = par;
     196bindingLock = false;
    179197SetMsg(0);
    180198SetUserData(NULL, 0);
     
    216234  }
    217235return;
     236}
     237
     238/* --Methode-- */
     239void PIWdgGen::LockBinding()
     240{
     241bindingLock = true;
     242}
     243
     244/* --Methode-- */
     245void PIWdgGen::UnLockBinding()
     246{
     247bindingLock = false;
    218248}
    219249
     
    318348}
    319349*/
     350
     351//++
     352// Class        PIScreenBuffer
     353// Lib          PI
     354// include      piwdggen.h
     355//
     356//      Classe de tampon de dessin hors écran. Permet la copie du contenu des pixels
     357//      depuis et vers des objets "PIWdg", ainsi que depuis et vers d'autres tampon
     358//      d'écran. Un objet "PIGraphic" peut-être instancié pour fournir les services
     359//      de dessin dans un "PIScreenBuffer"
     360//--
     361//++
     362// Links        Voir aussi
     363// PIWdg
     364// PIGraphic
     365//--
     366
     367//++
     368// Titre        Constructeurs, méthodes
     369//--
     370//++
     371// PIScreenBuffer(int sx, int sy)
     372//      Constructeur, création d'un tampon de taille "sx * sy" pixels.
     373// int  XSize()
     374//      Renvoie la taille en X.
     375// int  YSize()
     376//      Renvoie la taille en Y.
     377//
     378//      Pour les opérations de copie, le rectangle source est défini par
     379//      la position du coin haut-gauche "(ox,oy)" et la taille "dx * dy" en pixels.
     380//      La copie s'effectue sur l'objet destination à partir de l'offset "(x,y)".
     381//
     382// void CopyFromWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y)
     383//      Copie depuis l'objet "PIWdg* wdg".
     384// void CopyToWdg(PIWdg* wdg, int ox, int oy, int dx, int dy, int x, int y)
     385//      Copie vers l'objet "PIWdg* wdg".
     386// void CopyFrom(PIScreenBuffer* grb, int ox, int oy, int dx, int dy, int x, int y)
     387//      Copie depuis l'objet "PIScreenBuffer* grb"
     388//--
  • trunk/SophyaPI/PI/piwdggen.h

    r180 r190  
    6464  virtual void           SetBorderWidth(int bw)=0;
    6565  virtual void           SetLabel(string const&) {}
     66
     67//  Gestion des accrochages (binding) aux containers
    6668  virtual void           SetBinding(PIBindingKind left, PIBindingKind top,
    67                                     PIBindingKind right, PIBindingKind bottom)=0;
     69                                    PIBindingKind right, PIBindingKind bottom)      =0;
     70  virtual bool           GetBinding(PIBindingKind& left, PIBindingKind& top,
     71                                    PIBindingKind& right, PIBindingKind& bottom)    =0;
     72  virtual void           LockBinding();
     73  virtual void           UnLockBinding();
    6874
    6975  virtual int            XSize()=0;
     
    116122  list<EvHand>           mDHlist;
    117123  list<EvHand>           mEHlist;
     124  bool                   bindingLock;
    118125private:
    119126  int flag;
  • trunk/SophyaPI/PI/piwdgx.cc

    r180 r190  
    104104wmis =  k_wmi_appshell;
    105105stmng = false;
     106mBKleft =  mBKright =  mBKtop =  mBKbottom = PIBK_free;
    106107#ifdef DEBUG_PIWdgX
    107108printf("Debug_PIWdgX::PIWdgX(int , char * [])  this=%lx  top=%lx \n", (long)this, (long)sdw);
     
    118119sdw = NULL;
    119120wmis = k_wmi_unknown;
     121mBKleft =  mBKright =  mBKtop =  mBKbottom = PIBK_free;
    120122}
    121123
     
    313315Arg  wargs[9];
    314316int n=0;
     317if (bindingLock) return;
    315318if (!sdw)  return;
    316319if (!parent)  return;
     
    341344    XtSetArg(wargs[n],XmNleftPosition, frpos );  n++;
    342345    break;
    343   }
    344 
     346  default :
     347    left = PIBK_free;
     348    XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE);  n++;
     349    break;   
     350  }
     351 
    345352switch (top)
    346353  {
     
    358365    XtSetArg(wargs[n],XmNtopPosition, frpos );  n++;
    359366    break;
     367  default :
     368    top = PIBK_free;
     369    XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_NONE);  n++;
     370    break;
    360371  }
    361372 
     
    375386    XtSetArg(wargs[n],XmNrightPosition, frpos );  n++;
    376387    break;
     388  default :
     389    right = PIBK_free;
     390    XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_NONE);  n++;
     391    break;
     392
    377393  }
    378394
     
    392408    XtSetArg(wargs[n],XmNbottomPosition, frpos );  n++;
    393409    break;
     410  default :
     411    bottom =  PIBK_free;
     412    XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_NONE);  n++;
     413    break;
    394414  }
    395415
    396416XtSetValues(this->sdw, wargs, n);
    397 
     417mBKleft = left;  mBKright = right;
     418mBKtop = top;  mBKbottom = bottom;
    398419// printf(" Out_SetBinding: C-Sz= %d %d - Sz=%d %d , Pos= %d %d \n",  parent->XSize(),
    399420// parent->YSize(), XSize(), YSize(), XPos(), YPos());
     
    402423}
    403424
     425/* --Methode-- */
     426bool PIWdgX::GetBinding(PIBindingKind& left, PIBindingKind& top,
     427                        PIBindingKind& right, PIBindingKind& bottom)
     428{
     429left = mBKleft;  right = mBKright;
     430top = mBKtop;  bottom = mBKbottom;
     431return(bindingLock);
     432}
    404433
    405434/* --Methode-- */
  • trunk/SophyaPI/PI/piwdgx.h

    r180 r190  
    3636  virtual void   SetPos(int px, int py);
    3737  virtual void   SetLabel(string const & lab);
     38
     39
    3840  virtual void   SetBinding(PIBindingKind left, PIBindingKind top,
    3941                            PIBindingKind right, PIBindingKind bottom);
     42  virtual bool   GetBinding(PIBindingKind& left, PIBindingKind& top,
     43                            PIBindingKind& right, PIBindingKind& bottom);
    4044
    4145  virtual int    XSize();
     
    96100  WmIntState wmis;
    97101  bool stmng;
    98  
     102  PIBindingKind mBKleft, mBKright, mBKtop, mBKbottom;
    99103};
    100104
Note: See TracChangeset for help on using the changeset viewer.