Changeset 1642 in Sophya for trunk/SophyaPI/PIext/basexecut.cc
- Timestamp:
- Aug 16, 2001, 2:19:01 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r1569 r1642 98 98 } 99 99 else if (kw == "addtext") { 100 if (tokens.size() < 4) { cout << "Usage: addtext x y colfontatt txt" << endl; return(0); }100 if (tokens.size() < 3) { cout << "Usage: addtext x y txt [colfontatt]" << endl; return(0); } 101 101 double xp = atof(tokens[0].c_str()); 102 102 double yp = atof(tokens[1].c_str()); 103 bool fgsr = true;104 string txt = tokens[3];105 for(int k=4; k<(int)tokens.size(); k++) txt += (' ' + tokens[k]);106 //int opt = mObjMgr->GetServiceObj()->DecodeDispOption(tokens[2], fgsr);103 string txt = tokens[2]; 104 bool fgsr = false; 105 if (tokens.size() > 3) 106 mObjMgr->GetServiceObj()->DecodeDispOption(tokens[3], fgsr); 107 107 mImgApp->AddText(txt, xp, yp); 108 108 if (fgsr) mImgApp->RestoreGraphicAtt(); 109 109 } 110 else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect")) { 111 if (tokens.size() < 4) { cout << "Usage: addline/addrect/addfrect x1 y1 x2 y2 [colatt]" << endl; return(0); } 112 double xp1 = atof(tokens[0].c_str()); 113 double yp1 = atof(tokens[1].c_str()); 114 double xp2 = atof(tokens[2].c_str()); 115 double yp2 = atof(tokens[3].c_str()); 116 bool fgsr = false; 117 if (tokens.size() > 4) 118 mObjMgr->GetServiceObj()->DecodeDispOption(tokens[4], fgsr); 119 if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2); 120 else { 121 bool fgfill = (kw == "addrect") ? false : true; 122 mImgApp->AddRectangle(xp1, yp1, xp2, yp2, fgfill); 123 } 124 if (fgsr) mImgApp->RestoreGraphicAtt(); 125 } 126 else if ((kw == "addcirc") || (kw == "addfcirc")) { 127 if (tokens.size() < 3) { cout << "Usage: addcirc/addfcirc xc yc r [colatt]" << endl; return(0); } 128 double xc = atof(tokens[0].c_str()); 129 double yc = atof(tokens[1].c_str()); 130 double rad = atof(tokens[2].c_str()); 131 bool fgsr = false; 132 if (tokens.size() > 3) 133 mObjMgr->GetServiceObj()->DecodeDispOption(tokens[3], fgsr); 134 bool fgfill = (kw == "addcirc") ? false : true; 135 mImgApp->AddCircle(xc, yc, rad, fgfill); 136 if (fgsr) mImgApp->RestoreGraphicAtt(); 137 } 138 139 110 140 else if (kw == "settitle") { 111 if (tokens.size() < 2) { cout << "Usage: addtitle fontatt titleup" << endl; return(0); }141 if (tokens.size() < 1) { cout << "Usage: settitle TopTitle [BotTitle] [fontatt]" << endl; return(0); } 112 142 bool fgsr = true; 113 //int opt = mObjMgr->GetServiceObj()->DecodeDispOption(tokens[0], fgsr);114 string txt = tokens[1];115 for(int k=2; k<(int)tokens.size(); k++) txt += (' ' + tokens[k]);116 string td = "";117 mImgApp->SetTitle(t xt, td);143 if (tokens.size() > 2) 144 mObjMgr->GetServiceObj()->DecodeDispOption(tokens[2], fgsr); 145 if (tokens.size() < 2) 146 tokens.push_back(""); 147 mImgApp->SetTitle(tokens[0], tokens[1]); 118 148 if (fgsr) mImgApp->RestoreGraphicAtt(); 119 149 } … … 744 774 usage += "att_list=def back to default values, Example: gratt red,circlemarker5"; 745 775 usage += "\n ------------------ Graphic attribute list ------------------ \n"; 746 usage += ">> Colors: defcol black white grey red blue green yellow magenta cyan \n"; 747 usage += " turquoise navyblue orange siennared purple limegreen gold \n"; 776 usage += ">> Colors: defcol black white grey red blue green yellow \n"; 777 usage += " magenta cyan turquoise navyblue orange siennared purple \n"; 778 usage += " limegreen gold violet violetred blueviolet darkviolet \n"; 748 779 usage += ">> Lines: defline normalline thinline thickline dashedline thindashedline \n"; 749 780 usage += " thickdashedline dottedline thindottedline thickdottedline \n"; … … 796 827 kw = "addtext"; 797 828 usage = "Adds a text string to the current graphic object"; 798 usage += "\n at the specified position (Gr-Object Coordinate) with graphic attribute specification"; 799 usage += "\n Usage: addtext x y ColFontAtt TextString"; 800 usage += "\n Related commands: settitle graphicatt"; 829 usage += "\n at the specified position (+ color and font attributes) "; 830 usage += "\n The Base/AxesDrawer is used to handle added text strings" ; 831 usage += "\n Alt<Z> to remove added elements"; 832 usage += "\n Font attribute is common with axes"; 833 usage += "\n Usage: addtext x y TextString [ColFontAtt]"; 834 usage += "\n (use quotes '' for multi word text strings) "; 835 usage += "\n Related commands: addline addrect addfrect addcirc addfcirc settitle graphicatt"; 801 836 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 802 837 838 kw = "addline"; 839 usage = "Adds a line to the current graphic object"; 840 usage += "\n at the specified position (+ color attribute)"; 841 usage += "\n The Base/AxesDrawer is used to handle added lines"; 842 usage += "\n Alt<Z> to remove added elements"; 843 usage += "\n Usage: addline x1 y1 x2 y2 [ColAtt]"; 844 usage += "\n Related commands: addtext addrect addfrect addcirc addfcirc graphicatt"; 845 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 846 847 kw = "addrect"; 848 usage = "Adds a rectangle to the current graphic object"; 849 usage += "\n between the specified positions (+ color attribute)"; 850 usage += "\n The Base/AxesDrawer is used to handle added rectangle"; 851 usage += "\n Alt<Z> to remove added elements"; 852 usage += "\n Usage: addrect x1 y1 x2 y2 [ColAtt]"; 853 usage += "\n Related commands: addtext addline addfrect addcirc addfcirc graphicatt"; 854 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 855 856 kw = "addfrect"; 857 usage = "Adds a filled rectangle to the current graphic object"; 858 usage += "\n between the specified positions (+ color attribute)"; 859 usage += "\n The Base/AxesDrawer is used to handle added rectangle"; 860 usage += "\n Alt<Z> to remove added elements"; 861 usage += "\n Usage: addfrect x1 y1 x2 y2 [ColAtt]"; 862 usage += "\n Related commands: addtext addline addrect addcirc addfcirc graphicatt"; 863 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 864 865 kw = "addcirc"; 866 usage = "Adds a circle to the current graphic object"; 867 usage += "\n with the specified center and radius (+ color attribute)"; 868 usage += "\n The Base/AxesDrawer is used to handle added circles"; 869 usage += "\n Alt<Z> to remove added elements"; 870 usage += "\n Usage: addcirc xcenter ycenter radius [ColAtt]"; 871 usage += "\n Related commands: addtext addline addfrect addfrect addfcirc graphicatt"; 872 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 873 874 kw = "addfcirc"; 875 usage = "Adds a filled circle to the current graphic object"; 876 usage += "\n with the specified center and radius (+ color attribute)"; 877 usage += "\n The Base/AxesDrawer is used to handle added circles"; 878 usage += "\n Alt<Z> to remove added elements"; 879 usage += "\n Usage: addcirc xcenter ycenter radius [ColAtt]"; 880 usage += "\n Related commands: addtext addline addfrect addfrect addcirc graphicatt"; 881 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 882 803 883 kw = "settitle"; 804 usage = "Set the title string (top title ) for the current graphic object";805 usage += "\n Usage: settitle FontAtt TopTitle";884 usage = "Set the title string (top title / bottom title) for the current graphic object"; 885 usage += "\n Usage: settitle TopTitle [BottomTitle] [fontAtt]"; 806 886 usage += "\n Related commands: addtext graphicatt"; 807 887 mpiac->RegisterCommand(kw, usage, this, "Graphics");
Note:
See TracChangeset
for help on using the changeset viewer.