Changeset 209 in Sophya
- Timestamp:
- Mar 3, 1999, 4:05:17 PM (27 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pidrawer.cc
r207 r209 500 500 { 501 501 PILineAtt savlineatt = g->GetLineAtt(); 502 g->SelLine(PI_ThinDashedLine); 502 // g->SelLine(PI_ThinDashedLine); 503 g->SelLine(PI_ThinDottedLine); 503 504 504 505 for (double x=xFirstMajTick; x<=xMax; x += xMajTickStep) -
trunk/SophyaPI/PI/pidrwtools.cc
r207 r209 54 54 spy = bsy/4; 55 55 56 int wszx = 5*spx+ 4.25*bsx;57 int wszy = ( 6+3*0.85)*(spy+bsy);56 int wszx = 5*spx+3.5*bsx; 57 int wszy = (7+3*0.85)*(spy+bsy); 58 58 SetSize(wszx, wszy); 59 59 … … 62 62 int csx = cpx; 63 63 int csy = cpy; 64 mLab[0] = new PILabel(this, "X Min Max", 1. 5*bsx, bsy, cpx, cpy);64 mLab[0] = new PILabel(this, "X Min Max", 1.25*bsx, bsy, cpx, cpy); 65 65 cpy += spy+bsy; 66 mLab[1] = new PILabel(this, "Y Min Max", 1. 5*bsx, bsy, cpx, cpy);66 mLab[1] = new PILabel(this, "Y Min Max", 1.25*bsx, bsy, cpx, cpy); 67 67 mLab[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 68 68 mLab[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 69 69 70 70 cpy = spy*2; 71 cpx += spx+1. 5*bsx;72 mText[0] = new PIText(this, "x_min_max", 2. 75*bsx, bsy, cpx, cpy);71 cpx += spx+1.25*bsx; 72 mText[0] = new PIText(this, "x_min_max", 2.25*bsx, bsy, cpx, cpy); 73 73 mText[0]->SetText("-1.0 1.0"); 74 74 cpy += spy+bsy; 75 mText[1] = new PIText(this, "y_min_max", 2. 75*bsx, bsy, cpx, cpy);75 mText[1] = new PIText(this, "y_min_max", 2.25*bsx, bsy, cpx, cpy); 76 76 mText[1]->SetText("-1.0 1.0"); 77 77 mText[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); … … 80 80 cpx = spx+0.25*bsx; 81 81 cpy += spy+bsy; 82 mCkb[0] = new PICheckBox(this,"X-RtoL", 2000, bsx *1.25, bsy, cpx, cpy);83 cpx += spx+ 1.25*bsx;84 mCkb[1] = new PICheckBox(this,"Y-UpDn", 2000, bsx *1.25, bsy, cpx, cpy);85 cpx += spx+ 1.25*bsx;86 mCkb[2] = new PICheckBox(this,"Grid", 2000, bsx *1.25, bsy, cpx, cpy);82 mCkb[0] = new PICheckBox(this,"X-RtoL", 2000, bsx, bsy, cpx, cpy); 83 cpx += spx+bsx; 84 mCkb[1] = new PICheckBox(this,"Y-UpDn", 2000, bsx, bsy, cpx, cpy); 85 cpx += spx+bsx; 86 mCkb[2] = new PICheckBox(this,"Grid", 2000, bsx, bsy, cpx, cpy); 87 87 mCkb[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 88 88 mCkb[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); … … 90 90 91 91 cpy += spy+bsy; 92 cpx = 2.5*spx;; 93 mBut[0] = new PIButton(this, "Apply", 2600, bsx*1.25, bsy, cpx, cpy); 94 cpx += bsx*1.50; 95 mBut[1] = new PIButton(this, "Auto", 2700, bsx*1.25, bsy, cpx, cpy); 96 cpx += bsx*1.50; 97 mBut[2] = new PIButton(this, "Dismiss", 2500, bsx*1.25, bsy, cpx, cpy); 92 cpx = spx+0.25*bsx;; 93 mBut[0] = new PIButton(this, "SetAxes", 2600, bsx*1.5, bsy, cpx, cpy); 94 cpx += bsx*1.5+3*spx; 95 mBut[1] = new PIButton(this, "AutoLimits", 2700, bsx*1.5, bsy, cpx, cpy); 98 96 mBut[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 99 97 mBut[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 100 mBut[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);101 98 102 99 int offy = cpy+bsy+spy*2; … … 110 107 bsy = 0.85*bsy; spy = 0.85*spy; 111 108 112 mOpt[0] = new PIOptMenu(this, "bwt-opt-0", bsx* 2.0, bsy, cpx, cpy);109 mOpt[0] = new PIOptMenu(this, "bwt-opt-0", bsx*1.75, bsy, cpx, cpy); 113 110 mOpt[0]->AppendItem("Def.Col", 100); 114 111 mOpt[0]->AppendItem("Black", 101); … … 131 128 mOpt[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 132 129 133 cpx += spx+ 2.25*bsx;134 mOpt[1] = new PIOptMenu(this, "bwt-opt-1", bsx* 2.0, bsy, cpx, cpy);130 cpx += spx+1.75*bsx; 131 mOpt[1] = new PIOptMenu(this, "bwt-opt-1", bsx*1.75, bsy, cpx, cpy); 135 132 mOpt[1]->AppendItem("No.CMap", 200); 136 133 mOpt[1]->AppendItem("Grey32", 201); … … 150 147 cpx = 2*spx; 151 148 cpy += spy+bsy; 152 mOpt[2] = new PIOptMenu(this, "bwt-opt-2", bsx* 2.0, bsy, cpx, cpy);149 mOpt[2] = new PIOptMenu(this, "bwt-opt-2", bsx*1.75, bsy, cpx, cpy); 153 150 mOpt[2]->AppendItem("Def.Mrk", 300); 154 151 mOpt[2]->AppendItem("Mrk Dot(.)", 301); … … 166 163 mOpt[2]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 167 164 168 cpx += spx+ 2.25*bsx;169 mOpt[3] = new PIOptMenu(this, "bwt-opt-3", bsx* 2.0, bsy, cpx, cpy);165 cpx += spx+1.75*bsx; 166 mOpt[3] = new PIOptMenu(this, "bwt-opt-3", bsx*1.75, bsy, cpx, cpy); 170 167 mOpt[3]->AppendItem("Mrk 1 pt", 401); 171 168 mOpt[3]->AppendItem("Mrk 3 pt", 403); … … 181 178 cpx = 2*spx; 182 179 cpy += spy+bsy; 183 mOpt[4] = new PIOptMenu(this, "bwt-opt-4", bsx* 2.0, bsy, cpx, cpy);180 mOpt[4] = new PIOptMenu(this, "bwt-opt-4", bsx*1.75, bsy, cpx, cpy); 184 181 mOpt[4]->AppendItem("Def.Font", 500); 185 182 mOpt[4]->AppendItem("Normal-Font", 511); … … 198 195 mOpt[4]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 199 196 200 cpx += spx+ 2.25*bsx;201 mOpt[5] = new PIOptMenu(this, "bwt-opt-5", bsx* 2.0, bsy, cpx, cpy);197 cpx += spx+1.75*bsx; 198 mOpt[5] = new PIOptMenu(this, "bwt-opt-5", bsx*1.75, bsy, cpx, cpy); 202 199 mOpt[5]->AppendItem("Def.Line", 600); 203 200 mOpt[5]->AppendItem("Thin-Line", 601); … … 213 210 mOpt[5]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 214 211 215 cpx = spx;212 cpx = 2*spx; 216 213 cpy += spy+bsyo; 217 214 bsy = bsyo; spy = spyo; … … 227 224 mNlb->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 228 225 229 cpx = wszx-2.5*bsx-3*spx; 230 mButcf[0] = new PIButton(this, "GetAtt", 2800, bsx*0.80, bsy, cpx, cpy); 231 cpx += 0.80*bsx+spx; 232 mButcf[1] = new PIButton(this, "SetAtt", 2900, bsx*0.80, bsy, cpx, cpy); 233 cpx += 0.80*bsx+spx; 234 mButcf[2] = new PIButton(this, "Refresh", 3000, bsx*0.90, bsy, cpx, cpy); 226 cpx = wszx-1.7*bsx-3*spx; 227 mButcf[0] = new PIButton(this, "GetAtt", 2800, 0.85*bsx, bsy, cpx, cpy); 228 cpx += 0.85*bsx+spx; 229 mButcf[1] = new PIButton(this, "SetAtt", 2900, 0.85*bsx, bsy, cpx, cpy); 235 230 mButcf[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 236 231 mButcf[1]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 232 233 cpx = spx+0.25*bsx;; 234 cpy += spy+bsy; 235 mButcf[2] = new PIButton(this, "Refresh", 3000, bsx*1.5, bsy, cpx, cpy); 237 236 mButcf[2]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 237 cpx += bsx*1.5+3*spx; 238 mButcf[3] = new PIButton(this, "Dismiss", 3777, bsx*1.5, bsy, cpx, cpy); 239 mButcf[2]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 240 mButcf[3]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 238 241 239 242 cwdrwt = this; … … 382 385 383 386 msg = UserMsg(msg); 384 if (msg == 2500) { Hide(); return; }387 if (msg == 3777) { Hide(); return; } 385 388 386 389 if (mCurBW == NULL) return; -
trunk/SophyaPI/PI/pidrwtools.h
r207 r209 36 36 // Pour changer les axes 37 37 PILabel* mLab[2]; 38 PIButton* mBut[ 3];38 PIButton* mBut[2]; 39 39 PIText* mText[2]; 40 40 PICheckBox* mCkb[3]; … … 43 43 PILabel* mNlb; 44 44 PIButton* mButdr[2]; 45 PIButton* mButcf[ 3];45 PIButton* mButcf[4]; 46 46 int mNDr; 47 47 int mtyp, msz; -
trunk/SophyaPI/PI/piimage.cc
r204 r209 13 13 #include "pidrwtools.h" 14 14 #include PIAPP_H 15 16 //++ 17 // Class PIImage 18 // Lib PI 19 // include piimage.h 20 // 21 // Classe pour la l'affichage et la manipulation d'images. 22 // Peut contrôler un PIPixmap pour l'affichage d'une zone 23 // agrandie (zoom) et un PIPixmap pour l'affichage de toute 24 // l'image (réduite). 25 // Utilise les adaptateur de tableaux 2D manipuler le 26 // contenu des images ("P2DArrayAdapter"). 27 // 28 // * Bouton-1 : Envoie le message "PIMsg_Active" et affiche 29 // les coordonnées courantes et la valeur du pixel, 30 // et positionne le pavé. 31 // * Bouton-2 : Permet de définir une zone de l'image. 32 // * Bouton-3 : Permet de déplacer l'image dans la fenêtre 33 // 34 // Gestion du clavier : 35 // * <Alt>O : Affichage de la fenêtre de contrôle des paramètres de visualisation. 36 // * <Alt>G : Affichage de la fenêtre de changement des attributs graphiques 37 // * <Alt>R : Rafraîchit l'affichage. 38 // * <Alt>V : Copier/*Coller* Ajout du texte du buffer copier/coller 39 // sur l'objet à la position courante. 40 // * <Alt>C : *Copier*/Coller Permet de copier le contenu de la zone sélectionnée 41 // de l'image sous forme texte. 42 // * <Alt>Z : Supprime les textes et signes ajoutés au dessin. 43 // * Touches Curseurs : déplace la pavé. 44 //-- 45 //++ 46 // Links Parents 47 // PIPixmap 48 //-- 49 50 //++ 51 // Titre Constructeurs, méthodes 52 //-- 53 //++ 54 // PIImage(PIContainerGen *par, char *nom=NULL, int sx=0, int sy=0, int px=0, int py=0) 55 // Créateur 56 // 57 //-- 15 58 16 59 // -------------------------------------------------------------------------------- … … 438 481 cur_piimage = this; 439 482 if (kmod == PIKM_Alt) { 440 if (key == 'V' || key == 'v') RequestSelection(); // Pour coller (copier/coller) 441 if (key == 'Z' || key == 'z') { mdrw->ElDelAll(); Refresh(); } // Pour supprimer tous les signes 442 if (key == 'O' || key == 'o') PIImgTools::ShowPIImgTools(); // Fentre LUT et options 443 483 if (key == 'R' || key == 'r') Apply(true); // Pour tout rafraichir 484 else if (key == 'V' || key == 'v') RequestSelection(); // Pour coller (copier/coller) 485 else if (key == 'Z' || key == 'z') { mdrw->ElDelAll(); Refresh(); } // Pour supprimer tous les signes 486 else if (key == 'O' || key == 'o') PIImgTools::ShowPIImgTools(); // Fentre LUT et options 487 else if (key == 'G' || key == 'g') { // Fentre attributs graphiques 488 PIDrwTools::SetCurrentBaseWdg(this); 489 PIDrwTools::ShowPIDrwTools(); // Fentre axes et options de trace 490 } 444 491 // ---- Le copier ---- 445 if ((key == 'C' || key == 'c') && img) {492 else if ((key == 'C' || key == 'c') && img) { 446 493 // On limite la taille a 48x48 447 494 int i1 = XPave(); -
trunk/SophyaPI/PI/piscdrawwdg.cc
r204 r209 15 15 // de *Drawer* avec la gestion de zoom (agrandissement). 16 16 // * Bouton-1 : Envoie le message "PIMsg_Active" et affiche 17 // les coordonnées courant (User-Coordinates)17 // les coordonnées courantes (User-Coordinates) 18 18 // * Bouton-2 : Permet de définir un rectangle pour le zoom. 19 19 // 20 20 // Gestion du clavier : 21 // * <Alt>O : Affichage d'une fenêtre de changement des attributs graphiques 21 // * <Alt>O : Active/Affiche les contrôles de paramètres spécifiques 22 // (Par défaut, action identique à <Alt>G) 23 // * <Alt>G : Affichage de la fenêtre de changement des attributs graphiques 24 // * <Alt>R : Rafraîchit l'affichage. 25 // * <Alt>M : Active/Désactive l'affichage d'une réticule de mesure (Bouton-1) 22 26 // * <Alt>V : Copier/*Coller* Ajout du texte du buffer copier/coller 23 // sur l'objet à la position courante de la souris27 // sur l'objet à la position courante. 24 28 // * <Alt>Z : Supprime les textes et signes ajoutés au dessin. 25 29 //-- … … 60 64 :PIBaseWdg(par, nom, sx, sy, px, py) 61 65 { 66 mFgReticule = false; 67 mCPosX = mCPosY = 0; 68 mPPos[0] = mPPos[1] = 0.; 69 62 70 mBDrw = new PIElDrawer; 63 71 SetLimits(-1.,1.,-1.,1.,kAxeDirLtoR,kAxeDirDownUp); … … 91 99 { 92 100 if (kmod == PIKM_Alt) { 93 if (key == 'V' || key == 'v') RequestSelection(); // Pour coller (copier/coller) 94 if (key == 'Z' || key == 'z') { mBDrw->ElDelAll(); Refresh(); } // Pour supprimer tous les signes 95 if (key == 'O' || key == 'o') { 101 if (key == 'R' || key == 'r') Refresh(); // rafraichir l'affichage 102 else if (key == 'M' || key == 'm') mFgReticule = !mFgReticule; // reticule de mesure 103 else if (key == 'V' || key == 'v') RequestSelection(); // Pour coller (copier/coller) 104 else if (key == 'Z' || key == 'z') { mBDrw->ElDelAll(); Refresh(); } // Pour supprimer tous les signes 105 else if (key == 'O' || key == 'o') ActivateSpecializedControls(); 106 else if (key == 'G' || key == 'g') { 96 107 PIDrwTools::SetCurrentBaseWdg(this); 97 108 PIDrwTools::ShowPIDrwTools(); // Fentre axes et options de trace … … 177 188 // Gestion affichage coordonnees du point 178 189 179 string PIScDrawWdg::GetClickText(double x, double y) 190 string 191 PIScDrawWdg::GetClickText(double x, double y) 180 192 // Donne le texte a afficher pour position x,y 181 193 { … … 187 199 188 200 void 201 PIScDrawWdg::ActivateSpecializedControls() 202 // Par défaut affiche la fenetres des attributs graphiques et axes 203 { 204 PIDrwTools::SetCurrentBaseWdg(this); 205 PIDrwTools::ShowPIDrwTools(); // Fentre axes et options de trace 206 } 207 208 void 189 209 PIScDrawWdg::But1Press(int x, int y) 190 210 { 191 if (UpdateText(x, y)) 192 { 193 if (mTrW) 194 { 195 int tpx, tpy; 196 GetScreenPos(tpx, tpy); 197 tpy -= (mTrW->YSize()+5); 198 if (tpy < 0) tpy = 0; 199 mTrW->SetPos(tpx, tpy); 200 mTrW->Show(); 201 } 202 SelPointerShape(PI_CrossPointer); 203 } 211 UpdateText(x, y); 212 if (mTrW) 213 { 214 int tpx, tpy; 215 GetScreenPos(tpx, tpy); 216 tpy -= (mTrW->YSize()+5); 217 if (tpy < 0) tpy = 0; 218 mTrW->SetPos(tpx, tpy); 219 mTrW->Show(); 220 } 221 if (mFgReticule) { // On trace une reticule 222 cForCol = mWGrC->GetForeground(); 223 cGOmod = mWGrC->GetGOMode(); 224 cLatt = mWGrC->GetLineAtt(); 225 mWGrC->SelForeground(PI_Magenta); 226 mWGrC->SelGOMode(PI_GOXOR); 227 mWGrC->SelLine(PI_ThinLine); 228 mWGrC->DrawLine(x, 0, x, YSize()); 229 mWGrC->DrawLine(0, y, XSize(), y); 230 mCPosX = x; mCPosY = y; 231 } 232 else SelPointerShape(PI_CrossPointer); 233 204 234 Send(Msg(), PIMsg_Active); 205 235 PIDrwTools::SetCurrentBaseWdg(this); … … 209 239 PIScDrawWdg::Ptr1Move(int x, int y) 210 240 { 241 if (mFgReticule) { // On trace une reticule 242 mWGrC->DrawLine(mCPosX, 0, mCPosX, YSize()); 243 mWGrC->DrawLine(0, mCPosY, XSize(), mCPosY); 244 mWGrC->DrawLine(x, 0, x, YSize()); 245 mWGrC->DrawLine(0, y, XSize(), y); 246 mCPosX = x; mCPosY = y; 247 } 211 248 UpdateText(x, y); 212 249 } … … 215 252 PIScDrawWdg::But1Release(int x, int y) 216 253 { 217 if (UpdateText(x, y)) 218 SelPointerShape(PI_ArrowPointer); 254 UpdateText(x, y); 255 if (mFgReticule) { // On efface la reticule 256 mWGrC->DrawLine(mCPosX, 0, mCPosX, YSize()); 257 mWGrC->DrawLine(0, mCPosY, XSize(), mCPosY); 258 mWGrC->SelForeground(cForCol); 259 mWGrC->SelGOMode(cGOmod); 260 mWGrC->SelLine(cLatt); 261 mCPosX = mCPosY = 0; 262 } 263 else SelPointerShape(PI_ArrowPointer); 219 264 if (mTrW) mTrW->Hide(); 220 265 } 221 266 222 bool 267 void 223 268 PIScDrawWdg::UpdateText(int xp, int yp) 224 269 { … … 227 272 mBDrw->GetGraphicUC()->GrC2UC(xp, yp, dx, dy); 228 273 mPPos[0] = dx; mPPos[1] = dy; 229 if ((mTxw == NULL) && (mTrlb == NULL)) return(false);230 274 231 275 string ctxt = GetClickText(dx, dy); … … 235 279 if (mTrlb) 236 280 mTrlb->SetLabel(ctxt); 237 return (true);281 return; 238 282 239 283 } -
trunk/SophyaPI/PI/piscdrawwdg.h
r207 r209 57 57 58 58 virtual string GetClickText(double x, double y); // Donne le texte a afficher pour position x,y 59 virtual void ActivateSpecializedControls(); // Pour activer des controles specifiques 59 60 60 61 void SetTextWin(PILabel * tw, bool trw=true, int tx=300, int ty=30); … … 73 74 protected: 74 75 double xMinS, xMaxS, yMinS, yMaxS; // Sauvegarde pour zoom 75 double mPPos[2]; // Position click souris X,Y 76 double mPPos[2]; // Position courante (user coordinates) 77 int mCPosX, mCPosY; // Position click souris X,Y 78 bool mFgReticule; // Controle l'affiche d'une réticule (Bouton-1) 76 79 77 80 PIElDrawer* mBDrw; … … 88 91 89 92 private: 90 boolUpdateText(int xp, int yp);93 void UpdateText(int xp, int yp); 91 94 }; 92 95
Note:
See TracChangeset
for help on using the changeset viewer.