Changeset 190 in Sophya for trunk/SophyaPI
- Timestamp:
- Jan 19, 1999, 6:40:15 PM (27 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pi3ddrw.cc
r184 r190 14 14 // ........................ Classe PIDrawer3D .......................... 15 15 // ...................................................................... 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 //-- 17 54 18 55 /* --Methode-- */ … … 187 224 // ...................................................................... 188 225 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 //-- 189 274 190 275 /* --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 1 5 #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 //-- 2 23 3 24 #define MXMAPIDS 10 … … 16 37 static int NMaxTableAuto = 0; 17 38 static 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 //-- 18 71 19 72 PIColorMap::PIColorMap(CMapId id) … … 95 148 96 149 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 //-- 97 175 98 176 void 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 1 6 #ifndef PICMAP_H_SEEN 2 7 #define PICMAP_H_SEEN -
trunk/SophyaPI/PI/pidrwtools.cc
r163 r190 204 204 mOpt[5]->AppendItem("Dashed-Line", 605); 205 205 mOpt[5]->AppendItem("ThickDashed", 606); 206 mOpt[5]->AppendItem("ThinDotted", 607); 207 mOpt[5]->AppendItem("Dotted-Line", 608); 208 mOpt[5]->AppendItem("ThickDotted", 609); 206 209 mOpt[5]->SetValue(600); 207 210 mOpt[5]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); … … 305 308 PI_TriangleMarker, PI_FTriangleMarker, 306 309 PI_StarMarker, PI_FStarMarker }; 307 PILineAtt line[7] = { PI_NotDefLineAtt, PI_ThinLine, PI_NormalLine, PI_ThickLine, 308 PI_ThinDashedLine, PI_DashedLine, PI_ThickDashedLine}; 310 PILineAtt line[10] = { PI_NotDefLineAtt, PI_ThinLine, PI_NormalLine, PI_ThickLine, 311 PI_ThinDashedLine, PI_DashedLine, PI_ThickDashedLine, 312 PI_ThinDottedLine, PI_DottedLine, PI_ThickDottedLine }; 309 313 310 314 PIFontAtt fntatt[4] = { PI_NotDefFontAtt, PI_RomanFont, PI_BoldFont, PI_ItalicFont }; … … 363 367 drw->SetFontAtt(fntsz[kk], fntatt[kkk]); 364 368 k = mOpt[5]->GetValue()-600; 365 if ( (k < 0) || (k > 6) ) k = 0;369 if ( (k < 0) || (k > 9) ) k = 0; 366 370 drw->SetLineAtt(line[k]); 367 371 if (msg == 2800) drw->Refresh(); -
trunk/SophyaPI/PI/pievthandler.cc
r170 r190 5 5 6 6 #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 7 38 8 39 … … 25 56 } 26 57 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 27 77 /* --Methode-- */ 28 78 void PIEventHandler::Draw(PIGraphic*, int, int, int, int) … … 44 94 45 95 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 46 131 /* --Methode-- */ 47 132 void PIEventHandler::SetEventInfo(PIEventMask evt, int px, int py, -
trunk/SophyaPI/PI/pigraphgen.cc
r180 r190 199 199 // Choix du type de ligne pour le tracé des lignes et contours 200 200 //| 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 202 203 // void SelMarker(int msz=3, PIMarker mrk=PI_DotMarker) 203 204 // Choix de la taille et du type de signe pour "DrawMarker() / DrawMarkers()" -
trunk/SophyaPI/PI/pigraphgen.h
r180 r190 30 30 enum PILineAtt { PI_NotDefLineAtt = -1, 31 31 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 }; 33 34 34 35 enum PIMarker { PI_NotDefMarker = -1, -
trunk/SophyaPI/PI/pigraphx.cc
r180 r190 485 485 unsigned int lt=0; 486 486 int lstyle=LineSolid; 487 char dash[2]= {3,3}; 487 488 488 489 if (att == mLAtt) return; … … 502 503 lstyle = LineSolid; 503 504 break; 505 504 506 case PI_DashedLine : 505 507 lt = 2; 506 508 lstyle = LineOnOffDash; 509 dash[0] = dash[1] = 6; 507 510 break; 508 511 case PI_ThickDashedLine : 509 512 lt = 4; 510 513 lstyle = LineOnOffDash; 514 dash[0] = dash[1] = 6; 511 515 break; 512 516 case PI_ThinDashedLine : 513 517 lt = 0; 514 518 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; 515 536 break; 516 537 … … 520 541 break; 521 542 } 522 if (lstyle != LineSolid) { 523 char dash[2]= {3,3};543 544 if (lstyle != LineSolid) 524 545 XSetDashes( mDisp, DefGC(), 0, dash, 2); 525 }546 526 547 XSetLineAttributes(mDisp, DefGC(), lt, lstyle, CapButt, JoinMiter); 527 548 mLAtt = att; -
trunk/SophyaPI/PI/piperiodx.cc
r170 r190 37 37 int szx,szy,szf; 38 38 XtAppContext * appctx = PIXtAppCtx(szx, szy, szf); 39 mTId = XtAppAddTimeOut(*appctx, mDt*1000, xttimer_action, this);39 mTId = XtAppAddTimeOut(*appctx, Intervalms(), xttimer_action, this); 40 40 mFgact = true; 41 41 return; -
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 5 4 6 5 #include <stdlib.h> … … 9 8 #include "pipixmapgen.h" 10 9 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 //-- 12 81 13 82 /* --Methode-- */ -
trunk/SophyaPI/PI/piscdrawwdg.cc
r163 r190 7 7 #include "parradapter.h" 8 8 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 9 35 static 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 10 57 11 58 PIScDrawWdg::PIScDrawWdg(PIContainerGen *par, char *nom, -
trunk/SophyaPI/PI/pistzwin.cc
r158 r190 10 10 11 11 // -------------- 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 //-- 12 42 13 43 /* --Methode-- */ … … 79 109 } 80 110 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 81 147 /* --Methode-- */ 82 148 PIStackWindow::PIStackWindow(PIMsgHandler* par, char* nom, PIWindowKind k, … … 118 184 119 185 /* --Methode-- */ 120 void PIStackWindow::StartAutoDisp(int dt) 121 { 122 mPerad.Start(dt); 186 void PIStackWindow::StartAutoDisp(int dtms) 187 { 188 mPerad.SetIntervalms(dtms); 189 mPerad.Start(); 123 190 } 124 191 … … 130 197 131 198 //-------------------- 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 //-- 132 230 133 231 /* --Methode-- */ … … 180 278 child->SetSize(sx, sy); 181 279 child->SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic, PIBK_elastic); 280 child->LockBinding(); 182 281 // Il faut faire le delete a cet endroit, sinon probleme avec widget motif XmForm Reza 18/08/98 183 282 if (mZWdg[mZc]) { … … 219 318 220 319 //-------------------- 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 //-- 221 350 222 351 /* --Methode-- */ -
trunk/SophyaPI/PI/pistzwin.h
r158 r190 46 46 inline PIWdg* CurrentWdg() { return( ((PIStackLayout*)layout)->CurrentWdg() ); } 47 47 48 virtual void StartAutoDisp(int dt );48 virtual void StartAutoDisp(int dtms=1000); 49 49 virtual void StopAutoDisp(); 50 50 -
trunk/SophyaPI/PI/piwdggen.cc
r180 r190 33 33 // Links Parents 34 34 // PIMsgHandler 35 //-- 36 //++ 37 // Links Voir aussi 38 // PIEventHandler 35 39 //-- 36 40 … … 65 69 // void GetScreenPos(int & spx, int & spy) 66 70 // Renvoie la position de l'objet sur l'écran. 71 //-- 72 //++ 73 // Titre Gestion des accrochages (Binding) 74 //-- 75 //++ 67 76 // void SetBinding(PIBindingKind left, PIBindingKind top, PIBindingKind right, PIBindingKind bottom) 68 77 // Permet de contrôler le comportement de l'objet en cas de changement de taille … … 70 79 // attachée à une distance fixe par rapport au bord opposé du conteneur ("PIBK_fixed"), 71 80 // 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. 72 89 //-- 73 90 … … 177 194 { 178 195 parent = par; 196 bindingLock = false; 179 197 SetMsg(0); 180 198 SetUserData(NULL, 0); … … 216 234 } 217 235 return; 236 } 237 238 /* --Methode-- */ 239 void PIWdgGen::LockBinding() 240 { 241 bindingLock = true; 242 } 243 244 /* --Methode-- */ 245 void PIWdgGen::UnLockBinding() 246 { 247 bindingLock = false; 218 248 } 219 249 … … 318 348 } 319 349 */ 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 64 64 virtual void SetBorderWidth(int bw)=0; 65 65 virtual void SetLabel(string const&) {} 66 67 // Gestion des accrochages (binding) aux containers 66 68 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(); 68 74 69 75 virtual int XSize()=0; … … 116 122 list<EvHand> mDHlist; 117 123 list<EvHand> mEHlist; 124 bool bindingLock; 118 125 private: 119 126 int flag; -
trunk/SophyaPI/PI/piwdgx.cc
r180 r190 104 104 wmis = k_wmi_appshell; 105 105 stmng = false; 106 mBKleft = mBKright = mBKtop = mBKbottom = PIBK_free; 106 107 #ifdef DEBUG_PIWdgX 107 108 printf("Debug_PIWdgX::PIWdgX(int , char * []) this=%lx top=%lx \n", (long)this, (long)sdw); … … 118 119 sdw = NULL; 119 120 wmis = k_wmi_unknown; 121 mBKleft = mBKright = mBKtop = mBKbottom = PIBK_free; 120 122 } 121 123 … … 313 315 Arg wargs[9]; 314 316 int n=0; 317 if (bindingLock) return; 315 318 if (!sdw) return; 316 319 if (!parent) return; … … 341 344 XtSetArg(wargs[n],XmNleftPosition, frpos ); n++; 342 345 break; 343 } 344 346 default : 347 left = PIBK_free; 348 XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE); n++; 349 break; 350 } 351 345 352 switch (top) 346 353 { … … 358 365 XtSetArg(wargs[n],XmNtopPosition, frpos ); n++; 359 366 break; 367 default : 368 top = PIBK_free; 369 XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_NONE); n++; 370 break; 360 371 } 361 372 … … 375 386 XtSetArg(wargs[n],XmNrightPosition, frpos ); n++; 376 387 break; 388 default : 389 right = PIBK_free; 390 XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_NONE); n++; 391 break; 392 377 393 } 378 394 … … 392 408 XtSetArg(wargs[n],XmNbottomPosition, frpos ); n++; 393 409 break; 410 default : 411 bottom = PIBK_free; 412 XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_NONE); n++; 413 break; 394 414 } 395 415 396 416 XtSetValues(this->sdw, wargs, n); 397 417 mBKleft = left; mBKright = right; 418 mBKtop = top; mBKbottom = bottom; 398 419 // printf(" Out_SetBinding: C-Sz= %d %d - Sz=%d %d , Pos= %d %d \n", parent->XSize(), 399 420 // parent->YSize(), XSize(), YSize(), XPos(), YPos()); … … 402 423 } 403 424 425 /* --Methode-- */ 426 bool PIWdgX::GetBinding(PIBindingKind& left, PIBindingKind& top, 427 PIBindingKind& right, PIBindingKind& bottom) 428 { 429 left = mBKleft; right = mBKright; 430 top = mBKtop; bottom = mBKbottom; 431 return(bindingLock); 432 } 404 433 405 434 /* --Methode-- */ -
trunk/SophyaPI/PI/piwdgx.h
r180 r190 36 36 virtual void SetPos(int px, int py); 37 37 virtual void SetLabel(string const & lab); 38 39 38 40 virtual void SetBinding(PIBindingKind left, PIBindingKind top, 39 41 PIBindingKind right, PIBindingKind bottom); 42 virtual bool GetBinding(PIBindingKind& left, PIBindingKind& top, 43 PIBindingKind& right, PIBindingKind& bottom); 40 44 41 45 virtual int XSize(); … … 96 100 WmIntState wmis; 97 101 bool stmng; 98 102 PIBindingKind mBKleft, mBKright, mBKtop, mBKbottom; 99 103 }; 100 104
Note:
See TracChangeset
for help on using the changeset viewer.