Changeset 867
- Timestamp:
- Feb 6, 2008, 11:28:56 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/vizservers/nanovis/Command.cpp
r866 r867 220 220 * 221 221 * Clients send these commands to manipulate the camera. The "angle" 222 * op eration controls the angle of the camera around the focal point.223 * The "zoom" op eration sets the zoom factor, moving the camera in222 * option controls the angle of the camera around the focal point. 223 * The "zoom" option sets the zoom factor, moving the camera in 224 224 * and out. 225 225 * ---------------------------------------------------------------------- … … 355 355 * off. The "position" command changes the position to a relative 356 356 * value in the range 0-1. The <axis> can be x, y, or z. These 357 * op erations are applied to the volumes represented by one or more357 * options are applied to the volumes represented by one or more 358 358 * <volume> indices. If no volumes are specified, then all volumes 359 359 * are updated. … … 1069 1069 } 1070 1070 } else if ((c == 'i') && (strcmp(argv[2], "isosurface") == 0)) { 1071 1072 //vector<unsigned int> ivol; 1073 //if (GetVolumeIndices(interp, argc-3, argv+3, &ivol) != TCL_OK) 1074 //{ 1075 // return TCL_ERROR; 1076 // } 1077 } 1078 else { 1079 Tcl_AppendResult(interp, "bad option \"", argv[2], "\": should be ", 1080 "diffuse, opacity, specular, or transfunc", (char*)NULL); 1081 return TCL_ERROR; 1082 } 1083 } 1084 else if ((c == 's') && (strcmp(argv[1], "state") == 0)) 1085 { 1071 //vector<unsigned int> ivol; 1072 //if (GetVolumeIndices(interp, argc-3, argv+3, &ivol) != TCL_OK) 1073 //{ 1074 // return TCL_ERROR; 1075 // } 1076 } 1077 else { 1078 Tcl_AppendResult(interp, "bad option \"", argv[2], "\": should be ", 1079 "diffuse, opacity, specular, or transfunc", (char*)NULL); 1080 return TCL_ERROR; 1081 } 1082 } else if ((c == 's') && (strcmp(argv[1], "state") == 0)) { 1086 1083 if (argc < 3) { 1087 1084 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], … … 1095 1092 1096 1093 vector<unsigned int> ivol; 1097 if (GetVolumeIndices(interp, argc-3, argv+3, &ivol) != TCL_OK) 1098 { 1094 if (GetVolumeIndices(interp, argc-3, argv+3, &ivol) != TCL_OK) { 1099 1095 return TCL_ERROR; 1100 1096 } 1101 1102 1097 vector<unsigned int>::iterator iter = ivol.begin(); 1103 while (iter != ivol.end()) 1104 { 1098 while (iter != ivol.end()) { 1105 1099 if (state) { 1106 1100 NanoVis::volume[*iter]->enable(); … … 1136 1130 Rappture::Outcome err; 1137 1131 1132 if (argc < 2) { 1133 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], 1134 " option ?arg arg?", (char *)NULL); 1135 return TCL_ERROR; 1136 } 1138 1137 char c = argv[1][0]; 1139 1138 if ((c == 'v') && (strcmp(argv[1], "vectorid") == 0)) { … … 1230 1229 } 1231 1230 } else { 1232 Tcl_AppendResult(interp, "unknown op eration \"", argv[2],1231 Tcl_AppendResult(interp, "unknown option \"", argv[2], 1233 1232 "\": should be \"", argv[0], " visible, slice, or slicepos\"", 1234 1233 (char *)NULL); … … 1597 1596 GridCmd(ClientData cdata, Tcl_Interp *interp, int argc, const char *argv[]) 1598 1597 { 1598 if (argc < 2) { 1599 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], 1600 " option ?args?", (char *)NULL); 1601 return TCL_ERROR; 1602 } 1599 1603 char c = argv[1][0]; 1600 1604 if ((c == 'v') && (strcmp(argv[1],"visible") == 0)) { … … 1847 1851 } 1848 1852 vectorPtr->push_back((unsigned int)index); 1853 } 1854 return TCL_OK; 1855 } 1856 1857 1858 /* 1859 * ---------------------------------------------------------------------- 1860 * FUNCTION: GetVolumes() 1861 * 1862 * Used internally to decode a series of volume index values and 1863 * store then in the specified vector. If there are no volume index 1864 * arguments, this means "all volumes" to most commands, so all 1865 * active volume indices are stored in the vector. 1866 * 1867 * Updates pushes index values into the vector. Returns TCL_OK or 1868 * TCL_ERROR to indicate an error. 1869 * ---------------------------------------------------------------------- 1870 */ 1871 static int 1872 GetVolumes(Tcl_Interp *interp, int argc, const char *argv[], 1873 vector<Volume *>* vectorPtr) 1874 { 1875 if (argc == 0) { 1876 for (unsigned int n = 0; n < NanoVis::volume.size(); n++) { 1877 if (NanoVis::volume[n] != NULL) { 1878 vectorPtr->push_back(NanoVis::volume[n]); 1879 } 1880 } 1881 } else { 1882 for (int n = 0; n < argc; n++) { 1883 Volume *volPtr; 1884 1885 if (GetVolume(interp, argv[n], &volPtr) != TCL_OK) { 1886 return TCL_ERROR; 1887 } 1888 if (volPtr != NULL) { 1889 vectorPtr->push_back(volPtr); 1890 } 1891 } 1849 1892 } 1850 1893 return TCL_OK; … … 2240 2283 nBytes -= nRead; 2241 2284 } 2242 if (strncmp("@@RP-ENC", buf.bytes(), 8) == 0){2285 { 2243 2286 Rappture::Outcome err; 2244 2287
Note: See TracChangeset
for help on using the changeset viewer.