Changeset 2638 in Sophya for trunk/SophyaPI/PIext/basexecut.cc


Ignore:
Timestamp:
Nov 19, 2004, 6:41:07 PM (21 years ago)
Author:
ansari
Message:

Ajout commandes addoval addfoval pour trace d'ellipse - Reza 19/11/2004

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/basexecut.cc

    r2615 r2638  
    164164  }
    165165else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect") ||
     166         (kw == "addoval") || (kw == "addfoval") ||
    166167         (kw == "addarrow") ) {
    167168  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; 
    169173    return(0);
    170174  }
     
    178182  if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, false, fgnc);
    179183  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);
    183189  }
    184190}
     
    13391345usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
    13401346usage += "\n       addcirc addarc addfarc addpoly addfpoly graphicatt"; 
     1347mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
     1348
     1349kw = "addoval";
     1350usage = "Adds an oval (ellipse) to the current graphic object";
     1351usage += "\n centered on xc,yc - semi-axis ds,dy (+ graphic attribute)";
     1352usage += "\n The Base/AxesDrawer is used to handle added rectangle";
     1353usage += "\n Alt<E> to remove added element";
     1354usage += "\n  Usage: addoval xc yc dx dy [GraphicAtt] [fgnc=false/true]";
     1355usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
     1356usage += "\n  Related commands: addfoval addline addarrow addfrect addcirc addfcirc";
     1357usage += "\n       addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 
     1358mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
     1359
     1360kw = "addfoval";
     1361usage = "Adds a filled oval (ellipse) to the current graphic object";
     1362usage += "\n centered on xc,yc - semi-axis ds,dy (+ graphic attribute)";
     1363usage += "\n The Base/AxesDrawer is used to handle added rectangle";
     1364usage += "\n Alt<E> to remove added element";
     1365usage += "\n  Usage: addfoval xc yc dx dy [GraphicAtt] [fgnc=false/true]";
     1366usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
     1367usage += "\n  Related commands: addoval addline addarrow addfrect addcirc addfcirc";
     1368usage += "\n       addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 
    13411369mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    13421370
Note: See TracChangeset for help on using the changeset viewer.