Changeset 1533
- Timestamp:
- Jun 26, 2009 1:17:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/pymolproxy/pymolproxy.c
r1428 r1533 102 102 103 103 static FILE *flog; 104 static int debug = 0;104 static int debug = 1; 105 105 #ifdef notdef 106 106 static long _flags = 0; … … 263 263 for (;;) { 264 264 /* Look for the next newline (the next full line). */ 265 #ifdef notdef 265 266 trace("in GetLine: mark=%d fill=%d\n", readPtr->mark, readPtr->fill); 267 #endif 266 268 for (i = readPtr->mark; i < readPtr->fill; i++) { 267 269 if (readPtr->bytes[i] == '\n') { … … 355 357 return proxyPtr->status; 356 358 } 359 #ifdef notdef 357 360 trace("Entering Expect(want=%s, maxSize=%d)\n", match, maxSize); 361 #endif 358 362 c = match[0]; 359 363 length = strlen(match); … … 364 368 line = GetLine(&proxyPtr->server, &nBytes); 365 369 if (line != NULL) { 370 #ifdef notdef 366 371 trace("pymol says:%.*s", nBytes, out); 372 #endif 367 373 if ((c == line[0]) && (strncmp(line, match, length) == 0)) { 368 374 if (maxSize < nBytes) { … … 371 377 memcpy(out, line, nBytes); 372 378 clear_error(proxyPtr); 379 #ifdef notdef 373 380 trace("Leaving Expect: got (%.*s)\n", nBytes, out); 381 #endif 374 382 return BUFFER_OK; 375 383 } … … 518 526 start = CVT2SECS(tv); 519 527 528 trace("command from client is (%s)", cmd); 520 529 result = Tcl_Eval(interp, cmd); 521 trace("Executed (%s)", cmd);522 530 523 531 gettimeofday(&tv, NULL); … … 566 574 } 567 575 576 #ifdef notdef 568 577 trace("WriteImage: want to write %d bytes.", imgPtr->bytesLeft); 578 #endif 569 579 for (bytesLeft = imgPtr->bytesLeft; bytesLeft > 0; /*empty*/) { 570 580 ssize_t nWritten; 571 581 #ifdef notdef 572 582 trace("WriteImage: try to write %d bytes.", bytesLeft); 583 #endif 573 584 nWritten = write(fd, imgPtr->data + imgPtr->nWritten, bytesLeft); 585 #ifdef notdef 574 586 trace("WriteImage: wrote %d bytes.", nWritten); 587 #endif 575 588 if (nWritten < 0) { 576 589 trace("Error writing fd(%d), %d/%s.", fd, errno, … … 635 648 636 649 static int 637 Pymol(PymolProxy *proxyPtr, c har *format, ...)650 Pymol(PymolProxy *proxyPtr, const char *format, ...) 638 651 { 639 652 va_list ap; … … 703 716 { 704 717 if (proxyPtr->flags & PAN_PENDING) { 705 Pymol(proxyPtr,"move x,%f ;move y,%f\n", proxyPtr->xPan,proxyPtr->yPan);718 Pymol(proxyPtr,"move x,%f\nmove y,%f\n", proxyPtr->xPan,proxyPtr->yPan); 706 719 proxyPtr->flags &= ~PAN_PENDING; 707 720 } … … 714 727 /* Every pymol command line generates a new rendering. Execute all 715 728 * three turns as a single command line. */ 716 Pymol(proxyPtr,"turn x,%f ; turn y,%f;turn z,%f\n",729 Pymol(proxyPtr,"turn x,%f\nturn y,%f\nturn z,%f\n", 717 730 proxyPtr->xAngle, proxyPtr->yAngle, proxyPtr->zAngle); 718 731 proxyPtr->xAngle = proxyPtr->yAngle = proxyPtr->zAngle = 0.0f; … … 743 756 const char *argv[]) 744 757 { 745 int defer = 0, push = 0, arg;758 int defer = 0, push = 0, i; 746 759 double scale; 747 760 const char *model = "all"; … … 750 763 clear_error(proxyPtr); 751 764 scale = 0.25f; 752 for( arg = 1; arg < argc; arg++) {753 if ( strcmp(argv[ arg],"-defer") == 0 ) {765 for(i = 1; i < argc; i++) { 766 if ( strcmp(argv[i],"-defer") == 0 ) { 754 767 defer = 1; 755 } else if (strcmp(argv[ arg],"-push") == 0) {768 } else if (strcmp(argv[i],"-push") == 0) { 756 769 push = 1; 757 } else if (strcmp(argv[arg],"-model") == 0) { 758 if (++arg < argc) 759 model = argv[arg]; 770 } else if (strcmp(argv[i],"-model") == 0) { 771 if (++i < argc) { 772 model = argv[i]; 773 } 760 774 } else { 761 if (Tcl_GetDouble(interp, argv[ arg], &scale) != TCL_OK) {775 if (Tcl_GetDouble(interp, argv[i], &scale) != TCL_OK) { 762 776 return TCL_ERROR; 763 777 } … … 785 799 const char *argv[]) 786 800 { 787 float radius, transparency; 788 int ghost = 0, defer = 0, push = 0, arg; 789 const char *model = "all"; 790 PymolProxy *proxyPtr = clientData; 791 792 clear_error(proxyPtr); 793 794 for(arg = 1; arg < argc; arg++) { 795 if ( strcmp(argv[arg],"-defer") == 0 ) 796 defer = 1; 797 else if (strcmp(argv[arg],"-push") == 0) 798 push = 1; 799 else if (strcmp(argv[arg],"-ghost") == 0) 800 ghost = 1; 801 else if (strcmp(argv[arg],"-normal") == 0) 802 ghost = 0; 803 else if (strcmp(argv[arg],"-model") == 0) { 804 if (++arg < argc) 805 model = argv[arg]; 806 } 807 else 808 model = argv[arg]; 809 } 810 801 PymolProxy *proxyPtr = clientData; 802 const char *model; 803 int defer, push, i; 804 805 clear_error(proxyPtr); 806 defer = push = FALSE; 807 model = "all"; 808 for (i = 1; i < argc; i++) { 809 if (strcmp(argv[i],"-defer") == 0 ) { 810 defer = TRUE; 811 } else if (strcmp(argv[i],"-push") == 0) { 812 push = TRUE; 813 } else if (strcmp(argv[i],"-model") == 0) { 814 if (++i < argc) { 815 model = argv[i]; 816 } 817 } else { 818 model = argv[i]; 819 } 820 } 811 821 proxyPtr->flags |= INVALIDATE_CACHE; /* Ball 'n Stick */ 812 822 if (!defer || push) { … … 816 826 proxyPtr->flags |= FORCE_UPDATE; 817 827 } 818 Pymol(proxyPtr, "hide everything,%s\n",model); 819 Pymol(proxyPtr, "set stick_color,white,%s\n",model); 820 if (ghost) { 821 radius = 0.1f; 822 transparency = 0.75f; 823 } else { 824 radius = 0.14f; 825 transparency = 0.0f; 826 } 827 Pymol(proxyPtr, "set stick_radius,%g,%s\n", radius, model); 828 #ifdef notdef 829 Pymol(proxyPtr, "set sphere_scale=0.25,%s\n", model); 830 #endif 831 Pymol(proxyPtr, "set sphere_transparency,%g,%s\n", transparency, model); 832 Pymol(proxyPtr, "set stick_transparency,%g,%s\n", transparency, model); 833 Pymol(proxyPtr, "show sticks,%s\n", model); 834 Pymol(proxyPtr, "show spheres,%s\n", model); 828 Pymol(proxyPtr, "hide everything,%s\nset stick_color,white,%s\n", model, 829 model); 830 Pymol(proxyPtr, "show sticks,%s\nshow spheres,%s\n", model, model); 835 831 836 832 if (proxyPtr->flags & SHOW_LABELS) { … … 886 882 const char *argv[]) 887 883 { 888 int defer = 0, push = 0, arg;884 int defer = 0, push = 0, i; 889 885 double scale; 890 886 const char *model = "all"; … … 893 889 clear_error(proxyPtr); 894 890 scale = 0.25f; 895 for( arg = 1; arg < argc; arg++) {896 if ( strcmp(argv[ arg],"-defer") == 0 ) {891 for(i = 1; i < argc; i++) { 892 if ( strcmp(argv[i],"-defer") == 0 ) { 897 893 defer = 1; 898 } else if (strcmp(argv[ arg],"-push") == 0) {894 } else if (strcmp(argv[i],"-push") == 0) { 899 895 push = 1; 900 } else if (strcmp(argv[ arg],"-model") == 0) {901 if (++ arg< argc)902 model = argv[ arg];896 } else if (strcmp(argv[i],"-model") == 0) { 897 if (++i < argc) 898 model = argv[i]; 903 899 } else { 904 if (Tcl_GetDouble(interp, argv[ arg], &scale) != TCL_OK) {900 if (Tcl_GetDouble(interp, argv[i], &scale) != TCL_OK) { 905 901 return TCL_ERROR; 906 902 } … … 930 926 PymolProxy *proxyPtr = clientData; 931 927 const char *model = "all"; 932 int arg, defer = 0, push = 0;933 934 clear_error(proxyPtr); 935 936 for( arg = 1; arg < argc; arg++) {937 938 if (strcmp(argv[ arg], "-defer") == 0 )928 int i, defer = 0, push = 0; 929 930 clear_error(proxyPtr); 931 932 for(i = 1; i < argc; i++) { 933 934 if (strcmp(argv[i], "-defer") == 0 ) 939 935 defer = 1; 940 else if (strcmp(argv[ arg], "-push") == 0 )936 else if (strcmp(argv[i], "-push") == 0 ) 941 937 push = 1; 942 938 else 943 model = argv[ arg];939 model = argv[i]; 944 940 945 941 } … … 965 961 PymolProxy *proxyPtr = clientData; 966 962 const char *model = "all"; 967 int arg, defer = 0, push = 0;968 969 clear_error(proxyPtr); 970 971 for( arg = 1; arg < argc; arg++) {963 int i, defer = 0, push = 0; 964 965 clear_error(proxyPtr); 966 967 for(i = 1; i < argc; i++) { 972 968 973 if (strcmp(argv[ arg],"-defer") == 0)969 if (strcmp(argv[i],"-defer") == 0) 974 970 defer = 1; 975 else if (strcmp(argv[ arg], "-push") == 0 )971 else if (strcmp(argv[i], "-push") == 0 ) 976 972 push = 1; 977 973 else 978 model = argv[ arg];974 model = argv[i]; 979 975 980 976 } … … 996 992 PymolProxy *proxyPtr = clientData; 997 993 int frame = 0; 998 int arg, push = 0, defer = 0;999 1000 clear_error(proxyPtr); 1001 1002 for( arg = 1; arg < argc; arg++) {1003 if ( strcmp(argv[ arg],"-defer") == 0 )994 int i, push = 0, defer = 0; 995 996 clear_error(proxyPtr); 997 998 for(i = 1; i < argc; i++) { 999 if ( strcmp(argv[i],"-defer") == 0 ) 1004 1000 defer = 1; 1005 else if (strcmp(argv[ arg],"-push") == 0 )1001 else if (strcmp(argv[i],"-push") == 0 ) 1006 1002 push = 1; 1007 1003 else 1008 frame = atoi(argv[ arg]);1004 frame = atoi(argv[i]); 1009 1005 } 1010 1006 … … 1030 1026 { 1031 1027 PymolProxy *proxyPtr = clientData; 1032 int state = 1; 1033 int arg, push = 0, defer = 0; 1034 1035 clear_error(proxyPtr); 1036 1037 for(arg = 1; arg < argc; arg++) { 1038 if ( strcmp(argv[arg],"-defer") == 0 ) 1039 defer = 1; 1040 else if (strcmp(argv[arg],"-push") == 0 ) 1041 push = 1; 1042 else if (strcmp(argv[arg],"on") == 0 ) 1043 state = 1; 1044 else if (strcmp(argv[arg],"off") == 0 ) 1045 state = 0; 1046 else if (strcmp(argv[arg],"toggle") == 0 ) 1047 state = ((proxyPtr->flags & SHOW_LABELS) == 0); 1048 } 1049 1028 int i, push, defer, state, size; 1029 const char *model; 1030 1031 clear_error(proxyPtr); 1032 model = "all"; 1033 size = 14; 1034 state = TRUE; 1035 push = defer = FALSE; 1036 for(i = 1; i < argc; i++) { 1037 if (strcmp(argv[i],"-defer") == 0) { 1038 defer = TRUE; 1039 } else if (strcmp(argv[i],"-push") == 0) { 1040 push = TRUE; 1041 } else if (strcmp(argv[i],"-model") == 0) { 1042 if (++i < argc) { 1043 model = argv[i]; 1044 } 1045 } else if (strcmp(argv[i],"-size") == 0) { 1046 if (++i < argc) { 1047 size = atoi(argv[i]); 1048 } 1049 } else if (Tcl_GetBoolean(interp, argv[i], &state) != TCL_OK) { 1050 return TCL_ERROR; 1051 } 1052 } 1050 1053 proxyPtr->flags |= INVALIDATE_CACHE; /* Label */ 1051 1054 if (!defer || push) { … … 1055 1058 proxyPtr->flags |= FORCE_UPDATE; 1056 1059 } 1060 Pymol(proxyPtr, "set label_color,white,%s\nset label_size,%d,%s\n", 1061 model, size, model); 1057 1062 if (state) { 1058 Pymol(proxyPtr, "set label_color,white,all\n"); 1059 Pymol(proxyPtr, "set label_size,14,all\n"); 1060 Pymol(proxyPtr, "label all,\"%%s%%s\" %% (ID,name)\n"); 1061 } 1062 else 1063 Pymol(proxyPtr, "label all\n"); 1064 1063 Pymol(proxyPtr, "label %s,\"%%s%%s\" %% (ID,name)\n", model); 1064 } else { 1065 Pymol(proxyPtr, "label %s\n", model); 1066 } 1065 1067 if (state) { 1066 1068 proxyPtr->flags |= SHOW_LABELS; … … 1075 1077 const char *argv[]) 1076 1078 { 1077 int ghost = 0, defer = 0, push = 0, arg; 1078 const char *model = "all"; 1079 PymolProxy *proxyPtr = clientData; 1080 float lineWidth; 1081 1082 clear_error(proxyPtr); 1083 1084 for(arg = 1; arg < argc; arg++) { 1085 if ( strcmp(argv[arg],"-defer") == 0 ) 1086 defer = 1; 1087 else if (strcmp(argv[arg],"-push") == 0) 1088 push = 1; 1089 else if (strcmp(argv[arg],"-ghost") == 0) 1090 ghost = 1; 1091 else if (strcmp(argv[arg],"-normal") == 0) 1092 ghost = 0; 1093 else if (strcmp(argv[arg],"-model") == 0) { 1094 if (++arg < argc) 1095 model = argv[arg]; 1096 } 1097 else 1098 model = argv[arg]; 1099 } 1100 1079 PymolProxy *proxyPtr = clientData; 1080 const char *model; 1081 int defer, push, i; 1082 1083 clear_error(proxyPtr); 1084 defer = push = FALSE; 1085 model = "all"; 1086 for(i = 1; i < argc; i++) { 1087 if ( strcmp(argv[i],"-defer") == 0 ) { 1088 defer = TRUE; 1089 } else if (strcmp(argv[i],"-push") == 0) { 1090 push = TRUE; 1091 } else if (strcmp(argv[i],"-model") == 0) { 1092 if (++i < argc) { 1093 model = argv[i]; 1094 } 1095 } else { 1096 model = argv[i]; 1097 } 1098 } 1101 1099 proxyPtr->flags |= INVALIDATE_CACHE; /* Lines */ 1102 1100 if (!defer || push) { … … 1106 1104 proxyPtr->flags |= FORCE_UPDATE; 1107 1105 } 1108 Pymol(proxyPtr, "hide everything,%s\n",model); 1109 1110 lineWidth = (ghost) ? 0.25f : 1.0f; 1111 Pymol(proxyPtr, "set line_width,%g,%s\n", lineWidth, model); 1112 Pymol(proxyPtr, "show lines,%s\n", model); 1113 if (proxyPtr->flags & SHOW_LABELS) { 1114 Pymol(proxyPtr, "show labels,%s\n", model); 1115 } 1106 Pymol(proxyPtr, "hide everything,%s\nshow lines,%s\n", model, model); 1116 1107 return proxyPtr->status; 1117 1108 } … … 1124 1115 PymolProxy *proxyPtr = clientData; 1125 1116 int state = 1; 1126 int arg, defer = 0, push = 0, varg = 1;1117 int i, defer = 0, push = 0, varg = 1; 1127 1118 1128 1119 if (proxyPtr == NULL) … … 1130 1121 clear_error(proxyPtr); 1131 1122 pdbdata = name = NULL; /* Suppress compiler warning. */ 1132 for( arg = 1; arg < argc; arg++) {1133 if ( strcmp(argv[ arg],"-defer") == 0 )1123 for(i = 1; i < argc; i++) { 1124 if ( strcmp(argv[i],"-defer") == 0 ) 1134 1125 defer = 1; 1135 else if (strcmp(argv[ arg],"-push") == 0)1126 else if (strcmp(argv[i],"-push") == 0) 1136 1127 push = 1; 1137 1128 else if (varg == 1) { 1138 pdbdata = argv[ arg];1129 pdbdata = argv[i]; 1139 1130 varg++; 1140 1131 } else if (varg == 2) { 1141 name = argv[ arg];1132 name = argv[i]; 1142 1133 varg++; 1143 1134 } else if (varg == 3) { 1144 state = atoi( argv[ arg] );1135 state = atoi( argv[i] ); 1145 1136 varg++; 1146 1137 } … … 1342 1333 } 1343 1334 /* Force pymol to update the current scene. */ 1344 Pymol(proxyPtr,"refresh ; ray %d,%d ;png -, dpi=300\n", width, height);1335 Pymol(proxyPtr,"refresh\nray %d,%d\npng -, dpi=300\n", width, height); 1345 1336 Expect(proxyPtr, "png image follows: ", buffer, 800); 1346 1337 … … 1419 1410 proxyPtr->flags |= FORCE_UPDATE; 1420 1411 } 1421 Pymol(proxyPtr, "reset\n"); 1422 Pymol(proxyPtr, "zoom complete=1\n"); 1412 Pymol(proxyPtr, "reset\nzoom complete=1\n"); 1423 1413 return proxyPtr->status; 1424 1414 } … … 1527 1517 const char *argv[]) 1528 1518 { 1529 int defer = 0, ghost = 0, push = 0, arg; 1530 float scale; 1531 const char *model = "all"; 1532 PymolProxy *proxyPtr = clientData; 1533 1534 clear_error(proxyPtr); 1535 scale = 0.41f; 1536 for(arg = 1; arg < argc; arg++) { 1537 if ( strcmp(argv[arg],"-defer") == 0 ) { 1538 defer = 1; 1539 } else if (strcmp(argv[arg],"-push") == 0) { 1540 push = 1; 1541 } else if (strcmp(argv[arg],"-ghost") == 0) { 1542 ghost = 1; 1543 } else if (strcmp(argv[arg],"-normal") == 0) { 1544 ghost = 0; 1545 } else if (strcmp(argv[arg],"-model") == 0) { 1546 if (++arg < argc) 1547 model = argv[arg]; 1548 } else if (strcmp(argv[arg],"-scale") == 0) { 1549 if (++arg < argc) 1550 scale = atof(argv[arg]); 1551 } 1552 else 1553 model = argv[arg]; 1554 } 1555 1519 PymolProxy *proxyPtr = clientData; 1520 const char *model; 1521 int defer, push, i; 1522 1523 clear_error(proxyPtr); 1524 defer = push = FALSE; 1525 model = "all"; 1526 for(i = 1; i < argc; i++) { 1527 if ( strcmp(argv[i],"-defer") == 0 ) { 1528 defer = TRUE; 1529 } else if (strcmp(argv[i],"-push") == 0) { 1530 push = TRUE; 1531 } else if (strcmp(argv[i],"-model") == 0) { 1532 if (++i < argc) { 1533 model = argv[i]; 1534 } 1535 } else { 1536 model = argv[i]; 1537 } 1538 } 1556 1539 proxyPtr->flags |= INVALIDATE_CACHE; /* Spheres */ 1557 1540 if (!defer || push) { … … 1561 1544 proxyPtr->flags |= FORCE_UPDATE; 1562 1545 } 1563 Pymol(proxyPtr, "hide everything, %s\n", model); 1564 #ifdef notdef 1565 Pymol(proxyPtr, "set sphere_scale,%f,%s\n", scale, model); 1566 #endif 1567 //Pymol(proxyPtr, "set sphere_quality,2,%s\n", model); 1568 Pymol(proxyPtr, "set ambient,.2,%s\n", model); 1569 1570 if (ghost) 1571 Pymol(proxyPtr, "set sphere_transparency,.75,%s\n", model); 1572 else 1573 Pymol(proxyPtr, "set sphere_transparency,0,%s\n", model); 1574 1575 Pymol(proxyPtr, "show spheres,%s\n", model); 1576 1577 if (proxyPtr->flags & SHOW_LABELS) { 1578 Pymol(proxyPtr, "show labels,%s\n", model); 1579 } 1546 Pymol(proxyPtr, "set sphere_quality,2,%s\nhide everything,%s\n", 1547 model, model); 1548 Pymol(proxyPtr, "set ambient,.2,%s\nshow spheres,%s\n", model, model); 1580 1549 return proxyPtr->status; 1581 1550 } … … 1587 1556 PymolProxy *proxyPtr = clientData; 1588 1557 int width = 640, height = 480; 1589 int defer = 0, push = 0, arg, varg = 1;1590 1591 clear_error(proxyPtr); 1592 1593 for( arg = 1; arg < argc; arg++) {1594 if ( strcmp(argv[ arg],"-defer") == 0 )1558 int defer = 0, push = 0, i, varg = 1; 1559 1560 clear_error(proxyPtr); 1561 1562 for(i = 1; i < argc; i++) { 1563 if ( strcmp(argv[i],"-defer") == 0 ) 1595 1564 defer = 1; 1596 else if ( strcmp(argv[ arg], "-push") == 0 )1565 else if ( strcmp(argv[i], "-push") == 0 ) 1597 1566 push = 1; 1598 1567 else if (varg == 1) { 1599 width = atoi(argv[ arg]);1568 width = atoi(argv[i]); 1600 1569 height = width; 1601 1570 varg++; 1602 1571 } 1603 1572 else if (varg == 2) { 1604 height = atoi(argv[ arg]);1573 height = atoi(argv[i]); 1605 1574 varg++; 1606 1575 } … … 1622 1591 } 1623 1592 1593 1594 static int 1595 TransparencyCmd(ClientData clientData, Tcl_Interp *interp, int argc, 1596 const char *argv[]) 1597 { 1598 PymolProxy *proxyPtr = clientData; 1599 const char *model, *cmd; 1600 float transparency; 1601 int defer, push; 1602 int i; 1603 1604 clear_error(proxyPtr); 1605 model = "all"; 1606 defer = push = FALSE; 1607 transparency = 0.0f; 1608 for(i = 1; i < argc; i++) { 1609 if ( strcmp(argv[i],"-defer") == 0 ) { 1610 defer = 1; 1611 } else if (strcmp(argv[i],"-push") == 0) { 1612 push = 1; 1613 } else if (strcmp(argv[i],"-model") == 0) { 1614 if (++i < argc) { 1615 model = argv[i]; 1616 } 1617 } else { 1618 transparency = atof(argv[i]); 1619 } 1620 } 1621 proxyPtr->flags |= INVALIDATE_CACHE; 1622 if (!defer || push) { 1623 proxyPtr->flags |= UPDATE_PENDING; 1624 } 1625 if (push) { 1626 proxyPtr->flags |= FORCE_UPDATE; 1627 } 1628 cmd = "set sphere_transparency,%g,%s\nset stick_transparency,%g,%s\n"; 1629 Pymol(proxyPtr, cmd, transparency, model, transparency, model); 1630 return proxyPtr->status; 1631 } 1632 1624 1633 static int 1625 1634 VMouseCmd(ClientData clientData, Tcl_Interp *interp, int argc, … … 1627 1636 { 1628 1637 PymolProxy *proxyPtr = clientData; 1629 int arg, defer = 0, push = 0, varg = 1;1638 int i, defer = 0, push = 0, varg = 1; 1630 1639 int arg1 = 0, arg2 = 0, arg3 = 0, arg4 = 0, arg5 = 0; 1631 1640 1632 1641 clear_error(proxyPtr); 1633 1642 1634 for( arg = 1; arg < argc; arg++) {1635 if (strcmp(argv[ arg], "-defer") == 0)1643 for(i = 1; i < argc; i++) { 1644 if (strcmp(argv[i], "-defer") == 0) 1636 1645 defer = 1; 1637 else if (strcmp(argv[ arg], "-push") == 0)1646 else if (strcmp(argv[i], "-push") == 0) 1638 1647 push = 1; 1639 1648 else if (varg == 1) { 1640 arg1 = atoi(argv[ arg]);1649 arg1 = atoi(argv[i]); 1641 1650 varg++; 1642 1651 } 1643 1652 else if (varg == 2) { 1644 arg2 = atoi(argv[ arg]);1653 arg2 = atoi(argv[i]); 1645 1654 varg++; 1646 1655 } 1647 1656 else if (varg == 3) { 1648 arg3 = atoi(argv[ arg]);1657 arg3 = atoi(argv[i]); 1649 1658 varg++; 1650 1659 } 1651 1660 else if (varg == 4) { 1652 arg4 = atoi(argv[ arg]);1661 arg4 = atoi(argv[i]); 1653 1662 varg++; 1654 1663 } 1655 1664 else if (varg == 5) { 1656 arg5 = atoi(argv[ arg]);1665 arg5 = atoi(argv[i]); 1657 1666 varg++; 1658 1667 } … … 1688 1697 double factor = 0.0; 1689 1698 PymolProxy *proxyPtr = clientData; 1690 int defer = 0, push = 0, arg, varg = 1;1691 1692 clear_error(proxyPtr); 1693 1694 for( arg = 1; arg < argc; arg++) {1695 if (strcmp(argv[ arg],"-defer") == 0)1699 int defer = 0, push = 0, i, varg = 1; 1700 1701 clear_error(proxyPtr); 1702 1703 for(i = 1; i < argc; i++) { 1704 if (strcmp(argv[i],"-defer") == 0) 1696 1705 defer = 1; 1697 else if (strcmp(argv[ arg],"-push") == 0)1706 else if (strcmp(argv[i],"-push") == 0) 1698 1707 push = 1; 1699 1708 else if (varg == 1) { 1700 1709 double value; 1701 if (Tcl_GetDouble(interp, argv[ arg], &value) != TCL_OK) {1710 if (Tcl_GetDouble(interp, argv[i], &value) != TCL_OK) { 1702 1711 return TCL_ERROR; 1703 1712 } … … 1829 1838 Tcl_CreateCommand(interp, "screen", ScreenCmd, &proxy, NULL); 1830 1839 Tcl_CreateCommand(interp, "spheres", SpheresCmd, &proxy, NULL); 1840 Tcl_CreateCommand(interp, "transparency", TransparencyCmd, &proxy, NULL); 1831 1841 Tcl_CreateCommand(interp, "viewport", ScreenCmd, &proxy, NULL); 1832 1842 Tcl_CreateCommand(interp, "vmouse", VMouseCmd, &proxy, NULL);
Note: See TracChangeset
for help on using the changeset viewer.