Changeset 2264 in Sophya
- Timestamp:
- Nov 15, 2002, 12:54:16 AM (23 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pieldrw.cc
r2262 r2264 145 145 case PIDEL_Circ : 146 146 if ((*it).scc) // Coord specifie normalise 0..1 147 g->DrawCircle(CN_To_CG_X((*it).ex), CN_To_CG_Y((*it).ey), CN_To_CG_R((*it).e dx) );148 else g->DrawCircle((*it).ex, (*it).ey, (*it).e dx);147 g->DrawCircle(CN_To_CG_X((*it).ex), CN_To_CG_Y((*it).ey), CN_To_CG_R((*it).er) ); 148 else g->DrawCircle((*it).ex, (*it).ey, (*it).er ); 149 149 break; 150 150 case PIDEL_FCirc : 151 151 if ((*it).scc) // Coord specifie normalise 0..1 152 g->DrawFCircle(CN_To_CG_X((*it).ex), CN_To_CG_Y((*it).ey), CN_To_CG_R((*it).e dx) );153 else g->DrawFCircle((*it).ex, (*it).ey, (*it).e dx);152 g->DrawFCircle(CN_To_CG_X((*it).ex), CN_To_CG_Y((*it).ey), CN_To_CG_R((*it).er) ); 153 else g->DrawFCircle((*it).ex, (*it).ey, (*it).er ); 154 154 break; 155 155 case PIDEL_Arc : 156 if ((*it).scc) // Coord specifie normalise 0..1 157 g->DrawArc(CN_To_CG_X((*it).ex), CN_To_CG_Y((*it).ey), CN_To_CG_R((*it).er), 158 CN_To_CG_R((*it).er), (*it).edx, (*it).edy ); 159 else g->DrawArc((*it).ex, (*it).ey, (*it).er, (*it).er, 160 (*it).edx, (*it).edy ); 161 break; 162 case PIDEL_FArc : 163 if ((*it).scc) // Coord specifie normalise 0..1 164 g->DrawFArc(CN_To_CG_X((*it).ex), CN_To_CG_Y((*it).ey), CN_To_CG_R((*it).er), 165 CN_To_CG_R((*it).er), (*it).edx, (*it).edy ); 166 else g->DrawFArc((*it).ex, (*it).ey, (*it).er, (*it).er, 167 (*it).edx, (*it).edy ); 168 break; 169 case PIDEL_Arc3P : 156 170 if ((*it).scc) // Coord specifie normalise 0..1 157 171 g->Draw3PtArc(CN_To_CG_X((*it).xpol[0]), CN_To_CG_X((*it).xpol[1]), … … 161 175 (*it).ypol[1], (*it).xpol[2], (*it).ypol[2] ); 162 176 break; 163 case PIDEL_FArc :177 case PIDEL_FArc3P : 164 178 if ((*it).scc) // Coord specifie normalise 0..1 165 179 g->Draw3PtFArc(CN_To_CG_X((*it).xpol[0]), CN_To_CG_X((*it).xpol[1]), … … 256 270 // Renvoie le numéro identificateur de l'élément. 257 271 // 272 // int ElAddArc(double x, double y, double r, double a1, double da, bool fgsc=false) 273 // int ElAddArc(double x, double y, double r, double a1, double da, \ 274 // PIGraphicAtt gatt, bool fgsc=false) 275 // Ajout d'un élément de type arc de cercle défini par un angle de départ "a1" 276 // et une extension angulaire "da". 277 // Il est possible de spécifier un attribut graphique. 278 // si "fgsc==true", coordonnées spécifiées considerées normalisées entre 0 et 1. 279 // Renvoie le numéro identificateur de l'élément. 280 // 281 // int ElAddFArc(double x, double y, double r, double a1, double da, bool fgsc=false) 282 // int ElAddFArc(double x, double y, double r, double a1, double da, \ 283 // PIGraphicAtt gatt, bool fgsc=false) 284 // Ajout d'un élément de type arc de cercle plein défini par un angle de 285 // départ "a1" et une extension angulaire "da". 286 // Il est possible de spécifier un attribut graphique. 287 // si "fgsc==true", coordonnées spécifiées considerées normalisées entre 0 et 1. 288 // Renvoie le numéro identificateur de l'élément. 289 // 258 290 // int ElAddArc(double x1, double y1, double x2, double y2 \ 259 291 // double x3, double y3, bool fgsc=false) … … 298 330 /* --Methode-- */ 299 331 int PIElDrwMgr::ElAdd(int typ, double x, double y, double dx, double dy, 300 const char* s, PIGraphicAtt const& att, unsigned long tpd, bool fgsc) 332 const char* s, PIGraphicAtt const& att, 333 unsigned long tpd, bool fgsc, double r) 301 334 { 302 335 DrwEl dre; … … 305 338 dre.ex = x; dre.ey = y; 306 339 dre.edx = dx; dre.edy = dy; 340 dre.er = r; 307 341 dre.gatt = att; 308 342 if (s) { … … 329 363 dre.eid = mEn; dre.etyp = PIDEL_CText; 330 364 dre.ex = x; dre.ey = y; 331 dre.edx = 0; dre.edy = 0; 365 dre.edx = 0; dre.edy = 0; 366 dre.er = 0.; 332 367 dre.gatt = att; 333 368 dre.es = new TxtEl; … … 356 391 dre.ex = dre.ey = 0; 357 392 dre.edx = dre.edy = 0; 393 dre.er = 0.; 358 394 dre.gatt = att; 359 395 dre.es = NULL; -
trunk/SophyaPI/PI/pieldrw.h
r2262 r2264 8 8 #include "pidrawer.h" 9 9 10 // Classe avec gestion d une liste d elements a tracer 10 /* ------------------- Classe PIElDrwMgr ------------------------ */ 11 // Classe avec gerant d une liste d elements a tracer 11 12 12 13 class PIElDrwMgr … … 17 18 PIDEL_Circ = 5, PIDEL_FCirc = 6, 18 19 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 PIDEL_Arc3P = 9, PIDEL_FArc3P = 10, 21 PIDEL_Poly = 11, PIDEL_FPoly = 12, 22 PIDEL_Mark = 13, PIDEL_Arrow = 14, 23 PIDEL_CText = 15 } ; 22 24 23 25 PIElDrwMgr(); … … 88 90 // ---- Ajout de cercles 89 91 inline int ElAddCirc(double x, double y, double r, bool fgsc=false) 90 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt, 0, fgsc) ); } 92 { PIGraphicAtt gatt; 93 return( ElAdd(PIDEL_Circ, x, y, 0., 360., NULL, gatt, 0, fgsc, r) ); } 91 94 inline int ElAddCirc(double x, double y, double r, 92 95 PIGraphicAtt const & gatt, bool fgsc=false) 93 { return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt, 0, fgsc) ); }96 { return( ElAdd(PIDEL_Circ, x, y, 0., 360., NULL, gatt, 0, fgsc, r) ); } 94 97 95 98 inline int ElAddFCirc(double x, double y, double r, bool fgsc=false) 96 { PIGraphicAtt gatt; return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt, 0, fgsc) ); } 99 { PIGraphicAtt gatt; 100 return( ElAdd(PIDEL_FCirc, x, y, 0., 360., NULL, gatt, 0, fgsc, r) ); } 97 101 inline int ElAddFCirc(double x, double y, double r, 98 102 PIGraphicAtt const & gatt, bool fgsc=false) 99 { return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt, 0, fgsc) ); } 100 101 // ---- Ajout d' arcs 103 { return( ElAdd(PIDEL_FCirc, x, y, 0., 360., NULL, gatt, 0, fgsc, r) ); } 104 105 // ---- Ajout d' arcs specifies par deux angles 106 inline int ElAddArc(double x, double y, double r, 107 double a, double da, bool fgsc=false) 108 { PIGraphicAtt gatt; 109 return( ElAdd(PIDEL_Arc, x, y, a, da, NULL, gatt, 0, fgsc, r) ); } 110 inline int ElAddArc(double x, double y, double r, double a, double da, 111 PIGraphicAtt const & gatt, bool fgsc=false) 112 { return( ElAdd(PIDEL_Arc, x, y, a, da, NULL, gatt, 0, fgsc, r) ); } 113 114 inline int ElAddFArc(double x, double y, double r, 115 double a, double da, bool fgsc=false) 116 { PIGraphicAtt gatt; 117 return( ElAdd(PIDEL_FArc, x, y, a, da, NULL, gatt, 0, fgsc, r) ); } 118 inline int ElAddFArc(double x, double y, double r, double a, double da, 119 PIGraphicAtt const & gatt, bool fgsc=false) 120 { return( ElAdd(PIDEL_FArc, x, y, a, da, NULL, gatt, 0, fgsc, r) ); } 121 122 // ---- Ajout d' arcs specifies par 3 points 102 123 inline int ElAddArc(double x1, double y1, double x2, double y2, 103 124 double x3, double y3, bool fgsc=false) … … 105 126 x[0] = x1; x[1] = x2; x[2] = x3; 106 127 y[0] = y1; y[1] = y2; y[2] = y3; 107 return( ElAdd(PIDEL_Arc , x, y, 3, gatt, fgsc) ); }128 return( ElAdd(PIDEL_Arc3P, x, y, 3, gatt, fgsc) ); } 108 129 109 130 inline int ElAddArc(double x1, double y1, double x2, double y2, … … 112 133 x[0] = x1; x[1] = x2; x[2] = x3; 113 134 y[0] = y1; y[1] = y2; y[2] = y3; 114 return( ElAdd(PIDEL_Arc , x, y, 3, gatt, fgsc) ); }135 return( ElAdd(PIDEL_Arc3P, x, y, 3, gatt, fgsc) ); } 115 136 116 137 inline int ElAddFArc(double x1, double y1, double x2, double y2, … … 119 140 x[0] = x1; x[1] = x2; x[2] = x3; 120 141 y[0] = y1; y[1] = y2; y[2] = y3; 121 return( ElAdd(PIDEL_FArc , x, y, 3, gatt, fgsc) ); }142 return( ElAdd(PIDEL_FArc3P, x, y, 3, gatt, fgsc) ); } 122 143 123 144 inline int ElAddFArc(double x1, double y1, double x2, double y2, … … 126 147 x[0] = x1; x[1] = x2; x[2] = x3; 127 148 y[0] = y1; y[1] = y2; y[2] = y3; 128 return( ElAdd(PIDEL_FArc , x, y, 3, gatt, fgsc) ); }149 return( ElAdd(PIDEL_FArc3P, x, y, 3, gatt, fgsc) ); } 129 150 130 151 // ---- Ajout de polygones … … 149 170 int ElAdd(int typ, double x, double y, double dx, double dy, 150 171 const char* s, PIGraphicAtt const & att, 151 unsigned long txtposdir, bool fgsc );172 unsigned long txtposdir, bool fgsc, double r=0.); 152 173 int ElAdd(double x, double y, const char* s, PIGraphicAtt const & att, 153 174 const char* s_up, const char* s_dn, PIGraphicAtt const * gass, … … 169 190 struct DrwEl{ 170 191 int eid, etyp; 171 double ex,ey ;192 double ex,ey,er; 172 193 double edx,edy; 173 194 PIGraphicAtt gatt; … … 176 197 PIGrCoord* ypol; 177 198 int npol; 178 bool scc; // true -> scale coordinate (user-coord : 0..1 1199 bool scc; // true -> normalized coordinates ( 0..1 ) 179 200 }; 180 201 … … 184 205 185 206 }; 207 208 /* ------------------- Classe PIElDrawer ------------------------ */ 209 // Classe de Drawer capable de gerer une liste d'elements a tracer 186 210 187 211 class PIElDrawer : public PIDrawer -
trunk/SophyaPI/PI/pigraphuc.cc
r2257 r2264 638 638 UC2GrC(x0, y0, xf, yf); 639 639 DUC2GrC(dx, dy, dxf, dyf); 640 // $CHECK$ - Reza Nov 2002 , Il faudra aussi tenir compte de l'axe X 641 if (!isAxeYDirUpDown()) degdeb = 360.-(degdeb+deltadeg); 640 642 mGrC->DrawArc(xf, yf, dxf, dyf, degdeb, deltadeg); 641 643 } … … 649 651 UC2GrC(x0, y0, xf, yf); 650 652 DUC2GrC(dx, dy, dxf, dyf); 653 // $CHECK$ - Reza Nov 2002 , Il faudra aussi tenir compte de l'axe X 654 if (!isAxeYDirUpDown()) degdeb = 360.-(degdeb+deltadeg); 651 655 mGrC->DrawFArc(xf, yf, dxf, dyf, degdeb, deltadeg); 652 656 }
Note:
See TracChangeset
for help on using the changeset viewer.