- Timestamp:
- Jun 29, 2009, 1:30:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/pymolproxy/pymolproxy.c
r1534 r1538 19 19 */ 20 20 21 /* 22 * Notes: The proxy should not maintain any state information from the 23 * client, other that what it needs for event (rotate, pan, zoom, 24 * atom scale, bond thickness, etc.) compression. This is because 25 * the connection is periodically broken (timeout, error, etc.). 26 * It's the responsibility of the client (molvisviewer) to restore 27 * the settings of the previous view. The proxy is just a relay 28 * between the client and the pymol server. 29 */ 21 30 /* 22 31 * +--------------+ +------------+ +--------+ … … 41 50 * when we want to write the resulting image from the last command. 42 51 * 43 * FIXME: Need to fix the reads from the pymol server. We want to check for44 * an expected string within the pymol server output. Right now it's doing45 * single character reads to stop when we hit a newline. We should create a46 * read buffer that lets us do block reads. This problem only really affects47 * the echoing back of commands (waiting for the pymol command prompt). Most48 * command lines are small. Still it's a good area for improvement.49 *50 * FIXME: Might be a problem if another image is received from the server51 * before the last one is transmitted.52 52 */ 53 53 … … 846 846 proxyPtr->flags &= ~(UPDATE_PENDING|FORCE_UPDATE|INVALIDATE_CACHE); 847 847 848 /* Force pymol to update the current scene. */849 Pymol(proxyPtr, "refresh\n");850 Pymol(proxyPtr, "bmp -\n");848 /* Force pymol to update the current scene. */ 849 Pymol(proxyPtr, "refresh\n"); 850 Pymol(proxyPtr, "bmp -\n"); 851 851 if (Expect(proxyPtr, "bmp image follows: ", buffer, BUFSIZ) != BUFFER_OK) { 852 852 trace("can't find image follows line (%s)", buffer); … … 1092 1092 proxyPtr->flags |= FORCE_UPDATE; 1093 1093 } 1094 Pymol(proxyPtr, "hide spheres,%s\nshow lines,%s\n", model, model);1094 Pymol(proxyPtr, "hide spheres,%s\nshow sticks,%s\n", model, model); 1095 1095 return proxyPtr->status; 1096 1096 } … … 1154 1154 } 1155 1155 fclose(f); 1156 Pymol(proxyPtr, "load %s, %s,%d\n", fileName, name, state);1156 Pymol(proxyPtr, "load %s,%s,%d\n", fileName, name, state); 1157 1157 Pymol(proxyPtr, "zoom complete=1\n"); 1158 1158 } … … 1261 1261 1262 1262 /* Force pymol to update the current scene. */ 1263 Pymol(proxyPtr,"refresh\n"); 1264 1265 Pymol(proxyPtr,"png -\n"); 1263 Pymol(proxyPtr, "refresh\n"); 1264 Pymol(proxyPtr, "png -\n"); 1266 1265 1267 1266 Expect(proxyPtr, "png image follows: ", buffer, 800); … … 1321 1320 } 1322 1321 /* Force pymol to update the current scene. */ 1323 Pymol(proxyPtr,"refresh\nray %d,%d\npng -, dpi=300\n", width, height); 1322 Pymol(proxyPtr, "refresh\n"); 1323 Pymol(proxyPtr, "ray %d,%d\npng -,dpi=300\n", width, height); 1324 1324 Expect(proxyPtr, "png image follows: ", buffer, 800); 1325 1325 … … 1532 1532 proxyPtr->flags |= FORCE_UPDATE; 1533 1533 } 1534 Pymol(proxyPtr, "set sphere_quality,2,%s\nhide lines,%s\n", 1535 model, model); 1534 Pymol(proxyPtr, "set sphere_quality,2,%s\nhide sticks,%s\n", model, model); 1536 1535 Pymol(proxyPtr, "set ambient,.2,%s\nshow spheres,%s\n", model, model); 1537 1536 return proxyPtr->status; … … 1543 1542 { 1544 1543 PymolProxy *proxyPtr = clientData; 1545 int width = 640, height = 480; 1546 int defer = 0, push = 0, i, varg = 1; 1547 1548 clear_error(proxyPtr); 1549 1544 int width = -1, height = -1; 1545 int defer, push, i, varg; 1546 1547 clear_error(proxyPtr); 1548 defer = push = FALSE; 1549 varg = 1; 1550 1550 for(i = 1; i < argc; i++) { 1551 1551 if ( strcmp(argv[i],"-defer") == 0 ) … … 1562 1562 varg++; 1563 1563 } 1564 } 1565 if ((width < 0) || (height < 0)) { 1566 return TCL_ERROR; 1564 1567 } 1565 1568 proxyPtr->flags |= INVALIDATE_CACHE; /* viewport */
Note: See TracChangeset
for help on using the changeset viewer.