Changeset 889


Ignore:
Timestamp:
Feb 15, 2008, 2:58:28 PM (17 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

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

    r887 r889  
    11261126                return TCL_ERROR;
    11271127            }
    1128             int iso_surface = 0;
     1128            int iso_surface;
    11291129            if (Tcl_GetBoolean(interp, argv[3], &iso_surface) != TCL_OK) {
    11301130                return TCL_ERROR;
     
    11691169            }
    11701170        }
    1171     }
    1172     else if (strcmp(argv[1],"animation") == 0) {
    1173        
     1171    } else if (strcmp(argv[1],"animation") == 0) {
     1172        if (argc < 3) {
     1173            Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
     1174                " animation option ?args...?\"", (char*)NULL);
     1175            return TCL_ERROR;
     1176        }
    11741177        if (strcmp(argv[2],"volumes") == 0) {
    11751178            vector<unsigned int> ivol;
     
    11771180                return TCL_ERROR;
    11781181            }
    1179 
    11801182            NanoVis::vol_renderer->clearAnimatedVolumeInfo();
    1181 
    11821183            vector<unsigned int>::iterator iter;
    11831184            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    1184                 NanoVis::vol_renderer->addAnimatedVolume(NanoVis::volume[*iter], *iter);
    1185             }
    1186         }
    1187         else if (strcmp(argv[2],"start") == 0) {
    1188                 NanoVis::vol_renderer->startVolumeAnimation();
    1189         }
    1190         else if (strcmp(argv[2],"stop") == 0) {
     1185                NanoVis::vol_renderer->addAnimatedVolume(NanoVis::volume[*iter],
     1186                        *iter);
     1187            }
     1188        } else if (strcmp(argv[2],"start") == 0) {
     1189            NanoVis::vol_renderer->startVolumeAnimation();
     1190        } else if (strcmp(argv[2],"stop") == 0) {
    11911191                NanoVis::vol_renderer->stopVolumeAnimation();
    1192         }
    1193         else if (strcmp(argv[2],"clear") == 0) {
     1192        } else if (strcmp(argv[2],"clear") == 0) {
    11941193                NanoVis::vol_renderer->clearAnimatedVolumeInfo();
    1195         }
    1196 
    1197     }
    1198     else if ((c == 't') && (strcmp(argv[1],"test2") == 0)) {
     1194        } else {
     1195            Tcl_AppendResult(interp, "bad animation option \"", argv[2],
     1196                "\": should be volumes, start, stop,  or clear", (char*)NULL);
     1197            return TCL_ERROR;
     1198        }
     1199    } else if ((c == 't') && (strcmp(argv[1],"test2") == 0)) {
    11991200        NanoVis::volume[1]->disable_data();
    12001201        NanoVis::volume[1]->disable();
    1201         return TCL_OK;
    12021202    } else {
    12031203        Tcl_AppendResult(interp, "bad option \"", argv[1], "\": should be ",
     
    15841584        } else {
    15851585            Tcl_AppendResult(interp, "unknown option \"", argv[2], "\": ",
    1586                              "should be visible or color", (char *)NULL);
     1586                "should be visible or color", (char *)NULL);
    15871587            return TCL_ERROR;
    15881588        }
     
    16711671    } else {
    16721672        Tcl_AppendResult(interp, "bad option \"", argv[1],
    1673                 "\": should be data, linecontour, legend, or transfunc", (char*)NULL);
     1673                "\": should be data, linecontour, legend, or transfunc",
     1674                (char*)NULL);
    16741675        return TCL_ERROR;
    16751676    }
     
    17711772    }
    17721773    char c = argv[1][0];
    1773     if ((c == 'v') && (strcmp(argv[1],"visible") == 0)) {
     1774    if ((c == 'v') && (strcmp(argv[1], "visible") == 0)) {
    17741775        int ivisible;
    17751776
Note: See TracChangeset for help on using the changeset viewer.