Changeset 4893 for nanovis/branches/1.1


Ignore:
Timestamp:
Dec 20, 2014, 5:49:45 AM (5 years ago)
Author:
ldelgass
Message:

merge r4056 from trunk

Location:
nanovis/branches/1.1
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.1

  • nanovis/branches/1.1/CmdProc.cpp

    r4892 r4893  
    1010#include "CmdProc.h"
    1111
    12 using namespace Rappture;
     12using namespace nv;
    1313
    1414/**
     
    115115 */
    116116Tcl_ObjCmdProc *
    117 Rappture::GetOpFromObj(Tcl_Interp *interp,      /* Interpreter to report errors to */
    118                        int nSpecs,              /* Number of specifications in array */
    119                        CmdSpec *specs,          /* Op specification array */
    120                        int operPos,             /* Position of operation in argument
    121                                                  * list. */
    122                        int objc,                /* Number of arguments in the argument
    123                                                  * vector.  This includes any prefixed
    124                                                  * arguments */
    125                        Tcl_Obj *const *objv,    /* Argument vector */
    126                        int flags)
     117nv::GetOpFromObj(Tcl_Interp *interp,    /* Interpreter to report errors to */
     118                 int nSpecs,            /* Number of specifications in array */
     119                 CmdSpec *specs,                /* Op specification array */
     120                 int operPos,           /* Position of operation in argument
     121                                         * list. */
     122                 int objc,              /* Number of arguments in the argument
     123                                         * vector.  This includes any prefixed
     124                                         * arguments */
     125                 Tcl_Obj *const *objv,  /* Argument vector */
     126                 int flags)
    127127{
    128128    CmdSpec *specPtr;
  • nanovis/branches/1.1/CmdProc.h

    r4889 r4893  
    44 *
    55 */
    6 #ifndef RAPPTURE_CMDPROC_H
    7 #define RAPPTURE_CMDPROC_H
     6#ifndef NV_CMDPROC_H
     7#define NV_CMDPROC_H
    88
    9 namespace Rappture {
     9namespace nv {
    1010
    1111/**
     
    3838             CmdSpec *specs, int operPos, int objc, Tcl_Obj *const *objv, int flags);
    3939
    40 #define NumCmdSpecs(s) (sizeof(s) / sizeof(Rappture::CmdSpec))
     40#define NumCmdSpecs(s) (sizeof(s) / sizeof(nv::CmdSpec))
    4141
    4242}
  • nanovis/branches/1.1/Command.cpp

    r4889 r4893  
    648648}
    649649
    650 static Rappture::CmdSpec cameraOps[] = {
     650static CmdSpec cameraOps[] = {
    651651    {"angle",   2, CameraAngleOp,    5, 5, "xAngle yAngle zAngle",},
    652652    {"orient",  1, CameraOrientOp,   6, 6, "qw qx qy qz",},
     
    664664    Tcl_ObjCmdProc *proc;
    665665
    666     proc = Rappture::GetOpFromObj(interp, nCameraOps, cameraOps,
    667                                   Rappture::CMDSPEC_ARG1, objc, objv, 0);
     666    proc = GetOpFromObj(interp, nCameraOps, cameraOps,
     667                        CMDSPEC_ARG1, objc, objv, 0);
    668668    if (proc == NULL) {
    669669        return TCL_ERROR;
     
    778778}
    779779
    780 static Rappture::CmdSpec cutplaneOps[] = {
     780static CmdSpec cutplaneOps[] = {
    781781    {"position", 1, CutplanePositionOp, 4, 0, "relval axis ?indices?",},
    782782    {"state",    1, CutplaneStateOp,    4, 0, "bool axis ?indices?",},
     
    806806    Tcl_ObjCmdProc *proc;
    807807
    808     proc = Rappture::GetOpFromObj(interp, nCutplaneOps, cutplaneOps,
    809                                   Rappture::CMDSPEC_ARG1, objc, objv, 0);
     808    proc = GetOpFromObj(interp, nCutplaneOps, cutplaneOps,
     809                        CMDSPEC_ARG1, objc, objv, 0);
    810810    if (proc == NULL) {
    811811        return TCL_ERROR;
     
    985985}
    986986
    987 static Rappture::CmdSpec screenOps[] = {
     987static CmdSpec screenOps[] = {
    988988    {"bgcolor",  1, ScreenBgColorOp,  5, 5, "r g b",},
    989989    {"size",     1, ScreenSizeOp, 4, 4, "width height",},
     
    997997    Tcl_ObjCmdProc *proc;
    998998
    999     proc = Rappture::GetOpFromObj(interp, nScreenOps, screenOps,
    1000                                   Rappture::CMDSPEC_ARG1, objc, objv, 0);
     999    proc = GetOpFromObj(interp, nScreenOps, screenOps,
     1000                        CMDSPEC_ARG1, objc, objv, 0);
    10011001    if (proc == NULL) {
    10021002        return TCL_ERROR;
     
    12341234}
    12351235
    1236 static Rappture::CmdSpec volumeAnimationOps[] = {
     1236static CmdSpec volumeAnimationOps[] = {
    12371237    {"capture",   2, VolumeAnimationCaptureOp,  4, 5, "numframes ?filename?",},
    12381238    {"clear",     2, VolumeAnimationClearOp,    3, 3, "",},
     
    12501250    Tcl_ObjCmdProc *proc;
    12511251
    1252     proc = Rappture::GetOpFromObj(interp, nVolumeAnimationOps,
    1253                 volumeAnimationOps, Rappture::CMDSPEC_ARG2, objc, objv, 0);
     1252    proc = GetOpFromObj(interp, nVolumeAnimationOps,
     1253                        volumeAnimationOps, CMDSPEC_ARG2, objc, objv, 0);
    12541254    if (proc == NULL) {
    12551255        return TCL_ERROR;
     
    13841384}
    13851385
    1386 static Rappture::CmdSpec volumeDataOps[] = {
     1386static CmdSpec volumeDataOps[] = {
    13871387    {"follows",   1, VolumeDataFollowsOp, 5, 5, "nbytes tag",},
    13881388    {"state",     1, VolumeDataStateOp,   4, 0, "bool ?indices?",},
     
    13961396    Tcl_ObjCmdProc *proc;
    13971397
    1398     proc = Rappture::GetOpFromObj(interp, nVolumeDataOps, volumeDataOps,
    1399                                   Rappture::CMDSPEC_ARG2, objc, objv, 0);
     1398    proc = GetOpFromObj(interp, nVolumeDataOps, volumeDataOps,
     1399                        CMDSPEC_ARG2, objc, objv, 0);
    14001400    if (proc == NULL) {
    14011401        return TCL_ERROR;
     
    14881488}
    14891489
    1490 static Rappture::CmdSpec volumeOutlineOps[] = {
     1490static CmdSpec volumeOutlineOps[] = {
    14911491    {"color",     1, VolumeOutlineColorOp,  6, 0, "r g b ?indices?",},
    14921492    {"state",     1, VolumeOutlineStateOp,  4, 0, "bool ?indices?",},
     
    15011501    Tcl_ObjCmdProc *proc;
    15021502
    1503     proc = Rappture::GetOpFromObj(interp, nVolumeOutlineOps, volumeOutlineOps,
    1504         Rappture::CMDSPEC_ARG2, objc, objv, 0);
     1503    proc = GetOpFromObj(interp, nVolumeOutlineOps, volumeOutlineOps,
     1504                        CMDSPEC_ARG2, objc, objv, 0);
    15051505    if (proc == NULL) {
    15061506        return TCL_ERROR;
     
    16801680}
    16811681
    1682 static Rappture::CmdSpec volumeShadingOps[] = {
     1682static CmdSpec volumeShadingOps[] = {
    16831683    {"ambient",       1, VolumeShadingAmbientOp,     4, 0, "value ?indices?",},
    16841684    {"diffuse",       1, VolumeShadingDiffuseOp,     4, 0, "value ?indices?",},
     
    16981698    Tcl_ObjCmdProc *proc;
    16991699
    1700     proc = Rappture::GetOpFromObj(interp, nVolumeShadingOps, volumeShadingOps,
    1701         Rappture::CMDSPEC_ARG2, objc, objv, 0);
     1700    proc = GetOpFromObj(interp, nVolumeShadingOps, volumeShadingOps,
     1701                        CMDSPEC_ARG2, objc, objv, 0);
    17021702    if (proc == NULL) {
    17031703        return TCL_ERROR;
     
    17251725}
    17261726
    1727 static Rappture::CmdSpec volumeOps[] = {
     1727static CmdSpec volumeOps[] = {
    17281728    {"animation", 2, VolumeAnimationOp,   3, 0, "oper ?args?",},
    17291729    {"data",      2, VolumeDataOp,        3, 0, "oper ?args?",},
     
    17431743    Tcl_ObjCmdProc *proc;
    17441744
    1745     proc = Rappture::GetOpFromObj(interp, nVolumeOps, volumeOps,
    1746         Rappture::CMDSPEC_ARG1, objc, objv, 0);
     1745    proc = GetOpFromObj(interp, nVolumeOps, volumeOps,
     1746                        CMDSPEC_ARG1, objc, objv, 0);
    17471747    if (proc == NULL) {
    17481748        return TCL_ERROR;
     
    17651765        return TCL_ERROR;
    17661766    }
    1767     Rappture::Unirect2d data(1);
     1767    Unirect2d data(1);
    17681768    if (data.parseBuffer(interp, buf) != TCL_OK) {
    17691769        return TCL_ERROR;
     
    18191819}
    18201820
    1821 static Rappture::CmdSpec heightMapDataOps[] = {
     1821static CmdSpec heightMapDataOps[] = {
    18221822    {"follows",  1, HeightMapDataFollowsOp, 5, 5, "size heightmapName",},
    18231823    {"visible",  1, HeightMapDataVisibleOp, 4, 0, "bool ?heightmapNames...?",},
     
    18311831    Tcl_ObjCmdProc *proc;
    18321832
    1833     proc = Rappture::GetOpFromObj(interp, nHeightMapDataOps, heightMapDataOps,
    1834                                   Rappture::CMDSPEC_ARG2, objc, objv, 0);
     1833    proc = GetOpFromObj(interp, nHeightMapDataOps, heightMapDataOps,
     1834                        CMDSPEC_ARG2, objc, objv, 0);
    18351835    if (proc == NULL) {
    18361836        return TCL_ERROR;
     
    18791879}
    18801880
    1881 static Rappture::CmdSpec heightMapLineContourOps[] = {
     1881static CmdSpec heightMapLineContourOps[] = {
    18821882    {"color",   1, HeightMapLineContourColorOp,   6, 0, "r g b ?heightmapNames...?",},
    18831883    {"visible", 1, HeightMapLineContourVisibleOp, 4, 0, "bool ?heightmapNames...?",},
     
    18911891    Tcl_ObjCmdProc *proc;
    18921892
    1893     proc = Rappture::GetOpFromObj(interp, nHeightMapLineContourOps,
    1894         heightMapLineContourOps, Rappture::CMDSPEC_ARG2, objc, objv, 0);
     1893    proc = GetOpFromObj(interp, nHeightMapLineContourOps,
     1894                        heightMapLineContourOps, CMDSPEC_ARG2, objc, objv, 0);
    18951895    if (proc == NULL) {
    18961896        return TCL_ERROR;
     
    20342034}
    20352035
    2036 static Rappture::CmdSpec heightMapOps[] = {
     2036static CmdSpec heightMapOps[] = {
    20372037    {"create",       2, HeightMapCreateOp,      10, 10, "heightmapName xmin ymin xmax ymax xnum ynum values",},
    20382038    {"cull",         2, HeightMapCullOp,        3, 3, "mode",},
     
    20532053    Tcl_ObjCmdProc *proc;
    20542054
    2055     proc = Rappture::GetOpFromObj(interp, nHeightMapOps, heightMapOps,
    2056                                   Rappture::CMDSPEC_ARG1, objc, objv, 0);
     2055    proc = GetOpFromObj(interp, nHeightMapOps, heightMapOps,
     2056                        CMDSPEC_ARG1, objc, objv, 0);
    20572057    if (proc == NULL) {
    20582058        return TCL_ERROR;
     
    21362136}
    21372137
    2138 static Rappture::CmdSpec gridOps[] = {
     2138static CmdSpec gridOps[] = {
    21392139    {"axiscolor",  5, GridAxisColorOp,  5, 6, "r g b ?a?",},
    21402140    {"axisname",   5, GridAxisNameOp,   5, 5, "index title units",},
     
    21502150    Tcl_ObjCmdProc *proc;
    21512151
    2152     proc = Rappture::GetOpFromObj(interp, nGridOps, gridOps,
    2153                                   Rappture::CMDSPEC_ARG1, objc, objv, 0);
     2152    proc = GetOpFromObj(interp, nGridOps, gridOps,
     2153                        CMDSPEC_ARG1, objc, objv, 0);
    21542154    if (proc == NULL) {
    21552155        return TCL_ERROR;
  • nanovis/branches/1.1/Flow.cpp

    r4889 r4893  
    5050    TRACE("Enter");
    5151
    52     Rappture::FreeSwitches(_switches, &_sv, 0);
     52    FreeSwitches(_switches, &_sv, 0);
    5353
    5454    if (_data != NULL) {
  • nanovis/branches/1.1/Flow.h

    r4889 r4893  
    105105    }
    106106
    107     Rappture::Unirect3d *data()
     107    Unirect3d *data()
    108108    {
    109109        return _data;
    110110    }
    111111
    112     void data(Rappture::Unirect3d *data)
     112    void data(Unirect3d *unirect)
    113113    {
    114114        if (_data != NULL) {
    115115            delete _data;
    116116        }
    117         _data = data;
     117        _data = unirect;
    118118    }
    119119#if 0
     
    183183    int parseSwitches(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
    184184    {
    185         if (Rappture::ParseSwitches(interp, _switches, objc, objv, &_sv,
    186                                     SWITCH_DEFAULTS) < 0) {
     185        if (nv::ParseSwitches(interp, _switches, objc, objv, &_sv,
     186                              SWITCH_DEFAULTS) < 0) {
    187187            return TCL_ERROR;
    188188        }
     
    227227     * kept to regenerate the volume
    228228     * associated with the flow. */
    229     Rappture::Unirect3d *_data;
     229    Unirect3d *_data;
    230230
    231231    /**
     
    250250    FlowValues _sv;
    251251
    252     static Rappture::SwitchSpec _switches[];
     252    static SwitchSpec _switches[];
    253253};
    254254
  • nanovis/branches/1.1/FlowBox.cpp

    r4889 r4893  
    4141{
    4242    TRACE("Freeing switches");
    43     Rappture::FreeSwitches(_switches, &_sv, 0);
     43    FreeSwitches(_switches, &_sv, 0);
    4444}
    4545
  • nanovis/branches/1.1/FlowBox.h

    r4889 r4893  
    4949    int parseSwitches(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
    5050    {
    51         if (Rappture::ParseSwitches(interp, _switches, objc, objv, &_sv,
    52                                     SWITCH_DEFAULTS) < 0) {
     51        if (nv::ParseSwitches(interp, _switches, objc, objv, &_sv,
     52                              SWITCH_DEFAULTS) < 0) {
    5353            return TCL_ERROR;
    5454        }
     
    7070    std::string _name;          ///< Name of this box in the hash table.
    7171    FlowBoxValues _sv;
    72     static Rappture::SwitchSpec _switches[];
     72    static SwitchSpec _switches[];
    7373};
    7474
  • nanovis/branches/1.1/FlowCmd.cpp

    r4889 r4893  
    4646using namespace vrmath;
    4747
    48 static Rappture::SwitchParseProc AxisSwitchProc;
    49 static Rappture::SwitchCustom axisSwitch = {
     48static SwitchParseProc AxisSwitchProc;
     49static SwitchCustom axisSwitch = {
    5050    AxisSwitchProc, NULL, 0,
    5151};
    5252
    53 static Rappture::SwitchParseProc ColorSwitchProc;
    54 static Rappture::SwitchCustom colorSwitch = {
     53static SwitchParseProc ColorSwitchProc;
     54static SwitchCustom colorSwitch = {
    5555    ColorSwitchProc, NULL, 0,
    5656};
    5757
    58 static Rappture::SwitchParseProc PointSwitchProc;
    59 static Rappture::SwitchCustom pointSwitch = {
     58static SwitchParseProc PointSwitchProc;
     59static SwitchCustom pointSwitch = {
    6060    PointSwitchProc, NULL, 0,
    6161};
    6262
    63 static Rappture::SwitchParseProc PositionSwitchProc;
    64 static Rappture::SwitchCustom positionSwitch = {
     63static SwitchParseProc PositionSwitchProc;
     64static SwitchCustom positionSwitch = {
    6565    PositionSwitchProc, NULL, 0,
    6666};
    6767
    68 static Rappture::SwitchParseProc TransferFunctionSwitchProc;
    69 static Rappture::SwitchCustom transferFunctionSwitch = {
     68static SwitchParseProc TransferFunctionSwitchProc;
     69static SwitchCustom transferFunctionSwitch = {
    7070    TransferFunctionSwitchProc, NULL, 0,
    7171};
    7272
    73 Rappture::SwitchSpec Flow::_switches[] = {
    74     {Rappture::SWITCH_FLOAT, "-ambient", "value",
     73SwitchSpec Flow::_switches[] = {
     74    {SWITCH_FLOAT, "-ambient", "value",
    7575     offsetof(FlowValues, ambient), 0},
    76     {Rappture::SWITCH_BOOLEAN, "-arrows", "boolean",
     76    {SWITCH_BOOLEAN, "-arrows", "boolean",
    7777     offsetof(FlowValues, showArrows), 0},
    78     {Rappture::SWITCH_CUSTOM, "-axis", "axis",
     78    {SWITCH_CUSTOM, "-axis", "axis",
    7979     offsetof(FlowValues, slicePos.axis), 0, 0, &axisSwitch},
    80     {Rappture::SWITCH_FLOAT, "-diffuse", "value",
     80    {SWITCH_FLOAT, "-diffuse", "value",
    8181     offsetof(FlowValues, diffuse), 0},
    82     {Rappture::SWITCH_BOOLEAN, "-hide", "boolean",
     82    {SWITCH_BOOLEAN, "-hide", "boolean",
    8383     offsetof(FlowValues, isHidden), 0},
    84     {Rappture::SWITCH_BOOLEAN, "-light2side", "boolean",
     84    {SWITCH_BOOLEAN, "-light2side", "boolean",
    8585     offsetof(FlowValues, twoSidedLighting), 0},
    86     {Rappture::SWITCH_FLOAT, "-opacity", "value",
     86    {SWITCH_FLOAT, "-opacity", "value",
    8787     offsetof(FlowValues, opacity), 0},
    88     {Rappture::SWITCH_BOOLEAN, "-outline", "boolean",
     88    {SWITCH_BOOLEAN, "-outline", "boolean",
    8989     offsetof(FlowValues, showOutline), 0},
    90     {Rappture::SWITCH_CUSTOM, "-position", "number",
     90    {SWITCH_CUSTOM, "-position", "number",
    9191     offsetof(FlowValues, slicePos), 0, 0, &positionSwitch},
    92     {Rappture::SWITCH_BOOLEAN, "-slice", "boolean",
     92    {SWITCH_BOOLEAN, "-slice", "boolean",
    9393     offsetof(FlowValues, sliceVisible), 0},
    94     {Rappture::SWITCH_FLOAT, "-specularExp", "value",
     94    {SWITCH_FLOAT, "-specularExp", "value",
    9595     offsetof(FlowValues, specularExp), 0},
    96     {Rappture::SWITCH_FLOAT, "-specularLevel", "value",
     96    {SWITCH_FLOAT, "-specularLevel", "value",
    9797     offsetof(FlowValues, specular), 0},
    98     {Rappture::SWITCH_CUSTOM, "-transferfunction", "name",
     98    {SWITCH_CUSTOM, "-transferfunction", "name",
    9999     offsetof(FlowValues, transferFunction), 0, 0, &transferFunctionSwitch},
    100     {Rappture::SWITCH_BOOLEAN, "-volume", "boolean",
     100    {SWITCH_BOOLEAN, "-volume", "boolean",
    101101     offsetof(FlowValues, showVolume), 0},
    102     {Rappture::SWITCH_END}
    103 };
    104 
    105 Rappture::SwitchSpec FlowParticles::_switches[] = {
    106     {Rappture::SWITCH_CUSTOM, "-axis", "string",
     102    {SWITCH_END}
     103};
     104
     105SwitchSpec FlowParticles::_switches[] = {
     106    {SWITCH_CUSTOM, "-axis", "axis",
    107107     offsetof(FlowParticlesValues, position.axis), 0, 0, &axisSwitch},
    108     {Rappture::SWITCH_CUSTOM, "-color", "{r g b a}",
     108    {SWITCH_CUSTOM, "-color", "{r g b a}",
    109109     offsetof(FlowParticlesValues, color), 0, 0,  &colorSwitch},
    110     {Rappture::SWITCH_BOOLEAN, "-hide", "boolean",
     110    {SWITCH_BOOLEAN, "-hide", "boolean",
    111111     offsetof(FlowParticlesValues, isHidden), 0},
    112     {Rappture::SWITCH_CUSTOM, "-position", "number",
     112    {SWITCH_CUSTOM, "-position", "number",
    113113     offsetof(FlowParticlesValues, position), 0, 0, &positionSwitch},
    114     {Rappture::SWITCH_FLOAT, "-size", "float",
     114    {SWITCH_FLOAT, "-size", "float",
    115115     offsetof(FlowParticlesValues, particleSize), 0},
    116     {Rappture::SWITCH_END}
    117 };
    118 
    119 Rappture::SwitchSpec FlowBox::_switches[] = {
    120     {Rappture::SWITCH_CUSTOM, "-color", "{r g b a}",
     116    {SWITCH_END}
     117};
     118
     119SwitchSpec FlowBox::_switches[] = {
     120    {SWITCH_CUSTOM, "-color", "{r g b a}",
    121121     offsetof(FlowBoxValues, color), 0, 0,  &colorSwitch},
    122     {Rappture::SWITCH_CUSTOM, "-corner1", "{x y z}",
     122    {SWITCH_CUSTOM, "-corner1", "{x y z}",
    123123     offsetof(FlowBoxValues, corner1), 0, 0, &pointSwitch},
    124     {Rappture::SWITCH_CUSTOM, "-corner2", "{x y z}",
     124    {SWITCH_CUSTOM, "-corner2", "{x y z}",
    125125     offsetof(FlowBoxValues, corner2), 0, 0, &pointSwitch},
    126     {Rappture::SWITCH_BOOLEAN, "-hide", "boolean",
     126    {SWITCH_BOOLEAN, "-hide", "boolean",
    127127     offsetof(FlowBoxValues, isHidden), 0},
    128     {Rappture::SWITCH_FLOAT, "-linewidth", "number",
     128    {SWITCH_FLOAT, "-linewidth", "number",
    129129     offsetof(FlowBoxValues, lineWidth), 0},
    130     {Rappture::SWITCH_END}
     130    {SWITCH_END}
    131131};
    132132
     
    172172    size_t length = buf.size();
    173173
    174     Rappture::Unirect3d *dataPtr;
    175     dataPtr = new Rappture::Unirect3d(nComponents);
     174    Unirect3d *unirect = NULL;
    176175
    177176    Flow *flow = (Flow *)clientData;
    178177    if ((length > 4) && (strncmp(bytes, "<DX>", 4) == 0)) {
    179         if (!dataPtr->importDx(result, nComponents, length - 4, bytes + 4)) {
     178        unirect = new Unirect3d(nComponents);
     179        if (!unirect->importDx(result, nComponents, length - 4, bytes + 4)) {
    180180            Tcl_AppendResult(interp, result.remark(), (char *)NULL);
    181             delete dataPtr;
     181            delete unirect;
    182182            return TCL_ERROR;
    183183        }
    184184    } else if ((length > 10) && (strncmp(bytes, "unirect3d ", 10) == 0)) {
    185         if (dataPtr->parseBuffer(interp, buf) != TCL_OK) {
    186             delete dataPtr;
     185        unirect = new Unirect3d(nComponents);
     186        if (unirect->parseBuffer(interp, buf) != TCL_OK) {
     187            delete unirect;
    187188            return TCL_ERROR;
    188189        }
    189190    } else if ((length > 10) && (strncmp(bytes, "unirect2d ", 10) == 0)) {
    190         Rappture::Unirect2d *u2dPtr;
    191         u2dPtr = new Rappture::Unirect2d(nComponents);
     191        unirect = new Unirect3d(nComponents);
     192        Unirect2d *u2dPtr = new Unirect2d(nComponents);
    192193        if (u2dPtr->parseBuffer(interp, buf) != TCL_OK) {
    193194            delete u2dPtr;
    194195            return TCL_ERROR;
    195196        }
    196         dataPtr->convert(u2dPtr);
     197        unirect->convert(u2dPtr);
    197198        delete u2dPtr;
    198199    } else {
    199200        TRACE("header is %.14s", buf.bytes());
    200         if (!dataPtr->importDx(result, nComponents, length, bytes)) {
     201        unirect = new Unirect3d(nComponents);
     202        if (!unirect->importDx(result, nComponents, length, bytes)) {
    201203            Tcl_AppendResult(interp, result.remark(), (char *)NULL);
    202             delete dataPtr;
     204            delete unirect;
    203205            return TCL_ERROR;
    204206        }
    205207    }
    206     if (dataPtr->nValues() == 0) {
    207         delete dataPtr;
     208    if (unirect->nValues() == 0) {
     209        delete unirect;
    208210        Tcl_AppendResult(interp, "no data found in stream", (char *)NULL);
    209211        return TCL_ERROR;
    210212    }
    211213    TRACE("nx = %d ny = %d nz = %d",
    212           dataPtr->xNum(), dataPtr->yNum(), dataPtr->zNum());
     214          unirect->xNum(), unirect->yNum(), unirect->zNum());
    213215    TRACE("x0 = %lg y0 = %lg z0 = %lg",
    214           dataPtr->xMin(), dataPtr->yMin(), dataPtr->zMin());
     216          unirect->xMin(), unirect->yMin(), unirect->zMin());
    215217    TRACE("lx = %lg ly = %lg lz = %lg",
    216           dataPtr->xMax() - dataPtr->xMin(),
    217           dataPtr->yMax() - dataPtr->yMin(),
    218           dataPtr->zMax() - dataPtr->zMin());
     218          unirect->xMax() - unirect->xMin(),
     219          unirect->yMax() - unirect->yMin(),
     220          unirect->zMax() - unirect->zMin());
    219221    TRACE("dx = %lg dy = %lg dz = %lg",
    220           dataPtr->xNum() > 1 ? (dataPtr->xMax() - dataPtr->xMin())/(dataPtr->xNum()-1) : 0,
    221           dataPtr->yNum() > 1 ? (dataPtr->yMax() - dataPtr->yMin())/(dataPtr->yNum()-1) : 0,
    222           dataPtr->zNum() > 1 ? (dataPtr->zMax() - dataPtr->zMin())/(dataPtr->zNum()-1) : 0);
     222          unirect->xNum() > 1 ? (unirect->xMax() - unirect->xMin())/(unirect->xNum()-1) : 0,
     223          unirect->yNum() > 1 ? (unirect->yMax() - unirect->yMin())/(unirect->yNum()-1) : 0,
     224          unirect->zNum() > 1 ? (unirect->zMax() - unirect->zMin())/(unirect->zNum()-1) : 0);
    223225    TRACE("magMin = %lg magMax = %lg",
    224           dataPtr->magMin(), dataPtr->magMax());
    225     flow->data(dataPtr);
     226          unirect->magMin(), unirect->magMax());
     227    flow->data(unirect);
    226228    {
    227229        char info[1024];
    228230        int length =
    229231            sprintf(info, "nv>data tag %s min %g max %g\n",
    230                     flow->name(), dataPtr->magMin(), dataPtr->magMax());
     232                    flow->name(), unirect->magMin(), unirect->magMax());
    231233        if (SocketWrite(info, (size_t)length) < 0) {
    232234            return TCL_ERROR;
     
    237239}
    238240
    239 static Rappture::CmdSpec flowDataOps[] = {
     241static CmdSpec flowDataOps[] = {
    240242    {"follows", 1, FlowDataFollowsOp, 5, 5, "size nComponents",},
    241243};
     
    248250    Tcl_ObjCmdProc *proc;
    249251
    250     proc = Rappture::GetOpFromObj(interp, nFlowDataOps, flowDataOps,
    251                                   Rappture::CMDSPEC_ARG2, objc, objv, 0);
     252    proc = GetOpFromObj(interp, nFlowDataOps, flowDataOps,
     253                        CMDSPEC_ARG2, objc, objv, 0);
    252254    if (proc == NULL) {
    253255        return TCL_ERROR;
     
    568570}
    569571
    570 static Rappture::CmdSpec flowParticlesOps[] = {
     572static CmdSpec flowParticlesOps[] = {
    571573    {"add",        1, FlowParticlesAddOp,        4, 0, "name ?switches?",},
    572574    {"configure",  1, FlowParticlesConfigureOp,  4, 0, "name ?switches?",},
     
    592594{
    593595    Tcl_ObjCmdProc *proc;
    594     proc = Rappture::GetOpFromObj(interp, nFlowParticlesOps, flowParticlesOps,
    595                                   Rappture::CMDSPEC_ARG2, objc, objv, 0);
     596    proc = GetOpFromObj(interp, nFlowParticlesOps, flowParticlesOps,
     597                        CMDSPEC_ARG2, objc, objv, 0);
    596598    if (proc == NULL) {
    597599        return TCL_ERROR;
     
    675677}
    676678
    677 static Rappture::CmdSpec flowBoxOps[] = {
     679static CmdSpec flowBoxOps[] = {
    678680    {"add",        1, FlowBoxAddOp,        4, 0, "name ?switches?",},
    679681    {"configure",  1, FlowBoxConfigureOp,  4, 0, "name ?switches?",},
     
    697699{
    698700    Tcl_ObjCmdProc *proc;
    699     proc = Rappture::GetOpFromObj(interp, nFlowBoxOps, flowBoxOps,
    700                                   Rappture::CMDSPEC_ARG2, objc, objv, 0);
     701    proc = GetOpFromObj(interp, nFlowBoxOps, flowBoxOps,
     702                        CMDSPEC_ARG2, objc, objv, 0);
    701703    if (proc == NULL) {
    702704        return TCL_ERROR;
     
    747749}
    748750
    749 static Rappture::CmdSpec flowInstOps[] = {
     751static CmdSpec flowInstOps[] = {
    750752    {"box",         1, FlowBoxOp,        2, 0, "oper ?args?"},
    751753    {"configure",   1, FlowConfigureOp,  2, 0, "?switches?"},
     
    769771{
    770772    Tcl_ObjCmdProc *proc;
    771     proc = Rappture::GetOpFromObj(interp, nFlowInstOps, flowInstOps,
    772                                   Rappture::CMDSPEC_ARG1, objc, objv, 0);
     773    proc = GetOpFromObj(interp, nFlowInstOps, flowInstOps,
     774                        CMDSPEC_ARG1, objc, objv, 0);
    773775    if (proc == NULL) {
    774776        return TCL_ERROR;
     
    974976};
    975977
    976 static Rappture::SwitchParseProc VideoFormatSwitchProc;
    977 static Rappture::SwitchCustom videoFormatSwitch = {
     978static SwitchParseProc VideoFormatSwitchProc;
     979static SwitchCustom videoFormatSwitch = {
    978980    VideoFormatSwitchProc, NULL, 0,
    979981};
    980982
    981 static Rappture::SwitchSpec flowVideoSwitches[] = {
    982     {Rappture::SWITCH_INT, "-bitrate", "value",
     983static SwitchSpec flowVideoSwitches[] = {
     984    {SWITCH_INT, "-bitrate", "value",
    983985     offsetof(FlowVideoSwitches, bitRate), 0},
    984     {Rappture::SWITCH_CUSTOM, "-format", "string",
     986    {SWITCH_CUSTOM, "-format", "string",
    985987     offsetof(FlowVideoSwitches, formatObjPtr), 0, 0, &videoFormatSwitch},
    986     {Rappture::SWITCH_FLOAT, "-framerate", "value",
     988    {SWITCH_FLOAT, "-framerate", "value",
    987989     offsetof(FlowVideoSwitches, frameRate), 0},
    988     {Rappture::SWITCH_INT, "-height", "integer",
     990    {SWITCH_INT, "-height", "integer",
    989991     offsetof(FlowVideoSwitches, height), 0},
    990     {Rappture::SWITCH_INT, "-numframes", "count",
     992    {SWITCH_INT, "-numframes", "count",
    991993     offsetof(FlowVideoSwitches, numFrames), 0},
    992     {Rappture::SWITCH_INT, "-width", "integer",
     994    {SWITCH_INT, "-width", "integer",
    993995     offsetof(FlowVideoSwitches, width), 0},
    994     {Rappture::SWITCH_END}
     996    {SWITCH_END}
    995997};
    996998
     
    11781180    switches.formatObjPtr = Tcl_NewStringObj("mpeg1video", 10);
    11791181    Tcl_IncrRefCount(switches.formatObjPtr);
    1180     if (Rappture::ParseSwitches(interp, flowVideoSwitches,
     1182    if (ParseSwitches(interp, flowVideoSwitches,
    11811183                objc - 3, objv + 3, &switches, SWITCH_DEFAULTS) < 0) {
    11821184        return TCL_ERROR;
     
    12301232    tmpFileName[length] = '\0';
    12311233    rmdir(tmpFileName);
    1232     Rappture::FreeSwitches(flowVideoSwitches, &switches, 0);
     1234    FreeSwitches(flowVideoSwitches, &switches, 0);
    12331235    return result;
    12341236}
     
    12451247#endif /* HAVE_FFMPEG */
    12461248
    1247 static Rappture::CmdSpec flowCmdOps[] = {
     1249static CmdSpec flowCmdOps[] = {
    12481250    {"add",      1, FlowAddOp,     3, 0, "name ?option value...?",},
    12491251    {"delete",   1, FlowDeleteOp,  3, 0, "name ?name...?",},
     
    12631265    Tcl_ObjCmdProc *proc;
    12641266
    1265     proc = Rappture::GetOpFromObj(interp, nFlowCmdOps, flowCmdOps,
    1266                                   Rappture::CMDSPEC_ARG1, objc, objv, 0);
     1267    proc = GetOpFromObj(interp, nFlowCmdOps, flowCmdOps,
     1268                        CMDSPEC_ARG1, objc, objv, 0);
    12671269    if (proc == NULL) {
    12681270        return TCL_ERROR;
  • nanovis/branches/1.1/FlowParticles.cpp

    r4890 r4893  
    4141    }
    4242    TRACE("Freeing switches");
    43     Rappture::FreeSwitches(_switches, &_sv, 0);
     43    FreeSwitches(_switches, &_sv, 0);
    4444}
    4545
  • nanovis/branches/1.1/FlowParticles.h

    r4889 r4893  
    5252    int parseSwitches(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
    5353    {
    54         if (Rappture::ParseSwitches(interp, _switches, objc, objv, &_sv,
    55                                     SWITCH_DEFAULTS) < 0) {
     54        if (nv::ParseSwitches(interp, _switches, objc, objv, &_sv,
     55                              SWITCH_DEFAULTS) < 0) {
    5656            return TCL_ERROR;
    5757        }
     
    101101    FlowParticlesValues _sv;
    102102
    103     static Rappture::SwitchSpec _switches[];
     103    static SwitchSpec _switches[];
    104104};
    105105
  • nanovis/branches/1.1/Switch.cpp

    r3362 r4893  
    3636#include "Switch.h"
    3737
    38 namespace Rappture {
     38namespace nv {
    3939
    4040static void
  • nanovis/branches/1.1/Switch.h

    r4889 r4893  
    2828 */
    2929
    30 #ifndef RAPPTURE_SWITCH_H
    31 #define RAPPTURE_SWITCH_H
     30#ifndef NV_SWITCH_H
     31#define NV_SWITCH_H
    3232
    3333#ifdef HAVE_STDDEF_H
     
    3535#endif /* HAVE_STDDEF_H */
    3636
    37 namespace Rappture {
     37namespace nv {
    3838
    3939typedef int (SwitchParseProc)(ClientData clientData, Tcl_Interp *interp,
  • nanovis/branches/1.1/Unirect.cpp

    r4877 r4893  
    4545
    4646int
    47 Rappture::Unirect2d::parseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf)
     47nv::Unirect2d::parseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf)
    4848{
    4949    Tcl_Obj *objPtr = Tcl_NewStringObj(buf.bytes(), buf.size());
     
    6262
    6363int
    64 Rappture::Unirect3d::parseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf)
     64nv::Unirect3d::parseBuffer(Tcl_Interp *interp, Rappture::Buffer &buf)
    6565{
    6666    Tcl_Obj *objPtr = Tcl_NewStringObj(buf.bytes(), buf.size());
     
    7979
    8080int
    81 Rappture::Unirect3d::loadData(Tcl_Interp *interp, int objc,
    82                               Tcl_Obj *const *objv)
     81nv::Unirect3d::loadData(Tcl_Interp *interp, int objc,
     82                        Tcl_Obj *const *objv)
    8383{
    8484    int num[3], nValues;
     
    313313
    314314int
    315 Rappture::Unirect2d::loadData(Tcl_Interp *interp, int objc,
    316                               Tcl_Obj *const *objv)
     315nv::Unirect2d::loadData(Tcl_Interp *interp, int objc,
     316                        Tcl_Obj *const *objv)
    317317{
    318318    if ((objc & 0x01) == 0) {
     
    488488
    489489bool
    490 Rappture::Unirect3d::importDx(Rappture::Outcome &result, size_t nComponents,
    491                               size_t length, char *string)
     490nv::Unirect3d::importDx(Rappture::Outcome &result, size_t nComponents,
     491                        size_t length, char *string)
    492492{
    493493    int nx, ny, nz, npts;
     
    633633
    634634bool
    635 Rappture::Unirect3d::resample(Rappture::Outcome &result, size_t nSamples)
     635nv::Unirect3d::resample(Rappture::Outcome &result, size_t nSamples)
    636636{
    637637    Rappture::Mesh1D xgrid(_xMin, _xMax, _xNum);
     
    711711
    712712void
    713 Rappture::Unirect3d::getVectorRange()
     713nv::Unirect3d::getVectorRange()
    714714{
    715715    assert(_nComponents == 3);
     
    735735
    736736bool
    737 Rappture::Unirect3d::convert(Rappture::Unirect2d *dataPtr)
     737nv::Unirect3d::convert(nv::Unirect2d *dataPtr)
    738738{
    739739    _initialized = false;
  • nanovis/branches/1.1/Unirect.h

    r4889 r4893  
    55 * Author: George A. Howlett <gah@purdue.edu>
    66 */
    7 #ifndef RAPPTURE_UNIRECT_H
    8 #define RAPPTURE_UNIRECT_H
     7#ifndef NV_UNIRECT_H
     8#define NV_UNIRECT_H
    99
    1010#include <float.h>
     
    1616#include "Trace.h"
    1717
    18 namespace Rappture {
     18namespace nv {
    1919
    2020class Unirect2d;
  • nanovis/branches/1.1/nanovis.cpp

    r4889 r4893  
    12951295            continue;
    12961296        }
    1297         Rappture::Unirect3d *data = flow->data();
     1297        Unirect3d *data = flow->data();
    12981298        min = data->magMin();
    12991299        max = data->magMax();
Note: See TracChangeset for help on using the changeset viewer.