Ignore:
Timestamp:
May 27, 2009, 6:53:54 PM (15 years ago)
Author:
gah
Message:

change unirect?d parsing for flows to not call Tcl command

File:
1 edited

Legend:

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

    r1434 r1472  
    19291929
    19301930#ifdef NEW_FLOW_ENGINE
    1931     switch (key)
    1932     {
    1933         case 'a' :
    1934                 {
    1935                         printf("flowvis active\n");
    1936                         NanoVis::flowVisRenderer->active(true);
    1937                         NanoVis::licRenderer->active(true);
    1938                 }
    1939                 break;
    1940         case 'd' :
    1941                 {
    1942                         printf("flowvis deactived\n");
    1943                         NanoVis::flowVisRenderer->active(false);
    1944                         NanoVis::licRenderer->active(false);
    1945                 }
    1946                 break;
    1947         case '1' :
    1948                 {
    1949                         addVectorField("/home/iwoo/projects/nanovis/rappture/packages/vizservers/nanovis/data/flowvis_dx_files/jwire/J-wire-vec.dx",
    1950                                         "vf_name2", "plane_name1", "plane_name2", Vector4(0, 0, 1, 1), Vector4(0, 1, 1, 1));
    1951                         printf("add vector field\n");
    1952                 }
    1953                 break;
    1954         case '2' :
    1955                 {
    1956                         printf("add vector field\n");
    1957                         addVectorField("/home/iwoo/projects/nanovis/rappture/packages/vizservers/nanovis/data/flowvis_dx_files/3DWireLeakage/SiO2/SiO2.dx",
    1958                                         "vf_name1", "plane_name1", "plane_name2", Vector4(1, 0, 0, 1), Vector4(1, 1, 0, 1));
    1959                 }
    1960                 break;
    1961         case '3':
    1962                 {
    1963                         printf("activate\n");
    1964                         NanoVis::flowVisRenderer->activatePlane("vf_name1", "plane_name2");
    1965                 }
    1966                 break;
    1967         case '4' :
    1968                 {
    1969                         printf("deactivate\n");
    1970                         NanoVis::flowVisRenderer->deactivatePlane("vf_name1", "plane_name2");
    1971                 }
    1972                 break;
    1973         case '5' :
    1974 86              {
    1975 a                       printf("vector field deleted (vf_name2)\n");
    1976                         NanoVis::flowVisRenderer->removeVectorField("vf_name2");
    1977                 }
    1978                 break;
    1979         case '6' :
    1980                 {
    1981                         printf("add device shape\n");
    1982                         NvDeviceShape shape;
    1983                         shape.min.set(0, 0, 0);
    1984                         shape.max.set(30, 3, 3);
    1985                         shape.color.set(1, 0, 0, 1);
    1986                         NanoVis::flowVisRenderer->addDeviceShape("vf_name1", "device1", shape);
    1987                         shape.min.set(0, -1, -1);
    1988                         shape.max.set(30, 4, 4);
    1989                         shape.color.set(0, 1, 0, 1);
    1990                         NanoVis::flowVisRenderer->addDeviceShape("vf_name1", "device2", shape);
    1991                         shape.min.set(10, -1.5, -1);
    1992                         shape.max.set(20, 4.5, 4.5);
    1993                         shape.color.set(0, 0, 1, 1);
    1994                         NanoVis::flowVisRenderer->addDeviceShape("vf_name1", "device3", shape);
    1995                         NanoVis::flowVisRenderer->activateDeviceShape("vf_name1");
    1996                 }
    1997                 break;
    1998         case '7' :
    1999                 {
    2000                         printf("hide shape \n");
    2001                         NanoVis::flowVisRenderer->deactivateDeviceShape("vf_name1");
    2002                 }
    2003                 break;
    2004         case '8' :
    2005                 {
    2006                         printf("show shape\n");
    2007                         NanoVis::flowVisRenderer->activateDeviceShape("vf_name1");
    2008                 }
    2009                 break;
    2010         case '9' :
    2011                 {
    2012                         printf("show a shape \n");
    2013                         NanoVis::flowVisRenderer->activateDeviceShape("vf_name1", "device3");
    2014                 }
    2015                 break;
    2016         case '0' :
    2017                 {
    2018                         printf("delete a shape \n");
    2019                         NanoVis::flowVisRenderer->deactivateDeviceShape("vf_name1", "device3");
    2020                 }
    2021                 break;
    2022         case 'r' :
    2023                 {
    2024                         NanoVis::flowVisRenderer->reset();
    2025                         NanoVis::licRenderer->reset();
    2026                         printf("reset \n");
    2027                 }
    2028                 break;
     1931    switch (key) {
     1932    case 'a' :
     1933        {
     1934            printf("flowvis active\n");
     1935            char cmd[] = {
     1936                "foreach flow [flow names] {\n"
     1937                "    $flow configure -hide no -slice yes\n"
     1938                "}\n"
     1939            };
     1940            Tcl_Eval(interp, cmd);
     1941#ifdef notdef
     1942            NanoVis::flowVisRenderer->active(true);
     1943            NanoVis::licRenderer->active(true);
     1944#endif
    20291945        }
     1946        break;
     1947    case 'd' :
     1948        {
     1949            printf("flowvis deactived\n");
     1950            char cmd[] = {
     1951                "foreach flow [flow names] {\n"
     1952                "    $flow configure -hide yes -slice no\n"
     1953                "}\n"
     1954            };
     1955#ifdef notdef
     1956            NanoVis::flowVisRenderer->active(false);
     1957            NanoVis::licRenderer->active(false);
     1958#endif
     1959        }
     1960        break;
     1961    case '1' :
     1962        {
     1963            printf("add vector field\n");
     1964            char cmd[] = {
     1965                "flow create flow1\n"
     1966                "flow1 data file /home/iwoo/projects/nanovis/rappture/packages/vizservers/nanovis/data/flowvis_dx_files/jwire/J-wire-vec.dx 3\n"
     1967                "flow1 particles add plane1 -color { 0 0 1 1 }\n"
     1968                "flow1 particles add plane2 -color { 0 1 1 1 }\n"
     1969            };
     1970            Tcl_Eval(interp, cmd);
     1971#ifdef notdef
     1972            addVectorField("/home/iwoo/projects/nanovis/rappture/packages/vizservers/nanovis/data/flowvis_dx_files/jwire/J-wire-vec.dx",
     1973                           "vf_name2", "plane_name1", "plane_name2", Vector4(0, 0, 1, 1), Vector4(0, 1, 1, 1));
     1974#endif
     1975        }
     1976        break;
     1977    case '2' :
     1978        {
     1979            char cmd[] = {
     1980                "flow create flow2\n"
     1981                "flow2 data file /home/iwoo/projects/nanovis/rappture/packages/vizservers/nanovis/data/flowvis_dx_files/3DWireLeakage/SiO2/SiO2.dx 3\n"
     1982                "flow2 particles add plane1 -color { 1 0 0 1 }\n"
     1983                "flow2 particles add plane2 -color { 1 1 0 1 }\n"
     1984            };
     1985            Tcl_Eval(interp, cmd);
     1986            printf("add vector field\n");
     1987            addVectorField("/home/iwoo/projects/nanovis/rappture/packages/vizservers/nanovis/data/flowvis_dx_files/3DWireLeakage/SiO2/SiO2.dx",
     1988                           "vf_name1", "plane_name1", "plane_name2", Vector4(1, 0, 0, 1), Vector4(1, 1, 0, 1));
     1989        }
     1990        break;
     1991    case '3':
     1992        {
     1993            printf("activate\n");
     1994            char cmd[] = {
     1995                "flow1 particles add plane2 -hide no\n"
     1996            };
     1997            Tcl_Eval(interp, cmd);
     1998#ifdef notdef
     1999            NanoVis::flowVisRenderer->activatePlane("vf_name1", "plane_name2");
     2000#endif
     2001        }
     2002        break;
     2003    case '4' :
     2004        {
     2005            printf("deactivate\n");
     2006            char cmd[] = {
     2007                "flow1 particles add plane2 -hide yes\n"
     2008            };
     2009            Tcl_Eval(interp, cmd);
     2010#ifdef notdef
     2011            NanoVis::flowVisRenderer->deactivatePlane("vf_name1", "plane_name2");
     2012#endif
     2013        }
     2014        break;
     2015    case '5' :
     2016        {
     2017            printf("vector field deleted (vf_name2)\n");
     2018            char cmd[] = {
     2019                "flow delete flow2\n"
     2020            };
     2021            Tcl_Eval(interp, cmd);
     2022#ifdef notdef
     2023            NanoVis::flowVisRenderer->removeVectorField("vf_name2");
     2024#endif
     2025        }
     2026        break;
     2027    case '6' :
     2028        {
     2029            printf("add device shape\n");
     2030            char cmd[] = {
     2031                "flow1 box add box1 -corner1 {0 0 0} -corner2 {30 3 3} -color { 1 0 0 1 }\n"
     2032                "flow1 box add box2 -corner1 {0 -1 -1} -corner2 {30 4 4} -color { 0 1 0 1 }\n"
     2033                "flow1 box add box3 -corner1 {10 -1.5 -1} -corner2 {20 4.5 4.5} -color { 0 0 1 1 }\n"
     2034            };
     2035            Tcl_Eval(interp, cmd);
     2036#ifdef notdef
     2037            NvDeviceShape shape;
     2038            shape.min.set(0, 0, 0);
     2039            shape.max.set(30, 3, 3);
     2040            shape.color.set(1, 0, 0, 1);
     2041            NanoVis::flowVisRenderer->addDeviceShape("vf_name1", "device1", shape);
     2042            shape.min.set(0, -1, -1);
     2043            shape.max.set(30, 4, 4);
     2044            shape.color.set(0, 1, 0, 1);
     2045            NanoVis::flowVisRenderer->addDeviceShape("vf_name1", "device2", shape);
     2046            shape.min.set(10, -1.5, -1);
     2047            shape.max.set(20, 4.5, 4.5);
     2048            shape.color.set(0, 0, 1, 1);
     2049            NanoVis::flowVisRenderer->addDeviceShape("vf_name1", "device3", shape);
     2050            NanoVis::flowVisRenderer->activateDeviceShape("vf_name1");
     2051#endif
     2052        }
     2053        break;
     2054    case '7' :
     2055        {
     2056            printf("hide shape \n");
     2057            char cmd[] = {
     2058                "flow1 box configure box1 -hide yes\n"
     2059            };
     2060            Tcl_Eval(interp, cmd);
     2061#ifdef notdef
     2062            NanoVis::flowVisRenderer->deactivateDeviceShape("vf_name1");
     2063#endif
     2064        }
     2065        break;
     2066    case '8' :
     2067        {
     2068            printf("show shape\n");
     2069            char cmd[] = {
     2070                "flow1 box configure box1 -hide no\n"
     2071            };
     2072            Tcl_Eval(interp, cmd);
     2073#ifdef notdef
     2074            NanoVis::flowVisRenderer->activateDeviceShape("vf_name1");
     2075#endif
     2076        }
     2077        break;
     2078    case '9' :
     2079        {
     2080            printf("show a shape \n");
     2081            char cmd[] = {
     2082                "flow1 box configure box3 -hide no\n"
     2083            };
     2084            Tcl_Eval(interp, cmd);
     2085#ifdef notdef
     2086            NanoVis::flowVisRenderer->activateDeviceShape("vf_name1", "device3");
     2087#endif
     2088        }
     2089        break;
     2090    case '0' :
     2091        {
     2092            printf("delete a shape \n");
     2093            char cmd[] = {
     2094                "flow1 box delete box3\n"
     2095            };
     2096            Tcl_Eval(interp, cmd);
     2097#ifdef notdef
     2098            NanoVis::flowVisRenderer->deactivateDeviceShape("vf_name1", "device3");
     2099#endif
     2100        }
     2101        break;
     2102    case 'r' :
     2103        {
     2104            printf("reset \n");
     2105            char cmd[] = {
     2106                "flow reset\n"
     2107            };
     2108            Tcl_Eval(interp, cmd);
     2109#ifdef notdef
     2110            NanoVis::flowVisRenderer->reset();
     2111            NanoVis::licRenderer->reset();
     2112#endif
     2113        }
     2114        break;
     2115    }
    20302116#endif
    20312117}
     
    20902176#endif
    20912177
     2178#ifdef notdef
    20922179    if ((NanoVis::flowVisRenderer != NULL) && (NanoVis::flowVisRenderer->active())) {
    20932180        NanoVis::flowVisRenderer->advect();
    20942181    }
    2095 
     2182#endif
    20962183    NanoVis::update();
    20972184    display();
Note: See TracChangeset for help on using the changeset viewer.