Changeset 3268 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Jun 19, 2007, 4:12:47 PM (18 years ago)
Author:
ansari
Message:

Ajout methodes statiques PIGraphicAtt::ColNameToColor() , ColIndexToColor() - Reza 19 Juin 2007

Location:
trunk/SophyaPI/PI
Files:
4 edited

Legend:

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

    r2394 r3268  
    2121                 PI_OrangeRed = 23, PI_Brown = 24,
    2222                 PI_HighlightBlue = 25,
    23                  PI_ColorAllBits0 = 26, PI_ColorAllBits1 = 25 };
     23                 PI_ColorAllBits0 = 30, PI_ColorAllBits1 = 31 };
    2424
    2525#endif
  • trunk/SophyaPI/PI/pigratt.cc

    r2855 r3268  
    875875//      et le flag d'inversion de la table de couleur
    876876//--
     877
     878
     879//++
     880// Titre        Utilitaires pour choix de couleur
     881//--
     882//++
     883//
     884// PIColors ColNameToColor(string const & colname)
     885//      Renvoie la couleur specifiee par le nom colname (methode static)
     886// PIColors ColIndexToColor(string const & colname)
     887//      Renvoie la couleur specifiee par le numero colidx
     888//      et le flag d'inversion de la table de couleur
     889//--
     890
     891PIColors PIGraphicAtt::ColNameToColor(string const & colname)
     892{
     893  if (!gratt_init_done) InitGrAttStrings();
     894  GrAttColors& GrAcol = *GrAcolors;
     895  GrAttColors::const_iterator itc = GrAcol.find(colname);
     896  PIColors cdcol = PI_NotDefColor;
     897  if (itc != GrAcol.end())  cdcol = (*itc).second; 
     898  return cdcol;
     899}
     900
     901PIColors PIGraphicAtt::ColIndexToColor(int colidx)
     902{
     903  if (!gratt_init_done) InitGrAttStrings();
     904  GrAttColors& GrAcol = *GrAcolors;
     905  GrAttColors::const_iterator itc;
     906  PIColors cdcol = PI_NotDefColor;
     907  if ((colidx < 0) || (colidx >= GrAcol.size()))  return cdcol;
     908  int kc = 0;
     909  for(itc = GrAcol.begin(); itc != GrAcol.end(); itc++) {
     910    if (kc == colidx) { cdcol = (*itc).second; break; }
     911    kc++;
     912  }
     913  return cdcol;
     914}
  • trunk/SophyaPI/PI/pigratt.h

    r2503 r3268  
    7979  inline CMapId      GetColMapId(bool & rev) const { rev = mRevCmap; return(mCmapid); }
    8080
     81  static PIColors    ColNameToColor(string const & colname);
     82  static PIColors    ColIndexToColor(int colidx);
     83
    8184protected:
    82   void      InitGrAttStrings();   
     85  static void        InitGrAttStrings();   
    8386
    8487  PIColors           mFCol, mBCol;
  • trunk/SophyaPI/PI/piversion.h

    r3027 r3268  
    22#define PIVERSION_H_SEEN
    33
    4 #define PI_VERSIONNUMBER  4.0
     4#define PI_VERSIONNUMBER  4.01
    55
    66#endif
Note: See TracChangeset for help on using the changeset viewer.