Changeset 2242 in Sophya
- Timestamp:
- Nov 3, 2002, 10:49:34 PM (23 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pieldrw.cc
r2166 r2242 84 84 break; 85 85 case PIDEL_Text : 86 g->DrawString((*it).ex, (*it).ey, ( char*) ((*it).es.c_str()));86 g->DrawString((*it).ex, (*it).ey, ((*it).es->txt.c_str()), (*it).es->txtpd ); 87 87 break; 88 88 case PIDEL_Rect : … … 97 97 case PIDEL_FCirc : 98 98 g->DrawFCircle((*it).ex, (*it).ey, (*it).edx ); 99 break; 100 case PIDEL_Arc : 101 g->Draw3PtArc((*it).xpol[0], (*it).ypol[0], (*it).xpol[1], 102 (*it).ypol[1], (*it).xpol[2], (*it).ypol[2] ); 103 break; 104 case PIDEL_FArc : 105 g->Draw3PtFArc((*it).xpol[0], (*it).ypol[0], (*it).xpol[1], 106 (*it).ypol[1], (*it).xpol[2], (*it).ypol[2] ); 99 107 break; 100 108 case PIDEL_Poly : … … 145 153 // Renvoie le numéro identificateur de l'élément. 146 154 // 155 // int ElAddArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2 \ 156 // PIGrCoord x3, PIGrCoord y3) 157 // int ElAddArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2 \ 158 // PIGrCoord x3, PIGrCoord y3, PIGraphicAtt gatt) 159 // Ajout d'un élément de type arc défini par trois points 160 // (possibilité de spécification d'un attribut graphique). 161 // Renvoie le numéro identificateur de l'élément. 162 // 163 // int ElAddFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2 \ 164 // PIGrCoord x3, PIGrCoord y3) 165 // int ElAddFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2 \ 166 // PIGrCoord x3, PIGrCoord y3, PIGraphicAtt gatt) 167 // Ajout d'un élément de type arc plein défini par trois points 168 // (possibilité de spécification d'un attribut graphique). 169 // Renvoie le numéro identificateur de l'élément. 170 // 147 171 // int ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y) 148 172 // int ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt gatt) … … 162 186 //-- 163 187 188 164 189 /* --Methode-- */ 165 190 int PIElDrwMgr::ElAdd(int typ, PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy, 166 const char* s, PIGraphicAtt const& att )191 const char* s, PIGraphicAtt const& att, unsigned long tpd) 167 192 { 168 193 DrwEl dre; … … 172 197 dre.edx = dx; dre.edy = dy; 173 198 dre.gatt = att; 174 if (s) dre.es = s; 199 if (s) { 200 dre.es = new TxtEl; 201 dre.es->txt = s; 202 dre.es->txtpd = tpd; 203 } 204 else dre.es = NULL; 175 205 dre.xpol = dre.ypol = NULL; 176 206 dre.npol = 0; … … 188 218 dre.edx = dre.edy = 0; 189 219 dre.gatt = att; 220 dre.es = NULL; 190 221 dre.xpol = dre.ypol = NULL; 191 222 dre.npol = (y.size() < x.size()) ? y.size() : x.size(); … … 203 234 204 235 /* --Methode-- */ 236 int PIElDrwMgr::ElAdd(int typ, PIGrCoord* x, PIGrCoord* y, int n, 237 PIGraphicAtt const & att) 238 { 239 vector<PIGrCoord> vx, vy; 240 for(int k=0; k<n; k++) { 241 vx.push_back(x[k]); 242 vy.push_back(y[k]); 243 } 244 return ( ElAdd(typ, vx, vy, att) ); 245 } 246 247 248 /* --Methode-- */ 205 249 void PIElDrwMgr::ElDel(int id) 206 250 { … … 208 252 for (it = mElist.begin(); it != mElist.end(); it++) { 209 253 if ( (*it).eid == id) { 254 if ( (*it).es ) delete (*it).es; 210 255 if ( (*it).xpol ) delete[] (*it).xpol; 211 256 if ( (*it).ypol ) delete[] (*it).ypol; … … 222 267 DrwElList::iterator it; 223 268 for (it = mElist.begin(); it != mElist.end(); it++) { 269 if ( (*it).es ) delete (*it).es; 224 270 if ( (*it).xpol ) delete[] (*it).xpol; 225 271 if ( (*it).ypol ) delete[] (*it).ypol; … … 311 357 else if (opts == "finecenteredaxesgrid") 312 358 SetAxesFlags(kStdAxes | kMajTicks | kMinTicks | kLabels | kGridOn); 359 else if (opts == "axesnone") 360 SetAxesFlags(kAxesNone); 313 361 else if (opts == "autofontsize") 314 362 SetAxesAutoFontSize(true); … … 331 379 void PIElDrawer::DrawAxes(PIGraphicUC* g) 332 380 { 381 if (axesFlags == kAxesNone) return; 333 382 g->NoClip(); 334 383 g->SaveGraphicAtt(); -
trunk/SophyaPI/PI/pieldrw.h
r2164 r2242 16 16 PIDEL_Rect = 3, PIDEL_FRect = 4, 17 17 PIDEL_Circ = 5, PIDEL_FCirc = 6, 18 PIDEL_Poly = 7, PIDEL_FPoly = 8, 19 PIDEL_Mark = 9, PIDEL_Arrow = 10 } ; 18 PIDEL_Arc = 7, PIDEL_FArc = 8, 19 PIDEL_Poly = 9, PIDEL_FPoly = 10, 20 PIDEL_Mark = 11, PIDEL_Arrow = 12, 21 PIDEL_CText = 13 } ; 20 22 21 23 PIElDrwMgr(); … … 24 26 virtual void DrawElements(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax); 25 27 28 // ---- Ajout de lignes 26 29 inline int ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2) 27 30 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt) ); } … … 30 33 { return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt) ); } 31 34 35 // ---- Ajout de fleches 32 36 inline int ElAddArrow(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2) 33 37 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt) ); } … … 36 40 { return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt) ); } 37 41 42 // ---- Ajout de marker 38 43 inline int ElAddMarker(PIGrCoord x, PIGrCoord y) 39 44 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, 0, 0, NULL, gatt) ); } … … 41 46 { return( ElAdd(PIDEL_Mark, x, y, 0, 0, NULL, gatt) ); } 42 47 48 // ---- Ajout de texte 43 49 inline int ElAddText(PIGrCoord x, PIGrCoord y, const char* s) 44 50 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt) ); } 45 inline int ElAddText(PIGrCoord x, PIGrCoord y, const char* s, PIGraphicAtt const & gatt) 46 { return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt) ); } 51 inline int ElAddText(PIGrCoord x, PIGrCoord y, const char* s, 52 PIGraphicAtt const & gatt, unsigned long tpd) 53 { return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt, tpd) ); } 47 54 inline int ElAddText(PIGrCoord x, PIGrCoord y, string const & s) 48 55 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt) ); } 49 inline int ElAddText(PIGrCoord x, PIGrCoord y, string const & s, PIGraphicAtt const & gatt) 50 { return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt) ); } 51 56 inline int ElAddText(PIGrCoord x, PIGrCoord y, string const & s, 57 PIGraphicAtt const & gatt, unsigned long tpd) 58 { return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt, tpd) ); } 59 60 // ---- Ajout de rectangles 52 61 inline int ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy) 53 62 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt) ); } … … 62 71 { return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt) ); } 63 72 73 // ---- Ajout de cercles 64 74 inline int ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r) 65 75 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt) ); } … … 72 82 { return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt) ); } 73 83 84 // ---- Ajout d' arcs 85 inline int ElAddArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 86 PIGrCoord x3, PIGrCoord y3) 87 { PIGraphicAtt gatt; PIGrCoord x[3], y[3]; 88 x[0] = x1; x[1] = x2; x[2] = x3; 89 y[0] = y1; y[1] = y2; y[2] = y3; 90 return( ElAdd(PIDEL_Arc, x, y, 3, gatt) ); } 91 92 inline int ElAddArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 93 PIGrCoord x3, PIGrCoord y3, PIGraphicAtt const & gatt) 94 { PIGrCoord x[3], y[3]; 95 x[0] = x1; x[1] = x2; x[2] = x3; 96 y[0] = y1; y[1] = y2; y[2] = y3; 97 return( ElAdd(PIDEL_Arc, x, y, 3, gatt) ); } 98 99 inline int ElAddFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 100 PIGrCoord x3, PIGrCoord y3) 101 { PIGraphicAtt gatt; PIGrCoord x[3], y[3]; 102 x[0] = x1; x[1] = x2; x[2] = x3; 103 y[0] = y1; y[1] = y2; y[2] = y3; 104 return( ElAdd(PIDEL_FArc, x, y, 3, gatt) ); } 105 106 inline int ElAddFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 107 PIGrCoord x3, PIGrCoord y3, PIGraphicAtt const & gatt) 108 { PIGrCoord x[3], y[3]; 109 x[0] = x1; x[1] = x2; x[2] = x3; 110 y[0] = y1; y[1] = y2; y[2] = y3; 111 return( ElAdd(PIDEL_FArc, x, y, 3, gatt) ); } 112 113 // ---- Ajout de polygones 74 114 inline int ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y) 75 115 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Poly, x, y, gatt) ); } … … 80 120 { PIGraphicAtt gatt; return( ElAdd(PIDEL_FPoly, x, y, gatt) ); } 81 121 inline int ElAddFPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt const & gatt) 122 82 123 { return( ElAdd(PIDEL_FPoly, x, y, gatt) ); } 83 124 … … 87 128 protected: 88 129 int ElAdd(int typ, PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy, 89 const char* s, PIGraphicAtt const & att); 130 const char* s, PIGraphicAtt const & att, 131 unsigned long txtposdir=0); 90 132 int ElAdd(int typ, vector<PIGrCoord>& x, vector<PIGrCoord>& y, 91 133 PIGraphicAtt const & att); 134 int ElAdd(int typ, PIGrCoord* x, PIGrCoord* y, int n, 135 PIGraphicAtt const & att); 136 137 struct TxtEl { 138 string txt; 139 unsigned long txtpd; 140 }; 92 141 93 142 struct DrwEl{ … … 95 144 PIGrCoord ex,ey; 96 145 PIGrCoord edx,edy; 97 string es;98 146 PIGraphicAtt gatt; 147 TxtEl* es; 99 148 PIGrCoord* xpol; 100 149 PIGrCoord* ypol; -
trunk/SophyaPI/PI/pigraphgen.cc
r2138 r2242 7 7 #include "pigraphgen.h" 8 8 #include <math.h> 9 9 #include "ucckprot.h" 10 10 11 11 //++ … … 266 266 // Tracé d'un arc plein, inclu dans le "(x0,y0)" , "dx,dy" 267 267 // entre les angles (en degré) "degdeb" - "degfin" 268 // 269 // Draw3PtArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, \ 270 // PIGrCoord x3, PIGrCoord y3) 271 // Tracé d'un arc spécifié par trois points "(x1,y1)", "(x2,y2)" et "(x3,y3)" 272 // Draw3PtFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, \ 273 // PIGrCoord x3, PIGrCoord y3) 274 // Tracé d'un arc plein spécifié par trois points "(x1,y1)", "(x2,y2)" et "(x3,y3)" 268 275 //-- 269 276 … … 278 285 // Tracé de "n" signes aux points "(x[i],y[i])" 279 286 //-- 287 288 /* --Methode-- */ 289 void PIGraphicGen::Draw3PtArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 290 PIGrCoord x3, PIGrCoord y3) 291 // Trace d'un arc de cercle passant par 3 points 292 { 293 double x0, y0; 294 double dx, dy; 295 double degdeb, degfin; 296 int rc; 297 rc = ComputeArcFrom3Pt(x1, y1, x2, y2, x3, y3, x0, y0, dx, dy, degdeb, degfin); 298 if (rc != 0) return; 299 DrawArc(x0, y0, dx, dy, degdeb, degfin); 300 } 301 302 /* --Methode-- */ 303 void PIGraphicGen::Draw3PtFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 304 PIGrCoord x3, PIGrCoord y3) 305 // Trace d'un arc de cercle passant par 3 points 306 { 307 double x0, y0; 308 double dx, dy; 309 double degdeb, degfin; 310 int rc; 311 rc = ComputeArcFrom3Pt(x1, y1, x2, y2, x3, y3, x0, y0, dx, dy, degdeb, degfin); 312 if (rc != 0) return; 313 DrawFArc(x0, y0, dx, dy, degdeb, degfin); 314 } 315 316 /* --Methode-- */ 317 int PIGraphicGen::ComputeArcFrom3Pt(double x1, double y1, double x2, double y2, 318 double x3, double y3, double& x0, double& y0, 319 double& dx, double& dy, double& degdeb, double& degfin) 320 { 321 x0 = y0 = dx = dy = 0.; 322 degdeb = degfin = 0.; 323 double px[2], py[2]; 324 cout << "DBG - Arc3Pt" << x1 << "," << y1 << " - " 325 << x2 << "," << y2 << " - " 326 << x3 << "," << y3 << endl; 327 // Milieu de M1-M2 328 px[0] = (x1+x2)*0.5; 329 py[0] = (y1+y2)*0.5; 330 // Milieu de M2-M3 331 px[1] = (x2+x3)*0.5; 332 py[1] = (y2+y3)*0.5; 333 double delx, dely; 334 double a[2], b[2]; 335 bool xcst[2]; 336 for(int i=0; i<2; i++) { 337 if (i == 0) { 338 delx = x2-x1; 339 dely = y2-y1; 340 } 341 else { 342 delx = x3-x2; 343 dely = y3-y2; 344 } 345 if ((fabs(delx) > PETIT_DBLE) && (fabs(dely) > PETIT_DBLE)) { 346 // Direction perpendiculaire a M1-M2 , M2-M3 347 double alpha = atan2( dely, delx) + M_PI/2.; 348 a[i] = tan(alpha); 349 b[i] = py[i]-a[i]*px[i]; 350 xcst[i] = false; 351 } 352 else if (fabs(delx) > PETIT_DBLE) { 353 a[i] = b[i] = px[i]; 354 xcst[i] = true; 355 } 356 else if (fabs(dely) > PETIT_DBLE) { 357 a[i] = 0.; b[i] = py[i]; 358 xcst[i] = false; 359 } 360 else { 361 cerr << " PIGraphicGen::ComputeArcFrom3Pt()/Error - delx=" << delx 362 << " dely=" << dely << " (=0) for i=" << i << endl; 363 return(1); 364 } 365 } 366 if (xcst[0] && xcst[1]) { 367 cerr << " PIGraphicGen::ComputeArcFrom3Pt()/Error - xcst[0]&&xcst[1]" << endl; 368 return(2); 369 } 370 double xc,yc; 371 double dela = a[1]-a[0]; 372 if (xcst[0] || xcst[1]) { 373 if (xcst[0]) { 374 xc = px[0]; yc = a[1]*xc+b[1]; 375 } 376 else { 377 xc = px[1]; yc = a[0]*xc+b[0]; 378 } 379 } 380 else { 381 if (fabs(dela) < PETIT_DBLE) { 382 cerr << " PIGraphicGen::ComputeArcFrom3Pt()/Error - a[1]-a[0]=" << dela << endl; 383 return(3); 384 } 385 xc = (b[0]-b[1])/dela; yc = a[0]*xc+b[0]; 386 } 387 delx = x1-xc; 388 dely = y1-yc; 389 double r = sqrt(delx*delx+dely*dely); 390 double ang1 = atan2(dely, delx); 391 delx = x3-xc; 392 dely = y3-yc; 393 double ang2 = atan2(dely, delx); 394 x0 = (xc-r); 395 y0 = (yc-r); 396 dx = dy = 2.*r; 397 degdeb = -ang1*180./M_PI; 398 degfin = -ang2*180./M_PI; 399 cout << "DBG - Arc3Pt-2 " << xc << "," << yc << " R=" << r << " deg= " 400 << degdeb << " :: " << degfin << endl; 401 return(0); 402 } 280 403 281 404 /* --Methode-- */ -
trunk/SophyaPI/PI/pigraphgen.h
r2138 r2242 104 104 double degdeb, double degfin) = 0; 105 105 106 virtual void Draw3PtArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 107 PIGrCoord x3, PIGrCoord y3); 108 virtual void Draw3PtFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 109 PIGrCoord x3, PIGrCoord y3); 110 static int ComputeArcFrom3Pt(double x1, double y1, double x2, double y2, 111 double x3, double y3, double& x0, double& y0, 112 double& dx, double& dy, double& degdeb, double& degfin); 113 114 106 115 virtual void DrawMarker(PIGrCoord x0, PIGrCoord y0) = 0; 107 116 virtual void DrawMarkers(PIGrCoord *x, PIGrCoord *y, int n) = 0; -
trunk/SophyaPI/PI/pigraphuc.cc
r2166 r2242 653 653 654 654 /* --Methode-- */ 655 void PIGraphicUC::Draw3PtArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 656 PIGrCoord x3, PIGrCoord y3) 657 // Trace d'un arc de cercle passant par 3 points 658 { 659 if (!mGrC) return; 660 double xf1, xf2, xf3; 661 double yf1, yf2, yf3; 662 UC2GrC(x1, y1, xf1, yf1); 663 UC2GrC(x2, y2, xf2, yf2); 664 UC2GrC(x3, y3, xf3, yf3); 665 mGrC->Draw3PtArc(xf1, yf1, xf2, yf2, xf3, yf3); 666 } 667 668 /* --Methode-- */ 669 void PIGraphicUC::Draw3PtFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 670 PIGrCoord x3, PIGrCoord y3) 671 // Trace d'un arc de cercle passant par 3 points 672 { 673 if (!mGrC) return; 674 double xf1, xf2, xf3; 675 double yf1, yf2, yf3; 676 UC2GrC(x1, y1, xf1, yf1); 677 UC2GrC(x2, y2, xf2, yf2); 678 UC2GrC(x3, y3, xf3, yf3); 679 mGrC->Draw3PtFArc(xf1, yf1, xf2, yf2, xf3, yf3); 680 } 681 682 683 /* --Methode-- */ 655 684 void PIGraphicUC::DrawMarker(PIGrCoord x0, PIGrCoord y0) 656 685 { -
trunk/SophyaPI/PI/pigraphuc.h
r1935 r2242 68 68 virtual void DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy, 69 69 double degdeb, double degfin); 70 virtual void Draw3PtArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 71 PIGrCoord x3, PIGrCoord y3); 72 virtual void Draw3PtFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 73 PIGrCoord x3, PIGrCoord y3); 74 static int ComputeArcFrom3Pt(PIGrCoord& x1, PIGrCoord& y1, 75 PIGrCoord& x2, PIGrCoord& y2, 76 PIGrCoord& x2, PIGrCoord& y2, 77 PIGrCoord& x0, PIGrCoord& y0, 78 PIGrCoord& dx, PIGrCoord& dy, 79 double& degdeb, double& degfin); 70 80 71 81 virtual void DrawMarker(PIGrCoord x0, PIGrCoord y0); … … 138 148 139 149 protected: 140 150 141 151 PIGraphicGen* mGrC; 142 152 -
trunk/SophyaPI/PI/pigratt.cc
r2138 r2242 77 77 // int DecodeAttStrings(vector<string> & att, bool rmdecatt=true) 78 78 // Décode les attributs à partir du vecteur de string "att". 79 // Si Si"rmdecatt == true", les attributs décodés sont supprimés du79 // Si "rmdecatt == true", les attributs décodés sont supprimés du 80 80 // vecteur de départ. 81 // unsigned long DecodeTextPosDirAtt(vector<string> & att, bool rmdecatt=true) 82 // Décode les attributs de direction et de positionnement de tracé de texte 83 // à partir du vecteur de string "att" (méthode statique). 84 // Si "rmdecatt == true", les attributs décodés sont supprimés du 85 // vecteur de départ. 86 // Retourne le flag de positionnement. 81 87 //-- 82 88 … … 499 505 return(ndec); 500 506 } 507 508 int PIGraphicAtt::DecodeTextPosDirAtt(vector<string> & att, unsigned long& tdirpos, 509 bool rmdecatt) 510 { 511 if (att.size() == 0) return(0); 512 tdirpos = PI_HorizontalLeft | PI_VerticalBottom | PI_TextDirectionHorizontal; 513 int ndec = att.size(); 514 vector<string> udopt; 515 int k; 516 for( k=0; k<att.size(); k++ ) { 517 string& opts = att[k]; 518 if (opts == "horizleft") { 519 tdirpos &= (! PI_HorizontalPosition); 520 tdirpos |= PI_HorizontalLeft; 521 } 522 else if (opts == "horizcenter") { 523 tdirpos &= (! PI_HorizontalPosition); 524 tdirpos |= PI_HorizontalCenter; 525 } 526 else if (opts == "horizright") { 527 tdirpos &= (! PI_HorizontalPosition); 528 tdirpos |= PI_HorizontalRight; 529 } 530 else if (opts == "vertbottom") { 531 tdirpos &= (! PI_VerticalPosition); 532 tdirpos |= PI_VerticalBottom; 533 } 534 else if (opts == "vertcenter") { 535 tdirpos &= (! PI_VerticalPosition); 536 tdirpos |= PI_VerticalCenter; 537 } 538 else if (opts == "verttop") { 539 tdirpos &= (! PI_VerticalPosition); 540 tdirpos |= PI_VerticalTop; 541 } 542 else if (opts == "textdirhoriz") { 543 tdirpos &= (! PI_TextDirection); 544 } 545 else if (opts == "textdirvertup") { 546 tdirpos &= (! PI_TextDirection); 547 tdirpos |= PI_TextDirectionVerticalUp; 548 } 549 else if (opts == "textdirvertdown") { 550 tdirpos &= (! PI_TextDirection); 551 tdirpos |= PI_TextDirectionVerticalDown; 552 } 553 else { 554 ndec--; 555 if (rmdecatt) udopt.push_back(opts); 556 } 557 } 558 if (rmdecatt) att = udopt; 559 return(ndec); 560 561 } -
trunk/SophyaPI/PI/pigratt.h
r1970 r2242 33 33 virtual void UpdateFrom(PIGraphicAtt const & att); 34 34 virtual int DecodeAttStrings(vector<string> & att, bool rmdecatt=true); 35 35 // decodage des attributs de positions et direction de trace de texte 36 static int DecodeTextPosDirAtt(vector<string> & att, unsigned long& tdirpos, 37 bool rmdecatt=true); 36 38 // Changement des attributs graphiques 37 39 inline void SetColAtt(PIColors fg=PI_NotDefColor, -
trunk/SophyaPI/PI/piscdrawwdg.cc
r2119 r2242 244 244 continue; 245 245 } 246 if (opts.substr(0,10) == "defdrrect=") { 247 double x1 = 0.1; 248 double y1 = 0.1; 249 double x2 = 0.9; 250 double y2 = 0.9; 251 sscanf(opts.substr(10).c_str(),"%lg,%lg,%lg,%lg",&x1, &x2,&y1,&y2); 252 SetDefaultDrawRectangle(x1, y1, x2, y2, true); 253 continue; 254 } 246 255 if (opts == "linx") { 247 256 fglinlog = true; fglogx = false; -
trunk/SophyaPI/PI/piversion.h
r2230 r2242 2 2 #define PIVERSION_H_SEEN 3 3 4 #define PI_VERSIONNUMBER 3.8 34 #define PI_VERSIONNUMBER 3.85 5 5 6 6 #endif -
trunk/SophyaPI/PI/piyfxdrw.cc
r2115 r2242 188 188 PIFuncDrawer::Draw(PIGraphicUC* g, double /*xmin*/, double/*ymin*/, double/*xmax*/, double/*ymax*/) 189 189 { 190 if (mFunc == NULL) return; 191 190 192 PIGrCoord x1, x2, y1, y2; 191 193 g->GetGrSpace(x1, x2, y1, y2);
Note:
See TracChangeset
for help on using the changeset viewer.