Changeset 458 for trunk/gui/vizservers/nanovis/nanovis.cpp
- Timestamp:
- Jun 3, 2006, 8:01:33 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/vizservers/nanovis/nanovis.cpp
r457 r458 124 124 Texture2D* plane[10]; 125 125 126 // value indicates "up" axis: x=1, y=2, z=3, -x=-1, -y=-2, -z=-3 127 int updir = 2; 128 126 129 PerfQuery* perf; //perfromance counter 127 130 … … 157 160 static int ScreenCmd _ANSI_ARGS_((ClientData cdata, Tcl_Interp *interp, int argc, CONST84 char *argv[])); 158 161 static int TransfuncCmd _ANSI_ARGS_((ClientData cdata, Tcl_Interp *interp, int argc, CONST84 char *argv[])); 162 static int UpCmd _ANSI_ARGS_((ClientData cdata, Tcl_Interp *interp, int argc, CONST84 char *argv[])); 159 163 static int VolumeCmd _ANSI_ARGS_((ClientData cdata, Tcl_Interp *interp, int argc, CONST84 char *argv[])); 164 160 165 static int PlaneNewCmd _ANSI_ARGS_((ClientData cdata, Tcl_Interp *interp, int argc, CONST84 char *argv[])); 161 166 static int PlaneLinkCmd _ANSI_ARGS_((ClientData cdata, Tcl_Interp *interp, int argc, CONST84 char *argv[])); … … 582 587 "\": should be define", (char*)NULL); 583 588 return TCL_ERROR; 589 } 590 591 /* 592 * ---------------------------------------------------------------------- 593 * CLIENT COMMAND: 594 * up axis 595 * 596 * Clients use this to set the "up" direction for all volumes. Volumes 597 * are oriented such that this direction points upward. 598 * ---------------------------------------------------------------------- 599 */ 600 static int 601 UpCmd(ClientData cdata, Tcl_Interp *interp, int argc, CONST84 char *argv[]) 602 { 603 if (argc != 2) { 604 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], 605 " x|y|z|-x|-y|-z\"", (char*)NULL); 606 return TCL_ERROR; 607 } 608 609 int sign = 1; 610 char *axisName = argv[1]; 611 if (*axisName == '-') { 612 sign = -1; 613 axisName++; 614 } 615 616 int axis; 617 if (GetAxis(interp, axisName, &axis) != TCL_OK) { 618 return TCL_ERROR; 619 } 620 621 updir = (axis+1)*sign; 622 623 return TCL_OK; 584 624 } 585 625 … … 2111 2151 (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); 2112 2152 2153 // set the "up" direction for volumes 2154 Tcl_CreateCommand(interp, "up", UpCmd, 2155 (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); 2156 2113 2157 // manipulate volume data 2114 2158 Tcl_CreateCommand(interp, "volume", VolumeCmd, … … 2728 2772 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear screen 2729 2773 2730 if(volume_mode){ //3D rendering mode 2774 if (volume_mode) { 2775 //3D rendering mode 2731 2776 glEnable(GL_TEXTURE_2D); 2732 2777 glEnable(GL_DEPTH_TEST); … … 2735 2780 cam->activate(); 2736 2781 2737 //now render things in the scene 2738 // 2739 draw_3d_axis(); 2740 2741 //lic->render(); //display the line integral convolution result 2742 //soft_display_verts(); 2743 //perf->enable(); 2744 // psys->render(); 2745 //perf->disable(); 2746 //fprintf(stderr, "particle pixels: %d\n", perf->get_pixel_count()); 2747 //perf->reset(); 2748 2749 perf->enable(); 2750 vol_render->render_all(); 2751 //fprintf(stderr, "%lf\n", get_time_interval()); 2752 perf->disable(); 2782 //set up the orientation of items in the scene. 2783 glPushMatrix(); 2784 switch (updir) { 2785 case 1: // x 2786 glRotatef(90, 0, 0, 1); 2787 glRotatef(90, 1, 0, 0); 2788 break; 2789 2790 case 2: // y 2791 // this is the default 2792 break; 2793 2794 case 3: // z 2795 glRotatef(-90, 1, 0, 0); 2796 glRotatef(-90, 0, 0, 1); 2797 break; 2798 2799 case -1: // -x 2800 glRotatef(-90, 0, 0, 1); 2801 break; 2802 2803 case -2: // -y 2804 glRotatef(180, 0, 0, 1); 2805 glRotatef(-90, 0, 1, 0); 2806 break; 2807 2808 case -3: // -z 2809 glRotatef(90, 1, 0, 0); 2810 break; 2811 } 2812 2813 //now render things in the scene 2814 draw_3d_axis(); 2815 2816 //lic->render(); //display the line integral convolution result 2817 //soft_display_verts(); 2818 //perf->enable(); 2819 // psys->render(); 2820 //perf->disable(); 2821 //fprintf(stderr, "particle pixels: %d\n", perf->get_pixel_count()); 2822 //perf->reset(); 2823 2824 perf->enable(); 2825 vol_render->render_all(); 2826 perf->disable(); 2827 2828 glPopMatrix(); 2753 2829 } 2754 else{ //2D rendering mode2755 2830 else{ 2831 //2D rendering mode 2756 2832 perf->enable(); 2757 2833 plane_render->render();
Note: See TracChangeset
for help on using the changeset viewer.