Ignore:
Timestamp:
Feb 12, 2008, 11:41:22 AM (17 years ago)
Author:
gah
Message:

isosurface protocol changes

File:
1 edited

Legend:

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

    r871 r877  
    2222 */
    2323
     24/*
     25 * TODO:  In no particular order...
     26 *        o Convert to Tcl_CmdObj interface.
     27 *        o Use Tcl command option parser to reduce size of procedures, remove
     28 *          lots of extra error checking code.
     29 *        o Convert GetVolumeIndices to GetVolumes.  Goal is to remove
     30 *          all references of Nanovis::volume[] from this file.  Don't
     31 *          want to know how volumes are stored. Same for heightmaps.
     32 *        o Rationalize volume id scheme. Right now it's the index in
     33 *          the vector. 1) Use a list instead of a vector. 2) carry
     34 *          an id field that's a number that gets incremented each new volume.
     35 *        o Create R2, matrix, etc. libraries.
     36 */
    2437
    2538#include "Command.h"
     
    7689extern PlaneRenderer* plane_render;
    7790extern Texture2D* plane[10];
    78 
    7991
    8092extern Rappture::Outcome load_volume_stream(int index, std::iostream& fin);
     
    134146static int GetVolumeIndices(Tcl_Interp *interp, int argc, const char *argv[],
    135147        vector<unsigned int>* vectorPtr);
     148static int GetVolumes(Tcl_Interp *interp, int argc, const char *argv[],
     149        vector<Volume *>* vectorPtr);
    136150static int GetVolume(Tcl_Interp *interp, const char *string,
    137151        Volume **volPtrPtr);
     
    149163        int argc, const char *argv[]);
    150164
    151 
    152165static int
    153166GetFloat(Tcl_Interp *interp, const char *string, float *valuePtr)
     
    275288        NanoVis::zoom(zoom);
    276289    } else {
    277         Tcl_AppendResult(interp, "bad option \"", argv[1],
     290        Tcl_AppendResult(interp, "bad camera option \"", argv[1],
    278291                     "\": should be aim, angle, or zoom", (char*)NULL);
    279292        return TCL_ERROR;
     
    299312{
    300313#ifdef XINETD
    301     int old_win_width = NanoVis::win_width;
    302     int old_win_height = NanoVis::win_height;
    303 
    304314    NanoVis::resize_offscreen_buffer(1024, 1024);
    305315    NanoVis::cam->set_screen_size(30, 90, 1024 - 60, 1024 - 120);
     
    327337    }
    328338    */
    329 
    330 
    331 /*
    332     NanoVis::read_screen();
    333     glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
    334 
    335     NanoVis::bmp_write("nv>screenshot -bytes");
    336 
    337     //NanoVis::bmp_write_to_file();
    338    
    339     NanoVis::resize_offscreen_buffer(old_win_width, old_win_height);
    340 */
    341    
    342339#endif
    343340
     
    388385        }
    389386
    390         vector<unsigned int> ivol;
    391         if (GetVolumeIndices(interp, argc-4, argv+4, &ivol) != TCL_OK) {
     387        vector<Volume *> ivol;
     388        if (GetVolumes(interp, argc-4, argv+4, &ivol) != TCL_OK) {
    392389            return TCL_ERROR;
    393390        }
    394391        if (state) {
    395             vector<unsigned int>::iterator iter;
     392            vector<Volume *>::iterator iter;
    396393            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    397                 NanoVis::volume[*iter]->enable_cutplane(axis);
     394                (*iter)->enable_cutplane(axis);
    398395            }
    399396        } else {
    400             vector<unsigned int>::iterator iter;
     397            vector<Volume *>::iterator iter;
    401398            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    402                 NanoVis::volume[*iter]->disable_cutplane(axis);
     399                (*iter)->disable_cutplane(axis);
    403400            }
    404401        }
     
    414411            return TCL_ERROR;
    415412        }
     413
    416414        // keep this just inside the volume so it doesn't disappear
    417415        if (relval < 0.01f) {
     
    426424        }
    427425
    428         vector<unsigned int> ivol;
    429         if (GetVolumeIndices(interp, argc - 4, argv + 4, &ivol) != TCL_OK) {
     426        vector<Volume *> ivol;
     427        if (GetVolumes(interp, argc - 4, argv + 4, &ivol) != TCL_OK) {
    430428            return TCL_ERROR;
    431429        }
    432         vector<unsigned int>::iterator iter;
     430        vector<Volume *>::iterator iter;
    433431        for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    434             NanoVis::volume[*iter]->move_cutplane(axis, relval);
     432            (*iter)->move_cutplane(axis, relval);
    435433        }
    436434    } else {
     
    462460    }
    463461
    464     Volume *vol;
    465     if (GetVolume(interp, argv[1], &vol) != TCL_OK) {
     462    Volume *volPtr;
     463    if (GetVolume(interp, argv[1], &volPtr) != TCL_OK) {
    466464        return TCL_ERROR;
    467465    }
    468466    TransferFunction *tf;
    469     tf = NanoVis::vol_renderer->get_volume_shading(vol);
     467    tf = NanoVis::vol_renderer->get_volume_shading(volPtr);
    470468    if (tf == NULL) {
    471469        Tcl_AppendResult(interp, "no transfer function defined for volume \"",
     
    479477        return TCL_ERROR;
    480478    }
    481     NanoVis::render_legend(tf, vol->range_min(), vol->range_max(), width, height,
    482         argv[1]);
     479    NanoVis::render_legend(tf, volPtr->range_min(), volPtr->range_max(),
     480        width, height, argv[1]);
    483481    return TCL_OK;
    484482}
     
    704702        if (argc < 3) {
    705703            Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    706                 argv[1], " option ?arg arg...?\"", (char*)NULL);
     704                " axis option ?arg arg...?\"", (char*)NULL);
    707705            return TCL_ERROR;
    708706        }
     
    711709            if (argc < 4) {
    712710                Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    713                     argv[1], " label x|y|z string ?volume ...?\"", (char*)NULL);
    714                 return TCL_ERROR;
    715             }
    716 
     711                    " axis label x|y|z string ?volume ...?\"", (char*)NULL);
     712                return TCL_ERROR;
     713            }
    717714            int axis;
    718715            if (GetAxis(interp, (char*)argv[3], &axis) != TCL_OK) {
    719716                return TCL_ERROR;
    720717            }
    721 
    722             vector<unsigned int> ivol;
    723             if (GetVolumeIndices(interp, argc - 5, argv + 5, &ivol) != TCL_OK) {
    724                 return TCL_ERROR;
    725             }
    726 
    727             vector<unsigned int>::iterator iter;
     718            vector<Volume *> ivol;
     719            if (GetVolumes(interp, argc - 5, argv + 5, &ivol) != TCL_OK) {
     720                return TCL_ERROR;
     721            }
     722            vector<Volume *>::iterator iter;
    728723            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    729                 NanoVis::volume[*iter]->set_label(axis, argv[4]);
     724                (*iter)->set_label(axis, argv[4]);
    730725            }
    731726        } else {
    732727            Tcl_AppendResult(interp, "bad option \"", argv[2],
    733                              "\": should be label", (char*)NULL);
    734             return TCL_ERROR;
    735         }
    736     }
    737     else if ((c == 'd') && (strcmp(argv[1],"data") == 0)) {
     728                "\": should be label", (char*)NULL);
     729            return TCL_ERROR;
     730        }
     731    } else if ((c == 'd') && (strcmp(argv[1],"data") == 0)) {
    738732        if (argc < 3) {
    739733            Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    740                 argv[1], " option ?arg arg...?\"", (char*)NULL);
     734                " data option ?arg arg...?\"", (char*)NULL);
    741735            return TCL_ERROR;
    742736        }
     
    745739            if (argc < 4) {
    746740                Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    747                     argv[1], " state on|off ?volume ...?\"", (char*)NULL);
     741                    " data state on|off ?volume ...?\"", (char*)NULL);
    748742                return TCL_ERROR;
    749743            }
     
    752746                return TCL_ERROR;
    753747            }
    754             vector<unsigned int> ivol;
    755             if (GetVolumeIndices(interp, argc-4, argv+4, &ivol) != TCL_OK) {
    756                 return TCL_ERROR;
    757             }
    758             vector<unsigned int>::iterator iter = ivol.begin();
    759             while (iter != ivol.end()) {
    760                 if(NanoVis::volume[*iter] != 0) {
    761                     if (state) {
    762                         NanoVis::volume[*iter]->enable_data();
    763                     } else {
    764                         NanoVis::volume[*iter]->disable_data();
    765                     }
    766 
    767                     // TBD..
    768                     // POINTSET
    769                     /*
    770                     if (NanoVis::volume[*iter]->pointsetIndex != -1)
    771                     {
    772                         g_pointSet[volume[*iter]->pointsetIndex]->setVisible(state);
    773                     }
    774                     */
    775                 }
    776                 ++iter;
    777             }
    778         } else if (c == 'f' && strcmp(argv[2],"follows") == 0) {
     748            vector<Volume *> ivol;
     749            if (GetVolumes(interp, argc-4, argv+4, &ivol) != TCL_OK) {
     750                return TCL_ERROR;
     751            }
     752            if (state) {
     753                vector<Volume *>::iterator iter;
     754                for (iter = ivol.begin(); iter != ivol.end(); iter++) {
     755                    (*iter)->enable_data();
     756                }
     757            } else {
     758                vector<Volume *>::iterator iter;
     759                for (iter = ivol.begin(); iter != ivol.end(); iter++) {
     760                    (*iter)->disable_data();
     761                }
     762            }
     763        } else if (c == 'f' && strcmp(argv[2], "follows") == 0) {
     764            if (argc < 4) {
     765                Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
     766                    " data follows size", (char*)NULL);
     767                return TCL_ERROR;
     768            }
    779769            printf("Data Loading\n");
    780             //fflush(stdout);
    781             //return TCL_OK;
     770            fflush(stdout);
    782771
    783772            int nbytes;
     
    808797            fread(b, buf.size(), 1, fp);
    809798            fclose(fp);
    810 #endif
     799#endif  /*_LOCAL_ZINC_TEST_*/
    811800            printf("Checking header[%s]\n", header);
    812801            fflush(stdout);
     
    824813#else
    825814                vol = NvZincBlendeReconstructor::getInstance()->loadFromMemory((void*) buf.bytes());
    826 #endif
     815#endif  /*_LOCAL_ZINC_TEST_*/
    827816
    828817                printf("finish loading\n");
     
    860849                }
    861850*/
    862 #endif
     851#endif  /*__TEST_CODE__*/
    863852            } else {
    864853                Rappture::Outcome err;
     
    875864                }
    876865            }
    877            
    878866
    879867            //
     
    893881                NanoVis::vol_renderer->add_volume(NanoVis::volume[n],NanoVis::get_transfunc("default"));
    894882            }
     883
     884            {
     885                Volume *volPtr;
     886                char info[1024];
     887                float vmin, vmax, min, max;
     888
     889                volPtr = NanoVis::volume[n];
     890                vmin = min = volPtr->range_min();
     891                vmax = max = volPtr->range_max();
     892                for (int i = 0; i < NanoVis::n_volumes; i++) {
     893                    if (NanoVis::volume[i] == NULL) {
     894                        continue;
     895                    }
     896                    volPtr = NanoVis::volume[i];
     897                    if (vmin > volPtr->range_min()) {
     898                        vmin = volPtr->range_min();
     899                    }
     900                    if (vmax < volPtr->range_max()) {
     901                        vmax = volPtr->range_max();
     902                    }
     903                }
     904                sprintf(info, "nv>data id %d min %g max %g vmin %g vmax %g\n",
     905                        n, min, max, vmin, vmax);
     906                write(0, info, strlen(info));
     907            }
    895908        } else {
    896             Tcl_AppendResult(interp, "bad option \"", argv[2],
    897                              "\": should be follows or state", (char*)NULL);
     909            Tcl_AppendResult(interp, "bad data option \"", argv[2],
     910                "\": should be follows or state", (char*)NULL);
    898911            return TCL_ERROR;
    899912        }
     
    901914        if (argc < 3) {
    902915            Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    903                 argv[1], " option ?arg arg...?\"", (char*)NULL);
     916                " outline option ?arg arg...?\"", (char*)NULL);
    904917            return TCL_ERROR;
    905918        }
     
    908921            if (argc < 3) {
    909922                Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    910                     argv[1], " state on|off ?volume ...? \"", (char*)NULL);
     923                    " outline state on|off ?volume ...? \"", (char*)NULL);
    911924                return TCL_ERROR;
    912925            }
     
    916929                return TCL_ERROR;
    917930            }
    918             vector<unsigned int> ivol;
    919             if (GetVolumeIndices(interp, argc-4, argv+4, &ivol) != TCL_OK) {
     931            vector<Volume *> ivol;
     932            if (GetVolumes(interp, argc-4, argv+4, &ivol) != TCL_OK) {
    920933                return TCL_ERROR;
    921934            }
    922935            if (state) {
    923                 vector<unsigned int>::iterator iter;
     936                vector<Volume *>::iterator iter;
    924937                for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    925                     NanoVis::volume[*iter]->enable_outline();
     938                    (*iter)->enable_outline();
    926939                }
    927940            } else {
    928                 vector<unsigned int>::iterator iter;
     941                vector<Volume *>::iterator iter;
    929942                for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    930                     NanoVis::volume[*iter]->disable_outline();
     943                    (*iter)->disable_outline();
    931944                }
    932945            }
     
    953966            if (argc < 3) {
    954967                Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    955                     argv[1], " color {R G B} ?volume ...? \"", (char*)NULL);
     968                    " outline color {R G B} ?volume ...? \"", (char*)NULL);
    956969                return TCL_ERROR;
    957970            }
     
    960973                return TCL_ERROR;
    961974            }
    962             vector<unsigned int> ivol;
    963             if (GetVolumeIndices(interp, argc - 4, argv + 4, &ivol) != TCL_OK) {
    964                 return TCL_ERROR;
    965             }
    966             vector<unsigned int>::iterator iter;
     975            vector<Volume *> ivol;
     976            if (GetVolumes(interp, argc - 4, argv + 4, &ivol) != TCL_OK) {
     977                return TCL_ERROR;
     978            }
     979            vector<Volume *>::iterator iter;
    967980            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    968                 NanoVis::volume[*iter]->set_outline_color(rgb);
     981                (*iter)->set_outline_color(rgb);
    969982            }
    970983        }
    971984        else {
    972             Tcl_AppendResult(interp, "bad option \"", argv[2],
    973                              "\": should be color or state", (char*)NULL);
    974             return TCL_ERROR;
    975             }
     985            Tcl_AppendResult(interp, "bad outline option \"", argv[2],
     986                "\": should be color, visible, or state", (char*)NULL);
     987            return TCL_ERROR;
     988        }
    976989    } else if ((c == 's') && (strcmp(argv[1],"shading") == 0)) {
    977990        if (argc < 3) {
    978991            Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    979                 argv[1], " option ?arg arg...?\"", (char*)NULL);
     992                " shading option ?arg arg...?\"", (char*)NULL);
    980993            return TCL_ERROR;
    981994        }
     
    984997            if (argc < 4) {
    985998                Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    986                     argv[1], " transfunc name ?volume ...?\"", (char*)NULL);
     999                    " shading transfunc name ?volume ...?\"", (char*)NULL);
    9871000                return TCL_ERROR;
    9881001            }
     
    9941007                return TCL_ERROR;
    9951008            }
    996             vector<unsigned int> ivol;
    997             if (GetVolumeIndices(interp, argc-4, argv+4, &ivol) != TCL_OK) {
    998                 return TCL_ERROR;
    999             }
    1000 
    1001             vector<unsigned int>::iterator iter = ivol.begin();
    1002             while (iter != ivol.end())
    1003             {
    1004                 NanoVis::vol_renderer->shade_volume(NanoVis::volume[*iter], tf);
     1009            vector<Volume *> ivol;
     1010            if (GetVolumes(interp, argc-4, argv+4, &ivol) != TCL_OK) {
     1011                return TCL_ERROR;
     1012            }
     1013            vector<Volume *>::iterator iter;
     1014            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
     1015                NanoVis::vol_renderer->shade_volume(*iter, tf);
    10051016                // TBD..
    10061017                // POINTSET
    10071018                /*
    1008                 if (NanoVis::volume[*iter] && NanoVis::volume[*iter]->pointsetIndex != -1)
    1009                 {
    1010                     g_pointSet[NanoVis::volume[*iter]->pointsetIndex]->updateColor(tf->getData(), 256);
     1019                if ((*iter)->pointsetIndex != -1) {
     1020                    g_pointSet[(*iter)->pointsetIndex]->updateColor(tf->getData(), 256);
    10111021                }
    10121022                */
    1013                 ++iter;
    10141023            }
    10151024        } else if ((c == 'd') && (strcmp(argv[2], "diffuse") == 0)) {
    10161025            if (argc < 4) {
    10171026                Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    1018                     argv[1], " diffuse value ?volume ...?\"", (char*)NULL);
     1027                    " shading diffuse value ?volume ...?\"", (char*)NULL);
    10191028                return TCL_ERROR;
    10201029            }
     
    10241033                return TCL_ERROR;
    10251034            }
    1026             vector<unsigned int> ivol;
    1027             if (GetVolumeIndices(interp, argc-4, argv+4, &ivol) != TCL_OK) {
    1028                 return TCL_ERROR;
    1029             }
    1030             vector<unsigned int>::iterator iter;
     1035            vector<Volume *> ivol;
     1036            if (GetVolumes(interp, argc-4, argv+4, &ivol) != TCL_OK) {
     1037                return TCL_ERROR;
     1038            }
     1039            vector<Volume *>::iterator iter;
    10311040            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    1032                 NanoVis::volume[*iter]->set_diffuse(diffuse);
     1041                (*iter)->set_diffuse(diffuse);
    10331042            }
    10341043        } else if ((c == 'o') && (strcmp(argv[2], "opacity") == 0)) {
    10351044            if (argc < 4) {
    10361045                Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    1037                     argv[1], " opacity value ?volume ...?\"", (char*)NULL);
     1046                    " shading opacity value ?volume ...?\"", (char*)NULL);
    10381047                return TCL_ERROR;
    10391048            }
     
    10421051                return TCL_ERROR;
    10431052            }
    1044             vector<unsigned int> ivol;
    1045             if (GetVolumeIndices(interp, argc-4, argv+4, &ivol) != TCL_OK) {
    1046                 return TCL_ERROR;
    1047             }
    1048             vector<unsigned int>::iterator iter;
     1053            vector<Volume *> ivol;
     1054            if (GetVolumes(interp, argc-4, argv+4, &ivol) != TCL_OK) {
     1055                return TCL_ERROR;
     1056            }
     1057            vector<Volume *>::iterator iter;
    10491058            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    1050                 NanoVis::volume[*iter]->set_opacity_scale(opacity);
     1059                (*iter)->set_opacity_scale(opacity);
    10511060            }
    10521061        } else if ((c == 's') && (strcmp(argv[2], "specular") == 0)) {
    10531062            if (argc < 4) {
    10541063                Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    1055                     argv[1], " specular value ?volume ...?\"", (char*)NULL);
     1064                    " shading specular value ?volume ...?\"", (char*)NULL);
    10561065                return TCL_ERROR;
    10571066            }
     
    10601069                return TCL_ERROR;
    10611070            }
    1062             vector<unsigned int> ivol;
    1063             if (GetVolumeIndices(interp, argc-4, argv+4, &ivol) != TCL_OK) {
    1064                 return TCL_ERROR;
    1065             }
    1066             vector<unsigned int>::iterator iter;
     1071            vector<Volume *> ivol;
     1072            if (GetVolumes(interp, argc-4, argv+4, &ivol) != TCL_OK) {
     1073                return TCL_ERROR;
     1074            }
     1075            vector<Volume *>::iterator iter;
    10671076            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    1068                 NanoVis::volume[*iter]->set_specular(specular);
     1077                (*iter)->set_specular(specular);
    10691078            }
    10701079        } else if ((c == 'i') && (strcmp(argv[2], "isosurface") == 0)) {
    1071 
    10721080            if (argc < 4) {
    10731081                Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    1074                     argv[1], " isosurface value ?volume ...?\"", (char*)NULL);
    1075                 return TCL_ERROR;
    1076             }
    1077                         int iso_surface = 0;
    1078 
    1079                         if ((strcmp(argv[3], "true") == 0))
    1080                         {
    1081                                 iso_surface = 1;
    1082                         }
    1083 
    1084             vector<unsigned int> ivol;
    1085             if (GetVolumeIndices(interp, argc-4, argv+4, &ivol) != TCL_OK) {
    1086                 return TCL_ERROR;
    1087             }
    1088             vector<unsigned int>::iterator iter;
     1082                    " shading isosurface on|off ?volume ...?\"", (char*)NULL);
     1083                return TCL_ERROR;
     1084            }
     1085            int iso_surface = 0;
     1086            if (Tcl_GetBoolean(interp, argv[3], &iso_surface) != TCL_OK) {
     1087                return TCL_ERROR;
     1088            }
     1089            vector<Volume *> ivol;
     1090            if (GetVolumes(interp, argc-4, argv+4, &ivol) != TCL_OK) {
     1091                return TCL_ERROR;
     1092            }
     1093#ifndef notdef
     1094            vector<Volume *>::iterator iter;
    10891095            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
    1090                 NanoVis::volume[*iter]->set_isosurface(iso_surface);
    1091             }
    1092         }
    1093         else {
    1094             Tcl_AppendResult(interp, "bad option \"", argv[2], "\": should be ",
    1095                              "diffuse, opacity, specular, or transfunc", (char*)NULL);
     1096                (*iter)->set_isosurface(iso_surface);
     1097            }
     1098#endif
     1099        } else {
     1100            Tcl_AppendResult(interp, "bad shading option \"", argv[2],
     1101                "\": should be diffuse, opacity, specular, transfunc, or ",
     1102                "isosurface", (char*)NULL);
    10961103            return TCL_ERROR;
    10971104        }
     
    10991106        if (argc < 3) {
    11001107            Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
    1101                 argv[1], " on|off ?volume...?\"", (char*)NULL);
     1108                " state on|off ?volume...?\"", (char*)NULL);
    11021109            return TCL_ERROR;
    11031110        }
     
    11061113            return TCL_ERROR;
    11071114        }
    1108 
    1109         vector<unsigned int> ivol;
    1110         if (GetVolumeIndices(interp, argc-3, argv+3, &ivol) != TCL_OK) {
     1115        vector<Volume *> ivol;
     1116        if (GetVolumes(interp, argc-3, argv+3, &ivol) != TCL_OK) {
    11111117            return TCL_ERROR;
    11121118        }
    1113         vector<unsigned int>::iterator iter = ivol.begin();
    1114         while (iter != ivol.end()) {
    1115             if (state) {
    1116                 NanoVis::volume[*iter]->enable();
    1117             } else {
    1118                 NanoVis::volume[*iter]->disable();
    1119             }
    1120 
    1121             // TBD
    1122             // POINTSET
    1123             /*
    1124             if (volume[*iter]->pointsetIndex != -1)
    1125             {
    1126                 g_pointSet[volume[*iter]->pointsetIndex]->setVisible(state);
    1127             }
    1128             */
    1129             ++iter;
    1130         }
     1119        if (state) {
     1120            vector<Volume *>::iterator iter;
     1121            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
     1122                (*iter)->enable();
     1123            }
     1124        } else {
     1125            vector<Volume *>::iterator iter;
     1126            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
     1127                (*iter)->disable();
     1128            }
     1129        }
    11311130    } else if ((c == 't') && (strcmp(argv[1],"test2") == 0)) {
    11321131        NanoVis::volume[1]->disable_data();
     
    24892488        return TCL_ERROR;
    24902489    }
    2491    
    24922490    HeightMap* hMap;
    24932491    hMap = new HeightMap();
Note: See TracChangeset for help on using the changeset viewer.