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


Ignore:
Timestamp:
Nov 15, 2002, 12:58:41 AM (23 years ago)
Author:
ansari
Message:

Ajout addarca et addfarca: Trace d'arc defini par un angle et dangle + sum/product/mean/sigma ds RPNEvaluator - Reza 14/11/2002

File:
1 edited

Legend:

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

    r2263 r2265  
    117117  double ymax = atof(tokens[3].c_str());
    118118  char buff[128];
    119   sprintf(buff, "axesnone xylimits=%g,%g,%g,%g", xmin, xmax, ymin, ymax);
     119  sprintf(buff, "axesnone xylimits=%g,%g,%g,%g ", xmin, xmax, ymin, ymax);
    120120  string sop = buff;
    121121  if (tokens.size() > 4) sop += tokens[4];
    122122  string name;
    123   if (tokens.size() > 5) sop += tokens[5];
     123  if (tokens.size() > 5) name = tokens[5];
    124124  PIFuncDrawer* gdr = new PIFuncDrawer(NULL);
    125125  mImgApp->DispScDrawer(gdr, name, sop);
     
    185185  bool fgfill = (kw == "addcirc") ? false : true;
    186186  mImgApp->AddCircle(xc, yc, rad, sop, fgfill, fgnc);
     187  }
     188else if ((kw == "addarca") || (kw == "addfarca")) {
     189  if (tokens.size() < 5) {
     190    cout << "Usage: addarca/addfarca xc yc r a da [colatt] [fgnc]" << endl; 
     191    return(0);
     192  }
     193  double xc = atof(tokens[0].c_str());
     194  double yc = atof(tokens[1].c_str());
     195  double rad = atof(tokens[2].c_str());
     196  double ang = atof(tokens[3].c_str());
     197  double dang = atof(tokens[4].c_str());
     198  string sop;
     199  if (tokens.size() > 5) sop = tokens[5];
     200  bool fgnc = _CkBoolNC_(6); 
     201  bool fgfill = (kw == "addarca") ? false : true;
     202  mImgApp->AddArc(xc, yc, rad, ang, dang, sop, fgfill, fgnc);
    187203  }
    188204else if (kw == "addmarker") {
     
    10011017usage += "\n at the specified position (+ color/font/pos/dir attributes) ";
    10021018usage += "\n The Base/AxesDrawer is used to handle added text strings" ;
    1003 usage += "\n Alt<Z> to remove added elements";
     1019usage += "\n Alt<E> to remove the added element";
    10041020usage += "\n  Usage: addtext x y TextString [ColFontPosAtt] [fgnc=false/true]";
    10051021usage += "\n  (use quotes '' for multi word text strings) ";
     
    10111027usage += "\n  Related commands: addctext addline addarrow addrect addfrect";
    10121028usage += "\n      addcirc addfcirc addarc addfrac addpoly addfpoly settitle graphicatt"; 
    1013 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1029mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    10141030
    10151031kw = "addctext";
     
    10201036usage += "\n  Related commands: addtext addline addrect ...";
    10211037usage += "\n      (See command addtext and graphicatt for more details)"; 
    1022 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1038mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    10231039
    10241040kw = "addline";
     
    10261042usage += "\n at the specified position (+ graphic attribute)";
    10271043usage += "\n The Base/AxesDrawer is used to handle added lines";
    1028 usage += "\n Alt<Z> to remove added elements";
     1044usage += "\n Alt<E> to remove the added element";
    10291045usage += "\n  Usage: addline x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
    10301046usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
    10311047usage += "\n  Related commands: addarrow addtext addrect addfrect ";
    10321048usage += "\n       addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 
    1033 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1049mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    10341050
    10351051kw = "addarrow";
     
    10371053usage += "\n at the specified position (+ graphic attribute)";
    10381054usage += "\n The Base/AxesDrawer is used to handle added lines";
    1039 usage += "\n Alt<Z> to remove added elements";
     1055usage += "\n Alt<E> to remove the added element";
    10401056usage += "\n  Usage: addarrow x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
    10411057usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
    10421058usage += "\n  Related commands: addline addtext addrect addfrect ";
    10431059usage += "\n       addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 
    1044 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1060mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    10451061kw = "addarrow_nc";
    10461062
     
    10491065usage += "\n between the specified positions (+ graphic attribute)";
    10501066usage += "\n The Base/AxesDrawer is used to handle added rectangle";
    1051 usage += "\n Alt<Z> to remove added elements";
     1067usage += "\n Alt<E> to remove added element";
    10521068usage += "\n  Usage: addrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
    10531069usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
    10541070usage += "\n  Related commands: addtext addline addarrow addfrect";
    10551071usage += "\n       addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 
    1056 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1072mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    10571073
    10581074kw = "addfrect";
     
    10601076usage += "\n between the specified positions (+ graphic attribute)";
    10611077usage += "\n The Base/AxesDrawer is used to handle added rectangle";
    1062 usage += "\n Alt<Z> to remove added elements";
     1078usage += "\n Alt<E> to remove added element";
    10631079usage += "\n  Usage: addfrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
    10641080usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
    10651081usage += "\n  Related commands: addtext addline addarrow addrect";
    10661082usage += "\n       addcirc addfcirc addpoly addfpoly graphicatt"; 
    1067 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1083mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    10681084
    10691085kw = "addmarker";
     
    10711087usage += "\n at the specified position (+ graphic attribute)";
    10721088usage += "\n The Base/AxesDrawer is used to handle added circles";
    1073 usage += "\n Alt<Z> to remove added elements";
     1089usage += "\n Alt<E> to remove added element";
    10741090usage += "\n  Usage: addmarker xpos ypos [GraphicAtt] [fgnc=false/true]";
    10751091usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
    10761092usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
    10771093usage += "\n       addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 
    1078 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1094mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    10791095
    10801096kw = "addcirc";
     
    10821098usage += "\n with the specified center and radius (+ graphic attribute)";
    10831099usage += "\n The Base/AxesDrawer is used to handle added circles";
    1084 usage += "\n Alt<Z> to remove added elements";
     1100usage += "\n Alt<E> to remove added element";
    10851101usage += "\n  Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]";
    10861102usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
    10871103usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
    10881104usage += "\n       addfcirc addarc addfarc addpoly addfpoly graphicatt"; 
    1089 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1105mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    10901106
    10911107kw = "addfcirc";
     
    10931109usage += "\n with the specified center and radius (+ graphic attribute)";
    10941110usage += "\n The Base/AxesDrawer is used to handle added circles";
    1095 usage += "\n Alt<Z> to remove added elements";
     1111usage += "\n Alt<E> to remove added element";
    10961112usage += "\n  Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]";
    10971113usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
    10981114usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
    10991115usage += "\n       addcirc addarc addfarc addpoly addfpoly graphicatt"; 
    1100 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1116mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
     1117
     1118kw = "addarca";
     1119usage = "Adds an arc to the current graphic object";
     1120usage += "\n defined by the circle (center+radius), start angle and angular extension";
     1121usage += "\n Angles are specified in degrees";
     1122usage += "\n  Usage: addarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]";
     1123usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
     1124usage += "\n  Related commands: addtext addline addfarca addarc ...";
     1125mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
     1126
     1127kw = "addfarca";
     1128usage = "Adds a filled arc to the current graphic object";
     1129usage += "\n defined by the circle (center+radius), start angle and angular extension";
     1130usage += "\n Angles are specified in degrees";
     1131usage += "\n  Usage: addfarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]";
     1132usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
     1133usage += "\n  Related commands: addtext addline addarca addarc ...";
     1134mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    11011135
    11021136kw = "addarc";
     
    11041138usage += "\n defined by 3 points (+ graphic attribute)";
    11051139usage += "\n The Base/AxesDrawer is used to handle added arcs";
    1106 usage += "\n Alt<Z> to remove added elements";
     1140usage += "\n Alt<E> to remove the added element";
     1141usage += "\n  Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
     1142usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
     1143usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
     1144usage += "\n       addcirc addfcirc addfarc addarca addpoly addfpoly graphicatt"; 
     1145mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
     1146
     1147kw = "addfarc";
     1148usage = "Adds a filled arc to the current graphic object";
     1149usage += "\n defined by 3 points (+ graphic attribute)";
     1150usage += "\n The Base/AxesDrawer is used to handle added arcs";
     1151usage += "\n Alt<E> to remove added element";
    11071152usage += "\n  Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
    11081153usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
    11091154usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
    11101155usage += "\n       addcirc addfcirc addfarc addpoly addfpoly graphicatt"; 
    1111 mpiac->RegisterCommand(kw, usage, this, "Graphics");
    1112 
    1113 kw = "addfarc";
    1114 usage = "Adds a filled arc to the current graphic object";
    1115 usage += "\n defined by 3 points (+ graphic attribute)";
    1116 usage += "\n The Base/AxesDrawer is used to handle added arcs";
    1117 usage += "\n Alt<Z> to remove added elements";
    1118 usage += "\n  Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
    1119 usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
    1120 usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
    1121 usage += "\n       addcirc addfcirc addfarc addpoly addfpoly graphicatt"; 
    1122 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1156mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    11231157
    11241158kw = "addpoly";
     
    11291163usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
    11301164usage += "\n       addcirc addfcirc addfarc  graphicatt"; 
    1131 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1165mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    11321166
    11331167kw = "addfpoly";
     
    11381172usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
    11391173usage += "\n       addcirc addfcirc addfarc  graphicatt"; 
    1140 mpiac->RegisterCommand(kw, usage, this, "Graphics");
     1174mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
    11411175
    11421176kw = "settitle";
Note: See TracChangeset for help on using the changeset viewer.