Changeset 2263 in Sophya for trunk/SophyaPI/PIext
- Timestamp:
- Nov 14, 2002, 8:12:02 PM (23 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r2243 r2263 9 9 #include "pdlmgr.h" 10 10 #include "ctimer.h" 11 #include "strutilxx.h" 11 12 12 13 #include "pistdimgapp.h" … … 46 47 47 48 49 /* Macro pour tester si flag normalized coordinate est present */ 50 #define _CkBoolNC_(_jk_) ((tokens.size()>_jk_) && (tokens[_jk_] == "true")) ? true : false; 48 51 49 52 /* --Methode-- */ … … 123 126 } 124 127 else if (kw == "addtext") { 125 if (tokens.size() < 3) { cout << "Usage: addtext x y txt [colfontatt]" << endl; return(0); } 128 if (tokens.size() < 3) { 129 cout << "Usage: addtext x y txt [colfontatt] [fgnc]" << endl; 130 return(0); 131 } 126 132 double xp = atof(tokens[0].c_str()); 127 133 double yp = atof(tokens[1].c_str()); … … 129 135 string sop; 130 136 if (tokens.size() > 3) sop = tokens[3]; 131 mImgApp->AddText(txt, xp, yp, sop); 137 bool fgnc = _CkBoolNC_(4); 138 mImgApp->AddText(txt, xp, yp, sop, fgnc); 139 } 140 else if (kw == "addctext") { 141 if (tokens.size() < 5) { 142 cout << "Usage: addctext x y txt s_up s_dn [colfontatt] [updnfatt] [fgnc] " << endl; 143 return(0); 144 } 145 double xp = atof(tokens[0].c_str()); 146 double yp = atof(tokens[1].c_str()); 147 string sop; 148 if (tokens.size() > 5) sop = tokens[5]; 149 string sopfss; 150 if (tokens.size() > 6) sopfss = tokens[6]; 151 bool fgnc = _CkBoolNC_(7); 152 mImgApp->AddCompText(tokens[2], tokens[3], tokens[4], xp, yp, sop, sopfss, fgnc); 132 153 } 133 154 else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect") || 134 155 (kw == "addarrow") ) { 135 if (tokens.size() < 4) { cout << "Usage: addline/addrect/addfrect x1 y1 x2 y2 [colatt]" << endl; return(0); } 156 if (tokens.size() < 4) { 157 cout << "Usage: addline/addrect/addfrect x1 y1 x2 y2 [colatt] [fgnc]" << endl; 158 return(0); 159 } 136 160 double xp1 = atof(tokens[0].c_str()); 137 161 double yp1 = atof(tokens[1].c_str()); … … 140 164 string sop; 141 165 if (tokens.size() > 4) sop = tokens[4]; 142 if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, false); 143 else if (kw == "addarrow") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, true); 166 bool fgnc = _CkBoolNC_(5); 167 if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, false, fgnc); 168 else if (kw == "addarrow") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, true, fgnc); 144 169 else { 145 170 bool fgfill = (kw == "addrect") ? false : true; 146 mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill );171 mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill, fgnc); 147 172 } 148 173 } 149 174 else if ((kw == "addcirc") || (kw == "addfcirc")) { 150 if (tokens.size() < 3) { cout << "Usage: addcirc/addfcirc xc yc r [colatt]" << endl; return(0); } 175 if (tokens.size() < 3) { 176 cout << "Usage: addcirc/addfcirc xc yc r [colatt] [fgnc]" << endl; 177 return(0); 178 } 151 179 double xc = atof(tokens[0].c_str()); 152 180 double yc = atof(tokens[1].c_str()); … … 154 182 string sop; 155 183 if (tokens.size() > 3) sop = tokens[3]; 184 bool fgnc = _CkBoolNC_(4); 156 185 bool fgfill = (kw == "addcirc") ? false : true; 157 mImgApp->AddCircle(xc, yc, rad, sop, fgfill );186 mImgApp->AddCircle(xc, yc, rad, sop, fgfill, fgnc); 158 187 } 159 188 else if (kw == "addmarker") { 160 189 if (tokens.size() < 2) { 161 cout << "Usage: addmarker x y [gratt] " << endl;190 cout << "Usage: addmarker x y [gratt] [fgnc]" << endl; 162 191 return(0); 163 192 } … … 166 195 string sop; 167 196 if (tokens.size() > 2) sop = tokens[2]; 168 mImgApp->AddCircle(xm, ym, -1, sop, false); 197 bool fgnc = _CkBoolNC_(3); 198 mImgApp->AddCircle(xm, ym, -1, sop, false, fgnc); 169 199 } 170 200 else if ((kw == "addarc") || (kw == "addfarc") ) { 171 201 if (tokens.size() < 6) { 172 cout << "Usage: addarc/addfarc x1 y1 x2 y2 x3 y3 [gratt] " << endl;202 cout << "Usage: addarc/addfarc x1 y1 x2 y2 x3 y3 [gratt] [fgnc]" << endl; 173 203 return(0); 174 204 } … … 181 211 string sop; 182 212 if (tokens.size() > 6) sop = tokens[6]; 213 bool fgnc = _CkBoolNC_(7); 183 214 bool fgfill = (kw == "addarc") ? false : true; 184 mImgApp->AddArc(x1, y1, x2, y2, x3, y3, sop, fgfill); 185 } 215 mImgApp->AddArc(x1, y1, x2, y2, x3, y3, sop, fgfill, fgnc); 216 } 217 else if ((kw == "addpoly") || (kw == "addfpoly")) { 218 if (tokens.size() < 1) { 219 cout << "Usage: addpoly/addfpoly 'x1,y1 x2,y2 x3,y3 ...' [gratt] [fgnc]" << endl; 220 return(0); 221 } 222 vector<string> sxy; 223 vector<double> xpol, ypol; 224 double xp, yp; 225 FillVStringFrString(tokens[0], sxy); 226 for(int jkk=0; jkk<sxy.size(); jkk++) { 227 xp = yp = 0; 228 if (sscanf(sxy[jkk].c_str(), "%lg,%lg", &xp, &yp) == 2) { 229 xpol.push_back(xp); 230 ypol.push_back(yp); 231 } 232 } 233 string sop; 234 if (tokens.size() > 1) sop = tokens[1]; 235 bool fgnc = _CkBoolNC_(2); 236 bool fgfill = (kw == "addpoly") ? false : true; 237 mImgApp->AddPoly(xpol, ypol, sop, fgfill, fgnc); 238 } 186 239 187 240 … … 704 757 srvo->NtFromASCIIFile(tokens[0],tokens[1],def_val); 705 758 } 759 760 #ifndef SANS_EVOLPLANCK 761 /* Lecture matrice/vecteur depuis fichier ASCII */ 762 else if ((kw == "mtxfrascii") || (kw == "vecfrascii") ) { 763 if(tokens.size() < 2) { 764 cout<<"Usage: mtxfrascii/vecfrascii mtx/vec_name file_name "<<endl; 765 return(0); 766 } 767 TMatrix<r_8> mtx; 768 TVector<r_8> vec; 769 FILE* fip = fopen(tokens[1].c_str(), "r"); 770 if (fip == NULL) { 771 cout << "vec/mtxfrascii: can not open file " << tokens[1] << endl; 772 return(0); 773 } 774 fclose(fip); 775 ifstream is(tokens[1].c_str()); 776 sa_size_t nr, nc; 777 if (kw == "mtxfrascii") { 778 mtx.ReadASCII(is, nr, nc); 779 mObjMgr->AddObj(mtx, tokens[0]); 780 cout << "mtxfrascii: TMatrix<r_8> " << tokens[0] << " read from file " 781 << tokens[1] << endl; 782 } 783 else { 784 vec.ReadASCII(is, nr, nc); 785 mObjMgr->AddObj(vec, tokens[0]); 786 cout << "vecfrascii: TVector<r_8> " << tokens[0] << " read from file " 787 << tokens[1] << endl; 788 } 789 } 790 #endif 706 791 707 792 else if (kw == "fillnt" ) { … … 851 936 usage += " hugefont hugeboldfont hugeitalicfont hugebolditalicfont \n"; 852 937 usage += ">> Font Names: deffont courierfont helveticafont timesfont symbolfont \n"; 853 usage += ">> Marker: dotmarker<T> plusmarker<T> crossmarker<T> circlemarker 938 usage += ">> Marker: dotmarker<T> plusmarker<T> crossmarker<T> circlemarker<T> \n"; 854 939 usage += " fcirclemarker<T> boxmarker<T> fboxmarker<T> trianglemarker<T> \n"; 855 940 usage += " ftrianglemarker<T> starmarker<T> fstarmarker<T> \n"; 856 usage += " with <T> = 1 3 5 7 9 , Example fboxmarker5 , plusmarker9 ... \n"; 941 usage += " with <T> = 1 3 5 7 .. 15 , Example fboxmarker5 , plusmarker9 ... \n"; 942 usage += ">> ArrowMarker: basicarrow<T> trianglearrow<T> ftrianglearrow<T> \n"; 943 usage += " arrowshapedarrow<T> farrowshapedarrow<T> \n"; 944 usage += " with <T> = 5 7 .. 15 , Example trianglearrow7 ... \n"; 857 945 usage += ">> ColorTables: defcmap grey32 invgrey32 colrj32 colbr32 \n"; 858 946 usage += " grey128 invgrey128 colrj128 colbr128 \n"; … … 914 1002 usage += "\n The Base/AxesDrawer is used to handle added text strings" ; 915 1003 usage += "\n Alt<Z> to remove added elements"; 916 usage += "\n Usage: addtext x y TextString [ColFontPosAtt] ";1004 usage += "\n Usage: addtext x y TextString [ColFontPosAtt] [fgnc=false/true]"; 917 1005 usage += "\n (use quotes '' for multi word text strings) "; 1006 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 918 1007 usage += "\n Text position/direction attribute: "; 919 1008 usage += "\n horizleft horizcenter horizright"; 920 1009 usage += "\n vertbottom vertcenter verttop "; 921 1010 usage += "\n textdirhoriz textdirvertup textdirvertdown "; 922 usage += "\n Related commands: addline addarrow addrect addfrect"; 923 usage += "\n addcirc addfcirc addarc addfrac settitle graphicatt"; 1011 usage += "\n Related commands: addctext addline addarrow addrect addfrect"; 1012 usage += "\n addcirc addfcirc addarc addfrac addpoly addfpoly settitle graphicatt"; 1013 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 1014 1015 kw = "addctext"; 1016 usage = "Adds a composite text string with superscript and subscripts "; 1017 usage += "\n at the specified position (+ color/font/pos/dir attributes) "; 1018 usage += "\n Usage: addctext x y Text sUp sDown [ColFontPosAtt] [UpDownFontAtt] [fgnc]"; 1019 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 1020 usage += "\n Related commands: addtext addline addrect ..."; 1021 usage += "\n (See command addtext and graphicatt for more details)"; 924 1022 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 925 1023 … … 929 1027 usage += "\n The Base/AxesDrawer is used to handle added lines"; 930 1028 usage += "\n Alt<Z> to remove added elements"; 931 usage += "\n Usage: addline x1 y1 x2 y2 [GraphicAtt]"; 1029 usage += "\n Usage: addline x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]"; 1030 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 932 1031 usage += "\n Related commands: addarrow addtext addrect addfrect "; 933 usage += "\n addmarker addcirc addfcirc addarc addfarc graphicatt";1032 usage += "\n addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 934 1033 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 935 1034 … … 939 1038 usage += "\n The Base/AxesDrawer is used to handle added lines"; 940 1039 usage += "\n Alt<Z> to remove added elements"; 941 usage += "\n Usage: addarrow x1 y1 x2 y2 [GraphicAtt]"; 1040 usage += "\n Usage: addarrow x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]"; 1041 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 942 1042 usage += "\n Related commands: addline addtext addrect addfrect "; 943 usage += "\n addmarker addcirc addfcirc addarc addfarc graphicatt"; 944 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 1043 usage += "\n addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 1044 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 1045 kw = "addarrow_nc"; 945 1046 946 1047 kw = "addrect"; … … 949 1050 usage += "\n The Base/AxesDrawer is used to handle added rectangle"; 950 1051 usage += "\n Alt<Z> to remove added elements"; 951 usage += "\n Usage: addrect x1 y1 x2 y2 [GraphicAtt]"; 1052 usage += "\n Usage: addrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]"; 1053 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 952 1054 usage += "\n Related commands: addtext addline addarrow addfrect"; 953 usage += "\n addcirc addfcirc addarc addfarc graphicatt";1055 usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 954 1056 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 955 1057 … … 959 1061 usage += "\n The Base/AxesDrawer is used to handle added rectangle"; 960 1062 usage += "\n Alt<Z> to remove added elements"; 961 usage += "\n Usage: addfrect x1 y1 x2 y2 [GraphicAtt]"; 1063 usage += "\n Usage: addfrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]"; 1064 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 962 1065 usage += "\n Related commands: addtext addline addarrow addrect"; 963 usage += "\n addcirc addfcirc graphicatt";1066 usage += "\n addcirc addfcirc addpoly addfpoly graphicatt"; 964 1067 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 965 1068 … … 969 1072 usage += "\n The Base/AxesDrawer is used to handle added circles"; 970 1073 usage += "\n Alt<Z> to remove added elements"; 971 usage += "\n Usage: addmarker xpos ypos [GraphicAtt]"; 1074 usage += "\n Usage: addmarker xpos ypos [GraphicAtt] [fgnc=false/true]"; 1075 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 972 1076 usage += "\n Related commands: addtext addline addarrow addfrect addfrect"; 973 usage += "\n addcirc addfcirc addarc addfarc graphicatt";1077 usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt"; 974 1078 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 975 1079 … … 979 1083 usage += "\n The Base/AxesDrawer is used to handle added circles"; 980 1084 usage += "\n Alt<Z> to remove added elements"; 981 usage += "\n Usage: addcirc xcenter ycenter radius [GraphicAtt]"; 1085 usage += "\n Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]"; 1086 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 982 1087 usage += "\n Related commands: addtext addline addarrow addfrect addfrect"; 983 usage += "\n addfcirc addarc addfarc graphicatt";1088 usage += "\n addfcirc addarc addfarc addpoly addfpoly graphicatt"; 984 1089 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 985 1090 … … 989 1094 usage += "\n The Base/AxesDrawer is used to handle added circles"; 990 1095 usage += "\n Alt<Z> to remove added elements"; 991 usage += "\n Usage: addcirc xcenter ycenter radius [GraphicAtt]"; 1096 usage += "\n Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]"; 1097 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 992 1098 usage += "\n Related commands: addtext addline addarrow addfrect addfrect"; 993 usage += "\n addcirc addarc addfarc graphicatt";1099 usage += "\n addcirc addarc addfarc addpoly addfpoly graphicatt"; 994 1100 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 995 1101 … … 999 1105 usage += "\n The Base/AxesDrawer is used to handle added arcs"; 1000 1106 usage += "\n Alt<Z> to remove added elements"; 1001 usage += "\n Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt]"; 1107 usage += "\n Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]"; 1108 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 1002 1109 usage += "\n Related commands: addtext addline addarrow addfrect addfrect"; 1003 usage += "\n addcirc addfcirc addfarc graphicatt";1110 usage += "\n addcirc addfcirc addfarc addpoly addfpoly graphicatt"; 1004 1111 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 1005 1112 … … 1009 1116 usage += "\n The Base/AxesDrawer is used to handle added arcs"; 1010 1117 usage += "\n Alt<Z> to remove added elements"; 1011 usage += "\n Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt]"; 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)"; 1012 1120 usage += "\n Related commands: addtext addline addarrow addfrect addfrect"; 1013 usage += "\n addcirc addfcirc addfarc graphicatt"; 1121 usage += "\n addcirc addfcirc addfarc addpoly addfpoly graphicatt"; 1122 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 1123 1124 kw = "addpoly"; 1125 usage = "Adds a polyline/polygon to the current graphic object"; 1126 usage += "\n Usage: addploy 'x1,y1 x2,y2 x3,y3 ...' [GraphicAtt] [fgnc=false/true]"; 1127 usage += "\n Coordinates specified as pairs x,y in a single word (use simple or double quotes"; 1128 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 1129 usage += "\n Related commands: addtext addline addarrow addfrect addfrect"; 1130 usage += "\n addcirc addfcirc addfarc graphicatt"; 1131 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 1132 1133 kw = "addfpoly"; 1134 usage = "Adds a filled polygon to the current graphic object"; 1135 usage += "\n Usage: addploy 'x1,y1 x2,y2 x3,y3 ...' [GraphicAtt] [fgnc=false/true]"; 1136 usage += "\n Coordinates specified as pairs x,y in a single word (use simple or double quotes"; 1137 usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)"; 1138 usage += "\n Related commands: addtext addline addarrow addfrect addfrect"; 1139 usage += "\n addcirc addfcirc addfarc graphicatt"; 1014 1140 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 1015 1141 … … 1039 1165 1040 1166 kw = "openfits"; 1041 usage = "Loads a FITS file into an appr piate object \n Usage: openfits filename";1167 usage = "Loads a FITS file into an appropriate object \n Usage: openfits filename"; 1042 1168 usage += "\n Related commands: savefits openppf"; 1043 1169 mpiac->RegisterCommand(kw, usage, this, "FileIO"); … … 1071 1197 usage += "\n Related commands: ntloop fillnt "; 1072 1198 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 1073 1199 #ifndef SANS_EVOLPLANCK 1200 kw = "mtxfrascii"; 1201 usage = "Reads a matrix from an ASCII file (TMatrix<r_8>)"; 1202 usage += "\n Usage: mtxfrascii mtx_name file_name"; 1203 usage += "\n Related commands: vecfrascii ntfrascii "; 1204 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 1205 kw = "vecfrascii"; 1206 usage = "Reads a vactor from an ASCII file (TVector<r_8>)"; 1207 usage += "\n Usage: vecfrascii vec_name file_name"; 1208 usage += "\n Related commands: mtxfrascii ntfrascii "; 1209 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 1210 #endif 1074 1211 1075 1212 kw = "print"; … … 1491 1628 usage += "o <Alt>C : Copy/Paste / Copies the selected regions content as text in the copy/paste buffer \n"; 1492 1629 usage += "o <Alt>X : Show/Hide the Cut Window \n"; 1493 usage += "o <Alt>Z : Removes signs overlayed on image (Drawer 0) \n"; 1630 usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n"; 1631 usage += "o <Alt>E : Removes the last added graphic element \n"; 1494 1632 usage += "o <Alt>+ or <Cntl>+ : Zoom in \n"; 1495 1633 usage += "o <Alt>- or <Cntl>- : Zoom out \n"; … … 1510 1648 usage += " Drawer 0 manages the axes, as well as the added text \n"; 1511 1649 usage += "o <Alt>V : Copy/Paste / Text paste at the current position \n"; 1512 usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n"; 1650 usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n"; 1651 usage += "o <Alt>E : Removes the last added graphic element \n"; 1513 1652 usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n"; 1514 1653 usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1\n"; … … 1530 1669 usage += "o <Alt>O : = <Alt>G \n"; 1531 1670 usage += "o <Alt>V : Copy/Paste / Text paste at the current position (Drawer 0)\n"; 1532 usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n"; 1671 usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n"; 1672 usage += "o <Alt>E : Removes the last added graphic element \n"; 1533 1673 usage += "o <Alt>A : Activate/Deactivate axes drawing \n"; 1534 1674 usage += "o <Alt>S : Activate/Deactivate object rotation mode on Button-2 \n"; -
trunk/SophyaPI/PIext/nobjmgr.cc
r2218 r2263 1394 1394 return; 1395 1395 } 1396 Vector * vx = dynamic_cast<Vector *>(obj); 1397 if (vx == NULL) { 1398 cout << "NamedObjMgr::DisplayVector() Error " << nomvx << " not a Vector ! " << endl; 1396 //Vector * vx = dynamic_cast<Vector *>(obj); 1397 BaseArray* bax = dynamic_cast<BaseArray *>(obj); 1398 if (bax == NULL) { 1399 cout << "NamedObjMgr::DisplayVector() Error " << nomvx << " not a BaseArray ! " << endl; 1399 1400 return; 1400 1401 } … … 1405 1406 return; 1406 1407 } 1407 Vector * vy = dynamic_cast<Vector*>(obj);1408 if ( vy == NULL) {1409 cout << "NamedObjMgr::DisplayVector() Error " << nomvy << " not a Vector! " << endl;1408 BaseArray* bay = dynamic_cast<BaseArray *>(obj); 1409 if (bay == NULL) { 1410 cout << "NamedObjMgr::DisplayVector() Error " << nomvy << " not a BaseArray ! " << endl; 1410 1411 return; 1411 1412 } 1412 1413 1413 1414 Vector vx = *bax; 1415 Vector vy = *bay; 1414 1416 Vector * cvx, * cvy; 1415 1417 1416 if (vx ->Size() != vy->Size()) {1418 if (vx.Size() != vy.Size()) { 1417 1419 cout << "NamedObjMgr::DisplayVector() Warning / Vx.Size() != Vy.Size() " << endl; 1418 if (vx ->Size() < vy->Size()) {1419 cvx = new Vector( *vx);1420 cvy = new Vector(vy ->SubVector(Range(0, 0, vx->Size()-1)));1420 if (vx.Size() < vy.Size()) { 1421 cvx = new Vector(vx); 1422 cvy = new Vector(vy.SubVector(Range(0, 0, vx.Size()-1))); 1421 1423 } 1422 1424 else { 1423 cvx = new Vector(vx ->SubVector(Range(0, 0, vy->Size()-1)));1424 cvy = new Vector( *vy);1425 cvx = new Vector(vx.SubVector(Range(0, 0, vy.Size()-1))); 1426 cvy = new Vector(vy); 1425 1427 } 1426 1428 } 1427 1429 else { 1428 cvx = new Vector( *vx);1429 cvy = new Vector( *vy);1430 cvx = new Vector(vx); 1431 cvy = new Vector(vy); 1430 1432 } 1431 1433 -
trunk/SophyaPI/PIext/piacmd.cc
r2241 r2263 1712 1712 } 1713 1713 1714 /* --Methode-- */ 1715 void PIACmd::HelptoLaTex(string const & fname) 1714 /* Les definitions suivantes doivent se trouver ds l'en-tete du fichier LaTeX 1715 \newcommand{\piacommand}[1]{ 1716 \framebox{\bf \Large #1 } \index{#1} % (Command) 1717 } 1718 1719 \newcommand{\piahelpitem}[1]{ 1720 \framebox{\bf \Large #1 } \index{#1} (Help item) 1721 } 1722 1723 \newcommand{\myppageref}[1]{ (p. \pageref{#1} ) } 1724 */ 1725 1726 /* --Methode-- */ 1727 void PIACmd::HelptoLaTeX(string const & fname) 1716 1728 { 1717 1729 FILE *fip; … … 1725 1737 fputs("\\begin{itemize} \n",fip); 1726 1738 CmdHGroup::iterator it; 1727 for(it = cmdhgrp.begin(); it != cmdhgrp.end(); it++) 1739 for(it = cmdhgrp.begin(); it != cmdhgrp.end(); it++) { 1740 if ((*it).first == "All") continue; 1728 1741 fprintf(fip,"\\item {\\bf %s } (p. \\pageref{%s}) \n", 1729 1742 (*it).first.c_str(), (*it).first.c_str()); 1743 } 1730 1744 1731 1745 fputs("\\end{itemize} \n",fip); 1732 1746 1733 fputs("\\ newpage\n",fip);1747 fputs("\\vspace*{10mm} \n",fip); 1734 1748 1735 1749 CmdExmap::iterator ite; … … 1750 1764 fputs("\\end{tabular} \n", fip); 1751 1765 fputs("\\end{center} \n", fip); 1752 fputs("\n \n \\ vspace{1cm} \n",fip);1766 fputs("\n \n \\newpage \\vspace{1cm} \n",fip); 1753 1767 1754 1768 fputs("\\begin{center} \n ", fip); … … 1777 1791 fprintf(fip,"\\subsection{%s} \\label{%s} \n", 1778 1792 (*it).first.c_str(), (*it).first.c_str()); 1793 fprintf(fip,"\\noindent \n"); 1779 1794 for(ite = helpexmap.begin(); ite != helpexmap.end(); ite++) { 1780 1795 if ((*ite).second.group != gid) continue; 1781 fprintf(fip," { \\Large $ \\star \\star \\star $ } Help item {\\bf \\Large %s} \\label{%s} \n",1796 fprintf(fip,"\\piahelpitem{%s} \\label{%s} \n", 1782 1797 (*ite).first.c_str(), (*ite).first.c_str()); 1783 1798 fputs("\\begin{verbatim} \n",fip); … … 1787 1802 for(ite = cmdexmap.begin(); ite != cmdexmap.end(); ite++) { 1788 1803 if ((*ite).second.group != gid) continue; 1789 fprintf(fip," { \\Large $ \\star \\star \\star $ } Command {\\bf \\Large %s} \\label{%s} \n",1804 fprintf(fip,"\\piacommand{%s} \\label{%s} \n", 1790 1805 (*ite).first.c_str(), (*ite).first.c_str()); 1791 1806 fputs("\\begin{verbatim} \n",fip); -
trunk/SophyaPI/PIext/piacmd.h
r2241 r2263 91 91 void ShowCxxExecWindow(); 92 92 93 virtual void HelptoLaTe x(string const & flnm);93 virtual void HelptoLaTeX(string const & flnm); 94 94 95 95 inline CmdInterpreter* CurrentInterpreter() { return(curcmdi); } -
trunk/SophyaPI/PIext/piaversion.h
r2243 r2263 2 2 #define PIAPPVERSION_H_SEEN 3 3 4 #define PIAPP_VERSIONNUMBER 3. 654 #define PIAPP_VERSIONNUMBER 3.80 5 5 6 6 #endif -
trunk/SophyaPI/PIext/pistdimgapp.cc
r2259 r2263 19 19 20 20 #include "pistdimgapp.h" 21 #include "servnobjm.h" 21 22 // #include "pihisto2d.h" 22 23 #include "psfile.h" … … 95 96 m[0]->AppendItem("Open-Fits", 10120); 96 97 m[0]->AppendItem("Open-PPF", 10130); 98 #ifndef SANS_EVOLPLANCK 99 m[0]->AppendItem("Open-ASCII", 10140); 100 #endif 97 101 // m[0]->AppendItem("Options", 10101); 98 102 m[0]->AppendItem("Help", 10100); … … 251 255 pfc_fits = new PIFileChooser(this,"FITS-FileChooser", 10125); 252 256 pfc_ppf = new PIFileChooser(this,"PPF-FileChooser", 10135); 257 pfc_ascii = new PIFileChooser(this,"ASCII-FileChooser", 10145); 253 258 pfc_ps = new PIFileChooser(this,"PS-FileChooser", 10525); 254 259 … … 345 350 delete pfc_fits; 346 351 delete pfc_ppf; 352 delete pfc_ascii; 347 353 delete pfc_ps; 348 354 … … 796 802 797 803 /* --Methode-- */ 798 void PIStdImgApp::AddText(string const & txt, double xp, double yp, string const& sop )804 void PIStdImgApp::AddText(string const & txt, double xp, double yp, string const& sop, bool fgcn) 799 805 { 800 806 PIDrawer *eld=CurrentElDrawer(); … … 813 819 unsigned long tpd = 0; 814 820 gratt.DecodeTextPosDirAtt(opts, tpd, false); 815 elmgr->ElAddText(xp,yp,txt.c_str(), gratt, tpd );821 elmgr->ElAddText(xp,yp,txt.c_str(), gratt, tpd, fgcn); 816 822 eld->Refresh(); 817 823 } 818 824 819 825 /* --Methode-- */ 826 void PIStdImgApp::AddCompText(string const & txt, string const & txtup, string const & txtdn, 827 double xp, double yp, string const& sop, 828 string const& optss, bool fgcn) 829 { 830 PIDrawer *eld=CurrentElDrawer(); 831 if (eld == NULL) return; 832 PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld); 833 PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld); 834 if ((eld2 == NULL) && (eld3 == NULL)) return; 835 PIElDrwMgr* elmgr; 836 if (eld2) elmgr = &(eld2->ElDrwMgr()); 837 else if (eld3) elmgr = &(eld3->ElDrwMgr()); 838 if (elmgr == NULL) return; 839 840 vector<string> opts; 841 ParseDisplayOption(sop, opts); 842 PIGraphicAtt gratt(opts); 843 unsigned long tpd = 0; 844 gratt.DecodeTextPosDirAtt(opts, tpd, false); 845 ParseDisplayOption(optss, opts); 846 PIGraphicAtt grattss(opts); 847 elmgr->ElAddCompText(xp,yp,txt.c_str(), gratt, txtup, txtdn, grattss, tpd, fgcn); 848 eld->Refresh(); 849 } 850 851 /* --Methode-- */ 820 852 void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2, 821 string const& sop, bool fgarrow )853 string const& sop, bool fgarrow, bool fgcn) 822 854 { 823 855 PIDrawer *eld=CurrentElDrawer(); … … 835 867 PIGraphicAtt gratt(opts); 836 868 if (fgarrow) 837 elmgr->ElAddArrow(xp1, yp1, xp2, yp2, gratt );838 else elmgr->ElAddLine(xp1, yp1, xp2, yp2, gratt );869 elmgr->ElAddArrow(xp1, yp1, xp2, yp2, gratt, fgcn); 870 else elmgr->ElAddLine(xp1, yp1, xp2, yp2, gratt, fgcn); 839 871 eld->Refresh(); 840 872 } … … 842 874 /* --Methode-- */ 843 875 void PIStdImgApp::AddRectangle(double xp1, double yp1, double xp2, double yp2, 844 string const& sop, bool fgfill )876 string const& sop, bool fgfill, bool fgcn) 845 877 { 846 878 PIDrawer *eld=CurrentElDrawer(); … … 872 904 PIGraphicAtt gratt(opts); 873 905 874 if (fgfill) elmgr->ElAddFRect(xp, yp, dx, dy, gratt );875 else elmgr->ElAddRect(xp, yp, dx, dy, gratt );906 if (fgfill) elmgr->ElAddFRect(xp, yp, dx, dy, gratt, fgcn); 907 else elmgr->ElAddRect(xp, yp, dx, dy, gratt, fgcn); 876 908 eld->Refresh(); 877 909 } 878 910 879 911 /* --Methode-- */ 880 void PIStdImgApp::AddCircle(double xc, double yc, double r, string const& sop, bool fgfill) 912 void PIStdImgApp::AddCircle(double xc, double yc, double r, string const& sop, 913 bool fgfill, bool fgcn) 881 914 { 882 915 PIDrawer *eld=CurrentElDrawer(); … … 895 928 elmgr->ElAddMarker(xc, yc, gratt); 896 929 else { 897 if (fgfill) elmgr->ElAddFCirc(xc, yc, r, gratt );898 else elmgr->ElAddCirc(xc, yc, r, gratt );930 if (fgfill) elmgr->ElAddFCirc(xc, yc, r, gratt, fgcn); 931 else elmgr->ElAddCirc(xc, yc, r, gratt, fgcn); 899 932 } 900 933 eld->Refresh(); … … 903 936 /* --Methode-- */ 904 937 void PIStdImgApp::AddArc(double x1, double y1, double x2, double y2, 905 double x3, double y3, string const& sop, bool fgfill )938 double x3, double y3, string const& sop, bool fgfill, bool fgcn) 906 939 { 907 940 PIDrawer *eld=CurrentElDrawer(); … … 919 952 PIGraphicAtt gratt(opts); 920 953 if (fgfill) 921 elmgr->ElAddFArc(x1, y1, x2, y2, x3, y3, gratt );922 else elmgr->ElAddArc(x1, y1, x2, y2, x3, y3, gratt );954 elmgr->ElAddFArc(x1, y1, x2, y2, x3, y3, gratt, fgcn); 955 else elmgr->ElAddArc(x1, y1, x2, y2, x3, y3, gratt, fgcn); 923 956 eld->Refresh(); 924 957 } 958 959 /* --Methode-- */ 960 void PIStdImgApp::AddPoly(vector<double>& xpol, vector<double>& ypol, 961 string const& sop, bool fgfill, bool fgcn) 962 { 963 PIDrawer *eld=CurrentElDrawer(); 964 if (eld == NULL) return; 965 PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld); 966 PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld); 967 if ((eld2 == NULL) && (eld3 == NULL)) return; 968 PIElDrwMgr* elmgr = NULL; 969 if (eld2) elmgr = &(eld2->ElDrwMgr()); 970 else if (eld3) elmgr = &(eld3->ElDrwMgr()); 971 if (elmgr == NULL) return; 972 973 vector<string> opts; 974 ParseDisplayOption(sop, opts); 975 PIGraphicAtt gratt(opts); 976 if (fgfill) 977 elmgr->ElAddFPoly(xpol, ypol, gratt, fgcn); 978 else elmgr->ElAddPoly(xpol, ypol, gratt, fgcn); 979 eld->Refresh(); 980 981 } 982 925 983 926 984 /* --Methode-- */ … … 1426 1484 break; 1427 1485 1486 #ifndef SANS_EVOLPLANCK 1487 case 10140 : 1488 pfc_ascii->AcceptNewFile(false); 1489 mFCMsg = 10145; 1490 pfc_ascii->SetMsg(mFCMsg); 1491 SetBlocked(); 1492 pfc_ascii->Show(); 1493 break; 1494 1495 case 10145 : 1496 SetBusy(); 1497 if (data) { 1498 string afname = pfc_ascii->GetFileName(); 1499 string nomobj = ObjMgr()->GetServiceObj()->FileName2Name(afname); 1500 string cmd = "mtxfrascii "; 1501 cmd += nomobj; cmd += " "; cmd += afname; 1502 try { 1503 mCmd->Interpret(cmd); 1504 } 1505 catch ( PThrowable & exc ) { 1506 cerr << "\n PIStdImgApp::Process()/ Cmd->Interpret() Exception :" 1507 << (string)typeid(exc).name() << " Msg= " 1508 << exc.Msg() << endl; 1509 cout << endl; 1510 } 1511 catch ( ... ) { 1512 cerr << "\n PIStdImgApp::Process()/ Cmd->Interpret() Catched Exception ... " << endl; 1513 cout << endl; 1514 } 1515 1516 } 1517 mFCMsg = 0; 1518 SetReady(); 1519 break; 1520 #endif 1521 1428 1522 case 10105: 1429 1523 Stop(); -
trunk/SophyaPI/PIext/pistdimgapp.h
r2243 r2263 66 66 67 67 // Fonction d'ajout de texte (provisoire - Aout 99) 68 void AddText(string const & txt, double xp, double yp, string const& opt); 68 void AddText(string const & txt, double xp, double yp, string const& opt, bool fgcn=false); 69 void AddCompText(string const & txt, string const & txtup, string const & txtdn, 70 double xp, double yp, string const& opt, 71 string const& optss, bool fgcn=false); 69 72 // Ajout de lignes, rectangles, cercles (provisoires - Aout 2001) 70 73 void AddLine(double xp1, double yp1, double xp2, double yp2, 71 string const& opt, bool fgarrow=false );74 string const& opt, bool fgarrow=false, bool fgcn=false); 72 75 void AddRectangle(double xp1, double yp1, double xp2, double yp2, string const& opt, 73 bool fgfill=false );76 bool fgfill=false, bool fgcn=false); 74 77 void AddCircle(double xc, double yc, double r, string const& opt, 75 bool fgfill=false );78 bool fgfill=false, bool fgcn=false); 76 79 void AddArc(double x1, double y1, double x2, double y2, 77 double x3, double y3, string const& opt, bool fgfill=false); 80 double x3, double y3, string const& opt, bool fgfill=false, bool fgcn=false); 81 void AddPoly(vector<double>& x, vector<double>& y, 82 string const& opt, bool fgfill=false, bool fgcn=false); 78 83 79 84 // Fonction Ajout de titre de trace … … 172 177 PIFileChooser * pfc_fits; // Pour les fichiers FITS 173 178 PIFileChooser * pfc_ppf; // Pour les PPF 179 PIFileChooser * pfc_ascii; // Pour les fichiers ASCII 174 180 PIFileChooser * pfc_ps; // Pour les PostScript 175 181
Note:
See TracChangeset
for help on using the changeset viewer.