Changeset 331 in Sophya for trunk/SophyaPI/PIext


Ignore:
Timestamp:
Jun 28, 1999, 1:56:16 PM (26 years ago)
Author:
ercodmgr
Message:

Ajout SetXYLimits et debut d'introduction de repertoire dans la gestion des objets nommes - Reza 28/6/99

Location:
trunk/SophyaPI/PIext
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/basexecut.cc

    r330 r331  
    6868  mObjMgr->SetGraphicAttributes(tokens[0]);
    6969  }
    70 
     70else if (kw == "setxylimits") {
     71  if (tokens.size() < 4) { cout << "Usage: setxylimits xmin xmax ymin ymax" << endl;  return(0); }
     72  double xmin = atof(tokens[0].c_str());
     73  double xmax = atof(tokens[1].c_str());
     74  double ymin = atof(tokens[2].c_str());
     75  double ymax = atof(tokens[3].c_str());
     76  mImgApp->SetXYLimits(xmin, xmax, ymin, ymax);
     77  }
    7178// >>>>>>>>>>> Link dynamique de fonctions C++
    7279else if (kw == "link" ) {
     
    107114else if (kw == "openfits" ) {
    108115  if (tokens.size() < 1) { cout << "Usage: openfits file " << endl;  return(0); }
    109   else mObjMgr->ReadFits(tokens[0]);
     116  else { string nomobj = "";  mObjMgr->ReadFits(tokens[0], nomobj); }
    110117}
    111118else if (kw == "savefits" ) {
     
    137144  mObjMgr->DelObjects(tokens[0]); 
    138145}
    139 else if (kw == "listobjs")   mObjMgr->ListObjs();
     146else if (kw == "listobjs")   {
     147  if  (tokens.size() < 1)  tokens.push_back("*");
     148  mObjMgr->ListObjs(tokens[0]);
     149}
    140150
    141151// >>>>>>>>>>> Creation d'histos 1D-2D
     
    488498usage += ">> Axes:  stdaxes=defaxes=boxaxes  simpleaxes boxaxesgrid \n";
    489499usage += "          fineaxes  grid=fineaxesgrid \n";
     500usage += ">> XYLimits : xylimits  -> Forces X-Y limits in 2-D plots \n";
    490501usage += ">> DisplayWindow: next same win stack \n";
     502usage += "   Related commands: setxylimits"; 
     503mpiac->RegisterCommand(kw, usage, this, "Graphics");
     504
     505kw = "setxylimits";
     506usage = "Define 2-D plot limits \n Usage: setxylimits xmin xmax ymin ymax";
     507usage += "\n  Related commands: gratt"; 
    491508mpiac->RegisterCommand(kw, usage, this, "Graphics");
    492509
  • trunk/SophyaPI/PIext/nobjmgr.cc

    r330 r331  
    6565// ..................................................................
    6666// ......  Gestion des objets nommes, variables globales ............
     67struct nobj_diritem {
     68  int id;
     69  int nobj;
     70};
     71
     72typedef map<string, nobj_diritem, less<string> > NObjDirList;
     73
    6774struct nobj_item {
    6875  AnyDataObj* obj;
    6976  NObjMgrAdapter* obja;
    7077  int num;
     78  int dirid;
    7179  list<int> wrsid;
    7280  bool operator==(nobj_item const& b) const
     
    7684typedef map<string, nobj_item, less<string> > NObjList;
    7785
    78 static NObjList* myObjs;
     86static NObjDirList* myDirs = NULL;
     87static NObjList* myObjs = NULL;
    7988static int fgOInit = 0;
    8089static int myNObj = 0;
    81 static string* lastobj = NULL;
     90static int myDirId = 0;
     91static string* currDir;
    8292
    8393static PIStdImgApp* myImgApp=NULL;
     
    101111{
    102112if (fgOInit == 0) {
     113  myDirs = new NObjDirList;
    103114  myObjs = new NObjList; 
    104   lastobj = new string("");
     115  currDir = new string("home");
    105116  char* varenv;
    106117  TmpDir = new string("");
     
    149160{
    150161return(servnobjm);
     162}
     163
     164/* --Methode-- */
     165void NamedObjMgr::CreateDir(string const& dirname)
     166{
     167}
     168
     169/* --Methode-- */
     170void NamedObjMgr::DeleteDir(string const& dirname)
     171{
     172}
     173
     174/* --Methode-- */
     175void NamedObjMgr::SetCurrentDir(string const& dirname)
     176{
     177}
     178
     179/* --Methode-- */
     180void NamedObjMgr::CleanTmpDir()
     181{
     182}
     183
     184/* --Methode-- */
     185void NamedObjMgr::CleanOldDir()
     186{
    151187}
    152188
     
    169205// void  RenameObj(string const& nom, string& nomnew)
    170206//      Change le nom d'un objet dans la liste.
    171 // string  LastObjName()
    172 //      Renvoie le nom du dernier objet ajouté à la liste
    173207//--
    174208
    175209
    176210/* --Methode-- */
    177 void NamedObjMgr::AddObj(AnyDataObj* obj, string& nom, bool)
     211void NamedObjMgr::AddObj(AnyDataObj* obj, string & nom, bool)
    178212{
    179213
     
    200234  }
    201235
    202 (*lastobj) = nom;
    203236nobj_item no;
    204237no.obj = obj;
    205238no.obja = servnobjm->GetAdapter(obj);  // L'adaptateur
    206239no.num =  myNObj;
    207 (*myObjs)[(*lastobj)] = no;
     240(*myObjs)[nom] = no;
    208241if (myImgApp)  {
    209   string str = (*lastobj) + "    (T= " + typeid(*obj).name() + ")" ;
     242  string str = nom + "    (T= " + typeid(*obj).name() + ")" ;
    210243  (myImgApp->ObjMgrW())->AddObj(str.c_str(), myNObj+1000);
    211244}
    212245 
    213 cout << "NamedObjMgr::AddObj()  Object " << (*lastobj) << " ( " 
     246cout << "NamedObjMgr::AddObj()  Object " << nom << " ( " 
    214247     << typeid(*obj).name() << " ) added (Total= " << myObjs->size() << ")" << endl; 
    215248return;
     
    217250
    218251/* --Methode-- */
    219 void NamedObjMgr::DelObj(string const& nom, bool fgd)
     252void NamedObjMgr::RenameObj(string & nom, string& nomnew)
     253{
     254AnyDataObj* obj = GetObj(nom);
     255if (obj == NULL) return;
     256DelObj(nom, false);
     257AddObj(obj, nomnew);
     258return;
     259}
     260
     261/* --Methode-- */
     262void NamedObjMgr::DelObj(string & nom, bool fgd)
    220263{
    221264NObjList::iterator it = myObjs->find(nom);
     
    237280
    238281/* --Methode-- */
    239 void NamedObjMgr::DelObjects(string const& patt, bool fgd)
     282void NamedObjMgr::DelObj_Id(int oid)
     283{
     284}
     285
     286/* --Methode-- */
     287void NamedObjMgr::DelObjects(string & patt, bool fgd)
    240288{
    241289NObjList::iterator it; 
     
    251299
    252300/* --Methode-- */
    253 AnyDataObj* NamedObjMgr::GetObj(string const& nom)
     301AnyDataObj* NamedObjMgr::GetObj(string & nom)
    254302{
    255303NObjList::iterator it = myObjs->find(nom);
     
    259307
    260308/* --Methode-- */
    261 NObjMgrAdapter* NamedObjMgr::GetObjAdapter(string const& nom)
     309NObjMgrAdapter* NamedObjMgr::GetObjAdapter(string & nom)
    262310{
    263311NObjList::iterator it = myObjs->find(nom);
     
    267315
    268316/* --Methode-- */
    269 void NamedObjMgr::RenameObj(string const& nom, string& nomnew)
    270 {
    271 AnyDataObj* obj = GetObj(nom);
    272 if (obj == NULL) return;
    273 DelObj(nom, false);
    274 AddObj(obj, nomnew);
    275 return;
    276 }
    277 
    278 /* --Methode-- */
    279 string NamedObjMgr::LastObjName()
    280 {
    281 return((*lastobj));
     317void NamedObjMgr::ListObjs(string & patt)
     318{
     319int k;
     320AnyDataObj* obj=NULL;
     321string ctyp;
     322char strg[256];
     323
     324cout << "NamedObjMgr::ListObjs() NObjs= " << myObjs->size() << "\n" ;
     325NObjList::iterator it;  k = 0;
     326for(it = myObjs->begin(); it != myObjs->end(); it++) {
     327  obj = (*it).second.obj;
     328
     329  ctyp = typeid(*obj).name();
     330  sprintf(strg, "%2d/ %16s : %s", k, typeid(*obj).name(), ((*it).first).c_str());
     331  ctyp = strg;
     332  cout << ctyp << "\n" ;
     333  k++;
     334}
     335cout << endl;
     336return;
     337}
     338
     339/* --Methode-- */
     340void NamedObjMgr::GetObjList(string & patt, vector<string> &)
     341{
    282342}
    283343
     
    297357
    298358/* --Methode-- */
    299 void NamedObjMgr::ReadObj(string const & flnm, string nobj)
     359void NamedObjMgr::ReadObj(string const & flnm, string & nobj)
    300360{
    301361PPersist* obj=NULL;
     
    387447
    388448/* --Methode-- */
    389 void NamedObjMgr::ReadFits(string const & flnm, string nobj)
     449void NamedObjMgr::ReadFits(string const & flnm, string & nobj)
    390450{
    391451bool ok = true;
     
    415475static int key_for_write = 5000;
    416476/* --Methode-- */
    417 void NamedObjMgr::SaveObj(string const& nom, POutPersist& s)
     477void NamedObjMgr::SaveObj(string & nom, POutPersist& s)
    418478{
    419479NObjMgrAdapter* obja=NULL;
     
    445505
    446506/* --Methode-- */
    447 void NamedObjMgr::SaveFits(string const& nom, string const & flnm)
     507void NamedObjMgr::SaveFits(string& nom, string const & flnm)
    448508{
    449509NObjMgrAdapter* obja=NULL;
     
    455515
    456516
    457 /* --Methode-- */
    458 void NamedObjMgr::ListObjs()
    459 {
    460 int k;
    461 AnyDataObj* obj=NULL;
    462 string ctyp;
    463 char strg[256];
    464 
    465 cout << "NamedObjMgr::ListObjs() NObjs= " << myObjs->size() << "\n" ;
    466 NObjList::iterator it;  k = 0;
    467 for(it = myObjs->begin(); it != myObjs->end(); it++) {
    468   obj = (*it).second.obj;
    469 
    470   ctyp = typeid(*obj).name();
    471   sprintf(strg, "%2d/ %16s : %s", k, typeid(*obj).name(), ((*it).first).c_str());
    472   ctyp = strg;
    473   cout << ctyp << "\n" ;
    474   k++;
    475 }
    476 cout << endl;
    477 return;
    478 }
    479 
    480 /* --Methode-- */
    481 void NamedObjMgr::PrintObj(string const& nom)
     517
     518/* --Methode-- */
     519void NamedObjMgr::PrintObj(string& nom)
    482520{
    483521NObjMgrAdapter* obja=NULL;
     
    493531
    494532/* --Methode-- */
    495 void NamedObjMgr::DisplayObj(string const& nom, string dopt)
     533void NamedObjMgr::DisplayObj(string& nom, string dopt)
    496534{
    497535NObjMgrAdapter* obja=NULL;
     
    535573
    536574/* --Methode-- */
    537 void NamedObjMgr::DisplayImage(string const& nom, string dopt)
     575void NamedObjMgr::DisplayImage(string& nom, string dopt)
    538576{
    539577NObjMgrAdapter* obja=NULL;
     
    567605}
    568606/* --Methode-- */
    569 void NamedObjMgr::DisplaySurf3D(string const& nom, string dopt)
     607void NamedObjMgr::DisplaySurf3D(string& nom, string dopt)
    570608{
    571609NObjMgrAdapter* obja=NULL;
     
    608646
    609647/* --Methode-- */
    610 void NamedObjMgr::DisplayNT(string const& nom, string& nmx, string& nmy, string& nmz,
     648void NamedObjMgr::DisplayNT(string& nom, string& nmx, string& nmy, string& nmz,
    611649                            string& erx, string& ery, string& erz, string dopt)
    612650{
     
    657695
    658696/* --Methode-- cmv 13/10/98 */
    659 void NamedObjMgr::DisplayGFD(string const& nom, string& numvarx, string& numvary, string& err, string dopt)
     697void NamedObjMgr::DisplayGFD(string& nom, string& numvarx, string& numvary, string& err, string dopt)
    660698//      Pour le display 2D ou 3D d'un ``GeneralFitData''.
    661699//|  nom = nom de l'objet GeneralFitData a representer.
     
    719757
    720758/* --Methode--
    721 void NamedObjMgr::DisplayImage(string const& nom, string dopt)
     759void NamedObjMgr::DisplayImage(string& nom, string dopt)
    722760{
    723761  cout << "NamedObjMgr::DisplayImage() a faire ! " << endl;
     
    743781
    744782/* --Methode-- */
    745 void NamedObjMgr::DisplayPoints2D(string const& nom,  string& expx, string& expy,
     783void NamedObjMgr::DisplayPoints2D(string& nom,  string& expx, string& expy,
    746784                                  string& experrx, string& experry,
    747785                                  string& expcut, string dopt)
     
    787825
    788826/* --Methode-- */
    789 void NamedObjMgr::DisplayPoints3D(string const& nom,  string& expx, string& expy, string& expz,
     827void NamedObjMgr::DisplayPoints3D(string& nom,  string& expx, string& expy, string& expz,
    790828                                  string& expcut, string dopt)
    791829{
     
    829867
    830868/* --Methode-- */
    831 void NamedObjMgr::ProjectH1(string const& nom, string& expx, string& expwt, string& expcut, string& nomh1, string dopt)
     869void NamedObjMgr::ProjectH1(string& nom, string& expx, string& expwt, string& expcut, string& nomh1, string dopt)
    832870{
    833871NObjMgrAdapter* obja=NULL;
     
    877915
    878916/* --Methode-- */
    879 void NamedObjMgr::ProjectH2(string const& nom, string& expx, string& expy, string& expwt, string& expcut,
     917void NamedObjMgr::ProjectH2(string& nom, string& expx, string& expy, string& expwt, string& expcut,
    880918                            string& nomh2, string dopt)
    881919{
     
    928966
    929967/* --Methode-- cmv 13/10/98 */
    930 void NamedObjMgr::ProjectHProf(string const& nom, string& expx, string& expy, string& expwt, string& expcut,
     968void NamedObjMgr::ProjectHProf(string& nom, string& expx, string& expy, string& expwt, string& expcut,
    931969                              string& nomprof, string dopt)
    932970//      Pour remplir un ``GeneralFitData'' a partir de divers objets:
     
    9881026
    9891027/* --Methode-- */
    990 void NamedObjMgr::FillVect(string const& nom, string& expx, string& expcut, string& nomvec, string dopt)
     1028void NamedObjMgr::FillVect(string& nom, string& expx, string& expcut, string& nomvec, string dopt)
    9911029{
    9921030NObjMgrAdapter* obja=NULL;
     
    10291067
    10301068/* --Methode-- */
    1031 void NamedObjMgr::FillNT(string const& nom, string& expx, string& expy, string& expz, string& expt,
     1069void NamedObjMgr::FillNT(string& nom, string& expx, string& expy, string& expz, string& expt,
    10321070                         string& expcut, string& nomnt)
    10331071{
     
    10661104
    10671105/* --Methode-- cmv 13/10/98 */
    1068 void NamedObjMgr::FillGFD(string const& nom, string& expx, string& expy, string& expz,
     1106void NamedObjMgr::FillGFD(string& nom, string& expx, string& expy, string& expz,
    10691107                          string& experr, string& expcut, string& nomgfd)
    10701108//      Pour remplir un ``GeneralFitData'' a partir de divers objets:
     
    12461284
    12471285/* --Methode-- cmv 13/10/98 */
    1248 void  NamedObjMgr:: Fit12D(string const& nom, string& func,
     1286void  NamedObjMgr:: Fit12D(string& nom, string& func,
    12491287                          string par,string step,string min,string max,
    12501288                          string opt)
  • trunk/SophyaPI/PIext/nobjmgr.h

    r326 r331  
    77#define NOBJMGR_H_SEEN
    88
    9 #include "ppersist.h"
     9#include "machdefs.h"
     10#include "anydataobj.h"
    1011#include "dlftypes.h"
    11 #include "anydataobj.h"
     12
     13#include <string>
     14#include <vector>
     15#if defined(__KCC__)
     16using std::string ;
     17#include <vector.h>
     18#endif
    1219
    1320class NObjMgrAdapter;
     
    2431
    2532
    26 //  Pour ajouter, supprimer et acceder aux objets PPersist
    27   virtual void          AddObj(AnyDataObj* obj, string& nom, bool crd=false);
    28   virtual void          DelObj(string const& nom, bool fgd=true);
    29   virtual void          DelObjects(string const& patt, bool fgd=true);
    30   virtual AnyDataObj*   GetObj(string const& nom);
    31   virtual void          RenameObj(string const& nom, string& nomnew);
    32   virtual string        LastObjName();  // Renvoie le nom du dernier objet ajoute
     33// Gestion des repertoires
     34  virtual void          CreateDir(string const& dirname);
     35  virtual void          DeleteDir(string const& dirname);
     36  virtual void          SetCurrentDir(string const& dirname);
     37  virtual void          CleanTmpDir();
     38  virtual void          CleanOldDir();
     39
     40//  Pour ajouter, supprimer et acceder aux objets
     41  virtual void          AddObj(AnyDataObj* obj, string & nom, bool crd=false);
     42  virtual void          RenameObj(string & nom, string& nomnew);
     43  virtual void          DelObj(string & nom, bool fgd=true);
     44  virtual void          DelObjects(string & patt, bool fgd=true);
     45  virtual void          DelObj_Id(int oid);
     46  virtual AnyDataObj*   GetObj(string & nom);
     47  virtual void          ListObjs(string & patt);               
     48  virtual void          GetObjList(string & patt, vector<string>& );           
    3349
    3450//  Lecture et sauvegarde des objets sur fichier
    3551  virtual void          ReadObj(PInPersist& s, int num=-1);
    36   virtual void          ReadObj(string const & nomppf, string nobj="");
     52  virtual void          ReadObj(string const & nomppf, string & nobj);
    3753  virtual void          ReadAll(string const & nomppf);
    38   virtual void          ReadFits(string const & flnm, string nobj="");
    39   virtual void          SaveObj(string const& nom, POutPersist& s);
     54  virtual void          ReadFits(string const & flnm, string & nobj);
     55  virtual void          SaveObj(string & nom, POutPersist& s);
    4056  virtual void          SaveAll(string const& nomppf);
    41   virtual void          SaveFits(string const& nom, string const & flnm);
     57  virtual void          SaveFits(string & nom, string const & flnm);
    4258
    4359// Info sur les objets
    44   virtual void          ListObjs();             
    45   virtual void          PrintObj(string const& nom);
     60  virtual void          PrintObj(string & nom);
    4661
    4762//  Affichage des objets
    48   virtual void          DisplayObj(string const& nom, string dopt="");
    49   virtual void          DisplayImage(string const& nom, string dopt="");
    50   virtual void          DisplaySurf3D(string const& nom, string dopt="");
    51   virtual void          DisplayNT(string const& nom, string& nmx, string& nmy, string& nmz, 
     63  virtual void          DisplayObj(string & nom, string dopt="");
     64  virtual void          DisplayImage(string & nom, string dopt="");
     65  virtual void          DisplaySurf3D(string & nom, string dopt="");
     66  virtual void          DisplayNT(string & nom, string& nmx, string& nmy, string& nmz, 
    5267                                  string& erx, string& ery, string& erz, string dopt="");
    53   virtual void          DisplayGFD(string const& nom, string& numvarx, string& numvary, string& err, string dopt="");
     68  virtual void          DisplayGFD(string & nom, string& numvarx, string& numvary, string& err, string dopt="");
    5469
    5570  virtual void          SetGraphicAttributes(string gratt="");
     
    5873
    5974//  Trace d'expression de NTuple, et d'autres objets
    60   virtual void          DisplayPoints2D(string const& nom, string& expx, string& expy,
     75  virtual void          DisplayPoints2D(string & nom, string& expx, string& expy,
    6176                                        string& experrx, string& experry,
    6277                                        string& expcut, string dopt="");
    63   virtual void          DisplayPoints3D(string const& nom, string& expx, string& expy, string& expz,
     78  virtual void          DisplayPoints3D(string & nom, string& expx, string& expy, string& expz,
    6479                                        string& expcut, string dopt="");
    6580//  Projection d'expressions dans histogramme (et trace)
    66   virtual void          ProjectH1(string const& nom, string& expx, string& expwt, string& expcut,
     81  virtual void          ProjectH1(string & nom, string& expx, string& expwt, string& expcut,
    6782                                  string& nomh1, string dopt="");
    68   virtual void          ProjectH2(string const& nom, string& expx, string& expy, string& expwt,
     83  virtual void          ProjectH2(string & nom, string& expx, string& expy, string& expwt,
    6984                                  string& expcut, string& nomh2, string dopt="");
    70   virtual void          ProjectHProf(string const& nom, string& expx, string& expy, string& expwt,
     85  virtual void          ProjectHProf(string & nom, string& expx, string& expy, string& expwt,
    7186                                  string& expcut, string& nomprof, string dopt="");
    7287//  Projection d'expression dans vecteurs et dans n-tuple
    73   virtual void          FillVect(string const& nom, string& expx, string& expcut,
     88  virtual void          FillVect(string & nom, string& expx, string& expcut,
    7489                                 string& nomvec, string dopt="");
    75   virtual void          FillNT(string const& nom, string& expx, string& expy, string& expz,
     90  virtual void          FillNT(string & nom, string& expx, string& expy, string& expz,
    7691                               string& expt, string& expcut, string& nomnt);
    77   virtual void          FillGFD(string const& nom, string& expx, string& expy, string& expz,
     92  virtual void          FillGFD(string & nom, string& expx, string& expy, string& expz,
    7893                               string& experr, string& expcut, string& nomgfd);
    7994
    8095//   Methodes de fit, a rajouter  (pour CMV , deux methodes H1 H2 ou 1 seule ??) ...
    81   virtual void          Fit12D(string const& nom, string& func,
     96  virtual void          Fit12D(string & nom, string& func,
    8297                              string par,string step,string min,string max,string opt);
    8398
     
    87102
    88103protected :
    89   virtual NObjMgrAdapter*       GetObjAdapter(string const& nom);
     104  virtual NObjMgrAdapter*       GetObjAdapter(string & nom);
    90105};
    91106
  • trunk/SophyaPI/PIext/pistdimgapp.cc

    r295 r331  
    194194mZoom = 0;
    195195mAxesFlags = kBoxAxes | kExtTicks | kLabels;
     196mXmin = mYmin = -1.;
     197mXmax = mYmax = 1;
    196198SaveGraphicAtt();
    197199
     
    367369
    368370/* --Methode-- */
    369 int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, int opt)
     371int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, int opt, int oid)
    370372{
    371373PIImage* pii;
     
    414416if ( mCmapid != CMAP_OTHER ) pii->SetColMapId(mCmapid, false);
    415417pii->ShowCursor(true);
    416 pii->SetUserData(NULL, flag);
     418pii->SetUserData(NULL, oid);
    417419pii->SetImage(nouv, true);
    418420// printf("!!DBG!! PIImage Pos= %d %d  Size= %d %d \n", pii->XPos(), pii->YPos(), pii->XSize(), pii->YSize()   );
     
    427429
    428430/* --Methode-- */
    429 int PIStdImgApp::DispScDrawer(PIDrawer* scd, string const & name, int opt, string title)
     431int PIStdImgApp::DispScDrawer(PIDrawer* scd, string const & name, int opt, string title, int oid)
    430432{
    431433if (scd == NULL)
     
    462464else scw = new PIH2DWdg(win, (char *)name.c_str(), sx, sy, px, py);
    463465scw->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
    464 scw->SetUserData(NULL, flag);
     466scw->SetUserData(NULL, oid);
     467if (mFXYlim)  // Forcage limites XY
     468  scw->SetLimits(mXmin, mXmax, mYmin, mYmax);
    465469scw->SetAxesFlags(mAxesFlags);
    466470
     
    480484
    481485/* --Methode-- */
    482 int PIStdImgApp::Disp3DDrawer(PIDrawer3D* dr3, string const & name, int opt, string title)
     486int PIStdImgApp::Disp3DDrawer(PIDrawer3D* dr3, string const & name, int opt, string title, int oid)
    483487{
    484488if (dr3 == NULL)
     
    512516PIDraw3DWdg* wd3 = new PIDraw3DWdg(win, (char *)name.c_str(), sx, sy, px, py);
    513517wd3->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
    514 wd3->SetUserData(NULL, flag);
     518wd3->SetUserData(NULL, oid);
    515519wd3->AddDrawer3D(dr3, true);
    516520//   Titre du plot
     
    785789      SetBusy();
    786790      if (data)  {
    787         ObjMgr()->ReadFits(pfc->GetFileName());
    788         ObjMgr()->DisplayObj(ObjMgr()->LastObjName(), "win");
     791        string nomobj="";
     792        ObjMgr()->ReadFits(pfc->GetFileName(), nomobj);
     793        ObjMgr()->DisplayObj(nomobj, "win");
    789794      }
    790795      mFCMsg = 0;
     
    816821    case 10111 :
    817822      if (mCurWdg) {
    818         string no = mCurWdg->Nom();
     823        int oid = mCurWdg->UserFlag();
    819824        DeleteBaseWidget(mCurWdg);
    820         mObjMgr->DelObj(no);
     825        mObjMgr->DelObj_Id(oid);
    821826        }
    822827      break;
     
    11931198  mAxesFlags = axfl;
    11941199}
     1200/* --Methode-- */
     1201void PIStdImgApp::SetXYLimits(double xmin, double xmax, double ymin, double ymax)
     1202{
     1203  mXmin = xmin;  mXmax= xmax;
     1204  mYmin = ymin;  mYmax= ymax;
     1205}
    11951206
    11961207/* --Methode-- */
     
    12071218  mSZoom = mZoom;
    12081219  mSAxesFlags = mAxesFlags;
     1220  mSXmin = mXmin;  mSXmax = mXmax;
     1221  mSYmin = mYmin;  mSYmax = mYmax;
     1222  mSFXYlim = mFXYlim;
    12091223}
    12101224
     
    12221236  mZoom = mSZoom;
    12231237  mAxesFlags = mSAxesFlags;
    1224 }
     1238  mXmin = mSXmin;  mXmax = mSXmax;
     1239  mYmin = mSYmin;  mYmax = mSYmax;
     1240  mFXYlim = mSFXYlim;
     1241}
  • trunk/SophyaPI/PIext/pistdimgapp.h

    r295 r331  
    4646     virtual void   SetBlocked();
    4747
    48      int  DispImage(P2DArrayAdapter* nouv, string const & name, int opt);
    49      int  DispScDrawer(PIDrawer* scd, string const & name, int opt, string title="");
    50      int  Disp3DDrawer(PIDrawer3D* scd, string const & name, int opt, string title="");
     48     int  DispImage(P2DArrayAdapter* nouv, string const & name, int opt, int oid=0);
     49     int  DispScDrawer(PIDrawer* scd, string const & name, int opt, string title="", int oid=0);
     50     int  Disp3DDrawer(PIDrawer3D* scd, string const & name, int opt, string title="", int oid=0);
    5151
    5252     void CreateGraphWin(int nx=1, int ny=1, int sx=0, int sy = 0);
     
    9494     void  SetZoomAtt(int zoom=0);
    9595     void  SetAxesAtt(unsigned int axfl=kBoxAxes | kExtTicks | kLabels);
     96     void  SetXYLimits(double xmin=-1., double xmax=1., double ymin=-1., double ymax=1.);
     97     inline void  UseXYLimits(bool fg=false) {  mFXYlim=fg; }
    9698// Pour sauvegarder-restauration de  l'etat des attributs graphiques
    9799     void  SaveGraphicAtt();   
     
    158160    int          mZoom, mSZoom;
    159161    unsigned int mAxesFlags, mSAxesFlags;
     162    double       mXmin, mXmax, mYmin, mYmax;
     163    double       mSXmin, mSXmax, mSYmin, mSYmax;
     164    bool         mFXYlim, mSFXYlim;
    160165
    161166    PIMessage mFCMsg;  // Message for processing FileOpen
  • trunk/SophyaPI/PIext/servnobjm.cc

    r330 r331  
    401401  mImgapp->SetColMapId();
    402402  mImgapp->SetZoomAtt();
     403  mImgapp->SetAxesAtt();
     404  mImgapp->SetXYLimits();
     405  mImgapp->UseXYLimits();
    403406  return(ropt);
    404407  }
     
    438441  else fgcont = false;
    439442  if (fgcont)   continue;
    440  
     443
     444  // Utilisation limites X-Y
     445  if ( grt[k] == "xylimits" ) { mImgapp->UseXYLimits(true);  fgsrgr = true;  continue; }
    441446  // Si c'est une couleur
    442447  it = GrAcolors.find(grt[k]);
Note: See TracChangeset for help on using the changeset viewer.