Changeset 867


Ignore:
Timestamp:
Feb 6, 2008, 11:28:56 AM (17 years ago)
Author:
gah
Message:

Fix DX breakage

File:
1 edited

Legend:

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

    r866 r867  
    220220 *
    221221 * Clients send these commands to manipulate the camera.  The "angle"
    222  * operation controls the angle of the camera around the focal point.
    223  * The "zoom" operation sets the zoom factor, moving the camera in
     222 * option controls the angle of the camera around the focal point.
     223 * The "zoom" option sets the zoom factor, moving the camera in
    224224 * and out.
    225225 * ----------------------------------------------------------------------
     
    355355 * off.  The "position" command changes the position to a relative
    356356 * value in the range 0-1.  The <axis> can be x, y, or z.  These
    357  * operations are applied to the volumes represented by one or more
     357 * options are applied to the volumes represented by one or more
    358358 * <volume> indices.  If no volumes are specified, then all volumes
    359359 * are updated.
     
    10691069            }
    10701070        } else if ((c == 'i') && (strcmp(argv[2], "isosurface") == 0)) {
    1071 
    1072                 //vector<unsigned int> ivol;
    1073                 //if (GetVolumeIndices(interp, argc-3, argv+3, &ivol) != TCL_OK)
    1074                 //{
    1075          //             return TCL_ERROR;
    1076         //      }
    1077                 }
    1078                 else {
    1079                 Tcl_AppendResult(interp, "bad option \"", argv[2], "\": should be ",
    1080                         "diffuse, opacity, specular, or transfunc", (char*)NULL);
    1081                 return TCL_ERROR;
    1082             }
    1083         }
    1084     else if ((c == 's') && (strcmp(argv[1], "state") == 0))
    1085     {
     1071            //vector<unsigned int> ivol;
     1072            //if (GetVolumeIndices(interp, argc-3, argv+3, &ivol) != TCL_OK)
     1073            //{
     1074            //                  return TCL_ERROR;
     1075            //  }
     1076        }
     1077        else {
     1078            Tcl_AppendResult(interp, "bad option \"", argv[2], "\": should be ",
     1079                             "diffuse, opacity, specular, or transfunc", (char*)NULL);
     1080            return TCL_ERROR;
     1081        }
     1082    } else if ((c == 's') && (strcmp(argv[1], "state") == 0)) {
    10861083        if (argc < 3) {
    10871084            Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
     
    10951092
    10961093        vector<unsigned int> ivol;
    1097         if (GetVolumeIndices(interp, argc-3, argv+3, &ivol) != TCL_OK)
    1098         {
     1094        if (GetVolumeIndices(interp, argc-3, argv+3, &ivol) != TCL_OK) {
    10991095            return TCL_ERROR;
    11001096        }
    1101 
    11021097        vector<unsigned int>::iterator iter = ivol.begin();
    1103         while (iter != ivol.end())
    1104         {
     1098        while (iter != ivol.end()) {
    11051099            if (state) {
    11061100                NanoVis::volume[*iter]->enable();
     
    11361130    Rappture::Outcome err;
    11371131
     1132    if (argc < 2) {
     1133        Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
     1134                         " option ?arg arg?", (char *)NULL);
     1135        return TCL_ERROR;
     1136    }
    11381137    char c = argv[1][0];
    11391138    if ((c == 'v') && (strcmp(argv[1], "vectorid") == 0)) {
     
    12301229            }
    12311230        } else {
    1232             Tcl_AppendResult(interp, "unknown operation \"", argv[2],
     1231            Tcl_AppendResult(interp, "unknown option \"", argv[2],
    12331232                "\": should be \"", argv[0], " visible, slice, or slicepos\"",
    12341233                (char *)NULL);
     
    15971596GridCmd(ClientData cdata, Tcl_Interp *interp, int argc, const char *argv[])
    15981597{
     1598    if (argc < 2) {
     1599        Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
     1600                         " option ?args?", (char *)NULL);
     1601        return TCL_ERROR;
     1602    }
    15991603    char c = argv[1][0];
    16001604    if ((c == 'v') && (strcmp(argv[1],"visible") == 0)) {
     
    18471851        }
    18481852        vectorPtr->push_back((unsigned int)index);
     1853    }
     1854    return TCL_OK;
     1855}
     1856
     1857
     1858/*
     1859 * ----------------------------------------------------------------------
     1860 * FUNCTION: GetVolumes()
     1861 *
     1862 * Used internally to decode a series of volume index values and
     1863 * store then in the specified vector.  If there are no volume index
     1864 * arguments, this means "all volumes" to most commands, so all
     1865 * active volume indices are stored in the vector.
     1866 *
     1867 * Updates pushes index values into the vector.  Returns TCL_OK or
     1868 * TCL_ERROR to indicate an error.
     1869 * ----------------------------------------------------------------------
     1870 */
     1871static int
     1872GetVolumes(Tcl_Interp *interp, int argc, const char *argv[],
     1873    vector<Volume *>* vectorPtr)
     1874{
     1875    if (argc == 0) {
     1876        for (unsigned int n = 0; n < NanoVis::volume.size(); n++) {
     1877            if (NanoVis::volume[n] != NULL) {
     1878                vectorPtr->push_back(NanoVis::volume[n]);
     1879            }
     1880        }
     1881    } else {
     1882        for (int n = 0; n < argc; n++) {
     1883            Volume *volPtr;
     1884
     1885            if (GetVolume(interp, argv[n], &volPtr) != TCL_OK) {
     1886                return TCL_ERROR;
     1887            }
     1888            if (volPtr != NULL) {
     1889                vectorPtr->push_back(volPtr);
     1890            }
     1891        }
    18491892    }
    18501893    return TCL_OK;
     
    22402283        nBytes -= nRead;
    22412284    }
    2242     if (strncmp("@@RP-ENC", buf.bytes(), 8) == 0) {
     2285    {
    22432286        Rappture::Outcome err;
    22442287
Note: See TracChangeset for help on using the changeset viewer.