Changeset 871 for trunk


Ignore:
Timestamp:
Feb 8, 2008, 10:04:12 AM (17 years ago)
Author:
vrinside
Message:

made volume renderer generate more slices for iso-surface rendering and finish the command callback function for it.

Location:
trunk/vizservers/nanovis
Files:
2 edited

Legend:

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

    r869 r871  
    10691069            }
    10701070        } else if ((c == 'i') && (strcmp(argv[2], "isosurface") == 0)) {
    1071             //vector<unsigned int> ivol;
    1072             //if (GetVolumeIndices(interp, argc-3, argv+3, &ivol) != TCL_OK)
    1073             //{
    1074             //                  return TCL_ERROR;
    1075             //  }
     1071
     1072            if (argc < 4) {
     1073                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;
     1089            for (iter = ivol.begin(); iter != ivol.end(); iter++) {
     1090                NanoVis::volume[*iter]->set_isosurface(iso_surface);
     1091            }
    10761092        }
    10771093        else {
  • trunk/vizservers/nanovis/VolumeRenderer.cpp

    r825 r871  
    159159    int volume_index = i;
    160160    int n_slices = volume[volume_index]->get_n_slice();
     161    if (volume[volume_index]->get_isosurface())
     162    {
     163                // double the number of slices
     164        n_slices <<= 1;
     165        }
    161166
    162167    //volume start location
Note: See TracChangeset for help on using the changeset viewer.