Changeset 2262 in Sophya for trunk/SophyaPI/PI/pieldrw.h
- Timestamp:
- Nov 14, 2002, 8:10:05 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pieldrw.h
r2242 r2262 27 27 28 28 // ---- Ajout de lignes 29 inline int ElAddLine( PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)30 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt ) ); }31 inline int ElAddLine( PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoordy2,32 PIGraphicAtt const & gatt )33 { return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt ) ); }29 inline int ElAddLine(double x1, double y1, double x2, double y2, bool fgsc=false) 30 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt, 0, fgsc) ); } 31 inline int ElAddLine(double x1, double y1, double x2, double y2, 32 PIGraphicAtt const & gatt, bool fgsc=false) 33 { return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt, 0, fgsc) ); } 34 34 35 35 // ---- Ajout de fleches 36 inline int ElAddArrow( PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)37 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt ) ); }38 inline int ElAddArrow( PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoordy2,39 PIGraphicAtt const & gatt )40 { return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt ) ); }36 inline int ElAddArrow(double x1, double y1, double x2, double y2, bool fgsc=false) 37 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt, 0, fgsc) ); } 38 inline int ElAddArrow(double x1, double y1, double x2, double y2, 39 PIGraphicAtt const & gatt, bool fgsc=false) 40 { return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt, 0, fgsc) ); } 41 41 42 42 // ---- Ajout de marker 43 inline int ElAddMarker( PIGrCoord x, PIGrCoord y)44 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, 0, 0, NULL, gatt ) ); }45 inline int ElAddMarker( PIGrCoord x, PIGrCoord y, PIGraphicAtt const & gatt)46 { return( ElAdd(PIDEL_Mark, x, y, 0, 0, NULL, gatt ) ); }43 inline int ElAddMarker(double x, double y, bool fgsc=false) 44 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, 0, 0, NULL, gatt, 0, fgsc) ); } 45 inline int ElAddMarker(double x, double y, PIGraphicAtt const & gatt, bool fgsc=false) 46 { return( ElAdd(PIDEL_Mark, x, y, 0, 0, NULL, gatt, 0, fgsc) ); } 47 47 48 48 // ---- Ajout de texte 49 inline int ElAddText(PIGrCoord x, PIGrCoord y, const char* s) 50 { PIGraphicAtt gatt; 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) ); } 54 inline int ElAddText(PIGrCoord x, PIGrCoord y, string const & s) 55 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt) ); } 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) ); } 49 inline int ElAddText(double x, double y, const char* s, bool fgsc=false) 50 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt, 0, fgsc) ); } 51 inline int ElAddText(double x, double y, const char* s, 52 PIGraphicAtt const & gatt, unsigned long tpd, bool fgsc=false) 53 { return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt, tpd, fgsc) ); } 54 inline int ElAddText(double x, double y, string const & s, bool fgsc=false) 55 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt, 0, fgsc) ); } 56 inline int ElAddText(double x, double y, string const & s, 57 PIGraphicAtt const & gatt, unsigned long tpd, bool fgsc=false) 58 { return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt, tpd, fgsc) ); } 59 60 // ---- Ajout de texte composite avec exposant - indice 61 inline int ElAddCompText(double x, double y, string const& s, string const& s_up, 62 string const& s_dn, unsigned long tpd=0, bool fgsc=false) 63 { PIGraphicAtt gatt; 64 return( ElAdd(x, y, s.c_str(), gatt, s_up.c_str(), s_dn.c_str(), NULL, tpd, fgsc) ); } 65 inline int ElAddCompText(double x, double y, string const& s, PIGraphicAtt const & gatt, 66 string const& s_up, string const& s_dn, 67 unsigned long tpd=0, bool fgsc=false) 68 { return( ElAdd(x, y, s.c_str(), gatt, s_up.c_str(), s_dn.c_str(), NULL, tpd, fgsc) ); } 69 inline int ElAddCompText(double x, double y, string const& s, PIGraphicAtt const & gatt, 70 string const& s_up, string const& s_dn, PIGraphicAtt const & attss, 71 unsigned long tpd=0, bool fgsc=false) 72 { return( ElAdd(x, y, s.c_str(), gatt, s_up.c_str(), s_dn.c_str(), &attss, tpd, fgsc) ); } 73 59 74 60 75 // ---- Ajout de rectangles 61 inline int ElAddRect( PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy)62 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt ) ); }63 inline int ElAddRect( PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoorddy,64 PIGraphicAtt const & gatt )65 { return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt ) ); }66 67 inline int ElAddFRect( PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy)68 { PIGraphicAtt gatt; return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt ) ); }69 inline int ElAddFRect( PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoorddy,70 PIGraphicAtt const & gatt )71 { return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt ) ); }76 inline int ElAddRect(double x, double y, double dx, double dy, bool fgsc=false) 77 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt, 0, fgsc) ); } 78 inline int ElAddRect(double x, double y, double dx, double dy, 79 PIGraphicAtt const & gatt, bool fgsc=false) 80 { return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt, 0, fgsc) ); } 81 82 inline int ElAddFRect(double x, double y, double dx, double dy, bool fgsc=false) 83 { PIGraphicAtt gatt; return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt, 0, fgsc) ); } 84 inline int ElAddFRect(double x, double y, double dx, double dy, 85 PIGraphicAtt const & gatt, bool fgsc=false) 86 { return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt, 0, fgsc) ); } 72 87 73 88 // ---- Ajout de cercles 74 inline int ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r) 75 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt) ); } 76 inline int ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIGraphicAtt const & gatt) 77 { return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt) ); } 78 79 inline int ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r) 80 { PIGraphicAtt gatt; return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt) ); } 81 inline int ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIGraphicAtt const & gatt) 82 { return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt) ); } 89 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) ); } 91 inline int ElAddCirc(double x, double y, double r, 92 PIGraphicAtt const & gatt, bool fgsc=false) 93 { return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt, 0, fgsc) ); } 94 95 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) ); } 97 inline int ElAddFCirc(double x, double y, double r, 98 PIGraphicAtt const & gatt, bool fgsc=false) 99 { return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt, 0, fgsc) ); } 83 100 84 101 // ---- Ajout d' arcs 85 inline int ElAddArc( PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoordy2,86 PIGrCoord x3, PIGrCoord y3)87 { PIGraphicAtt gatt; PIGrCoordx[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, PIGrCoordy2,93 PIGrCoord x3, PIGrCoord y3, PIGraphicAtt const & gatt)94 { PIGrCoordx[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, PIGrCoordy2,100 PIGrCoord x3, PIGrCoord y3)101 { PIGraphicAtt gatt; PIGrCoordx[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, PIGrCoordy2,107 PIGrCoord x3, PIGrCoord y3, PIGraphicAtt const & gatt)108 { PIGrCoordx[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 ) ); }102 inline int ElAddArc(double x1, double y1, double x2, double y2, 103 double x3, double y3, bool fgsc=false) 104 { PIGraphicAtt gatt; double x[3], y[3]; 105 x[0] = x1; x[1] = x2; x[2] = x3; 106 y[0] = y1; y[1] = y2; y[2] = y3; 107 return( ElAdd(PIDEL_Arc, x, y, 3, gatt, fgsc) ); } 108 109 inline int ElAddArc(double x1, double y1, double x2, double y2, 110 double x3, double y3, PIGraphicAtt const & gatt, bool fgsc=false) 111 { double x[3], y[3]; 112 x[0] = x1; x[1] = x2; x[2] = x3; 113 y[0] = y1; y[1] = y2; y[2] = y3; 114 return( ElAdd(PIDEL_Arc, x, y, 3, gatt, fgsc) ); } 115 116 inline int ElAddFArc(double x1, double y1, double x2, double y2, 117 double x3, double y3, bool fgsc=false) 118 { PIGraphicAtt gatt; double x[3], y[3]; 119 x[0] = x1; x[1] = x2; x[2] = x3; 120 y[0] = y1; y[1] = y2; y[2] = y3; 121 return( ElAdd(PIDEL_FArc, x, y, 3, gatt, fgsc) ); } 122 123 inline int ElAddFArc(double x1, double y1, double x2, double y2, 124 double x3, double y3, PIGraphicAtt const & gatt, bool fgsc=false) 125 { double x[3], y[3]; 126 x[0] = x1; x[1] = x2; x[2] = x3; 127 y[0] = y1; y[1] = y2; y[2] = y3; 128 return( ElAdd(PIDEL_FArc, x, y, 3, gatt, fgsc) ); } 112 129 113 130 // ---- Ajout de polygones 114 inline int ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y) 115 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Poly, x, y, gatt) ); } 116 inline int ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt const & gatt) 117 { return( ElAdd(PIDEL_Poly, x, y, gatt) ); } 131 inline int ElAddPoly(vector<double>& x, vector<double>& y, bool fgsc=false) 132 { PIGraphicAtt gatt; return( ElAdd(PIDEL_Poly, x, y, gatt, fgsc) ); } 133 inline int ElAddPoly(vector<double>& x, vector<double>& y, 134 PIGraphicAtt const & gatt, bool fgsc=false) 135 { return( ElAdd(PIDEL_Poly, x, y, gatt, fgsc) ); } 118 136 119 inline int ElAddFPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y) 120 { PIGraphicAtt gatt; return( ElAdd(PIDEL_FPoly, x, y, gatt) ); } 121 inline int ElAddFPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt const & gatt) 122 123 { return( ElAdd(PIDEL_FPoly, x, y, gatt) ); } 137 inline int ElAddFPoly(vector<double>& x, vector<double>& y, bool fgsc=false) 138 { PIGraphicAtt gatt; return( ElAdd(PIDEL_FPoly, x, y, gatt, fgsc) ); } 139 inline int ElAddFPoly(vector<double>& x, vector<double>& y, 140 PIGraphicAtt const & gatt, bool fgsc=false) 141 142 { return( ElAdd(PIDEL_FPoly, x, y, gatt, fgsc) ); } 124 143 125 144 void ElDel(int id); 145 inline void ElDelLast() { ElDel(mEn); } 126 146 void ElDelAll(); 127 147 128 148 protected: 129 int ElAdd(int typ, PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoorddy,149 int ElAdd(int typ, double x, double y, double dx, double dy, 130 150 const char* s, PIGraphicAtt const & att, 131 unsigned long txtposdir=0); 132 int ElAdd(int typ, vector<PIGrCoord>& x, vector<PIGrCoord>& y, 133 PIGraphicAtt const & att); 134 int ElAdd(int typ, PIGrCoord* x, PIGrCoord* y, int n, 135 PIGraphicAtt const & att); 151 unsigned long txtposdir, bool fgsc); 152 int ElAdd(double x, double y, const char* s, PIGraphicAtt const & att, 153 const char* s_up, const char* s_dn, PIGraphicAtt const * gass, 154 unsigned long tpd, bool fgsc); 155 156 int ElAdd(int typ, vector<double>& x, vector<double>& y, 157 PIGraphicAtt const & att, bool fgsc); 158 int ElAdd(int typ, double* x, double* y, int n, 159 PIGraphicAtt const & att, bool fgsc); 136 160 137 161 struct TxtEl { 138 162 string txt; 139 163 unsigned long txtpd; 164 string* txt_up; 165 string* txt_dn; 166 PIGraphicAtt* attss; 140 167 }; 141 168 142 169 struct DrwEl{ 143 170 int eid, etyp; 144 PIGrCoordex,ey;145 PIGrCoordedx,edy;171 double ex,ey; 172 double edx,edy; 146 173 PIGraphicAtt gatt; 147 174 TxtEl* es; … … 149 176 PIGrCoord* ypol; 150 177 int npol; 178 bool scc; // true -> scale coordinate (user-coord : 0..1 1 151 179 }; 152 180 … … 160 188 { 161 189 public: 162 PIElDrawer( );190 PIElDrawer(bool fgclip=true); 163 191 virtual ~PIElDrawer(); 164 192 … … 184 212 // -- Pour compatibilite avec l'interface precedente , Reza 08/2002 185 213 inline void ElDel(int id) { eltsMgr.ElDel(id); } 214 inline void ElDelLast() { eltsMgr.ElDelLast(); } 186 215 inline void ElDelAll() { eltsMgr.ElDelAll(); } 187 216 188 inline int ElAddText( PIGrCoord x, PIGrCoordy, const char* s)217 inline int ElAddText(double x, double y, const char* s) 189 218 { return eltsMgr.ElAddText(x, y, s); } 190 219 … … 197 226 PIGraphicAtt labelAtt; // Attributs graphiques de trace de label d'axes 198 227 bool showAxesLabels; // Affichage des labels d'axes si true 199 228 bool fgClip; // Si true, appel a PIGraphicUC::Clip() ds Draw() 200 229 }; 201 230
Note:
See TracChangeset
for help on using the changeset viewer.