Changeset 1337


Ignore:
Timestamp:
Mar 18, 2009 8:16:52 AM (15 years ago)
Author:
gah
Message:
 
Location:
trunk/packages/vizservers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/RpAVTranslate.cpp

    r1325 r1337  
    180180    }
    181181
     182#ifdef notdef
    182183    // use img_convert instead of sws_scale because img_convert
    183184    // is lgpl nad sws_scale is gpl
     
    185186                (AVPicture *)_rgb_picture, PIX_FMT_RGB24,
    186187                _width, _height);
    187 
     188#endif
    188189    writeVideoFrame(status);
    189190
  • trunk/packages/vizservers/pymolproxy/pymolproxy.c

    r1336 r1337  
    133133#define BUFFER_SHORT_READ       -3
    134134
    135 #define ATOM_SCALE_PENDING      (1<<0)
    136 #define BOND_THICKNESS_PENDING  (1<<1)
    137 #define ROTATE_PENDING          (1<<2)
    138 #define PAN_PENDING             (1<<3)
    139 #define ZOOM_PENDING            (1<<4)
    140 #define UPDATE_PENDING          (1<<5)
    141 #define FORCE_UPDATE            (1<<6)
    142 #define CAN_UPDATE              (1<<7)
    143 #define SHOW_LABELS             (1<<8)
    144 #define INVALIDATE_CACHE        (1<<9)
     135#define FORCE_UPDATE            (1<<0)
     136#define CAN_UPDATE              (1<<1)
     137#define SHOW_LABELS             (1<<2)
     138#define INVALIDATE_CACHE        (1<<3)
     139#define ATOM_SCALE_PENDING      (1<<4)
     140#define BOND_THICKNESS_PENDING  (1<<5)
     141#define ROTATE_PENDING          (1<<6)
     142#define PAN_PENDING             (1<<7)
     143#define ZOOM_PENDING            (1<<8)
     144#define UPDATE_PENDING          (1<<9)
     145#define VIEWPORT_PENDING        (1<<10)
    145146
    146147typedef struct {
     
    164165    int error;
    165166    int status;
     167    int width, height;          /* Size of viewport. */
    166168    float xAngle, yAngle, zAngle;  /* Euler angles of pending rotation.  */
    167169    float atomScale;            /* Atom scale of pending re-scale. */
     
    533535    imgPtr = malloc(sizeof(Image) + dataLength);
    534536    if (imgPtr == NULL) {
    535         fprintf(stderr, "can't allocate image of %d bytes",
    536                 sizeof(Image) + dataLength);
     537        fprintf(stderr, "can't allocate image of %lu bytes",
     538                (unsigned long)(sizeof(Image) + dataLength));
    537539        abort();
    538540    }
     
    671673        }
    672674        return  proxyPtr->status;
     675    }
     676}
     677
     678static void
     679SetViewport(PymolProxy *proxyPtr)
     680{
     681    if (proxyPtr->flags & VIEWPORT_PENDING) {
     682        Pymol(proxyPtr, "viewport %d,%d\n", proxyPtr->width, proxyPtr->height);
     683        proxyPtr->flags &= ~VIEWPORT_PENDING;
    673684    }
    674685}
     
    12621273{
    12631274    char buffer[800];
    1264     size_t nBytes=0;
     1275    int nBytes=0;
    12651276    PymolProxy *proxyPtr = clientData;
    12661277    size_t length;
     
    15561567        proxyPtr->flags |= FORCE_UPDATE;
    15571568    }
    1558     Pymol(proxyPtr, "viewport %d,%d\n", width, height);
     1569    proxyPtr->width = width;
     1570    proxyPtr->height = height;
     1571    proxyPtr->flags |= VIEWPORT_PENDING;
    15591572
    15601573    //usleep(205000); // .2s delay for pymol to update its geometry *HACK ALERT*
     
    19621975
    19631976        /* Handle all the pending setting changes now. */
     1977        if (proxyPtr->flags & VIEWPORT_PENDING) {
     1978            SetViewport(proxyPtr);
     1979        }
    19641980        if (proxyPtr->flags & ROTATE_PENDING) {
    19651981            SetRotation(proxyPtr);
Note: See TracChangeset for help on using the changeset viewer.