- Timestamp:
- Sep 14, 2009, 2:17:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/pymolproxy/pymolproxy.c
r1557 r1563 358 358 return proxyPtr->status; 359 359 } 360 #if def notdef360 #ifndef notdef 361 361 trace("Entering Expect(want=%s, maxSize=%d)\n", match, maxSize); 362 362 #endif … … 369 369 line = GetLine(&proxyPtr->server, &nBytes); 370 370 if (line != NULL) { 371 #if def notdef371 #ifndef notdef 372 372 trace("pymol says:%.*s", nBytes, out); 373 373 #endif … … 378 378 memcpy(out, line, nBytes); 379 379 clear_error(proxyPtr); 380 #if def notdef380 #ifndef notdef 381 381 trace("Leaving Expect: got (%.*s)\n", nBytes, out); 382 382 #endif … … 664 664 665 665 va_start(ap, format); 666 vsnprintf(buffer, BUFSIZ-1, format, ap);666 result = vsnprintf(buffer, BUFSIZ-1, format, ap); 667 667 va_end(ap); 668 668 669 trace("to-pymol>(%s) ", buffer);669 trace("to-pymol>(%s) code=%d", buffer, result); 670 670 671 671 /* Write the command out to the server. */ … … 1225 1225 Image *imgPtr; 1226 1226 int width, height; 1227 const char *token ;1227 const char *token, *bgcolor; 1228 1228 1229 1229 clear_error(proxyPtr); … … 1234 1234 proxyPtr->flags &= ~(UPDATE_PENDING | FORCE_UPDATE | INVALIDATE_CACHE); 1235 1235 1236 if (argc != 4) {1236 if (argc != 5) { 1237 1237 Tcl_AppendResult(interp, "wrong # arguments: should be \"", 1238 argv[0], " token width height \"", (char *)NULL);1238 argv[0], " token width height color\"", (char *)NULL); 1239 1239 return TCL_ERROR; 1240 1240 } … … 1246 1246 return TCL_ERROR; 1247 1247 } 1248 bgcolor = argv[4]; 1248 1249 /* Force pymol to update the current scene. */ 1249 Pymol(proxyPtr, " refresh\n");1250 Pymol(proxyPtr, 1251 "ray %d,%d\n" 1252 "png -,dpi=300\n", 1253 width, height);1250 Pymol(proxyPtr, "bg_color %s\nrefresh\n", bgcolor); 1251 Pymol(proxyPtr, "ray %d,%d\n", width, height); 1252 Expect(proxyPtr, " Ray:", buffer, 800); 1253 1254 Pymol(proxyPtr, "png -,dpi=300\nbg_color black\n"); 1254 1255 Expect(proxyPtr, "png image follows: ", buffer, 800); 1255 1256 … … 1261 1262 sprintf(buffer, "nv>image %d print \"%s\" %d\n", nBytes, token, 1262 1263 proxyPtr->rockOffset); 1264 trace("header is png is (%s)\n", buffer); 1263 1265 length = strlen(buffer); 1264 1266 imgPtr = NewImage(proxyPtr, nBytes + length); … … 1405 1407 proxyPtr->flags |= FORCE_UPDATE; 1406 1408 } 1407 if (strcmp(rep, "ballnstick") == 0) { 1408 /* Ball 'n Stick */ 1409 Pymol(proxyPtr, "set stick_color,white,%s\n", model); 1409 if (strcmp(rep, "ballnstick") == 0) { /* Ball 'n Stick */ 1410 1410 Pymol(proxyPtr, 1411 "set stick_color,white,%s\n" 1412 "show sticks,%s\n" 1413 "show spheres,%s\n" 1411 1414 "hide lines,%s\n" 1412 "show sticks,%s\n" 1413 "show spheres,%s\n", 1414 model, model, model); 1415 } else if (strcmp(rep, "spheres") == 0) { 1416 /* spheres */ 1415 "hide cartoon,%s\n", 1416 model, model, model, model, model); 1417 } else if (strcmp(rep, "spheres") == 0) { /* spheres */ 1417 1418 Pymol(proxyPtr, 1418 1419 "hide sticks,%s\n" 1420 "show spheres,%s\n" 1419 1421 "hide lines,%s\n" 1420 "show spheres,%s\n", 1421 model, model, model); 1422 Pymol(proxyPtr, 1422 "hide cartoon,%s\n" 1423 1423 "set sphere_quality,2,%s\n" 1424 1424 "set ambient,.2,%s\n", 1425 model, model); 1426 } else if (strcmp(rep, "none") == 0) { 1427 /* nothing */ 1425 model, model, model, model, model, model); 1426 } else if (strcmp(rep, "none") == 0) { /* nothing */ 1428 1427 Pymol(proxyPtr, 1428 "hide sticks,%s\n", 1429 1429 "hide spheres,%s\n" 1430 1430 "hide lines,%s\n" 1431 "hide sticks,%s\n", 1432 model, model, model); 1433 } else if (strcmp(rep, "sticks") == 0) { 1434 /* sticks */ 1435 Pymol(proxyPtr, "set stick_color,white,%s\n", model); 1431 "hide cartoon,%s\n", 1432 model, model, model, model); 1433 } else if (strcmp(rep, "sticks") == 0) { /* sticks */ 1436 1434 Pymol(proxyPtr, 1435 "set stick_color,white,%s\n" 1436 "show sticks,%s\n" 1437 1437 "hide spheres,%s\n" 1438 1438 "hide lines,%s\n" 1439 "show sticks,%s\n", 1440 model, model, model); 1441 } else if (strcmp(rep, "lines") == 0) { 1442 /* lines */ 1439 "hide cartoon,%s\n", 1440 model, model, model, model, model); 1441 } else if (strcmp(rep, "lines") == 0) { /* lines */ 1443 1442 Pymol(proxyPtr, 1443 "hide sticks,%s\n" 1444 1444 "hide spheres,%s\n" 1445 "show lines,%s\n" 1446 "hide cartoon,%s\n", 1447 model, model, model, model); 1448 } else if (strcmp(rep, "cartoon") == 0) { /* cartoon */ 1449 Pymol(proxyPtr, 1445 1450 "hide sticks,%s\n" 1446 "show lines,%s\n", 1447 model, model, model); 1448 } 1451 "hide spheres,%s\n" 1452 "hide lines,%s\n" 1453 "show cartoon,%s\n", 1454 model, model, model, model); 1455 } 1449 1456 return proxyPtr->status; 1450 1457 }
Note: See TracChangeset
for help on using the changeset viewer.