Changeset 2638 in Sophya
- Timestamp:
- Nov 19, 2004, 6:41:07 PM (21 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r2615 r2638 164 164 } 165 165 else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect") || 166 (kw == "addoval") || (kw == "addfoval") || 166 167 (kw == "addarrow") ) { 167 168 if (tokens.size() < 4) { 168 cout << "Usage: addline/addrect/addfrect x1 y1 x2 y2 [colatt] [fgnc]" << endl; 169 if ( (kw == "addoval") || (kw == "addfoval") ) 170 cout << "Usage addoval/addfoval/addarrow xc yc dx dy [colatt] [fgnc]" << endl; 171 else 172 cout << "Usage: addline/addrect/addfrect/addarrow x1 y1 x2 y2 [colatt] [fgnc]" << endl; 169 173 return(0); 170 174 } … … 178 182 if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, false, fgnc); 179 183 else if (kw == "addarrow") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, true, fgnc); 180 else { 181 bool fgfill = (kw == "addrect") ? false : true; 182 mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill, fgnc); 184 else { 185 bool fgfill = ((kw == "addrect") || (kw == "addoval")) ? false : true; 186 if ( (kw == "addrect") || (kw == "addfrect") ) 187 mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill, fgnc); 188 else mImgApp->AddOval(xp1, yp1, xp2, yp2, sop, fgfill, fgnc); 183 189 } 184 190 } … … 1339 1345 usage += "\n Related commands: addtext addline addarrow addfrect addfrect"; 1340 1346 usage += "\n addcirc addarc addfarc addpoly addfpoly graphicatt"; 1347 mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); 1348 1349 kw = "addoval"; 1350 usage = "Adds an oval (ellipse) to the current graphic object"; 1351 usage += "\n centered on xc,yc - semi-axis ds,dy (+ graphic attribute)"; 1352 usage += "\n The Base/AxesDrawer is used to handle added rectangle"; 1353 usage += "\n Alt<E> to remove added element"; 1354 usage += "\n Usage: addoval xc yc dx dy [GraphicAtt] [fgnc=false/true]"; 1355 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 1356 usage += "\n Related commands: addfoval addline addarrow addfrect addcirc addfcirc"; 1357 usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 1358 mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); 1359 1360 kw = "addfoval"; 1361 usage = "Adds a filled oval (ellipse) to the current graphic object"; 1362 usage += "\n centered on xc,yc - semi-axis ds,dy (+ graphic attribute)"; 1363 usage += "\n The Base/AxesDrawer is used to handle added rectangle"; 1364 usage += "\n Alt<E> to remove added element"; 1365 usage += "\n Usage: addfoval xc yc dx dy [GraphicAtt] [fgnc=false/true]"; 1366 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 1367 usage += "\n Related commands: addoval addline addarrow addfrect addcirc addfcirc"; 1368 usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 1341 1369 mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts"); 1342 1370 -
trunk/SophyaPI/PIext/pistdimgapp.cc
r2615 r2638 1148 1148 } 1149 1149 /* --Methode-- */ 1150 void PIStdImgApp::AddOval(double xp, double yp, double dx, double dy, 1151 string const& sop, bool fgfill, bool fgcn) 1152 { 1153 // <ZThread> global PIApplication event loop synchronisation 1154 ZSync zs(thr_glsyn, 2); 1155 1156 PIDrawer *eld=CurrentElDrawer(); 1157 if (eld == NULL) return; 1158 PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld); 1159 PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld); 1160 if ((eld2 == NULL) && (eld3 == NULL)) return; 1161 PIElDrwMgr* elmgr = NULL; 1162 if (eld2) elmgr = &(eld2->ElDrwMgr()); 1163 else if (eld3) elmgr = &(eld3->ElDrwMgr()); 1164 1165 1166 vector<string> opts; 1167 ParseDisplayOption(sop, opts); 1168 PIGraphicAtt gratt(opts); 1169 1170 if (fgfill) elmgr->ElAddFOval(xp, yp, dx, dy, gratt, fgcn); 1171 else elmgr->ElAddOval(xp, yp, dx, dy, gratt, fgcn); 1172 eld->Refresh(); 1173 } 1174 1175 /* --Methode-- */ 1150 1176 void PIStdImgApp::AddArc(double xc, double yc, double r, double a, double da, 1151 1177 string const& sop, bool fgfill, bool fgcn) -
trunk/SophyaPI/PIext/pistdimgapp.h
r2494 r2638 90 90 void AddCircle(double xc, double yc, double r, string const& opt, 91 91 bool fgfill=false, bool fgcn=false); 92 void AddOval(double xp, double yp, double dx, double dy, string const& opt, 93 bool fgfill=false, bool fgcn=false); 92 94 void AddArc(double xc, double yc, double r, double a, double da, 93 95 string const& opt, bool fgfill=false, bool fgcn=false);
Note:
See TracChangeset
for help on using the changeset viewer.