Ignore:
Timestamp:
Mar 6, 2009, 9:27:24 PM (16 years ago)
Author:
dkearney
Message:

adding flowvisviewer widget and flowvis-test program for exercising flow
commands. most stuff works in the flowvis-test gui, there are not transfer
functions or legends. play/pause, stop and record work, record download's or
saves the video file to users's desktop. adding iconc for pause, record and
stop.

added "flow play" command to nanovis. the goal of this command is to send back
the next frame to the client. the play functionality allows users to see
frames as if they were a movie, and also send command nanovis server. this
makes the experience more interactive than waiting for a movie to be made and
downloading it. also the play functionality can be used as a cheap preview to
get the best angle and settings before recording the movie.

added sendDataToClient function to nanovis server so i could send back movie
files. we create the movie on the render server and send back the mpeg binary
for the user to download. the function is pretty general so it can be used to
send any blob of data.

File:
1 edited

Legend:

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

    r1291 r1295  
    18481848    }
    18491849    NanoVis::initParticle();
     1850
     1851    // send the movie back to the client
     1852    // FIXME: find a way to get the data from the movie object as a char*
     1853    Rappture::Buffer data;
     1854    data.load(fileName);
     1855    char command[512];
     1856    sprintf(command,"nv>file -bytes %lu\n",data.size());
     1857    NanoVis::sendDataToClient(command,data.bytes(),data.size());
     1858
    18501859    return TCL_OK;
    18511860}
     
    19361945
    19371946static int
     1947FlowPlayOp(ClientData cdata, Tcl_Interp *interp, int objc,
     1948             Tcl_Obj *const *objv)
     1949{
     1950    if (NanoVis::licRenderer &&
     1951        !NanoVis::licRenderer->isActivated()) {
     1952        NanoVis::licRenderer->activate();
     1953    }
     1954    if (NanoVis::particleRenderer &&
     1955        !NanoVis::particleRenderer->isActivated()) {
     1956        NanoVis::particleRenderer->activate();
     1957    }
     1958
     1959    Trace("sending flow playback frame\n");
     1960
     1961    // Generate the latest frame and send it back to the client
     1962    if (NanoVis::licRenderer &&
     1963        NanoVis::licRenderer->isActivated()) {
     1964        NanoVis::licRenderer->convolve();
     1965    }
     1966    if (NanoVis::particleRenderer &&
     1967        NanoVis::particleRenderer->isActivated()) {
     1968        NanoVis::particleRenderer->advect();
     1969    }
     1970    NanoVis::offscreen_buffer_capture();  //enable offscreen render
     1971    NanoVis::display();
     1972
     1973    NanoVis::read_screen();
     1974    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
     1975
     1976    // NanoVis::bmp_write_to_file(frame_count, fileName);
     1977
     1978    Trace("FLOW end\n");
     1979    return TCL_OK;
     1980}
     1981
     1982static int
    19381983FlowResetOp(ClientData cdata, Tcl_Interp *interp, int objc,
    19391984             Tcl_Obj *const *objv)
     
    19732018    {"data",      1, FlowDataOp,          3, 0, "oper ?args?",},
    19742019    {"lic",       1, FlowLicOp,           3, 3, "on|off",},
    1975     {"particle",  1, FlowParticleOp,      3, 0, "oper ?args?",},
     2020    {"particle",  2, FlowParticleOp,      3, 0, "oper ?args?",},
     2021    {"play",      2, FlowPlayOp,          2, 2, "",},
    19762022    {"reset",     1, FlowResetOp,         2, 2, "",},
    19772023    {"vectorid",  1, FlowVectorIdOp,      3, 3, "index",},
     
    19832029 * CLIENT COMMAND:
    19842030 *   flow data follows <value>
    1985  *   flow capture
     2031 *   flow capture frames filename
    19862032 *   flow lic on|off
    19872033 *   flow particle visible on|off
    19882034 *   flow particle slice <volumeId>
    19892035 *   flow particle slicepos <value>
     2036 *   flow play
    19902037 *   flow reset
    19912038 *   flow vectorid <volumeId>
Note: See TracChangeset for help on using the changeset viewer.