Ignore:
Timestamp:
Nov 15, 2013, 6:32:03 PM (6 years ago)
Author:
ldelgass
Message:

Remove some more Rappture deps from nanovis

File:
1 edited

Legend:

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

    r4056 r4063  
    3333
    3434#include <assert.h>
     35#include <errno.h>
    3536#include <stdlib.h>
    3637#include <unistd.h>                     /* Needed for getpid, gethostname,
     
    4041#include <RpField1D.h>
    4142#include <RpEncode.h>
    42 #include <RpOutcome.h>
    4343#include <RpBuffer.h>
    4444
     
    5757#ifdef USE_VTK
    5858#include "VtkDataSetReader.h"
     59#else
     60#include "VtkReader.h"
    5961#endif
    60 #include "VtkReader.h"
    6162#include "BMPWriter.h"
    6263#include "PPMWriter.h"
     
    153154}
    154155
    155 bool
    156 nv::SocketRead(Rappture::Buffer &buf, size_t len)
    157 {
    158     ReadBuffer::BufferStatus status;
    159     status = g_inBufPtr->followingData(buf, len);
    160     TRACE("followingData status: %d", status);
    161     return (status == ReadBuffer::OK);
    162 }
    163 
    164156static int
    165157ExecuteCommand(Tcl_Interp *interp, Tcl_DString *dsPtr)
     
    534526/**
    535527 * Read the requested number of bytes from standard input into the given
    536  * buffer.  The buffer is then decompressed and decoded.
     528 * buffer.  The buffer must have already been allocated for nBytes.  The
     529 * buffer is then decompressed and decoded.
    537530 */
    538531int
    539532nv::GetDataStream(Tcl_Interp *interp, Rappture::Buffer &buf, int nBytes)
    540533{
    541     if (!SocketRead(buf, nBytes)) {
    542         return TCL_ERROR;
    543     }
     534    if (!SocketRead((char *)buf.bytes(), nBytes)) {
     535        return TCL_ERROR;
     536    }
     537    buf.count(nBytes);
    544538    Rappture::Outcome err;
    545539    TRACE("Checking header[%.13s]", buf.bytes());
     
    12801274    if ((nBytes > 5) && (strncmp(bytes, "<HDR>", 5) == 0)) {
    12811275        TRACE("ZincBlende Stream loading...");
    1282         volume = (Volume *)ZincBlendeReconstructor::getInstance()->loadFromMemory(const_cast<char *>(bytes));
     1276        volume = (Volume *)ZincBlendeReconstructor::getInstance()->loadFromMemory(bytes);
    12831277        if (volume == NULL) {
    12841278            Tcl_AppendResult(interp, "can't get volume instance", (char *)NULL);
     
    13011295            abort();
    13021296        }
    1303         Rappture::Outcome context;
    13041297#ifdef USE_VTK
    1305         volume = load_vtk_volume_stream(context, tag, bytes, nBytes);
     1298        volume = load_vtk_volume_stream(tag, bytes, nBytes);
    13061299#else
    13071300        std::stringstream fdata;
    13081301        fdata.write(bytes, nBytes);
    1309         volume = load_vtk_volume_stream(context, tag, fdata);
     1302        volume = load_vtk_volume_stream(tag, fdata);
    13101303#endif
    13111304        if (volume == NULL) {
    1312             Tcl_AppendResult(interp, context.remark(), (char*)NULL);
     1305            Tcl_AppendResult(interp, "Failed to load VTK file", (char*)NULL);
    13131306            return TCL_ERROR;
    13141307        }
     
    13261319        std::stringstream fdata;
    13271320        fdata.write(bytes, nBytes);
    1328         Rappture::Outcome context;
    1329         volume = load_dx_volume_stream(context, tag, fdata);
     1321        volume = load_dx_volume_stream(tag, fdata);
    13301322        if (volume == NULL) {
    1331             Tcl_AppendResult(interp, context.remark(), (char*)NULL);
     1323            Tcl_AppendResult(interp, "Failed to load DX file", (char*)NULL);
    13321324            return TCL_ERROR;
    13331325        }
     
    17651757    }
    17661758    Unirect2d data(1);
    1767     if (data.parseBuffer(interp, buf) != TCL_OK) {
     1759    if (data.parseBuffer(interp, buf.bytes(), buf.size()) != TCL_OK) {
    17681760        return TCL_ERROR;
    17691761    }
Note: See TracChangeset for help on using the changeset viewer.