Changeset 128 in Sophya for trunk/SophyaPI
- Timestamp:
- Aug 3, 1998, 5:32:46 PM (27 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/piapplgen.h
r110 r128 34 34 35 35 virtual void RedirectOutStream(PIConsole* cons, unsigned char va= PIVA_Def) = 0; 36 virtual void RedirectErrStream(PIConsole* cons, unsigned char va= PIVA_Ital ) = 0;36 virtual void RedirectErrStream(PIConsole* cons, unsigned char va= PIVA_Ital|PIVA_Red) = 0; 37 37 38 38 protected: -
trunk/SophyaPI/PI/piapplx.h
r111 r128 23 23 24 24 virtual void RedirectOutStream(PIConsole* cons, unsigned char va= PIVA_Def); 25 virtual void RedirectErrStream(PIConsole* cons, unsigned char va= PIVA_Ital );25 virtual void RedirectErrStream(PIConsole* cons, unsigned char va= PIVA_Ital|PIVA_Red); 26 26 27 27 PIContainer* MBCont() { return intcont; } -
trunk/SophyaPI/PI/picmapview.cc
r127 r128 27 27 void PICMapView::SetColMap(PIColorMap* cmp, bool refr) 28 28 { 29 if (cmp == NULL) { 30 if (cmap) delete cmap; 31 cmap = NULL; 32 return; 33 } 34 if ( cmap && (cmp->Type() == cmap->Type()) && (cmp->Type() != CMAP_OTHER) ) return; 29 35 if (cmap) delete cmap; 30 if (cmp == NULL) cmap = NULL; 31 else cmap = new PIColorMap(*cmp); 36 cmap = new PIColorMap(*cmp); 32 37 if (refr) Refresh(); 33 38 return; -
trunk/SophyaPI/PI/picons.cc
r127 r128 20 20 21 21 static int CmdStrLen = 256; 22 static int PIVA_Select = 1 28;22 static int PIVA_Select = 1 << 3; 23 23 24 24 /* --Methode-- */ … … 53 53 mNComm = NMxRecall = 0; 54 54 mRCindx = mRindx = 0; 55 mChangeFg = false; 55 56 56 57 // Copier/coller … … 79 80 opmc->AppendItem("25L x 132C", 3302); 80 81 opmc->AppendItem("5L x 80C", 3303); 81 opmc->AppendItem("White-Black", 3201); 82 opmc->AppendItem("Black-White", 3202); 83 opmc->AppendItem("Black-Yellow", 3203); 82 opmc->AppendItem("Bkg White", 3201); 83 opmc->AppendItem("Bkg Black", 3202); 84 84 } 85 85 nb_opmc++; … … 341 341 mRindx = mRCindx; 342 342 } 343 mChangeFg = false; 343 344 Send( Msg(), PIMsg_OK, mCmdStr); 344 345 ClrCmd(); … … 351 352 for(k=mCCP-1; k<mCLC-1; k++) mCmdStr[k] = mCmdStr[k+1]; 352 353 mCmdStr[mCLC-1] = ' '; mCCP--; mCLC--; 353 } 354 mChangeFg = true; 355 } 354 356 // printf("Keyb()-Debug- Backspace CCP,CLC= %d %d CmdStr= %s (L=%d) \n", mCCP, mCLC, 355 357 // mCmdStr, strlen(mCmdStr)); … … 360 362 // printf("Keyb()-Debug- CursorUp/Down(%d) Index= %d %d \n", key, mRindx, mRCindx); 361 363 if (mNComm > 0) { 364 if (mChangeFg) { 365 mCmdStr[mCLC] = '\0'; 366 mRStr[mRCindx] = mCmdStr; 367 mChangeFg = false; 368 } 362 369 int nmxrec = ((mNComm+1) < NMxRecall) ? mNComm+1 : NMxRecall; 363 370 if (key == PIK_Up) { … … 581 588 582 589 int lva = -1; 590 int ccol, cfnt; 583 591 584 592 PIFontAtt vafat[8] = {PI_RomanFont, PI_BoldFont, PI_ItalicFont, … … 586 594 PI_ItalicFont, PI_RomanFont}; 587 595 PIColors fgc, bgc, dbgc; 596 PIColors col[6] = {PI_Black, PI_Red, PI_Blue, PI_Green, PI_Yellow, PI_Magenta}; 588 597 589 598 g->SelForeground(mFgC); 590 599 g->SelBackground(mBgC); 591 fgc = g->GetForeground();600 fgc = col[0] = g->GetForeground(); 592 601 dbgc = bgc = g->GetBackground(); 593 602 … … 618 627 } 619 628 lva = mAtt[mLPo[l]+j]; 620 if (lva & PIVA_Select) 621 { bgc = PI_Grey; g->SelFont(mFTaille, vafat[lva-PIVA_Select]); } 622 else { bgc = dbgc; g->SelFont(mFTaille, vafat[lva]); } 629 cfnt = lva & 15; // Index de fonte 630 ccol = lva >> 4; // Index de couleur 631 fgc = col[ccol]; 632 if (cfnt & PIVA_Select) 633 { bgc = PI_Grey; g->SelFont(mFTaille, vafat[cfnt-PIVA_Select]); } 634 else { bgc = dbgc; g->SelFont(mFTaille, vafat[cfnt]); } 623 635 624 if ( lva& PIVA_Reverse) {636 if (cfnt & PIVA_Reverse) { 625 637 g->SelForeground(bgc); 626 638 g->SelBackground(fgc); … … 700 712 // printf(" ++DBG++ C=%d L=%d MX=%d KMX=%d\n", mCCP, mCLC, CmdStrLen,kmx); 701 713 for(k=kmx; k>mCCP; k--) mCmdStr[k] = mCmdStr[k-1]; mCLC = kmx+1; 702 }714 } 703 715 mCmdStr[mCCP] = key; mCCP++; 704 716 if (mCCP > mCLC) mCLC = mCCP; 717 mChangeFg = true; 705 718 } 706 719 } -
trunk/SophyaPI/PI/picons.h
r127 r128 15 15 enum PIVAType { 16 16 PIVA_Def = 0, 17 PIVA_Bold = 1, 18 PIVA_Ital = 2, 19 PIVA_Reverse = 4 17 PIVA_Bold = 1 << 0, 18 PIVA_Ital = 1 << 1, 19 PIVA_Reverse = 1 << 2, 20 // Le 4eme bit (<<3) est reserve pour l'usage interne (PIVA_Select) 21 PIVA_DefCol = 0, 22 PIVA_Red = 1 << 4, 23 PIVA_Blue = 2 << 4, 24 PIVA_Green = 3 << 4, 25 PIVA_Yellow = 4 << 4, 26 PIVA_Magenta = 5 << 4 20 27 }; 21 28 … … 92 99 string * mRStr; // Stockage des chaines 93 100 int mRCindx, mRindx; // Index pour le rappel 101 bool mChangeFg; // Texte modifie 94 102 95 103 // Gestion du buffer de copie -
trunk/SophyaPI/PI/picontainergen.cc
r111 r128 54 54 //-- 55 55 56 #define NCHALGRP 456 #define NCHALGRP 8 57 57 58 58 /* --Methode-- */ … … 147 147 } 148 148 149 /* --Methode-- */ 150 PIWdg* PIContainerGen::GetChild(int n) 151 { 152 if ( (n < 0) || (n >= mNCh)) return(NULL); 153 return ((PIWdg*)mChilds[n]); 154 } 149 155 150 156 /* --Methode-- */ -
trunk/SophyaPI/PI/picontainergen.h
r111 r128 27 27 virtual void ChildDel(PIWdgGen * child); 28 28 virtual int NbChilds(); 29 virtual PIWdg* GetChild(int n); 29 30 30 31 void SetAutoDelChilds(bool ad = false); -
trunk/SophyaPI/PI/piimage.cc
r127 r128 77 77 AddDrawer(mdrw, true, false, false); 78 78 79 SetColMap (CMAP_COLRJ32);79 SetColMapId(CMAP_COLRJ32); 80 80 81 81 // pour le copier-coller … … 201 201 { 202 202 cmvw = cw; 203 if (cmvw && refr) cmvw->SetColMap Id(GetColMapId(),true);203 if (cmvw && refr) cmvw->SetColMap(cmap, true); 204 204 } 205 205 … … 341 341 } 342 342 343 344 /* --Methode-- */ 345 void PIImage::SetColMap(CMapId cmap, bool refr) 346 { 347 if ( (cmap == CMAP_GREY32) || (cmap == CMAP_GREYINV32) ) mdrw->SetColAtt(PI_Red); 343 /* --Methode-- */ 344 void PIImage::SetColMap(PIColorMap* cmp, bool refr) 345 { 346 if (!cmp) return; 347 int cmapid = cmp->Type(); 348 if ( (cmapid == CMAP_GREY32) || (cmapid == CMAP_GREYINV32) || 349 (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128)) mdrw->SetColAtt(PI_Red); 348 350 else mdrw->SetColAtt(PI_White); 349 PIPixmap::SetColMap(cmap, refr); 350 if (zow) zow->SetColMap(cmap, refr); 351 if (gvw) gvw->SetColMap(cmap, refr); 352 if (cmvw) cmvw->SetColMapId(cmap, true); 351 PIPixmap::SetColMap(cmp, refr); 352 if (zow) zow->SetColMap(cmp, refr); 353 if (gvw) gvw->SetColMap(cmp, refr); 354 if (cmvw) cmvw->SetColMap(cmp, refr); 355 return; 356 } 357 358 /* --Methode-- */ 359 void PIImage::SetColMapId(CMapId cmapid, bool refr) 360 { 361 if ( (cmapid == CMAP_GREY32) || (cmapid == CMAP_GREYINV32) || 362 (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128)) mdrw->SetColAtt(PI_Red); 363 else mdrw->SetColAtt(PI_White); 364 PIPixmap::SetColMapId(cmapid, refr); 365 if (zow) zow->SetColMapId(cmapid, refr); 366 if (gvw) gvw->SetColMapId(cmapid, refr); 367 if (cmvw) cmvw->SetColMapId(cmapid, refr); 353 368 return; 354 369 } … … 377 392 if (gvw != NULL) 378 393 if ( (gvw->UserData() != this) || (mw) ) SetGloVPixmap(); 379 if (cmvw) cmvw->SetColMap Id(GetColMapId(),true);394 if (cmvw) cmvw->SetColMap(cmap, true); 380 395 381 396 return; … … 743 758 744 759 zpixm = img->ComputePixmap(lut, lofx, lofy, zm, xwsz, ywsz, zpixm, &xszpxm, &yszpxm); 745 zow->SetColMap( GetColMapId(), false);760 zow->SetColMap(cmap, false); 746 761 zow->SetPixmap(zpixm, xszpxm, yszpxm); 747 762 zow->SetUserData((void *)this, 0); … … 800 815 gvdrw->ElDelAll(); 801 816 gvdrw->SetLimits(xw1, xw2, yw1, yw2, kAxeDirLtoR, kAxeDirUpDown); 802 gvdrw->SetColAtt(PI_Yellow); 817 int cmapid = cmap->Type(); 818 if ( (cmapid == CMAP_GREY32) || (cmapid == CMAP_GREYINV32) || 819 (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128)) gvdrw->SetColAtt(PI_Red); 820 else gvdrw->SetColAtt(PI_Yellow); 803 821 gvdrw->SetLineAtt(PI_NormalLine); 804 822 gvdrw->ElAddRect(x,y,dx,dy); 805 823 gvw->AddDrawer(gvdrw, xw1, yw1, xw2, yw2, false); 806 gvw->SetColMap( GetColMapId(), false);824 gvw->SetColMap(cmap, false); 807 825 gvw->SetPixmap(gpixm, xsgpxm, ysgpxm, true, xw1, yw1); 808 826 gvw->SetUserData((void *)this, 0); -
trunk/SophyaPI/PI/piimage.h
r127 r128 37 37 { mdrw->SetAxesFlags(flags); mdrw->Refresh(); } 38 38 39 // Fenetre de Zoom, Vue global , ColorMap, text, ...39 // Fenetre de Zoom, Vue globale, ColorMap, text, ... 40 40 void SetZoomWin(PIPixmap * zw, bool refr=false); 41 41 void SetGloVWin(PIPixmap * zw, bool refr=false); … … 55 55 float GetZoomF(); 56 56 57 virtual void SetColMap(CMapId cmap, bool refr=true); 57 // Changement de table de couleur 58 virtual void SetColMap(PIColorMap* cmp, bool refr=true); 59 virtual void SetColMapId(CMapId cmapid, bool refr=true); 58 60 61 // Positionnement image - pave 59 62 void SetOffset(int ox, int oy, bool refr=true); 60 63 void SetPave(int x, int y, bool refr=true, bool cent=true); 61 64 65 // Acces aux informations 62 66 inline P2DArrayAdapter * Image() { return(img); } 63 67 inline LUT * Lut() { return(lut); } … … 70 74 inline PIElDrawer* MyElDrawer() { return (mdrw); } 71 75 76 // Rafraichissement des widgets auxiliaires (zoom, ...) 72 77 void Apply(bool mw=true); 73 78 -
trunk/SophyaPI/PI/piimgtools.cc
r127 r128 374 374 375 375 if ((msg <= 110) && (msg >= 90)) // Zoom 376 PIImage::CurrentPIImage()->SetZoom((int)(msg-100) );376 PIImage::CurrentPIImage()->SetZoom((int)(msg-100), true); 377 377 else if ((msg > 200) && (msg < 211)) // Changement de couleur 378 PIImage::CurrentPIImage()->SetColMap (cmap[msg-201]);378 PIImage::CurrentPIImage()->SetColMapId(cmap[msg-201], true); 379 379 380 380 return; -
trunk/SophyaPI/PI/pipixmapgen.cc
r111 r128 48 48 } 49 49 50 /* --Methode-- */ 51 void PIPixmapGen::SetColMap(PIColorMap* cmp, bool refr) 52 { 53 if (!cmp) return; 54 if ( (cmp->Type() == cmap->Type()) && (cmp->Type() != CMAP_OTHER) ) return; 55 if (cmap) delete cmap; 56 cmap = new PIColorMap(*cmp); 57 if (refr) Refresh(); 58 } 50 59 51 60 /* --Methode-- */ 52 void PIPixmapGen::SetColMap (CMapId cmapid, bool refr)61 void PIPixmapGen::SetColMapId(CMapId cmapid, bool refr) 53 62 { 54 63 if (!cmap || (cmap->Type() != cmapid) || (cmapid == CMAP_OTHER) ) { 55 64 if (cmap) delete cmap; 56 65 cmap = new PIColorMap(cmapid); 57 }66 } 58 67 if (refr) Refresh(); 59 68 } -
trunk/SophyaPI/PI/pipixmapgen.h
r111 r128 24 24 virtual void SetPixmap(unsigned char *pix, int sx, int sy, 25 25 bool refr=true, int ox=0, int oy=0); 26 void SetColMap(CMapId cmapid, bool refr=true); 26 27 virtual void SetColMap(PIColorMap* cmp, bool refr=true); 28 virtual void SetColMapId(CMapId cmapid, bool refr=true); 29 30 inline PIColorMap* GetColMap() { return cmap; } 27 31 inline CMapId GetColMapId() { return ((CMapId)cmap->Type()); }; 28 32 inline int NbCol() { return(cmap->NCol()); }; -
trunk/SophyaPI/PI/pipodrw.cc
r121 r128 102 102 return((*mVec)(i)); 103 103 } 104 105 // Adaptateur d'Histo-2D Peida++ a P2DArrayAdapter 106 /* --Methode-- */ 107 POH2DAdapter::POH2DAdapter(Histo2D* h2d, bool ad) 108 : P2DArrayAdapter(h2d->NBinX(), h2d->NBinY()) 109 { 110 aDel = ad; mH2d = h2d; 111 DefineXYCoordinates(h2d->XMin(), h2d->YMin(), h2d->WBinX(), h2d->WBinY() ); 112 } 113 114 /* --Methode-- */ 115 POH2DAdapter::~POH2DAdapter() 116 { 117 if (aDel) delete mH2d; 118 } 119 120 /* --Methode-- */ 121 float POH2DAdapter::Value(int ix, int iy) 122 { 123 return((*mH2d)(ix, iy)); 124 } -
trunk/SophyaPI/PI/pipodrw.h
r121 r128 1 // This may look like C code, but it is really -*- C++ -*- 2 // Adaptateurs et Drawers divers pour Outils PEIDA++ 3 // R. Ansari 06-08/98 4 // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA 5 1 6 #ifndef PIPODRW_H_SEEN 2 7 #define PIPODRW_H_SEEN … … 5 10 #include "parradapter.h" 6 11 #include "cvector.h" 12 #include "histos2.h" 7 13 8 14 class PIFuncDrawer : public PIDrawer { … … 44 50 }; 45 51 52 // Adaptateur d'Histo-2D Peida++ a P2DArrayAdapter 53 class POH2DAdapter : public P2DArrayAdapter { 54 public : 55 POH2DAdapter(Histo2D* h2d, bool ad=false); 56 virtual ~POH2DAdapter(); 57 58 virtual float Value(int ix, int iy); 59 60 protected: 61 bool aDel; 62 Histo2D* mH2d; 63 }; 64 46 65 #endif
Note:
See TracChangeset
for help on using the changeset viewer.