Changeset 2754 in Sophya


Ignore:
Timestamp:
May 23, 2005, 6:25:18 PM (20 years ago)
Author:
ansari
Message:

1/ Correction decodage options graphique pour marker(ftriangle,fstar) et arrow
ds pigratt.cc
2/ Ajout flag separe pour LabelsH et LabelsV (labels horiz/vertical) pour le trace des axes (piaxes.h piaxes.cc) et decodage des options correspondantes ds pieldrw.cc
3/ Gestion des attributs pour chaque ligne de texte + trace de marker ds pitxtdrw.cc (PITextDrawer) - non encore teste

Reza 23 Mai 2005

Location:
trunk/SophyaPI/PI
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/piaxes.cc

    r2615 r2754  
    6060//|     kIntTicks, kExtTicks
    6161//|     kMajTicks, kMinTicks
     62//|     kLabelsH, kLabelsV, kLabels
    6263//|     kAxesDflt = kStdAxes =
    6364//|           kBoxAxes | kTicks | | kIntTicks | kLabels
     
    149150    // Les labels
    150151   
    151     if (flags & kLabels) {
     152    if (flags & kLabelsH) {
    152153      double declab = 2*xMajTickLen;
    153154      if (!aYdir)
     
    155156      else
    156157        DrawHLabels(g, y0axes+declab, xMajTicks, PI_VerticalTop);
    157 
    158       declab = 2.*yMajTickLen;
     158    }
     159    if (flags & kLabelsV) {
     160      double declab = 2.*yMajTickLen;
    159161      if (!aXdir)
    160162        DrawVLabels(g, x0axes-declab, yMajTicks, PI_HorizontalRight);
     
    209211    // Les labels
    210212   
    211     if (flags & kLabels) {
     213    if (flags & kLabelsH) {
    212214      double declab = xMajTickLen;
    213215      if (flags & kExtTicks) declab *= 2.;
     
    218220        DrawHLabels(g, g->DeltaUCY(yMax,  declab), xMajTicks, PI_VerticalTop);
    219221      }
    220       declab = yMajTickLen;
     222    }
     223    if (flags & kLabelsV) {
     224      double declab = yMajTickLen;
    221225      if (flags & kExtTicks) declab *= 2.;
    222226      if (!aXdir) {
  • trunk/SophyaPI/PI/piaxes.h

    r2522 r2754  
    1515  kBoxAxes     = 0x0002,
    1616  kTicks       = 0x0004,
     17  kGridOn      = 0x0008,
     18
    1719  kIntTicks    = 0x0010,
    1820  kExtTicks    = 0x0020,
    19   kMajTicks    = 0x0040,
    20   kMinTicks    = 0x0080,
    21   kLabels      = 0x1000,
    22   kGridOn      = 0x2000,
     21  kMajTicks    = 0x0030,
     22  kMinTicks    = 0x0040,
     23
     24  kLabelsH     = 0x1000,
     25  kLabelsV     = 0x2000,
     26  kLabels      = kLabelsH | kLabelsV,
     27
    2328// Axes trace par defaut
    2429  kAxesDflt    = kBoxAxes | kTicks | kMajTicks | kIntTicks | kLabels,       
  • trunk/SophyaPI/PI/pieldrw.cc

    r2637 r2754  
    558558    else if (opts == "nolabels")
    559559      SetAxesFlags(GetAxesFlags() & ~kLabels);
     560    else if (opts == "hlabels")
     561      SetAxesFlags(GetAxesFlags() | kLabelsH);
     562    else if (opts == "nohlabels")
     563      SetAxesFlags(GetAxesFlags() & ~kLabelsH);
     564    else if (opts == "vlabels")
     565      SetAxesFlags(GetAxesFlags() | kLabelsV);
     566    else if (opts == "novlabels")
     567      SetAxesFlags(GetAxesFlags() & ~kLabelsV);
    560568    else if (opts == "ticks")
    561569      SetAxesFlags(GetAxesFlags() | kTicks);
     
    626634  info += "   centeredaxes finecenteredaxes centeredaxesgrid \n";
    627635  info += "   finecenteredaxesgrid  grid/nogrid \n";
    628   info += " >> Axe ticks/labels: \n";
    629   info += "   labels/nolabels  ticks/noticks minorticks/nominorticks \n";
     636  info += " >> Axe ticks/labels (h=horizontal/x, v=vertical/y): \n";
     637  info += "   labels/nolabels  hlabels/nohlabels vlabels/novlabels \n";
     638  info += "   ticks/noticks minorticks/nominorticks \n";
    630639  info += "   extticks/intticks/extintticks nbticks=X_NbTicks,Y_NbTicks \n";
    631640  info += "   tickslen=MajorTickLenFrac,MinorTickLenFraC \n";
  • trunk/SophyaPI/PI/pigratt.cc

    r2615 r2754  
    550550        else if (mka[0] == "fbox") dmrk = PI_FBoxMarker;
    551551        else if (mka[0] == "triangle") dmrk = PI_TriangleMarker;
    552         else if (mka[0] == "ftriangle") dmrk = PI_TriangleMarker;
     552        else if (mka[0] == "ftriangle") dmrk = PI_FTriangleMarker;
    553553        else if (mka[0] == "star") dmrk = PI_StarMarker;
    554         else if (mka[0] == "fstar") dmrk = PI_StarMarker;
     554        else if (mka[0] == "fstar") dmrk = PI_FStarMarker;
    555555      }
    556556      if (mka.size() > 1) dmsz = atoi(mka[1].c_str());
     
    560560    }
    561561    // decodage de arrowmarker sour forme de arrow=type,size
    562     else if (gratt.substr(0, 7) == "arrow=") {
     562    else if (gratt.substr(0, 6) == "arrow=") {
    563563      PIArrowMarker darr = PI_NotDefArrowMarker;
    564       int dasz = 1;
     564      int dasz = 3;
    565565      vector<string> mka;
    566566      FillVStringFrString(gratt.substr(6), mka, ',');
  • trunk/SophyaPI/PI/pitxtdrw.cc

    r2615 r2754  
    1212// ----------------------------------------------------------
    1313//  Classe de representation d'une serie de lignes de texte
    14 //  eventuellemet avec marker et bout de ligne
     14//  eventuellement avec marker ( et bout de ligne <- pas fait)
    1515// ----------------------------------------------------------
    1616// --------------------------------------------------------------------------
     
    2222//
    2323//      Classe de representation d'une serie de lignes eventuellement
    24 //      avec un marker et un bout de ligne
     24//      avec un marker
    2525//
    2626//--
     
    8282{
    8383  if (mLines.size() < 1) return;
    84   PIGrCoord x,y,dx,dy,fa,fd;
     84  PIGraphicAtt siatt = GetGraphicAtt();
     85  PIGraphicAtt catt;
     86
     87  PIGrCoord x,y,ym,dx,dy,fa,fd;
    8588  x = 0.05;   y = 0.95;
    86   for(unsigned int k=0; k<mLines.size(); k++) { // Trace des lignes de texte
     89  for(unsigned int k=0; k<mLines.size(); k++) {
     90    catt = siatt;
     91    catt.UpdateFrom(mLines[k].att);
     92    SelGraAtt(g);
     93    if (mLines[k].att.GetMarker() != PI_NotDefMarker) {
     94      x = 0.03;
     95      ym = (double)y-(double)(g->GetFontHeight(fa, fd))*0.5;
     96      g->DrawMarker(x, ym);
     97      double dxu, dyu;
     98      double dxpix = g->GetMarkerSize();
     99      g->DGrC2UC(dxpix, 0, dxu, dyu);
     100      x = (double)x+dxu+0.02;
     101    }
     102    else x = 0.05;
     103    // Trace des lignes de texte
    87104    g->DrawString(x,y,mLines[k].line.c_str(),PI_VerticalTop);
    88105    y = (double)y-(double)(g->GetFontHeight(fa, fd))*1.1;
    89106  }
    90107  if (fgFrame) {   // Trace de cadre
     108    SetGraphicAtt(siatt);
     109    SelGraAtt(g);
    91110    x = y = 0.;
    92111    dx = dy = 1.;
Note: See TracChangeset for help on using the changeset viewer.