Changeset 1879 in Sophya


Ignore:
Timestamp:
Jan 21, 2002, 6:11:31 PM (24 years ago)
Author:
ansari
Message:

Ajout methode PIDrawer::GetClickInfo() - Modifs PIScDrawWdg : methode
PIScDrawWdg::GetClickText() pour affichage info du drawer courant ,
Methode PIScDrawWdg::UpdatePosForDeltaMarker() : Conservation de la
position courante et affichage DeltaX,DeltaY (activation <Alt>K / L)

+ MAJ Numero de version - Reza 21/01/2002 "

Location:
trunk/SophyaPI/PI
Files:
5 edited

Legend:

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

    r1855 r1879  
    534534
    535535void
     536PIDrawer::GetClickInfo(string& info, double x, double y)
     537{
     538}
     539
     540void
    536541PIDrawer::DrawHTicks(PIGraphicUC* g, double y, double tickUp, double tickDown, double xBeg, double xStep)
    537542{
  • trunk/SophyaPI/PI/pidrawer.h

    r1851 r1879  
    3939   
    4040  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    41    
     41
     42//  Rajoute l'information concernant la zone xmin,ymin ---> xmax,ymax au string info
    4243  virtual void       AppendTextInfo(string& info, double xmin, double ymin, double xmax, double ymax);
     44
     45// Renvoie une information liee au drawer pour une position x,y
     46  virtual void       GetClickInfo(string& info, double x, double y);
    4347
    4448  virtual void       Refresh();      // Recalcule les limites et reaffiche
     
    9397  virtual void       ShowControlWindow(PIBaseWdgGen* wdg);
    9498  inline  bool       HasSpecificControlWindow() const { return mFgSpecContWind; }
    95 
    9699
    97100//   Methode permettant de decoder des options a partir de chaines
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r1855 r1879  
    8080  mPSz[0] = mPSz[1] = 0.;
    8181  mFormatOpt[0] = "%-g"; mFormatOpt[1] = "%-g";
     82  mFgDeltaPos = false;
     83  mPosForDelta[0] = mPosForDelta[1] = 0.;
     84  mPosForDeltaX = mPosForDeltaY = 0;
    8285
    8386  mBDrw = new PIElDrawer;
     
    125128  if      (key == 'R' || key == 'r')  Refresh(); // rafraichir l'affichage
    126129  else if (key == 'M' || key == 'm') mFgReticule = !mFgReticule; // reticule de mesure
     130  else if (key == 'K' || key == 'k') UpdatePosForDeltaMarker(true);
     131  else if (key == 'L' || key == 'l') UpdatePosForDeltaMarker(false);
    127132  else if (key == 'V' || key == 'v') RequestSelection();  // Pour coller (copier/coller) 
    128133  else if (key == 'Z' || key == 'z') { mBDrw->ElDelAll();  Refresh(); } // Pour supprimer tous les signes
     
    232237// Gestion affichage coordonnees du point
    233238
    234 string   
    235 PIScDrawWdg::GetClickText(double x, double y)
     239void
     240PIScDrawWdg::GetClickText(string& info, double x, double y)
    236241// Donne le texte a afficher pour position x,y 
    237242{
    238243  char buff[128];
    239   string format  = "X= ";  format += mFormatOpt[0].c_str();
    240          format += " Y= "; format += mFormatOpt[1].c_str();
    241   sprintf(buff,format.c_str(),x,y);
    242   return((string)buff);
     244  PIDrawer*  dr = GetActiveDrawer();
     245  strcpy(buff,"X= ");  sprintf(buff+3, mFormatOpt[0].c_str(), x);
     246  info += buff;
     247  strcpy(buff," Y= ");  sprintf(buff+4, mFormatOpt[1].c_str(), y);
     248  if (mFgDeltaPos)
     249    sprintf(buff+strlen(buff)," (dX=%g, dY=%g)",
     250            x-mPosForDelta[0], y-mPosForDelta[1]);
     251  info += buff;
     252
     253  if (dr) {
     254    info += "  ";  info += dr->Name();
     255    dr->GetClickInfo(info, x, y);
     256  }
     257  return;
    243258}
    244259
     
    400415  mPPos[0] = dx;  mPPos[1] = dy;
    401416 
    402   string ctxt =  GetClickText(dx, dy);
     417  string ctxt;
     418  GetClickText(ctxt, dx, dy);
    403419//DEBUG  char buff[32];    sprintf(buff, " %d:%d",xp,yp); ctxt += buff;
    404420  if (mTxw)
     
    409425
    410426}
     427
     428void
     429PIScDrawWdg::UpdatePosForDeltaMarker(bool fg)
     430{
     431  if (!mFgDeltaPos && !fg ) return;
     432  cForCol = mWGrC->GetForeground();
     433  cGOmod  = mWGrC->GetGOMode();
     434  cLatt = mWGrC->GetLineAtt();
     435  mWGrC->SelForeground(PI_Magenta);
     436  mWGrC->SelGOMode(PI_GOXOR);
     437  mWGrC->SelLine(PI_NormalLine);
     438  if (mFgDeltaPos) {
     439    mWGrC->DrawLine(mPosForDeltaX-7, mPosForDeltaY, mPosForDeltaX+7, mPosForDeltaY);
     440    mWGrC->DrawLine(mPosForDeltaX, mPosForDeltaY-7, mPosForDeltaX, mPosForDeltaY+7);
     441  }
     442  mFgDeltaPos = fg;
     443  if (mFgDeltaPos) {
     444    mPosForDelta[0] = mPPos[0]; 
     445    mPosForDelta[1] = mPPos[1]; 
     446    mPosForDeltaX = mCPosX;
     447    mPosForDeltaY = mCPosY;
     448    mWGrC->DrawLine(mPosForDeltaX-7, mPosForDeltaY, mPosForDeltaX+7, mPosForDeltaY);
     449    mWGrC->DrawLine(mPosForDeltaX, mPosForDeltaY-7, mPosForDeltaX, mPosForDeltaY+7);
     450  }
     451  mWGrC->SelForeground(cForCol);
     452  mWGrC->SelGOMode(cGOmod);
     453  mWGrC->SelLine(cLatt);
     454  return;
     455}
     456
    411457
    412458// .............................
  • trunk/SophyaPI/PI/piscdrawwdg.h

    r1631 r1879  
    6161   
    6262
    63   virtual string     GetClickText(double x, double y); // Donne le texte a afficher pour position x,y
     63  virtual void       GetClickText(string& info, double x, double y); // Donne le texte a afficher pour position x,y
    6464  virtual void       ActivateSpecializedControls();   // Pour activer des controles specifiques
    6565
     
    9191  double mPSz[2];         // Taille courant du pave info
    9292  int mCPosX, mCPosY;     // Position click souris X,Y
     93  bool mFgDeltaPos;       // affichage de l'ecart par rapport a la position memorisee
     94  double mPosForDelta[2];     // Position memorisee - Pour affichage d'ecart
     95  int mPosForDeltaX, mPosForDeltaY; // Position click memorisee - Pour affichage d'ecart
    9396  bool mFgReticule;       // Controle l'affiche d'une réticule (Bouton-1)
    9497  string mFormatOpt[2];   // Format optimal d'impression des textes
     
    112115private:
    113116  void  UpdateText(int xp, int yp);
     117  void  UpdatePosForDeltaMarker(bool fg);
    114118};
    115119
  • trunk/SophyaPI/PI/piversion.h

    r1827 r1879  
    22#define PIVERSION_H_SEEN
    33
    4 #define PI_VERSIONNUMBER  3.35
     4#define PI_VERSIONNUMBER  3.40
    55
    66#endif
Note: See TracChangeset for help on using the changeset viewer.