Changeset 1525 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc


Ignore:
Timestamp:
Jun 13, 2001, 5:05:38 PM (24 years ago)
Author:
ansari
Message:

Ajout methode NamedObjMgr::DisplayVector() et commande vecplot , Reza 13/6/2001

File:
1 edited

Legend:

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

    r1513 r1525  
    2424#else
    2525#include "fitsautoreader.h"
     26#include "tvector.h"
     27#include "pitvmaad.h"
     28#include "piscdrawwdg.h"
    2629#endif
    2730
     
    13611364}
    13621365
     1366/* --Methode-- */
     1367void NamedObjMgr::DisplayVector(string & nomvx, string& nomvy, string dopt)
     1368//      Pour l'affichage 2-D de points avec coordonnees definies par deux vecteurs
     1369//   nomvx et nomvy
     1370{
     1371#ifdef SANS_EVOLPLANCK
     1372  cerr << " NamedObjMgr::DisplayVector() Error: Not implemented with PEIDA " << endl;
     1373#else
     1374
     1375if(!myImgApp) return;
     1376
     1377AnyDataObj* obj;
     1378obj = GetObj(nomvx);
     1379if(obj == NULL) {
     1380  cout << "NamedObjMgr::DisplayVector() Error , No such object " << nomvx << endl;
     1381  return;
     1382}
     1383Vector * vx = dynamic_cast<Vector *>(obj);
     1384if (vx == NULL) {
     1385  cout << "NamedObjMgr::DisplayVector() Error " << nomvx << " not a Vector ! " << endl;
     1386  return; 
     1387}
     1388
     1389obj = GetObj(nomvy);
     1390if(obj == NULL) {
     1391  cout << "NamedObjMgr::DisplayVector() Error , No such object " << nomvy << endl;
     1392  return;
     1393}
     1394Vector * vy = dynamic_cast<Vector *>(obj);
     1395if (vy == NULL) {
     1396  cout << "NamedObjMgr::DisplayVector() Error " << nomvy << " not a Vector ! " << endl;
     1397  return; 
     1398}
     1399
     1400
     1401Vector * cvx, * cvy;
     1402
     1403if (vx->Size() != vy->Size()) {
     1404  cout << "NamedObjMgr::DisplayVector() Warning / Vx.Size() != Vy.Size() " << endl;
     1405  if (vx->Size() < vy->Size()) {
     1406    cvx = new Vector(*vx);
     1407    cvy = new Vector(vy->SubVector(Range(0, 0, vx->Size()-1)));
     1408  }
     1409  else {
     1410    cvx = new Vector(vx->SubVector(Range(0, 0, vy->Size()-1)));
     1411    cvy = new Vector(*vy);
     1412  }
     1413}
     1414else {
     1415  cvx = new Vector(*vx);
     1416  cvy = new Vector(*vy);
     1417}
     1418
     1419POVectorAdapter * avx = new POVectorAdapter(cvx, true);
     1420POVectorAdapter * avy = new POVectorAdapter(cvy, true);
     1421PIYfXDrawer * vxydrw = new PIYfXDrawer(avx, avy, true);
     1422
     1423// Decodage des options classiques
     1424bool fgsr = true;
     1425int opt = servnobjm->DecodeDispOption(dopt, fgsr);
     1426string nx,rx;
     1427ParseObjectName(nomvx, rx, nx);
     1428string ny,ry;
     1429ParseObjectName(nomvy, ry, ny);
     1430
     1431string title = ny + " (Y) vs. " + nx + " (X)";
     1432// display 2D
     1433int wrsid = myImgApp->DispScDrawer(vxydrw, title, opt);
     1434
     1435if (fgsr) myImgApp->RestoreGraphicAtt();
     1436return;
     1437
     1438#endif
     1439}
     1440
    13631441/* --Methode--
    13641442void NamedObjMgr::DisplayImage(string& nom, string dopt)
Note: See TracChangeset for help on using the changeset viewer.