Ignore:
Timestamp:
Jul 9, 2007 6:38:11 PM (17 years ago)
Author:
vrinside
Message:

modified controlling visibility of linecontour of heightmap

Location:
trunk/vizservers/nanovis
Files:
2 edited

Legend:

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

    r776 r779  
    4646        glEnable(GL_DEPTH_TEST);
    4747
    48     /*
    4948        if (_vertexBufferObjectID)
    5049        {
     
    8988                }
    9089        }
    91     */
    9290
    9391        glShadeModel(GL_FLAT);
  • trunk/vizservers/nanovis/nanovis.cpp

    r778 r779  
    11471147        //bytes
    11481148        vector<int> indices;
    1149         if (strcmp(argv[2],"on") == 0)
     1149        if (strcmp(argv[2],"visible") == 0)
    11501150        {
    1151             if (GetVolumeIndices(interp, argc-2, argv+2, &indices) != TCL_OK)
     1151            bool visible = !strcmp(argv[3], "true");
     1152           
     1153            if (GetIndices(interp, argc-4, argv+4, &indices) != TCL_OK)
    11521154            {
    1153                 return TCL_ERROR;
     1155               return TCL_ERROR;
    11541156            }
    11551157
     
    11581160                if ((indices[i] < g_heightMap.size()) && (g_heightMap[indices[i]] != NULL))
    11591161                {
    1160                     g_heightMap[indices[i]]->setVisible(true);
     1162                    g_heightMap[indices[i]]->setVisible(visible);
    11611163                }
    11621164            }
    11631165            return TCL_OK;
    11641166        }
    1165         else if (strcmp(argv[2],"off") == 0)
    1166         {
    1167             if (GetVolumeIndices(interp, argc-2, argv+2, &indices) != TCL_OK)
    1168             {
     1167        else if (c == 'f' && strcmp(argv[2],"follows") == 0) {
     1168            int nbytes;
     1169            if (Tcl_GetInt(interp, argv[3], &nbytes) != TCL_OK) {
    11691170                return TCL_ERROR;
    11701171            }
    1171 
    1172             for (int i = 0; i < indices.size(); ++i)
    1173             {
    1174                 if ((indices[i] < g_heightMap.size()) && (g_heightMap[indices[i]] != NULL))
    1175                 {
    1176                     g_heightMap[indices[i]]->setVisible(false);
    1177                 }
    1178             }
    1179             return TCL_OK;
    1180         }
    1181        
    1182        
    1183        
     1172        }
    11841173    }
    11851174    else if (c == 'l' && (strcmp(argv[1], "linecontour") == 0))
     
    11871176        //bytes
    11881177        vector<int> indices;
    1189         if (strcmp(argv[2],"on") == 0)
     1178        if (strcmp(argv[2],"visible") == 0)
    11901179        {
    1191             if (GetVolumeIndices(interp, argc-3, argv+3, &indices) != TCL_OK)
     1180           
     1181            bool visible = !(strcmp("true", argv[3]));
     1182            printf("heightmap linecontour visible %s\n", (visible)?"true":"false");
     1183            if (GetIndices(interp, argc-4, argv+4, &indices) != TCL_OK)
    11921184            {
    11931185                return TCL_ERROR;
     
    11961188            for (int i = 0; i < indices.size(); ++i)
    11971189            {
     1190                printf("heightmap index %d\n");
    11981191                if ((indices[i] < g_heightMap.size()) && (g_heightMap[indices[i]] != NULL))
    11991192                {
    1200                     g_heightMap[indices[i]]->setLineContourVisible(true);
     1193                    printf("heightmap index %d visible applied\n");
     1194                    g_heightMap[indices[i]]->setLineContourVisible(visible);
    12011195                }
    12021196            }
    12031197            return TCL_OK;
    12041198        }
    1205         else if (strcmp(argv[2],"off") == 0)
    1206         {
    1207             if (GetVolumeIndices(interp, argc-3, argv+3, &indices) != TCL_OK)
    1208             {
    1209                 return TCL_ERROR;
    1210             }
    1211 
    1212             for (int i = 0; i < indices.size(); ++i)
    1213             {
    1214                 if ((indices[i] < g_heightMap.size()) && (g_heightMap[indices[i]] != NULL))
    1215                 {
    1216                     g_heightMap[indices[i]]->setLineContourVisible(false);
    1217                 }
    1218             }
    1219             return TCL_OK;
    1220         }
    1221        
    1222         return TCL_OK;
    12231199    }
    12241200    else if (c == 't' && (strcmp(argv[1], "transfunc") == 0))
    12251201    {
    1226         TransferFunction *tf = get_transfunc((char*)argv[3]);
     1202        TransferFunction *tf = get_transfunc((char*)argv[2]);
    12271203        if (tf == NULL) {
    12281204            Tcl_AppendResult(interp, "transfer function \"", argv[3],
     
    14151391            return TCL_ERROR;
    14161392        }
    1417         if (ivol < 0 || ivol >= volume.size()) {
    1418             Tcl_AppendResult(interp, "bad volume index \"", argv[n],
    1419                     "\"", (char*)NULL);
    1420                 return TCL_ERROR;
    1421         }
     1393        vectorPtr->push_back(ivol);
    14221394    }
    14231395    return TCL_OK;
Note: See TracChangeset for help on using the changeset viewer.