Changeset 1971 in Sophya for trunk/SophyaPI/PIext/basexecut.cc
- Timestamp:
- Apr 30, 2002, 2:34:41 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r1938 r1971 61 61 nx = ny = 1; 62 62 nx = atoi(tokens[0].c_str()); ny = atoi(tokens[1].c_str()); 63 mObjMgr->SetGraphicWinZone(nx, ny, false);63 if (mImgApp) mImgApp->SetZone(nx, ny); 64 64 } 65 65 else if (kw == "newwin") { … … 68 68 if(tokens.size() > 0) nx = atoi(tokens[0].c_str()); 69 69 if(tokens.size() > 1) ny = atoi(tokens[1].c_str()); 70 mObjMgr->SetGraphicWinZone(nx, ny, true);70 if (mImgApp) mImgApp->CreateGraphWin(nx, ny); 71 71 } 72 72 else if (kw == "stacknext") mImgApp->StackWinNext(); 73 73 else if (kw == "graphicatt") { 74 74 if (tokens.size() < 1) { cout << "Usage: graphicatt attributes_list (att=def->defaut)" << endl; return(0); } 75 mObjMgr->SetGraphicAttributes(tokens[0]); 76 } 77 else if (kw == "setxylimits") { 78 if (tokens.size() < 4) { cout << "Usage: setxylimits xmin xmax ymin ymax" << endl; return(0); } 79 double xmin = atof(tokens[0].c_str()); 80 double xmax = atof(tokens[1].c_str()); 81 double ymin = atof(tokens[2].c_str()); 82 double ymax = atof(tokens[3].c_str()); 83 mImgApp->SetXYLimits(xmin, xmax, ymin, ymax); 75 string opts = tokens[0]; 76 if (tokens.size() > 1) 77 for(int kt=1; kt<tokens.size(); kt++) { opts += ' '; opts += tokens[kt]; } 78 if (mImgApp) mImgApp->SetDefaultGraphicAttributes(opts); 79 } 80 else if (kw == "setaxesatt") { 81 if (tokens.size() < 1) { cout << "Usage: setaxesatt attributes_list " << endl; return(0); } 82 string opts = tokens[0]; 83 if (tokens.size() > 1) 84 for(int kt=1; kt<tokens.size(); kt++) { opts += ' '; opts += tokens[kt]; } 85 if (mImgApp) mImgApp->SetDefaultAxesAttributes(opts); 84 86 } 85 87 else if (kw == "setinsetlimits") { … … 91 93 mImgApp->SetInsetLimits(xmin, xmax, ymin, ymax); 92 94 } 93 else if (kw == "setimgcenter") {94 if (tokens.size() < 2) { cout << "Usage: setimgcenter xc yc" << endl; return(0); }95 int xc = atoi(tokens[0].c_str());96 int yc = atoi(tokens[1].c_str());97 mImgApp->SetImageCenterPosition(xc, yc);98 }99 95 else if (kw == "addtext") { 100 96 if (tokens.size() < 3) { cout << "Usage: addtext x y txt [colfontatt]" << endl; return(0); } … … 102 98 double yp = atof(tokens[1].c_str()); 103 99 string txt = tokens[2]; 104 bool fgsr = false; 105 if (tokens.size() > 3) 106 mObjMgr->GetServiceObj()->DecodeDispOption(tokens[3], fgsr); 107 mImgApp->AddText(txt, xp, yp); 108 if (fgsr) mImgApp->RestoreGraphicAtt(); 100 string sop; 101 if (tokens.size() > 3) sop = tokens[3]; 102 mImgApp->AddText(txt, xp, yp, sop); 109 103 } 110 104 else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect")) { … … 114 108 double xp2 = atof(tokens[2].c_str()); 115 109 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); 110 string sop; 111 if (tokens.size() > 4) sop = tokens[4]; 112 if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop); 120 113 else { 121 114 bool fgfill = (kw == "addrect") ? false : true; 122 mImgApp->AddRectangle(xp1, yp1, xp2, yp2, fgfill); 123 } 124 if (fgsr) mImgApp->RestoreGraphicAtt(); 115 mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill); 116 } 125 117 } 126 118 else if ((kw == "addcirc") || (kw == "addfcirc")) { … … 130 122 double rad = atof(tokens[2].c_str()); 131 123 bool fgsr = false; 132 if (tokens.size() > 3)133 mObjMgr->GetServiceObj()->DecodeDispOption(tokens[3], fgsr);124 string sop; 125 if (tokens.size() > 3) sop = tokens[3]; 134 126 bool fgfill = (kw == "addcirc") ? false : true; 135 mImgApp->AddCircle(xc, yc, rad, fgfill); 136 if (fgsr) mImgApp->RestoreGraphicAtt(); 127 mImgApp->AddCircle(xc, yc, rad, sop, fgfill); 137 128 } 138 129 … … 141 132 if (tokens.size() < 1) { cout << "Usage: settitle TopTitle [BotTitle] [fontatt]" << endl; return(0); } 142 133 bool fgsr = true; 143 if (tokens.size() > 2)144 mObjMgr->GetServiceObj()->DecodeDispOption(tokens[2], fgsr);145 if (tokens.size() < 2)146 tokens.push_back("");147 134 mImgApp->SetTitle(tokens[0], tokens[1]); 148 if (fgsr) mImgApp->RestoreGraphicAtt();149 135 } 150 136 … … 397 383 } 398 384 else { 399 if (tokens.size() < 5) tokens.push_back("n ");385 if (tokens.size() < 5) tokens.push_back("next"); 400 386 mObjMgr->GetServiceObj()->PlotFunc2D(tokens[3], tokens[0], xmin, xmax, ymin, ymax, 401 387 nx, ny, tokens[4]); … … 415 401 else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") ) { 416 402 if (tokens.size() < 1) { cout << "Usage: disp/surf/imag nameobj [opt]" << endl; return(0); } 417 string opt = "n ";403 string opt = "next"; 418 404 if (tokens.size() > 1) opt = tokens[1]; 419 405 if (kw == "disp") mObjMgr->DisplayObj(tokens[0], opt); … … 457 443 string numvary = ""; 458 444 string err = ""; 459 string opt = "n ";445 string opt = "next"; 460 446 if(tokens.size()>2) err = tokens[2]; 461 447 if(tokens.size()>3) opt = tokens[3]; … … 468 454 return(0);} 469 455 string err = ""; 470 string opt = "n ";456 string opt = "next"; 471 457 if(tokens.size()>3) err = tokens[3]; 472 458 if(tokens.size()>4) opt = tokens[4]; … … 767 753 kw = "graphicatt"; 768 754 usage = "To change default graphic options \n Usage: graphicatt att_list \n"; 769 usage += "att_list=def back to default values, Example: gratt red,circlemarker5";755 usage += "att_list=def back to default values, Example: gratt 'red circlemarker5'"; 770 756 usage += "\n ------------------ Graphic attribute list ------------------ \n"; 771 757 usage += ">> Colors: defcol black white grey red blue green yellow \n"; … … 791 777 usage += ">> ZoomFactors: defzoom zoomx1 zoomx2 zoomx3 zoomx4 zoomx5 \n"; 792 778 usage += " zoom/2 zoom/3 zoom/4 zoom/5 \n"; 793 usage += ">> Image centering: centerimg-> Position the image in widget \n";779 usage += ">> imagecenter=ix,iy -> Position the image in widget \n"; 794 780 usage += ">> Axes: stdaxes=defaxes=boxaxes simpleaxes boxaxesgrid \n"; 795 usage += " fineaxes grid=fineaxesgrid \n";781 usage += " fineaxes fineaxesgrid \n"; 796 782 usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n"; 797 783 usage += ">> XYLimits : xylimits -> Forces X-Y limits in 2-D plots \n"; … … 799 785 usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n"; 800 786 usage += ">> DisplayWindow: next same win stack inset \n"; 801 usage += " Related commands: set xylimits setinsetlimits setimgcenter";787 usage += " Related commands: setaxesatt setinsetlimits "; 802 788 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 803 789 804 kw = "setxylimits"; 805 usage = "Define 2-D plot limits \n Usage: setxylimits xmin xmax ymin ymax"; 806 usage += "\n Related commands: graphicatt /xylimits"; 790 kw = "setaxesatt"; 791 usage = "To set default axes attributes \n Usage: setaxesatt att_list \n"; 792 usage += ">> Axes: stdaxes=defaxes=boxaxes simpleaxes boxaxesgrid \n"; 793 usage += " fineaxes fineaxesgrid \n"; 794 usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n"; 795 usage += ">> xylimits=xmin,xmax,ymin,ymax -> Forces X-Y limits in 2-D plots \n"; 807 796 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 797 808 798 809 799 kw = "setinsetlimits";
Note:
See TracChangeset
for help on using the changeset viewer.