Ignore:
Timestamp:
Nov 14, 2013, 8:39:19 PM (6 years ago)
Author:
ldelgass
Message:

Use nv namespace for internal classes (not Rappture) to make it easier to find
dependencies on the Rappture libraries.

File:
1 edited

Legend:

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

    r3943 r4056  
    5050using namespace vrmath;
    5151
    52 static Rappture::SwitchParseProc AxisSwitchProc;
    53 static Rappture::SwitchCustom axisSwitch = {
     52static SwitchParseProc AxisSwitchProc;
     53static SwitchCustom axisSwitch = {
    5454    AxisSwitchProc, NULL, 0,
    5555};
    5656
    57 static Rappture::SwitchParseProc ColorSwitchProc;
    58 static Rappture::SwitchCustom colorSwitch = {
     57static SwitchParseProc ColorSwitchProc;
     58static SwitchCustom colorSwitch = {
    5959    ColorSwitchProc, NULL, 0,
    6060};
    6161
    62 static Rappture::SwitchParseProc PointSwitchProc;
    63 static Rappture::SwitchCustom pointSwitch = {
     62static SwitchParseProc PointSwitchProc;
     63static SwitchCustom pointSwitch = {
    6464    PointSwitchProc, NULL, 0,
    6565};
    6666
    67 static Rappture::SwitchParseProc PositionSwitchProc;
    68 static Rappture::SwitchCustom positionSwitch = {
     67static SwitchParseProc PositionSwitchProc;
     68static SwitchCustom positionSwitch = {
    6969    PositionSwitchProc, NULL, 0,
    7070};
    7171
    72 static Rappture::SwitchParseProc TransferFunctionSwitchProc;
    73 static Rappture::SwitchCustom transferFunctionSwitch = {
     72static SwitchParseProc TransferFunctionSwitchProc;
     73static SwitchCustom transferFunctionSwitch = {
    7474    TransferFunctionSwitchProc, NULL, 0,
    7575};
    7676
    77 Rappture::SwitchSpec Flow::_switches[] = {
    78     {Rappture::SWITCH_FLOAT, "-ambient", "value",
     77SwitchSpec Flow::_switches[] = {
     78    {SWITCH_FLOAT, "-ambient", "value",
    7979     offsetof(FlowValues, ambient), 0},
    80     {Rappture::SWITCH_BOOLEAN, "-arrows", "boolean",
     80    {SWITCH_BOOLEAN, "-arrows", "boolean",
    8181     offsetof(FlowValues, showArrows), 0},
    82     {Rappture::SWITCH_CUSTOM, "-axis", "axis",
     82    {SWITCH_CUSTOM, "-axis", "axis",
    8383     offsetof(FlowValues, slicePos.axis), 0, 0, &axisSwitch},
    84     {Rappture::SWITCH_FLOAT, "-diffuse", "value",
     84    {SWITCH_FLOAT, "-diffuse", "value",
    8585     offsetof(FlowValues, diffuse), 0},
    86     {Rappture::SWITCH_BOOLEAN, "-hide", "boolean",
     86    {SWITCH_BOOLEAN, "-hide", "boolean",
    8787     offsetof(FlowValues, isHidden), 0},
    88     {Rappture::SWITCH_BOOLEAN, "-light2side", "boolean",
     88    {SWITCH_BOOLEAN, "-light2side", "boolean",
    8989     offsetof(FlowValues, twoSidedLighting), 0},
    90     {Rappture::SWITCH_FLOAT, "-opacity", "value",
     90    {SWITCH_FLOAT, "-opacity", "value",
    9191     offsetof(FlowValues, opacity), 0},
    92     {Rappture::SWITCH_BOOLEAN, "-outline", "boolean",
     92    {SWITCH_BOOLEAN, "-outline", "boolean",
    9393     offsetof(FlowValues, showOutline), 0},
    94     {Rappture::SWITCH_CUSTOM, "-position", "number",
     94    {SWITCH_CUSTOM, "-position", "number",
    9595     offsetof(FlowValues, slicePos), 0, 0, &positionSwitch},
    96     {Rappture::SWITCH_BOOLEAN, "-slice", "boolean",
     96    {SWITCH_BOOLEAN, "-slice", "boolean",
    9797     offsetof(FlowValues, sliceVisible), 0},
    98     {Rappture::SWITCH_FLOAT, "-specularExp", "value",
     98    {SWITCH_FLOAT, "-specularExp", "value",
    9999     offsetof(FlowValues, specularExp), 0},
    100     {Rappture::SWITCH_FLOAT, "-specularLevel", "value",
     100    {SWITCH_FLOAT, "-specularLevel", "value",
    101101     offsetof(FlowValues, specular), 0},
    102     {Rappture::SWITCH_CUSTOM, "-transferfunction", "name",
     102    {SWITCH_CUSTOM, "-transferfunction", "name",
    103103     offsetof(FlowValues, transferFunction), 0, 0, &transferFunctionSwitch},
    104     {Rappture::SWITCH_BOOLEAN, "-volume", "boolean",
     104    {SWITCH_BOOLEAN, "-volume", "boolean",
    105105     offsetof(FlowValues, showVolume), 0},
    106     {Rappture::SWITCH_END}
    107 };
    108 
    109 Rappture::SwitchSpec FlowParticles::_switches[] = {
    110     {Rappture::SWITCH_CUSTOM, "-axis", "axis",
     106    {SWITCH_END}
     107};
     108
     109SwitchSpec FlowParticles::_switches[] = {
     110    {SWITCH_CUSTOM, "-axis", "axis",
    111111     offsetof(FlowParticlesValues, position.axis), 0, 0, &axisSwitch},
    112     {Rappture::SWITCH_CUSTOM, "-color", "{r g b a}",
     112    {SWITCH_CUSTOM, "-color", "{r g b a}",
    113113     offsetof(FlowParticlesValues, color), 0, 0,  &colorSwitch},
    114     {Rappture::SWITCH_BOOLEAN, "-hide", "boolean",
     114    {SWITCH_BOOLEAN, "-hide", "boolean",
    115115     offsetof(FlowParticlesValues, isHidden), 0},
    116     {Rappture::SWITCH_CUSTOM, "-position", "number",
     116    {SWITCH_CUSTOM, "-position", "number",
    117117     offsetof(FlowParticlesValues, position), 0, 0, &positionSwitch},
    118     {Rappture::SWITCH_FLOAT, "-size", "float",
     118    {SWITCH_FLOAT, "-size", "float",
    119119     offsetof(FlowParticlesValues, particleSize), 0},
    120     {Rappture::SWITCH_END}
    121 };
    122 
    123 Rappture::SwitchSpec FlowBox::_switches[] = {
    124     {Rappture::SWITCH_CUSTOM, "-color", "{r g b a}",
     120    {SWITCH_END}
     121};
     122
     123SwitchSpec FlowBox::_switches[] = {
     124    {SWITCH_CUSTOM, "-color", "{r g b a}",
    125125     offsetof(FlowBoxValues, color), 0, 0,  &colorSwitch},
    126     {Rappture::SWITCH_CUSTOM, "-corner1", "{x y z}",
     126    {SWITCH_CUSTOM, "-corner1", "{x y z}",
    127127     offsetof(FlowBoxValues, corner1), 0, 0, &pointSwitch},
    128     {Rappture::SWITCH_CUSTOM, "-corner2", "{x y z}",
     128    {SWITCH_CUSTOM, "-corner2", "{x y z}",
    129129     offsetof(FlowBoxValues, corner2), 0, 0, &pointSwitch},
    130     {Rappture::SWITCH_BOOLEAN, "-hide", "boolean",
     130    {SWITCH_BOOLEAN, "-hide", "boolean",
    131131     offsetof(FlowBoxValues, isHidden), 0},
    132     {Rappture::SWITCH_FLOAT, "-linewidth", "number",
     132    {SWITCH_FLOAT, "-linewidth", "number",
    133133     offsetof(FlowBoxValues, lineWidth), 0},
    134     {Rappture::SWITCH_END}
     134    {SWITCH_END}
    135135};
    136136
     
    161161    }
    162162
    163     Rappture::Unirect3d *dataPtr;
    164     dataPtr = new Rappture::Unirect3d(nComponents);
     163    Unirect3d *dataPtr;
     164    dataPtr = new Unirect3d(nComponents);
    165165    Flow *flow = (Flow *)clientData;
    166166    size_t length = buf.size();
     
    178178        }
    179179    } else if ((length > 10) && (strncmp(bytes, "unirect2d ", 10) == 0)) {
    180         Rappture::Unirect2d *u2dPtr;
    181         u2dPtr = new Rappture::Unirect2d(nComponents);
     180        Unirect2d *u2dPtr;
     181        u2dPtr = new Unirect2d(nComponents);
    182182        if (u2dPtr->parseBuffer(interp, buf) != TCL_OK) {
    183183            delete u2dPtr;
     
    247247    size_t length = buf.size();
    248248
    249     Rappture::Unirect3d *unirect = NULL;
     249    Unirect3d *unirect = NULL;
    250250    Volume *volume = NULL;
    251251
    252252    Flow *flow = (Flow *)clientData;
    253253    if ((length > 4) && (strncmp(bytes, "<DX>", 4) == 0)) {
    254         unirect = new Rappture::Unirect3d(nComponents);
     254        unirect = new Unirect3d(nComponents);
    255255        if (!unirect->importDx(result, nComponents, length - 4, bytes + 4)) {
    256256            Tcl_AppendResult(interp, result.remark(), (char *)NULL);
     
    259259        }
    260260    } else if ((length > 10) && (strncmp(bytes, "unirect3d ", 10) == 0)) {
    261         unirect = new Rappture::Unirect3d(nComponents);
     261        unirect = new Unirect3d(nComponents);
    262262        if (unirect->parseBuffer(interp, buf) != TCL_OK) {
    263263            delete unirect;
     
    265265        }
    266266    } else if ((length > 10) && (strncmp(bytes, "unirect2d ", 10) == 0)) {
    267         unirect = new Rappture::Unirect3d(nComponents);
    268         Rappture::Unirect2d *u2dPtr;
    269         u2dPtr = new Rappture::Unirect2d(nComponents);
     267        unirect = new Unirect3d(nComponents);
     268        Unirect2d *u2dPtr;
     269        u2dPtr = new Unirect2d(nComponents);
    270270        if (u2dPtr->parseBuffer(interp, buf) != TCL_OK) {
    271271            delete unirect;
     
    297297    } else {
    298298        TRACE("header is %.14s", buf.bytes());
    299         unirect = new Rappture::Unirect3d(nComponents);
     299        unirect = new Unirect3d(nComponents);
    300300        if (!unirect->importDx(result, nComponents, length, bytes)) {
    301301            Tcl_AppendResult(interp, result.remark(), (char *)NULL);
     
    349349}
    350350
    351 static Rappture::CmdSpec flowDataOps[] = {
     351static CmdSpec flowDataOps[] = {
    352352    {"file",    2, FlowDataFileOp,    5, 5, "fileName nComponents",},
    353353    {"follows", 2, FlowDataFollowsOp, 5, 5, "size nComponents",},
     
    361361    Tcl_ObjCmdProc *proc;
    362362
    363     proc = Rappture::GetOpFromObj(interp, nFlowDataOps, flowDataOps,
    364                                   Rappture::CMDSPEC_ARG2, objc, objv, 0);
     363    proc = GetOpFromObj(interp, nFlowDataOps, flowDataOps,
     364                        CMDSPEC_ARG2, objc, objv, 0);
    365365    if (proc == NULL) {
    366366        return TCL_ERROR;
     
    687687}
    688688
    689 static Rappture::CmdSpec flowParticlesOps[] = {
     689static CmdSpec flowParticlesOps[] = {
    690690    {"add",        1, FlowParticlesAddOp,        4, 0, "name ?switches?",},
    691691    {"configure",  1, FlowParticlesConfigureOp,  4, 0, "name ?switches?",},
     
    711711{
    712712    Tcl_ObjCmdProc *proc;
    713     proc = Rappture::GetOpFromObj(interp, nFlowParticlesOps, flowParticlesOps,
    714                                   Rappture::CMDSPEC_ARG2, objc, objv, 0);
     713    proc = GetOpFromObj(interp, nFlowParticlesOps, flowParticlesOps,
     714                        CMDSPEC_ARG2, objc, objv, 0);
    715715    if (proc == NULL) {
    716716        return TCL_ERROR;
     
    794794}
    795795
    796 static Rappture::CmdSpec flowBoxOps[] = {
     796static CmdSpec flowBoxOps[] = {
    797797    {"add",        1, FlowBoxAddOp,        4, 0, "name ?switches?",},
    798798    {"configure",  1, FlowBoxConfigureOp,  4, 0, "name ?switches?",},
     
    816816{
    817817    Tcl_ObjCmdProc *proc;
    818     proc = Rappture::GetOpFromObj(interp, nFlowBoxOps, flowBoxOps,
    819                                   Rappture::CMDSPEC_ARG2, objc, objv, 0);
     818    proc = GetOpFromObj(interp, nFlowBoxOps, flowBoxOps,
     819                        CMDSPEC_ARG2, objc, objv, 0);
    820820    if (proc == NULL) {
    821821        return TCL_ERROR;
     
    866866}
    867867
    868 static Rappture::CmdSpec flowInstOps[] = {
     868static CmdSpec flowInstOps[] = {
    869869    {"box",         1, FlowBoxOp,        2, 0, "oper ?args?"},
    870870    {"configure",   1, FlowConfigureOp,  2, 0, "?switches?"},
     
    888888{
    889889    Tcl_ObjCmdProc *proc;
    890     proc = Rappture::GetOpFromObj(interp, nFlowInstOps, flowInstOps,
    891                                   Rappture::CMDSPEC_ARG1, objc, objv, 0);
     890    proc = GetOpFromObj(interp, nFlowInstOps, flowInstOps,
     891                        CMDSPEC_ARG1, objc, objv, 0);
    892892    if (proc == NULL) {
    893893        return TCL_ERROR;
     
    10911091};
    10921092
    1093 static Rappture::SwitchParseProc VideoFormatSwitchProc;
    1094 static Rappture::SwitchCustom videoFormatSwitch = {
     1093static SwitchParseProc VideoFormatSwitchProc;
     1094static SwitchCustom videoFormatSwitch = {
    10951095    VideoFormatSwitchProc, NULL, 0,
    10961096};
    10971097
    1098 static Rappture::SwitchSpec flowVideoSwitches[] = {
    1099     {Rappture::SWITCH_INT, "-bitrate", "value",
     1098static SwitchSpec flowVideoSwitches[] = {
     1099    {SWITCH_INT, "-bitrate", "value",
    11001100     offsetof(FlowVideoSwitches, bitRate), 0},
    1101     {Rappture::SWITCH_CUSTOM, "-format", "string",
     1101    {SWITCH_CUSTOM, "-format", "string",
    11021102     offsetof(FlowVideoSwitches, formatObjPtr), 0, 0, &videoFormatSwitch},
    1103     {Rappture::SWITCH_FLOAT, "-framerate", "value",
     1103    {SWITCH_FLOAT, "-framerate", "value",
    11041104     offsetof(FlowVideoSwitches, frameRate), 0},
    1105     {Rappture::SWITCH_INT, "-height", "integer",
     1105    {SWITCH_INT, "-height", "integer",
    11061106     offsetof(FlowVideoSwitches, height), 0},
    1107     {Rappture::SWITCH_INT, "-numframes", "count",
     1107    {SWITCH_INT, "-numframes", "count",
    11081108     offsetof(FlowVideoSwitches, numFrames), 0},
    1109     {Rappture::SWITCH_INT, "-width", "integer",
     1109    {SWITCH_INT, "-width", "integer",
    11101110     offsetof(FlowVideoSwitches, width), 0},
    1111     {Rappture::SWITCH_END}
     1111    {SWITCH_END}
    11121112};
    11131113
     
    12471247    switches.formatObjPtr = Tcl_NewStringObj("mpeg1video", 10);
    12481248    Tcl_IncrRefCount(switches.formatObjPtr);
    1249     if (Rappture::ParseSwitches(interp, flowVideoSwitches,
     1249    if (ParseSwitches(interp, flowVideoSwitches,
    12501250                objc - 3, objv + 3, &switches, SWITCH_DEFAULTS) < 0) {
    12511251        return TCL_ERROR;
     
    12991299    tmpFileName[length] = '\0';
    13001300    rmdir(tmpFileName);
    1301     Rappture::FreeSwitches(flowVideoSwitches, &switches, 0);
     1301    FreeSwitches(flowVideoSwitches, &switches, 0);
    13021302    return result;
    13031303}
     
    13141314#endif /* HAVE_FFMPEG */
    13151315
    1316 static Rappture::CmdSpec flowCmdOps[] = {
     1316static CmdSpec flowCmdOps[] = {
    13171317    {"add",      1, FlowAddOp,     3, 0, "name ?option value...?",},
    13181318    {"delete",   1, FlowDeleteOp,  3, 0, "name ?name...?",},
     
    13321332    Tcl_ObjCmdProc *proc;
    13331333
    1334     proc = Rappture::GetOpFromObj(interp, nFlowCmdOps, flowCmdOps,
    1335                                   Rappture::CMDSPEC_ARG1, objc, objv, 0);
     1334    proc = GetOpFromObj(interp, nFlowCmdOps, flowCmdOps,
     1335                        CMDSPEC_ARG1, objc, objv, 0);
    13361336    if (proc == NULL) {
    13371337        return TCL_ERROR;
Note: See TracChangeset for help on using the changeset viewer.