Changeset 1827 in Sophya


Ignore:
Timestamp:
Dec 19, 2001, 6:48:26 PM (24 years ago)
Author:
perderos
Message:

Modifs pour support de DrawerActive et methode pour affichage de control-tools specialise par drawer - Olivier + Reza 19/12/2001

Location:
trunk/SophyaPI/PI
Files:
10 edited

Legend:

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

    r1589 r1827  
    440440if (kmod == PIKM_Alt) {
    441441  if (key == 'V' || key == 'v') RequestSelection();  // Pour coller (copier/coller) 
    442   if (key == 'Z' || key == 'z') { mBDrw->ElDelAll();  Refresh(); } // Pour supprimer tous les signes
    443   if (key == 'O' || key == 'o' || key == 'G' || key == 'g') {
    444     PIDrwTools::SetCurrentBaseWdg(this);
    445     PIDrwTools::ShowPIDrwTools();   // Fentre axes et options de trace
    446     }
    447   if (key == 'A' || key == 'a')  {    // On affiche ou on enleve les axes
     442  else if (key == 'Z' || key == 'z') { mBDrw->ElDelAll();  Refresh(); } // Pour supprimer tous les signes
     443  else if (key == 'O' || key == 'o') { // fenetre des options de controle du drawer actif
     444    PIDrawer* actdrw = GetActiveDrawer();
     445    if (actdrw != NULL) actdrw->ShowControlWindow(this);
     446  }
     447  else if (key == 'G' || key == 'g') // Fenetre des options graphiques de trace
     448    PIDrwTools::ShowPIDrwTools(this);   
     449
     450  else if (key == 'A' || key == 'a')  {    // On affiche ou on enleve les axes
    448451    axfg = !axfg;
    449452    list<int>::iterator it;
     
    458461    }
    459462//  <Alt>S active la sensibilite de la zone centrale pour tourner l'objet
    460   if (key == 'S' || key == 's')  skcfg = !skcfg; 
    461   if (key == 'R' || key == 'r')  Update3DView();
     463  else if (key == 'S' || key == 's')  skcfg = !skcfg; 
     464  else if (key == 'R' || key == 'r')  Update3DView();
    462465  }
    463466}
  • trunk/SophyaPI/PI/pibwdggen.cc

    r1534 r1827  
    8888{
    8989mDrwId=0;   // Compteur des numeros sequentiel des PIDrawer
     90mActDrwId = -1;  // Identificateur du drawer actif
    9091mAdfg=false;    // Pour controle d'appel de RemoveDrawer()
    9192mWGrC = NULL;   // PIGraphic (Contexte graphique) associe a la fenetre}
     
    377378mDrwList.push_back(did);
    378379drw->Attach(this, mDrwId);
     380mActDrwId = mDrwId;   // Le dernier drawer ajoute devient le drawer actif par defaut
    379381return(mDrwId);
    380382}
     
    394396mDrwList.push_back(did);
    395397drw->Attach(this, mDrwId);
     398mActDrwId = mDrwId;   // Le dernier drawer ajoute devient le drawer actif par defaut
    396399return(mDrwId);
    397400}
     
    428431vector<BWDrwId>::iterator it;
    429432for(it = mDrwList.begin(); it != mDrwList.end(); it++)
    430   if ((*it).id == id)
    431     { (*it).drw->Detach(this, id); mDrwList.erase(it); break; }
     433  if ((*it).id == id) {
     434    (*it).drw->Detach(this, id); mDrwList.erase(it);
     435    if (id == mActDrwId) {
     436      if (NbDrawers() > 0) mActDrwId = (*mDrwList.end()).id;
     437      else mActDrwId = -1;
     438    }
     439  break;
     440  }
    432441return;
    433442}
     
    441450  if ((*it).ad)  delete (*it).drw;
    442451mDrwList.erase(mDrwList.begin(), mDrwList.end() );
     452mActDrwId = -1;
    443453mAdfg = false;
    444454return;
     
    477487}
    478488
     489
     490/* --Methode-- */
     491void PIBaseWdgGen::SetActiveDrawerId(int id)
     492{
     493vector<BWDrwId>::iterator it;
     494for(it = mDrwList.begin(); it != mDrwList.end(); it++) 
     495  if ((*it).id == id) { mActDrwId = id; break; }
     496return;
     497}
     498
     499/* --Methode-- */
     500void PIBaseWdgGen::SetActiveDrawer(int n)
     501{
     502if ( (n >= 0) && (n < mDrwList.size()) ) mActDrwId = mDrwList[n].id;
     503return;
     504}
     505
     506/* --Methode-- */
     507int PIBaseWdgGen::GetActiveDrawerId()
     508{
     509  return(mActDrwId);
     510}
     511
     512/* --Methode-- */
     513int PIBaseWdgGen::GetActiveDrawerNum()
     514{
     515  if (mActDrwId < 0) return(-1);
     516  for(int i=0; i<mDrwList.size(); i++)
     517    if (mDrwList[i].id == mActDrwId) return(i);
     518  return(-1);
     519}
     520
     521/* --Methode-- */
     522PIDrawer*  PIBaseWdgGen::GetActiveDrawer()
     523{
     524  if (mActDrwId < 0) return(NULL);
     525  else return(GetDrawerId(mActDrwId));
     526}
    479527
    480528//++
  • trunk/SophyaPI/PI/pibwdggen.h

    r1534 r1827  
    9797  virtual int        NbDrawers();
    9898  virtual PIDrawer*  GetDrawerId(int id);   
    99   virtual PIDrawer*  GetDrawer(int n);   
     99  virtual PIDrawer*  GetDrawer(int n);
     100 
     101// Quel est le drawer actif
     102  virtual void       SetActiveDrawerId(int id);   
     103  virtual void       SetActiveDrawer(int n);   
     104  virtual int        GetActiveDrawerId();   
     105  virtual int        GetActiveDrawerNum();   
     106  virtual PIDrawer*  GetActiveDrawer();   
    100107
    101108//  Trace des Drawers ...         
     
    113120  bool mAdfg;           // Pour la gestion de DeleteDrawers() quand appele par delete de PIBaseWdg
    114121  int mDrwId;           // Compteur pour DrawerId
    115   vector<BWDrwId> mDrwList;
     122  int mActDrwId;        // Identificateur du drawer actif
     123  vector<BWDrwId> mDrwList;   // Liste des drawers et leur Id
    116124//  Definition de la zone de trace et limites UC des drawers par defaut 
    117125  PIGrCoord mDrX1, mDrY1,  mDrX2,  mDrY2; 
  • trunk/SophyaPI/PI/picmapview.cc

    r1538 r1827  
    136136    }
    137137  }
    138  
     138  cout << " PICMapView::Draw1 "<<vmin<<" "<<vmax<<endl;
    139139  if (vmin > vmax)   return;
    140140  if ( (cmap->Type() == CMAP_GREY32) || (cmap->Type() == CMAP_GREYINV32) ||
    141141       (cmap->Type() == CMAP_GREY128) || (cmap->Type() == CMAP_GREYINV128) )  g->SelForeground(PI_Red);
    142142  else g->SelForeground(PI_Green);
    143 
     143  cout << " PICMapView::Draw2 "<<vmin<<" "<<vmax<<endl;
    144144  if (sx > sy) {    // horizontal
    145145    int fsz = (sy < 20) ? sy-6 : 14;
     
    151151    else sprintf(buff, "%8.4g", vmin);
    152152    g->DrawString(4, sy-4, buff);
     153    cout << " buff "<<buff;
    153154    av = fabs(vmax);
    154155    if ( (av < 1.e6) && (av > 1.e-3) )  sprintf(buff, "%.2f", vmax);
    155156    else sprintf(buff, "%8.4g", vmax);
     157    cout << " buff2 "<<buff<<endl;
    156158    g->DrawString(sx-4-(int)g->CalcStringWidth(buff), sy-4, buff);
    157159    }
  • trunk/SophyaPI/PI/pidrawer.cc

    r1667 r1827  
    88#include <iostream.h>
    99#include "pidrawer.h"
     10
     11#include "pidrwtools.h"
    1012
    1113#include <math.h>
     
    311313}
    312314
     315void
     316PIDrawer::ShowControlWindow(PIBaseWdgGen* wdg)
     317{
     318  // On affiche par defaut la fenetre de gestion des attributs graphiques
     319   PIDrwTools::ShowPIDrwTools(wdg);
     320}
     321
     322int
     323PIDrawer::DecodeOptionString(vector<string> & opt)
     324{
     325  // a faire un jour OP+Reza 30/11/01
     326  return(0);
     327}
    313328
    314329PIGraphicUC*
  • trunk/SophyaPI/PI/pidrawer.h

    r1631 r1827  
    9090
    9191
    92 //  --- Methode static ----
     92//  Methode permettant l'affichage d'une fenetre de controle specialisee
     93  virtual void       ShowControlWindow(PIBaseWdgGen* wdg);
     94
     95//   Methode permettant de decoder des options a partir de chaines
     96  virtual int        DecodeOptionString(vector<string> & opt);
     97
     98//  --- Methode- static ----
    9399//  Calcul des Distances optimales des subdivisions
    94100  static void        BestTicks(double rmin,double rmax,int nticks,double& majt);
  • trunk/SophyaPI/PI/pidrwtools.cc

    r1640 r1827  
    5454
    5555/* --Methode-- */
     56void PIDrwTools::ShowPIDrwTools(PIBaseWdgGen* cbw)
     57{
     58if (cwdrwt == NULL)  cwdrwt = new PIDrwTools(PIApplicationGetApp());
     59SetCurrentBaseWdg(cbw);
     60cwdrwt->Show();
     61}
     62
     63/* --Methode-- */
    5664void PIDrwTools::ShowPIDrwTools()
    5765{
     
    7482if (cwdrwt)  {
    7583  if (mCurBW != NULL)  {
    76     cwdrwt->mNDr = mCurBW->NbDrawers()-1;
     84    cwdrwt->mNDr = mCurBW->GetActiveDrawerNum();
    7785    if (cwdrwt->mNDr < 0)  cwdrwt->mNDr = 0;
    7886    }
     
    248256mOpt[7]->AppendItem("Big FontSz", 804);
    249257mOpt[7]->AppendItem("Huge FontSz", 805);
     258mOpt[7]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
    250259
    251260cpx = 2*spx;
     
    410419  PIDrawer* drw = mCurBW->GetDrawer(mNDr);
    411420  if (drw == NULL)  return;
     421  mCurBW->SetActiveDrawer(mNDr);
    412422  int k,ii,jj,kk;
    413423  k = mOpt[0]->GetValue()-100;
     
    461471    case 3200 :
    462472      if ((mCurBW != NULL) && (mCurBW->GetDrawer(mNDr) != NULL) ) {
    463         if (mod == PIMsg_Press)  mCurBW->GetDrawer(mNDr)->HighLight(true);
     473        if (mod == PIMsg_Press)  {
     474          mCurBW->GetDrawer(mNDr)->HighLight(true);
     475          mCurBW->SetActiveDrawer(mNDr);
     476        }
    464477        else  mCurBW->GetDrawer(mNDr)->HighLight(false);
    465478      }
  • trunk/SophyaPI/PI/pidrwtools.h

    r1589 r1827  
    2626  static PIDrwTools* curlutw;
    2727  static void ShowPIDrwTools();
     28  static void ShowPIDrwTools(PIBaseWdgGen* cbw);
    2829  static void HidePIDrwTools();
    2930  static void SetCurrentBaseWdg(PIBaseWdgGen* cbw);
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r1631 r1827  
    1111#include "piaxestools.h"
    1212#include "parradapter.h"
     13
    1314
    1415//++
     
    3435//      * <Alt>I : Affiche et met a jour la fenetre Texte-Info .
    3536//      * <Alt>Z : Supprime les textes et signes ajoutés au dessin.
     37//      * <Alt>P : fenetre des options de drawing des contours
    3638//--
    3739//++
     
    117119}
    118120
    119 void
    120 PIScDrawWdg::Keyboard(int key, PIKeyModifier kmod)
     121void PIScDrawWdg::Keyboard(int key, PIKeyModifier kmod)
    121122{
    122123if (kmod == PIKM_Alt) {
     
    125126  else if (key == 'V' || key == 'v') RequestSelection();  // Pour coller (copier/coller) 
    126127  else if (key == 'Z' || key == 'z') { mBDrw->ElDelAll();  Refresh(); } // Pour supprimer tous les signes
    127   else if (key == 'O' || key == 'o') ActivateSpecializedControls();
    128   else if (key == 'G' || key == 'g') {
    129     PIDrwTools::SetCurrentBaseWdg(this);
    130     PIDrwTools::ShowPIDrwTools();   // Fentre axes et options de trace
    131     }
     128  else if (key == 'O' || key == 'o') { // fenetre des options de controle du drawer actif
     129    PIDrawer* actdrw = GetActiveDrawer();
     130    if (actdrw != NULL) actdrw->ShowControlWindow(this);
     131  }
     132  else if (key == 'G' || key == 'g') // Fenetre des options graphiques de trace
     133    PIDrwTools::ShowPIDrwTools(this);   
     134 
    132135  else if (key == 'A' || key == 'a') {
    133136    PIAxesTools::SetCurrentScDrawWdg(this);
    134137    PIAxesTools::ShowPIAxesTools();  // Fenetre de gestion des axes
    135138  }
     139 
    136140  else if (key == 'I' || key == 'i') UpdateInfoWindow();  // Fenetre Text-Info
    137141  }
  • trunk/SophyaPI/PI/piversion.h

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