Changeset 1538 for trunk


Ignore:
Timestamp:
Jun 29, 2009 1:30:40 PM (15 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/pymolproxy/pymolproxy.c

    r1534 r1538  
    1919 */
    2020
     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 */
    2130/*
    2231 *   +--------------+        +------------+         +--------+
     
    4150 * when we want to write the resulting image from the last command.
    4251 *
    43  * FIXME: Need to fix the reads from the pymol server.  We want to check for
    44  * an expected string within the pymol server output.  Right now it's doing
    45  * single character reads to stop when we hit a newline.  We should create a
    46  * read buffer that lets us do block reads.  This problem only really affects
    47  * the echoing back of commands (waiting for the pymol command prompt).  Most
    48  * 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 server
    51  *        before the last one is transmitted.
    5252 */
    5353
     
    846846    proxyPtr->flags &= ~(UPDATE_PENDING|FORCE_UPDATE|INVALIDATE_CACHE);
    847847
    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");
    851851    if (Expect(proxyPtr, "bmp image follows: ", buffer, BUFSIZ) != BUFFER_OK) {
    852852        trace("can't find image follows line (%s)", buffer);
     
    10921092        proxyPtr->flags |= FORCE_UPDATE;
    10931093    }
    1094     Pymol(proxyPtr, "hide spheres,%s\nshow lines,%s\n", model, model);
     1094    Pymol(proxyPtr, "hide spheres,%s\nshow sticks,%s\n", model, model);
    10951095    return proxyPtr->status;
    10961096}
     
    11541154        }
    11551155        fclose(f);
    1156         Pymol(proxyPtr, "load %s, %s, %d\n", fileName, name, state);
     1156        Pymol(proxyPtr, "load %s,%s,%d\n", fileName, name, state);
    11571157        Pymol(proxyPtr, "zoom complete=1\n");
    11581158    }
     
    12611261
    12621262    /* 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");
    12661265
    12671266    Expect(proxyPtr, "png image follows: ", buffer, 800);
     
    13211320    }
    13221321    /* 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);
    13241324    Expect(proxyPtr, "png image follows: ", buffer, 800);
    13251325
     
    15321532        proxyPtr->flags |= FORCE_UPDATE;
    15331533    }
    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);
    15361535    Pymol(proxyPtr, "set ambient,.2,%s\nshow spheres,%s\n", model, model);
    15371536    return proxyPtr->status;
     
    15431542{
    15441543    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;
    15501550    for(i = 1; i < argc; i++) {
    15511551        if ( strcmp(argv[i],"-defer") == 0 )
     
    15621562            varg++;
    15631563        }
     1564    }
     1565    if ((width < 0) || (height < 0)) {
     1566        return TCL_ERROR;
    15641567    }
    15651568    proxyPtr->flags |= INVALIDATE_CACHE; /* viewport */
Note: See TracChangeset for help on using the changeset viewer.