Ignore:
Timestamp:
Sep 16, 2008 8:54:52 AM (16 years ago)
Author:
vrinside
Message:

added new function calls for the 2d-contour lines of heightmaps

Location:
trunk/packages/vizservers/nanovis
Files:
3 edited

Legend:

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

    r1111 r1156  
    21182118
    21192119static int
     2120HeightMapTopView(ClientData data, Tcl_Interp *interp, int objc,
     2121                Tcl_Obj *const *objv)
     2122{
     2123
     2124    // the variables below should be reassigned
     2125    int heightmap_index = 0;
     2126    int image_width = 512;
     2127    int image_height = 512;
     2128    HeightMap* heightmap = 0;
     2129
     2130    // HELP ME
     2131    // GEORGE
     2132
     2133
     2134    NanoVis::render_2d_contour(heightmap, image_width, image_height);
     2135   
     2136    return TCL_OK;
     2137}
     2138
     2139static int
    21202140HeightMapTestOp(ClientData cdata, Tcl_Interp *interp, int objc,
    21212141                Tcl_Obj *const *objv)
     
    21842204    {"test",         2, HeightMapTestOp,        2, 2, "",},
    21852205    {"transfunc",    2, HeightMapTransFuncOp,   3, 0, "name ?indices?",},
     2206
     2207    // HELP ME
     2208    // GOERGE
     2209    {"topview",      1, HeightMapTopView,     3, 3, "model",},
    21862210};
    21872211static int nHeightMapOps = NumCmdSpecs(heightMapOps);
     
    26982722#endif
    26992723}
     2724
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r1111 r1156  
    20612061}
    20622062
     2063int
     2064NanoVis::render_2d_contour(HeightMap* heightmap, int width, int height)
     2065{
     2066    int old_width = win_width;
     2067    int old_height = win_height;
     2068
     2069    resize_offscreen_buffer(width, height);
     2070
     2071/*
     2072    plane_render->set_screen_size(width, height);
     2073
     2074    // generate data for the legend
     2075    float data[512];
     2076    for (int i=0; i < 256; i++) {
     2077        data[i] = data[i+256] = (float)(i/255.0);
     2078    }
     2079    plane[0] = new Texture2D(256, 2, GL_FLOAT, GL_LINEAR, 1, data);
     2080    int index = plane_render->add_plane(plane[0], tf);
     2081    plane_render->set_active_plane(index);
     2082
     2083    offscreen_buffer_capture();
     2084    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear screen
     2085
     2086    //plane_render->render();
     2087    // INSOO : is going to implement here for the topview of the heightmap
     2088    heightmap->render(renderContext);
     2089
     2090    // INSOO
     2091    glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, screen_buffer);
     2092    //glReadPixels(0, 0, width, height, GL_BGR, GL_UNSIGNED_BYTE, screen_buffer); // INSOO's
     2093*/
     2094
     2095
     2096    // HELP ME
     2097    // GEORGE
     2098    // I am not sure what I should do
     2099    //char prefix[200];
     2100    //sprintf(prefix, "nv>height_top_view %s %g %g", volArg, min, max);
     2101    //ppm_write(prefix);
     2102    //write(0, "\n", 1);
     2103   
     2104
     2105
     2106
     2107    //plane_render->remove_plane(index);
     2108   
     2109    resize_offscreen_buffer(old_width, old_height);
     2110
     2111    return TCL_OK;
     2112}
  • trunk/packages/vizservers/nanovis/nanovis.h

    r1111 r1156  
    164164    static Volume *load_volume(int index, int width, int height, int depth,
    165165        int n, float* data, double vmin, double vmax, double nzero_min);
     166    static int render_2d_contour(HeightMap* heightmap, int width, int height);
     167
    166168#ifndef XINETD
    167169    static void keyboard(unsigned char key, int x, int y);
Note: See TracChangeset for help on using the changeset viewer.