Changeset 4884 for nanovis/branches/1.1


Ignore:
Timestamp:
Dec 19, 2014, 8:11:10 PM (5 years ago)
Author:
ldelgass
Message:

Remove unused 'flow data file...' command

Location:
nanovis/branches/1.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.1/FlowCmd.cpp

    r4881 r4884  
    2020
    2121#include <RpOutcome.h>
     22#include <RpBuffer.h>
    2223
    2324#include <vrmath/Vector3f.h>
     
    130131};
    131132
    132 static int
    133 FlowDataFileOp(ClientData clientData, Tcl_Interp *interp, int objc,
    134                Tcl_Obj *const *objv)
    135 {
    136     Rappture::Outcome result;
    137 
    138     const char *fileName;
    139     fileName = Tcl_GetString(objv[3]);
    140     TRACE("File: %s", fileName);
    141 
    142     int nComponents;
    143     if (Tcl_GetIntFromObj(interp, objv[4], &nComponents) != TCL_OK) {
    144         return TCL_ERROR;
    145     }
    146     if ((nComponents < 1) || (nComponents > 4)) {
    147         Tcl_AppendResult(interp, "bad # of components \"",
    148                          Tcl_GetString(objv[4]), "\"", (char *)NULL);
    149         return TCL_ERROR;
    150     }
    151     Rappture::Buffer buf;
    152     if (!buf.load(result, fileName)) {
    153         Tcl_AppendResult(interp, "can't load data from \"", fileName, "\": ",
    154                          result.remark(), (char *)NULL);
    155         return TCL_ERROR;
    156     }
    157 
    158     Rappture::Unirect3d *dataPtr;
    159     dataPtr = new Rappture::Unirect3d(nComponents);
    160     Flow *flow = (Flow *)clientData;
    161     size_t length = buf.size();
    162     char *bytes = (char *)buf.bytes();
    163     if ((length > 4) && (strncmp(bytes, "<DX>", 4) == 0)) {
    164         if (!dataPtr->importDx(result, nComponents, length-4, bytes+4)) {
    165             Tcl_AppendResult(interp, result.remark(), (char *)NULL);
    166             delete dataPtr;
    167             return TCL_ERROR;
    168         }
    169     } else if ((length > 10) && (strncmp(bytes, "unirect3d ", 10) == 0)) {
    170         if (dataPtr->parseBuffer(interp, buf) != TCL_OK) {
    171             delete dataPtr;
    172             return TCL_ERROR;
    173         }
    174     } else if ((length > 10) && (strncmp(bytes, "unirect2d ", 10) == 0)) {
    175         Rappture::Unirect2d *u2dPtr;
    176         u2dPtr = new Rappture::Unirect2d(nComponents);
    177         if (u2dPtr->parseBuffer(interp, buf) != TCL_OK) {
    178             delete u2dPtr;
    179             return TCL_ERROR;
    180         }
    181         dataPtr->convert(u2dPtr);
    182         delete u2dPtr;
    183     } else {
    184         TRACE("header is %.14s", buf.bytes());
    185         if (!dataPtr->importDx(result, nComponents, length, bytes)) {
    186             Tcl_AppendResult(interp, result.remark(), (char *)NULL);
    187             delete dataPtr;
    188             return TCL_ERROR;
    189         }
    190     }
    191     if (dataPtr->nValues() == 0) {
    192         delete dataPtr;
    193         Tcl_AppendResult(interp, "no data found in \"", fileName, "\"",
    194                          (char *)NULL);
    195         return TCL_ERROR;
    196     }
    197     flow->data(dataPtr);
    198     NanoVis::eventuallyRedraw(NanoVis::MAP_FLOWS);
    199     return TCL_OK;
    200 }
    201 
    202133/**
    203134 * $flow data follows nbytes nComponents
     
    307238
    308239static Rappture::CmdSpec flowDataOps[] = {
    309     {"file",    2, FlowDataFileOp,    5, 5, "fileName nComponents",},
    310     {"follows", 2, FlowDataFollowsOp, 5, 5, "size nComponents",},
     240    {"follows", 1, FlowDataFollowsOp, 5, 5, "size nComponents",},
    311241};
    312242static int nFlowDataOps = NumCmdSpecs(flowDataOps);
  • nanovis/branches/1.1/protocol-nanovis.txt

    r4877 r4884  
    9696          This doesn't currently produce a response, it only returns a Tcl list
    9797          within the server's interpreter
    98 
    9998<flowObj> configure <?option value...?>
    10099          -ambient <val>
     
    113112          -transferfunction <name>
    114113          -volume <bool>
    115 <flowObj> data file <fileName> <numComponents>
    116           Load a data file.  fileName is path to file on server
    117114<flowObj> data follows <nbytes> <numComponents>
    118115          Send flow data.  Data bytes follow the newline after the command
    119116<flowObj> legend <w> <h>
    120 
    121117<flowObj> particles add <name> <?switches?>
    122118          see '<flowObj> particles configure' for switches
Note: See TracChangeset for help on using the changeset viewer.