Changeset 535 in Sophya for trunk/SophyaPI
- Timestamp:
- Nov 1, 1999, 11:54:32 PM (26 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pibwdggen.cc
r505 r535 338 338 mDrXmin = xmin; mDrXmax = xmax; 339 339 mDrYmin = ymin; mDrYmax = ymax; 340 mDXdir = axrl; mDYdir = ayud; 340 if ( (axrl != kAxeDirSame) && (axrl != kAxeDirAuto) ) mDXdir = axrl; 341 if ( (ayud != kAxeDirSame) && (ayud != kAxeDirAuto) ) mDYdir = ayud; 341 342 } 342 343 -
trunk/SophyaPI/PI/picmapview.cc
r316 r535 5 5 #include "picmapview.h" 6 6 7 //++ 8 // Class PICMapView 9 // Lib PI 10 // include picmapview.h 11 // 12 // Classe permettant la visualisation d'une table de couleur. 13 //-- 14 //++ 15 // Links Voir aussi 16 // PIColorMap 17 //-- 18 19 //++ 20 // Titre Constructeur 21 //-- 22 //++ 23 // PICMapView(PIContainerGen *par, char *nom, int sx=256, int sy=10, int px=0, int py=0); 24 // Constructeur - Le choix d'affichage (vertical ou horizontal) dépend 25 // du rapport des tailles "sx", "sy" 26 //-- 7 27 8 28 … … 24 44 } 25 45 46 47 48 //++ 49 // Titre Méthodes 50 //-- 51 //++ 52 // long kind() 53 // Retourne PICMapView::ClassId . 54 // void SetColMap(PIColorMap* cmp=NULL, float min=1., float max=-1., bool refr=true) 55 // Choix de la table de couleur et valeurs min et max. Si "refr==true", 56 // la méthode "Refresh()" est appelée. 57 // void SetColMapId(CMapId cmapid, float min=1., float max=-1., bool refr=true) 58 // Choix de la table de couleur en utilisant le "CMapId" et 59 // définition des valeurs min et max. Si "refr==true", 60 // la méthode "Refresh()" est appelée. 61 //-- 26 62 27 63 /* --Methode-- */ -
trunk/SophyaPI/PI/pidrawer.cc
r505 r535 308 308 PIDrawer::CalcTicks() 309 309 { 310 BestTicks(xMin,xMax,7,xMajTickStep); 310 int ntick_x = (aXlog) ? 4 : 7; 311 BestTicks(xMin,xMax,ntick_x,xMajTickStep); 311 312 xMinTickStep = xMajTickStep/5; 312 313 xFirstMajTick = int(xMin / xMajTickStep) * xMajTickStep; … … 315 316 if (xFirstMinTick < xMin) xFirstMinTick += xMinTickStep; 316 317 317 BestTicks(yMin,yMax,12,yMajTickStep); 318 int ntick_y = (aYlog) ? 6 : 12; 319 BestTicks(yMin,yMax,ntick_y,yMajTickStep); 318 320 yMinTickStep = yMajTickStep/5; 319 321 yFirstMajTick = int(yMin / yMajTickStep) * yMajTickStep; … … 439 441 if (flags & kLabels) { 440 442 if (!aYdir) { 441 DrawHLabels(g, yMin-xMajTickLen*8, xFirstMajTick, xMajTickStep,0);442 DrawHLabels(g, yMax+xMajTickLen*2, xFirstMajTick, xMajTickStep,0);443 DrawHLabels(g, g->DeltaUCY(yMin, -xMajTickLen*8), xFirstMajTick, xMajTickStep,0); 444 DrawHLabels(g, g->DeltaUCY(yMax, xMajTickLen*2), xFirstMajTick, xMajTickStep,0); 443 445 } 444 446 else { 445 DrawHLabels(g, yMin-xMajTickLen*2, xFirstMajTick, xMajTickStep,0);446 DrawHLabels(g, yMax+xMajTickLen*8, xFirstMajTick, xMajTickStep,0);447 DrawHLabels(g, g->DeltaUCY(yMin, -xMajTickLen*2), xFirstMajTick, xMajTickStep,0); 448 DrawHLabels(g, g->DeltaUCY(yMax, xMajTickLen*8), xFirstMajTick, xMajTickStep,0); 447 449 } 448 450 if (!aXdir) { 449 DrawVLabels(g, xMin-yMajTickLen*2, yFirstMajTick, yMajTickStep,1);450 DrawVLabels(g, xMax+yMajTickLen*2, yFirstMajTick, yMajTickStep,-1);451 DrawVLabels(g, g->DeltaUCX(xMin, -yMajTickLen*2), yFirstMajTick, yMajTickStep,1); 452 DrawVLabels(g, g->DeltaUCX(xMax, yMajTickLen*2), yFirstMajTick, yMajTickStep,-1); 451 453 } 452 454 else { 453 DrawVLabels(g, xMin-yMajTickLen*2, yFirstMajTick, yMajTickStep,-1);454 DrawVLabels(g, xMax+yMajTickLen*2, yFirstMajTick, yMajTickStep,1);455 DrawVLabels(g, g->DeltaUCX(xMin, -yMajTickLen*2), yFirstMajTick, yMajTickStep,-1); 456 DrawVLabels(g, g->DeltaUCX(xMax, yMajTickLen*2), yFirstMajTick, yMajTickStep,1); 455 457 } 456 458 } … … 478 480 { 479 481 for (double x=xBeg; x<=xMax; x += xStep) 480 g->DrawLine(x, y-tickDown, x, y+tickUp);482 g->DrawLine(x, g->DeltaUCY(y, -tickDown), x, g->DeltaUCY(y, tickUp)); 481 483 } 482 484 … … 485 487 { 486 488 for (double y=yBeg; y<=yMax; y += yStep) 487 g->DrawLine( x-tickLeft, y, x+tickRight, y);489 g->DrawLine(g->DeltaUCX(x, -tickLeft), y, g->DeltaUCX(x,tickRight), y); 488 490 } 489 491 … … 509 511 xOffset = 0; 510 512 if (aXdir) xOffset = -xOffset; 511 g->DrawString( x+xOffset, y, label);513 g->DrawString(g->DeltaUCX(x,xOffset), y, label); 512 514 } 513 515 } … … 530 532 xOffset = 0; 531 533 if (aXdir) xOffset = -xOffset; 532 g->DrawString( x+xOffset, y, label);534 g->DrawString(g->DeltaUCX(x, xOffset), y, label); 533 535 } 534 536 } … … 597 599 if ( titleT.length() > 0) { 598 600 fx = g->CalcStringWidth(titleT.c_str()); 599 if(aXdir) fx = XMax()-(XMax()-XMin()-fx)/2.;600 else fx = XMin()+(XMax()-XMin()-fx)/2.;601 if ( aYdir) fy = YMin()-fh;602 else fy = YMax()+fh;601 if(aXdir) fx = g->DeltaUCX(XMax(), -(XMax()-XMin()-fx)/2.); 602 else fx = g->DeltaUCX(XMin(), (XMax()-XMin()-fx)/2.); 603 if (g->isAxeYDirUpDown()) fy = g->DeltaUCY(YMin(), -fh); 604 else fy = g->DeltaUCY(YMax(), fh); 603 605 g->DrawString(fx, fy, titleT.c_str()); 604 606 // printf(" PIElDrawer::Draw()/DBG (%g , %g) %s - %g \n", fx, fy, titleT.c_str(), fh); … … 606 608 if ( titleB.length() > 0) { 607 609 fx = g->CalcStringWidth(titleB.c_str()); 608 if(aXdir) fx = XMax()-(XMax()-XMin()-fx)/2.;609 else fx = XMin()+(XMax()-XMin()-fx)/2.;610 if ( aYdir) fy = YMax()+fh*1.5;611 else fy = YMin()-fh*1.5;610 if(aXdir) fx = g->DeltaUCX(XMax(), -(XMax()-XMin()-fx)/2.); 611 else fx = g->DeltaUCX(XMin(), (XMax()-XMin()-fx)/2.); 612 if (g->isAxeYDirUpDown()) fy = g->DeltaUCY(YMax(), fh*1.5); 613 else fy = g->DeltaUCY(YMin(), -fh*1.5); 612 614 g->DrawString(fx, fy, titleB.c_str()); 613 615 // printf(" PIElDrawer::Draw()/DBG (%g , %g) %s - %g \n", fx, fy, titleT.c_str(), fh); -
trunk/SophyaPI/PI/pigraphuc.cc
r505 r535 120 120 // bool isLogScaleY() 121 121 // Renvoie "true" si échelle logarithmique pour l'axe X,Y 122 // bool isAxeXDirRtoL() 123 // Renvoie "true" si axe X de droite a gauche 124 // bool isAxeYDirUpDown() 125 // Renvoie "true" si axe Y de haut vers vbas. 122 126 // 123 127 // void UC2GrC(double x, double y, double& xpix, double& ypix) … … 132 136 // Transformation de distances selon X,Y dans l'espace graphique de départ en distance 133 137 // dans l'espace de coordonnées utilisateur. 138 // 139 // void LinUC2GrC(double x, double y, double& xpix, double& ypix) 140 // Transformation de coordonnées utilisateur "(x,y)" en coordoonnées 141 // de l'espace graphic de départ "(xpix, ypix)", sans utilisation de 142 // l'échelle logarithmique. 143 // double DeltaUCX(double x, double dx) 144 // Retourne la nouvelle coordonnée X, correspondant a "x" décalée de 145 // "dx", avec "dx" exprimé en échelle linéaire. 146 // double DeltaUCY(double y, double dy) 147 // Retourne la nouvelle coordonnée Y, coorespondant a "y" décalée de 148 // "dy", avec "dy" exprimé en échelle linéaire. 134 149 //-- 135 150 … … 218 233 } 219 234 else xOrgLog = -log10(xMinLog) * xScaleLog + (xOrg + xMinLog*xScale); 235 // if (xMinLog > xMin) 236 // cerr << "PIGraphicUC::SetLogScale() Warning - Linear Scale for X < " << xMinLog << endl; 220 237 } 221 238 else { … … 233 250 } 234 251 else yOrgLog = -log10(yMinLog) * yScaleLog + (yOrg + yMinLog*yScale); 252 // if (yMinLog > yMin) 253 // cerr << "PIGraphicUC::SetLogScale() Warning - Linear Scale for Y < " << yMinLog << endl; 235 254 } 236 255 else { … … 293 312 if (dy < 0.) dy = -dy; 294 313 } 314 315 /* --Methode-- */ 316 void PIGraphicUC::LinUC2GrC(double x, double y, double& xpix, double& ypix) 317 { 318 xpix = (double)(xOrg + x*xScale); 319 ypix = (double)(yOrg + y*yScale); 320 } 321 322 /* --Methode-- */ 323 double PIGraphicUC::DeltaUCX(double x, double dx) 324 { 325 if (!aXlog) return(x+dx); 326 double xpix, dxpix, tmp, ret; 327 UC2GrC(x, yMin, xpix, tmp); 328 DUC2GrC(dx, 0., dxpix, tmp); 329 if ( ((dx < 0.) && !aXdir) || ((dx >= 0.) && aXdir) ) dxpix = -dxpix; 330 GrC2UC(xpix+dxpix, yW0, ret, tmp); 331 return(ret); 332 } 333 334 /* --Methode-- */ 335 double PIGraphicUC::DeltaUCY(double y, double dy) 336 { 337 if (!aYlog) return(y+dy); 338 double ypix, dypix, tmp, ret; 339 UC2GrC(xMin, y, tmp, ypix); 340 DUC2GrC(0, dy, tmp, dypix); 341 if ( ((dy < 0.) && aYdir) || ((dy >= 0.) && !aYdir) ) dypix = -dypix; 342 GrC2UC(xW0, ypix+dypix, tmp, ret); 343 return(ret); 344 } 345 346 295 347 296 348 /* --Methode-- */ -
trunk/SophyaPI/PI/pigraphuc.h
r505 r535 38 38 inline bool isLogScaleX() { return aXlog; } 39 39 inline bool isLogScaleY() { return aYlog; } 40 inline bool isAxeXDirRtoL() { return aXdir; } 41 inline bool isAxeYDirUpDown() { return aYdir; } 40 42 41 43 // Trace graphiques … … 105 107 virtual void DUC2GrC(double dx, double dy, double& dxpix, double& dypix); 106 108 virtual void DGrC2UC(double dxpix, double dypix, double& dx, double& dy); 109 virtual void LinUC2GrC(double x, double y, double& xpix, double& ypix); 110 virtual double DeltaUCX(double x, double dx); 111 virtual double DeltaUCY(double y, double dy); 107 112 108 113 void NoClip() {clip = false; } -
trunk/SophyaPI/PI/piimage.cc
r485 r535 57 57 58 58 //++ 59 // Titre Constructeurs , méthodes59 // Titre Constructeurs 60 60 //-- 61 61 //++ -
trunk/SophyaPI/PI/pioptmenugen.cc
r329 r535 1 // Module PI : Peida Interactive PIOptMenu 2 // Menu a option 96-97 3 // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA 4 1 5 #include "pioptmenugen.h" 2 6 7 //++ 8 // Class PIOptMenu 9 // Lib PI 10 // include pioptmenugen.h 11 // 12 // Composant graphique de type menu à options. 13 // "PIOptMenuGen" définit l'interface (classe virtuelle pure). Les objets 14 // instanciés doivent être de la classe "PIOptMenu" déclarée dans le fichier 15 // entête "PIOPTMENU_H". Lors de la séléction d'une des options du menu 16 // Le message correspondant complété par "PIMsg_Click" est envoyé à l'objet 17 // par "SendSelf()". 18 //-- 19 //-- 20 //++ 21 // Links Parents 22 // PIWdg 23 //-- 24 //++ 25 // Links Voir aussi 26 // PIMenu 27 //-- 28 29 //++ 30 // Titre Constructeurs 31 //-- 32 //++ 33 // PIOptMenuGen(PIContainerGen* par, const char* nom, int sx=50, int sy=15, int px=0, int py=0) 34 // Constructeur. 35 //-- 3 36 4 37 PIOptMenuGen::PIOptMenuGen(PIContainerGen* par, const char* nom, int sx, int sy, int px, int py) … … 10 43 {} 11 44 45 //++ 46 // Titre Méthodes 47 //-- 12 48 49 //++ 50 // long kind() 51 // Retourne PIOptMenuGen::ClassId 52 // PIMenu* Menu() 53 // Retourne le menu associé. 54 // void AppendItem(const char* nom, PIMessage msg) 55 // Permet d'ajouter une option au menu. 56 // string GetValueStr() 57 // Retourne la chaine de caracteres correspondant au choix courant. 58 // PIMessage GetValue() 59 // Retourne le message correspondant au choix courant. 60 // void SetValueStr(string & s) 61 // Permet de sélectionner l'option correspondant a la chaine "s". 62 // void SetValue(PIMessage msg) 63 // Permet de sélectionner l'option correspondant au message "msg". 64 //-- 65 66 -
trunk/SophyaPI/PI/piscdrawwdg.cc
r505 r535 167 167 if (d == NULL) return; 168 168 d->UpdateLimits(); 169 SetLimits(d->XMin(), d->XMax(), d->YMin(), d->YMax() );169 SetLimits(d->XMin(), d->XMax(), d->YMin(), d->YMax(), mDXdir, mDYdir); 170 170 Refresh(); 171 171 return; … … 178 178 if (! LimitsFixed() ) { // On met a jour les limites 179 179 d->UpdateLimits(); 180 SetLimits(d->XMin(), d->XMax(), d->YMin(), d->YMax() );180 SetLimits(d->XMin(), d->XMax(), d->YMin(), d->YMax(), mDXdir, mDYdir); 181 181 } 182 182 return(AddDrawer(d, true, ad));
Note:
See TracChangeset
for help on using the changeset viewer.