Changeset 128 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Aug 3, 1998, 5:32:46 PM (27 years ago)
Author:
ercodmgr
Message:

Dernieres (avant-avant ??) modifs de cette version de PI (depuis PC Reza 03/08/98)

Location:
trunk/SophyaPI/PI
Files:
14 edited

Legend:

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

    r110 r128  
    3434
    3535        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;
    3737
    3838protected:
  • trunk/SophyaPI/PI/piapplx.h

    r111 r128  
    2323
    2424  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);
    2626
    2727  PIContainer*              MBCont() { return intcont; }
  • trunk/SophyaPI/PI/picmapview.cc

    r127 r128  
    2727void PICMapView::SetColMap(PIColorMap* cmp, bool refr)
    2828{
     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;
    2935  if (cmap) delete cmap;
    30   if (cmp == NULL)   cmap = NULL;
    31   else cmap = new PIColorMap(*cmp);
     36  cmap = new PIColorMap(*cmp);
    3237  if (refr)  Refresh(); 
    3338  return;
  • trunk/SophyaPI/PI/picons.cc

    r127 r128  
    2020
    2121static int CmdStrLen = 256;
    22 static int PIVA_Select = 128;
     22static int PIVA_Select = 1 << 3;
    2323
    2424/* --Methode-- */
     
    5353mNComm = NMxRecall = 0;
    5454mRCindx = mRindx = 0;
     55mChangeFg = false;
    5556
    5657// Copier/coller
     
    7980  opmc->AppendItem("25L x 132C", 3302);
    8081  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);
    8484  }
    8585nb_opmc++;
     
    341341        mRindx = mRCindx;
    342342        }
     343      mChangeFg = false;
    343344      Send( Msg(), PIMsg_OK, mCmdStr);
    344345      ClrCmd();
     
    351352        for(k=mCCP-1; k<mCLC-1; k++)  mCmdStr[k] = mCmdStr[k+1];
    352353        mCmdStr[mCLC-1] = ' ';   mCCP--;  mCLC--;
    353       }
     354        mChangeFg = true;
     355        }
    354356      //      printf("Keyb()-Debug- Backspace CCP,CLC= %d %d CmdStr= %s (L=%d) \n", mCCP, mCLC,
    355357      //      mCmdStr, strlen(mCmdStr));
     
    360362//      printf("Keyb()-Debug- CursorUp/Down(%d)  Index= %d %d  \n", key, mRindx, mRCindx);
    361363      if (mNComm > 0) {
     364        if (mChangeFg) {
     365          mCmdStr[mCLC] = '\0';
     366          mRStr[mRCindx] = mCmdStr;
     367          mChangeFg = false;
     368          }
    362369        int nmxrec = ((mNComm+1) < NMxRecall) ? mNComm+1 : NMxRecall;
    363370        if (key == PIK_Up)  {
     
    581588
    582589int lva = -1;
     590int ccol, cfnt;
    583591
    584592PIFontAtt vafat[8] = {PI_RomanFont, PI_BoldFont, PI_ItalicFont,
     
    586594                      PI_ItalicFont, PI_RomanFont};
    587595PIColors fgc, bgc, dbgc;
     596PIColors col[6] = {PI_Black, PI_Red, PI_Blue, PI_Green, PI_Yellow, PI_Magenta};
    588597
    589598g->SelForeground(mFgC);
    590599g->SelBackground(mBgC);
    591 fgc =  g->GetForeground();
     600fgc =  col[0] = g->GetForeground();
    592601dbgc = bgc =  g->GetBackground();
    593602
     
    618627       }
    619628     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]); }
    623635     
    624      if (lva & PIVA_Reverse) {
     636     if (cfnt & PIVA_Reverse) {
    625637       g->SelForeground(bgc);
    626638       g->SelBackground(fgc);
     
    700712      //      printf(" ++DBG++ C=%d L=%d MX=%d KMX=%d\n", mCCP, mCLC, CmdStrLen,kmx);
    701713      for(k=kmx; k>mCCP; k--) mCmdStr[k] = mCmdStr[k-1];   mCLC = kmx+1;     
    702     }
     714      }
    703715    mCmdStr[mCCP] = key;  mCCP++;
    704716    if (mCCP > mCLC)  mCLC = mCCP;
     717    mChangeFg = true;
    705718    }
    706719}
  • trunk/SophyaPI/PI/picons.h

    r127 r128  
    1515enum PIVAType {   
    1616  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
    2027};
    2128
     
    9299  string * mRStr;           // Stockage des chaines
    93100  int mRCindx, mRindx;      // Index pour le rappel
     101  bool mChangeFg;           // Texte modifie
    94102 
    95103// Gestion du buffer de copie
  • trunk/SophyaPI/PI/picontainergen.cc

    r111 r128  
    5454//--
    5555
    56 #define NCHALGRP 4
     56#define NCHALGRP 8
    5757
    5858/* --Methode-- */
     
    147147}
    148148
     149/* --Methode-- */
     150PIWdg* PIContainerGen::GetChild(int n)
     151{
     152if ( (n < 0) || (n >= mNCh))  return(NULL);
     153return ((PIWdg*)mChilds[n]);
     154}
    149155
    150156/* --Methode-- */
  • trunk/SophyaPI/PI/picontainergen.h

    r111 r128  
    2727  virtual void         ChildDel(PIWdgGen * child);
    2828  virtual int          NbChilds();
     29  virtual PIWdg*       GetChild(int n);
    2930
    3031  void                 SetAutoDelChilds(bool ad = false);
  • trunk/SophyaPI/PI/piimage.cc

    r127 r128  
    7777AddDrawer(mdrw, true, false, false);
    7878
    79 SetColMap(CMAP_COLRJ32);
     79SetColMapId(CMAP_COLRJ32);
    8080
    8181// pour le copier-coller
     
    201201{
    202202cmvw = cw;
    203 if (cmvw && refr) cmvw->SetColMapId(GetColMapId(),true);
     203if (cmvw && refr) cmvw->SetColMap(cmap, true);
    204204}
    205205
     
    341341}
    342342
    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-- */
     344void PIImage::SetColMap(PIColorMap* cmp, bool refr)
     345{
     346if (!cmp)  return;
     347int cmapid = cmp->Type();
     348if ( (cmapid == CMAP_GREY32) || (cmapid == CMAP_GREYINV32) ||
     349     (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128))  mdrw->SetColAtt(PI_Red);
    348350else 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);
     351PIPixmap::SetColMap(cmp, refr);
     352if (zow)  zow->SetColMap(cmp, refr);
     353if (gvw)  gvw->SetColMap(cmp, refr);
     354if (cmvw) cmvw->SetColMap(cmp, refr);
     355return;
     356}
     357
     358/* --Methode-- */
     359void PIImage::SetColMapId(CMapId cmapid, bool refr)
     360{
     361if ( (cmapid == CMAP_GREY32) || (cmapid == CMAP_GREYINV32) ||
     362     (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128))  mdrw->SetColAtt(PI_Red);
     363else mdrw->SetColAtt(PI_White);
     364PIPixmap::SetColMapId(cmapid, refr);
     365if (zow)  zow->SetColMapId(cmapid, refr);
     366if (gvw)  gvw->SetColMapId(cmapid, refr);
     367if (cmvw) cmvw->SetColMapId(cmapid, refr);
    353368return;
    354369}
     
    377392if (gvw != NULL)
    378393  if ( (gvw->UserData() != this) || (mw) )  SetGloVPixmap();
    379 if (cmvw) cmvw->SetColMapId(GetColMapId(),true);
     394if (cmvw) cmvw->SetColMap(cmap, true);
    380395 
    381396return;
     
    743758
    744759zpixm = img->ComputePixmap(lut, lofx, lofy, zm, xwsz, ywsz, zpixm, &xszpxm, &yszpxm);
    745 zow->SetColMap(GetColMapId(), false);
     760zow->SetColMap(cmap, false);
    746761zow->SetPixmap(zpixm, xszpxm, yszpxm);
    747762zow->SetUserData((void *)this, 0);
     
    800815gvdrw->ElDelAll();
    801816gvdrw->SetLimits(xw1, xw2, yw1, yw2, kAxeDirLtoR, kAxeDirUpDown);
    802 gvdrw->SetColAtt(PI_Yellow);
     817int cmapid = cmap->Type();
     818if ( (cmapid == CMAP_GREY32) || (cmapid == CMAP_GREYINV32) ||
     819     (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128)) gvdrw->SetColAtt(PI_Red);
     820else gvdrw->SetColAtt(PI_Yellow);
    803821gvdrw->SetLineAtt(PI_NormalLine);
    804822gvdrw->ElAddRect(x,y,dx,dy);
    805823gvw->AddDrawer(gvdrw, xw1, yw1, xw2, yw2, false);
    806 gvw->SetColMap(GetColMapId(), false);
     824gvw->SetColMap(cmap, false);
    807825gvw->SetPixmap(gpixm, xsgpxm, ysgpxm, true, xw1, yw1);
    808826gvw->SetUserData((void *)this, 0);
  • trunk/SophyaPI/PI/piimage.h

    r127 r128  
    3737                       { mdrw->SetAxesFlags(flags); mdrw->Refresh(); }
    3838
    39 // Fenetre de Zoom, Vue global, ColorMap, text, ...
     39// Fenetre de Zoom, Vue globale, ColorMap, text, ...
    4040  void SetZoomWin(PIPixmap * zw, bool refr=false);
    4141  void SetGloVWin(PIPixmap * zw, bool refr=false);
     
    5555  float GetZoomF();
    5656
    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);
    5860
     61// Positionnement image - pave
    5962  void SetOffset(int ox, int oy, bool refr=true);
    6063  void SetPave(int x, int y, bool refr=true, bool cent=true);
    6164
     65// Acces aux informations
    6266  inline P2DArrayAdapter * Image() { return(img); }
    6367  inline LUT *     Lut() { return(lut); }
     
    7074  inline PIElDrawer* MyElDrawer() { return (mdrw); }
    7175
     76// Rafraichissement des widgets auxiliaires (zoom, ...)
    7277  void Apply(bool mw=true);
    7378
  • trunk/SophyaPI/PI/piimgtools.cc

    r127 r128  
    374374
    375375if ((msg <= 110) && (msg >= 90))  // Zoom
    376   PIImage::CurrentPIImage()->SetZoom((int)(msg-100));
     376  PIImage::CurrentPIImage()->SetZoom((int)(msg-100), true);
    377377else if ((msg > 200) && (msg < 211)) // Changement de couleur
    378   PIImage::CurrentPIImage()->SetColMap(cmap[msg-201]);
     378  PIImage::CurrentPIImage()->SetColMapId(cmap[msg-201], true);
    379379
    380380return;
  • trunk/SophyaPI/PI/pipixmapgen.cc

    r111 r128  
    4848}
    4949
     50/* --Methode-- */
     51void PIPixmapGen::SetColMap(PIColorMap* cmp, bool refr)
     52{
     53if (!cmp)  return;
     54if ( (cmp->Type() == cmap->Type()) && (cmp->Type() != CMAP_OTHER) ) return;
     55if (cmap) delete cmap;
     56cmap = new PIColorMap(*cmp);
     57if (refr)  Refresh(); 
     58}
    5059
    5160/* --Methode-- */
    52 void PIPixmapGen::SetColMap(CMapId cmapid, bool refr)
     61void PIPixmapGen::SetColMapId(CMapId cmapid, bool refr)
    5362{
    5463if (!cmap || (cmap->Type() != cmapid) || (cmapid == CMAP_OTHER) ) { 
    5564  if (cmap) delete cmap;
    5665  cmap = new PIColorMap(cmapid);
    57 }
     66  }
    5867if (refr)  Refresh(); 
    5968}
  • trunk/SophyaPI/PI/pipixmapgen.h

    r111 r128  
    2424  virtual void  SetPixmap(unsigned char *pix, int sx, int sy,
    2525                          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; }
    2731  inline CMapId GetColMapId() { return ((CMapId)cmap->Type()); };
    2832  inline int    NbCol() { return(cmap->NCol()); };
  • trunk/SophyaPI/PI/pipodrw.cc

    r121 r128  
    102102return((*mVec)(i));
    103103}
     104
     105// Adaptateur d'Histo-2D Peida++ a P2DArrayAdapter
     106/* --Methode-- */
     107POH2DAdapter::POH2DAdapter(Histo2D* h2d, bool ad)
     108        : P2DArrayAdapter(h2d->NBinX(), h2d->NBinY())
     109{
     110aDel = ad; mH2d = h2d;
     111DefineXYCoordinates(h2d->XMin(), h2d->YMin(), h2d->WBinX(), h2d->WBinY() );
     112}
     113
     114/* --Methode-- */
     115POH2DAdapter::~POH2DAdapter()
     116{
     117if (aDel)  delete mH2d;
     118}
     119
     120/* --Methode-- */
     121float POH2DAdapter::Value(int ix, int iy)
     122{
     123return((*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
    16#ifndef PIPODRW_H_SEEN
    27#define PIPODRW_H_SEEN
     
    510#include "parradapter.h"
    611#include "cvector.h"
     12#include "histos2.h"
    713
    814class PIFuncDrawer : public PIDrawer {
     
    4450};
    4551
     52// Adaptateur d'Histo-2D Peida++ a P2DArrayAdapter
     53class POH2DAdapter :  public P2DArrayAdapter {
     54public :
     55                  POH2DAdapter(Histo2D* h2d, bool ad=false);
     56  virtual         ~POH2DAdapter();
     57
     58  virtual float   Value(int ix, int iy);   
     59
     60protected:
     61  bool aDel;
     62  Histo2D* mH2d;
     63};
     64
    4665#endif
Note: See TracChangeset for help on using the changeset viewer.