Changeset 2088
- Timestamp:
- Feb 9, 2011 11:57:06 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/drawing3d.tcl
r1929 r2088 106 106 ymin yaxis.min 107 107 ymax yaxis.max 108 zlabel zaxis.label 109 zdesc zaxis.description 110 zunits zaxis.units 111 zscale zaxis.scale 112 zmin zaxis.min 113 zmax zaxis.max 108 114 } { 109 115 set str [$_drawing3d get $path] … … 242 248 # ---------------------------------------------------------------------- 243 249 itcl::body Rappture::Drawing3d::hints { {keyword ""} } { 250 if 0 { 244 251 if {[info exists _hints(xlabel)] && "" != $_hints(xlabel) 245 252 && [info exists _hints(xunits)] && "" != $_hints(xunits)} { … … 250 257 set _hints(ylabel) "$_hints(ylabel) ($_hints(yunits))" 251 258 } 252 259 } 253 260 if {[info exists _hints(group)] && [info exists _hints(label)]} { 254 261 # pop-up help for each curve -
trunk/gui/scripts/resultviewer.tcl
r1930 r2088 151 151 # ---------------------------------------------------------------------- 152 152 itcl::body Rappture::ResultViewer::plot {option args} { 153 puts stderr "plot option=$option args=$args" 153 154 switch -- $option { 154 155 add { … … 180 181 eval lappend settings $opts 181 182 183 puts stderr "_plotAdd $dobj $settings" 184 182 185 _plotAdd $dobj $settings 183 186 } … … 188 191 } 189 192 clear { 193 puts stderr "in plot clear mode=$_mode" 190 194 # clear the contents of the current mode 191 195 if {"" != $_mode} { 196 puts stderr "in plot clear mode=$_mode" 192 197 $_mode2widget($_mode) delete 193 198 } … … 219 224 ::Rappture::Drawing3d { 220 225 set mode "vtkviewer" 226 puts stderr mode2widget=[array names _mode2widget] 221 227 if {![info exists _mode2widget($mode)]} { 222 set w $itk_interior. xy223 Rappture::VtkViewer $w228 set w $itk_interior.vtkviewer 229 catch { Rappture::VtkViewer $w } 224 230 set _mode2widget($mode) $w 225 231 } … … 228 234 set mode "histogram" 229 235 if {![info exists _mode2widget($mode)]} { 230 set w $itk_interior. xy236 set w $itk_interior.histogram 231 237 Rappture::HistogramResult $w 232 238 set _mode2widget($mode) $w … … 389 395 } 390 396 391 # are we plotting in a new mode? then change widgets397 # Are we plotting in a new mode? then change widgets 392 398 if {$_mode2widget($mode) != [pack slaves $itk_interior]} { 393 399 # remove any current window … … 397 403 pack $_mode2widget($mode) -expand yes -fill both 398 404 405 puts stderr "_mode=$_mode mode=$mode" 399 406 set _mode $mode 400 407 $_dispatcher event -idle !scale -
trunk/gui/scripts/vtkviewer.tcl
r1929 r2088 45 45 private variable _lights ;# list of lights for each renderer 46 46 private variable _click ;# info used for _move operations 47 private variable _slicer ;# vtk transform used for 3D slice plane48 47 private variable _limits ;# autoscale min/max for all axes 49 48 private variable _view ;# view params for 3D view … … 79 78 protected method Zoom {option} 80 79 protected method Move {option x y} 81 protected method Slice {option args}82 80 protected method _3dView {theta phi} 83 81 protected method _fixLimits {} 84 protected method Slicertip {axis}85 82 protected method _color2rgb {color} 86 83 protected method SetActorProperties { actor style } … … 89 86 private method GetLimits {} 90 87 private method BuildCameraTab {} 91 private method BuildCutplanesTab {}92 88 private method BuildViewTab {} 93 89 private method BuildVolumeTab {} … … 108 104 pack propagate $itk_component(hull) no 109 105 110 set _slicer(xplane) ""111 set _slicer(yplane) ""112 set _slicer(zplane) ""113 set _slicer(xslice) ""114 set _slicer(yslice) ""115 set _slicer(zslice) ""116 set _slicer(readout) ""117 106 set _view(theta) 0 118 107 set _view(phi) 0 … … 225 214 $_axesWidget SetOrientationMarker $_axesActor 226 215 $_axesWidget SetInteractor $_interactor 227 $_axesWidget SetEnabled 1228 $_axesWidget SetInteractive 0216 #$_axesWidget SetEnabled 1 217 #$_axesWidget SetInteractive 0 229 218 $_axesWidget SetViewport .7 0 1.0 0.3 230 219 231 $_cubeAxesActor SetXTitle "X Axis (units)"232 $_cubeAxesActor SetYTitle "Y Axis (units)"233 234 220 BuildViewTab 221 if 0 { 235 222 BuildVolumeTab 236 BuildCutplanesTab237 223 BuildCameraTab 238 224 } 239 225 set v0 0 240 226 set v1 1 … … 244 230 $_lookup Build 245 231 246 247 #248 # 3D CUT PLANES249 #250 foreach axis {x y z} norm {{1 0 0} {0 1 0} {0 0 1}} {251 252 set plane [vtkPlane $this-${axis}cutplane]253 eval $plane SetNormal $norm254 set _slicer(${axis}plane) $plane255 256 set cutter [vtkCutter $this-${axis}cutter]257 $cutter SetCutFunction $plane258 259 set mapper [vtkPolyDataMapper $this-${axis}cutmapper]260 $mapper SetInput [$cutter GetOutput]261 $mapper SetScalarRange $v0 $v1262 $mapper SetLookupTable $_lookup263 264 #lappend _obj2vtk($dataobj) $cutplane $cutter $mapper265 266 set actor [vtkActor $this-${axis}actor]267 $actor VisibilityOn268 $actor SetMapper $mapper269 $actor SetPosition 0 0 0270 [$actor GetProperty] SetColor 0 0 0271 set _slicer(${axis}slice) $actor272 273 $_renderer AddActor $actor274 lappend _actors $actor275 #lappend _obj2vtk($dataobj) $actor276 }277 278 #279 # CUT PLANE READOUT280 #281 set mapper [vtkTextMapper $this-text]282 set props [$mapper GetTextProperty]283 #eval $props SetColor [_color2rgb $itk_option(-plotforeground)]284 $props SetVerticalJustificationToTop285 set _slicer(readout) $mapper286 287 set actor [vtkActor2D $this-texta]288 $actor SetMapper $mapper289 set coords [$actor GetPositionCoordinate]290 $coords SetCoordinateSystemToNormalizedDisplay291 $coords SetValue 0.02 0.98292 293 $_renderer AddActor $actor294 lappend _actors $actor295 #lappend _obj2vtk($dataobj) $mapper $actor296 297 # turn off all slicers by default298 foreach axis {x y z} {299 $itk_component(${axis}CutScale) configure -state normal300 $itk_component(${axis}CutScale) set 50301 Slice move $axis 50302 Slice axis $axis off303 }304 305 232 set lightKit [vtkLightKit $this-LightKit] 306 233 $lightKit AddLightsToRenderer $_renderer … … 309 236 # Create a picture for download snapshots 310 237 # 311 set _download [image create p icture]238 set _download [image create photo] 312 239 313 240 eval itk_initialize $args … … 446 373 switch $option { 447 374 coming { 448 if {[catch {$_download snap $itk_component(area)} errs] != 0 } { 449 global errorInfo 450 puts stderr "$errorInfo" 451 $_download blank #000000 375 if {[catch { 376 blt::winop snap $itk_component(plotarea) $_download 377 }]} { 378 $_download configure -width 1 -height 1 379 $_download put #000000 452 380 } 453 381 } … … 504 432 set _obj2vtk($dataobj) "" 505 433 } 506 set _slicer(xplane) ""507 set _slicer(yplane) ""508 set _slicer(zplane) ""509 set _slicer(xslice) ""510 set _slicer(yslice) ""511 set _slicer(zslice) ""512 set _slicer(readout) ""513 434 } 514 435 … … 605 526 } 606 527 607 # ----------------------------------------------------------------------608 # USAGE: Slice axis x|y|z ?on|off|toggle?609 # USAGE: Slice move x|y|z <newval>610 #611 # Called automatically when the user drags the slider to move the612 # cut plane that slices 3D data. Gets the current value from the613 # slider and moves the cut plane to the appropriate point in the614 # data set.615 # ----------------------------------------------------------------------616 itcl::body Rappture::VtkViewer::Slice {option args} {617 if {$_slicer(xplane) == ""} {618 # no slicer? then bail out!619 return620 }621 switch -- $option {622 axis {623 if {[llength $args] < 1 || [llength $args] > 2} {624 error "wrong # args: should be \"Slice axis x|y|z ?on|off|toggle?\""625 }626 set axis [lindex $args 0]627 set op [lindex $args 1]628 if {$op == ""} { set op "on" }629 630 set current $_settings($this-${axis}cutplane)631 if {$op == "toggle"} {632 set op [expr $current==0]633 }634 635 if {$op} {636 $itk_component(${axis}CutScale) configure -state normal637 $_slicer(${axis}slice) VisibilityOn638 $itk_component(${axis}CutButton) select639 } else {640 $itk_component(${axis}CutScale) configure -state disabled641 $_slicer(${axis}slice) VisibilityOff642 $itk_component(${axis}CutButton) deselect643 }644 $_window Render645 }646 move {647 if {[llength $args] != 2} {648 error "wrong # args: should be \"Slice move x|y|z newval\""649 }650 set axis [lindex $args 0]651 set newval [lindex $args 1]652 653 set xm [expr {0.5*($_limits(xMax)+$_limits(xMin))}]654 set ym [expr {0.5*($_limits(yMax)+$_limits(yMin))}]655 set zm [expr {0.5*($_limits(zMax)+$_limits(zMin))}]656 657 set newval [expr {0.01*($newval-50)658 *($_limits(${axis}Max)-$_limits(${axis}Min))659 + 0.5*($_limits(${axis}Max)+$_limits(${axis}Min))}]660 661 # show the current value in the readout662 if {$_slicer(readout) != ""} {663 $_slicer(readout) SetInput "$axis = $newval"664 }665 666 # keep a little inside the volume, or the slice will disappear!667 if {$newval == $_limits(${axis}Min)} {668 set range [expr {$_limits(${axis}Max)-$_limits(${axis}Min)}]669 set newval [expr {$newval + 1e-6*$range}]670 }671 672 # xfer new value to the proper dimension and move the cut plane673 set ${axis}m $newval674 $_slicer(${axis}plane) SetOrigin $xm $ym $zm675 676 $_window Render677 }678 default {679 error "bad option \"$option\": should be axis or move"680 }681 }682 }683 528 684 529 # ---------------------------------------------------------------------- … … 730 575 $this-vtkRenderWindow2 Render 731 576 } 732 }733 734 # ----------------------------------------------------------------------735 # USAGE: Slicertip <axis>736 #737 # Used internally to generate a tooltip for the x/y/z slicer controls.738 # Returns a message that includes the current slicer value.739 # ----------------------------------------------------------------------740 itcl::body Rappture::VtkViewer::Slicertip {axis} {741 set val [$itk_component(${axis}slicer) get]742 set val [expr {0.01*($val-50)743 *($_limits(${axis}Max)-$_limits(${axis}Min))744 + 0.5*($_limits(${axis}Max)+$_limits(${axis}Min))}]745 return "Move the [string toupper $axis] cut plane.\nCurrently: $axis = $val"746 577 } 747 578 … … 826 657 ComputeLimits 827 658 $_cubeAxesActor SetCamera [$_renderer GetActiveCamera] 828 puts stderr limits=[GetLimits]829 659 eval $_cubeAxesActor SetBounds [GetLimits] 830 660 … … 890 720 SetActorProperties $actor $style 891 721 set mapper [$dataobj data $comp] 892 $this-xcutter SetInput [$mapper GetInput]893 #$_cubeAxesActor SetCamera [$_renderer GetActiveCamera]894 #eval $_cubeAxesActor SetBounds [$actor GetBounds]895 896 897 if 0 {898 #899 # Add color contours.900 #901 if {$firstobj} {902 if {$_dims == "3D"} {903 pack $itk_component(slicers) -side bottom -padx 4 -pady 4904 pack $itk_component(reset) -side left905 pack $itk_component(zoomin) -side left906 pack $itk_component(zoomout) -side left907 908 #909 # 3D DATA SET910 #911 set mesh [$dataobj mesh $comp]912 if {"" == $mesh} {913 set x [expr {[winfo rootx $itk_component(area)]+10}]914 set y [expr {[winfo rooty $itk_component(area)]+10}]915 Rappture::Tooltip::cue @$x,$y "This data requires the visualization server, and that appears to be down. Please try your simulation again later."916 return917 }918 switch -- [$mesh GetClassName] {919 vtkPoints {920 # handle cloud of 3D points921 set pd $this-polydata922 vtkPolyData $pd923 $pd SetPoints $mesh924 [$pd GetPointData] SetScalars [$dataobj values $comp]925 926 set tr $this-triangles927 vtkDelaunay3D $tr928 $tr SetInput $pd929 $tr SetTolerance 0.0000000000001930 set source [$tr GetOutput]931 932 set mp $this-mapper933 vtkPolyDataMapper $mp934 935 lappend _obj2vtk($dataobj) $pd $tr $mp936 }937 vtkUnstructuredGrid {938 # handle 3D grid with connectivity939 set gr $this-grdata940 vtkUnstructuredGrid $gr941 $gr ShallowCopy $mesh942 [$gr GetPointData] SetScalars [$dataobj values $comp]943 set source $gr944 945 lappend _obj2vtk($dataobj) $gr946 }947 vtkRectilinearGrid {948 # handle 3D grid with connectivity949 set gr $this-grdata950 vtkRectilinearGrid $gr951 $gr ShallowCopy $mesh952 [$gr GetPointData] SetScalars [$dataobj values $comp]953 set source $gr954 955 lappend _obj2vtk($dataobj) $gr956 }957 default {958 error "don't know how to handle [$mesh GetClassName] data"959 }960 }961 962 #963 # 3D ISOSURFACES964 #965 set iso $this-iso966 vtkContourFilter $iso967 $iso SetInput $source968 969 set mp $this-isomap970 vtkPolyDataMapper $mp971 $mp SetInput [$iso GetOutput]972 973 set ac $this-isoactor974 vtkActor $ac975 $ac SetMapper $mp976 [$ac GetProperty] SetOpacity 0.3977 [$ac GetProperty] SetDiffuse 0.5978 [$ac GetProperty] SetAmbient 0.7979 [$ac GetProperty] SetSpecular 10.0980 [$ac GetProperty] SetSpecularPower 200.0981 $_renderer AddActor $ac982 983 lappend _obj2vtk($dataobj) $iso $mp $ac984 lappend _actors $ac985 986 catch {unset style}987 array set style [lindex [$dataobj components -style $comp] 0]988 if {[info exists style(-color)]} {989 $mp ScalarVisibilityOff ;# take color from actor990 eval [$ac GetProperty] SetColor [_color2rgb $style(-color)]991 }992 993 if {[info exists style(-opacity)]} {994 [$ac GetProperty] SetOpacity $style(-opacity)995 }996 997 set levels 5998 if {[info exists style(-levels)]} {999 set levels $style(-levels)1000 }1001 if {$levels == 1} {1002 $iso SetValue 0 [expr {0.5*($v1-$v0)+$v0}]1003 } else {1004 $iso GenerateValues [expr {$levels+2}] $v0 $v11005 }1006 1007 #1008 # 3D CUT PLANES1009 #1010 if {$id == 0} {1011 foreach axis {x y z} norm {{1 0 0} {0 1 0} {0 0 1}} {1012 set pl $this-${axis}cutplane$id1013 vtkPlane $pl1014 eval $pl SetNormal $norm1015 set _slicer(${axis}plane) $pl1016 1017 set ct $this-${axis}cutter$id1018 vtkCutter $ct1019 $ct SetInput $source1020 $ct SetCutFunction $pl1021 1022 set mp $this-${axis}cutmapper$id1023 vtkPolyDataMapper $mp1024 $mp SetInput [$ct GetOutput]1025 $mp SetScalarRange $v0 $v11026 $mp SetLookupTable $lu1027 1028 lappend _obj2vtk($dataobj) $pl $ct $mp1029 1030 set ac $this-${axis}actor$id1031 vtkActor $ac1032 $ac VisibilityOff1033 $ac SetMapper $mp1034 $ac SetPosition 0 0 01035 [$ac GetProperty] SetColor 0 0 01036 set _slicer(${axis}slice) $ac1037 1038 $_renderer AddActor $ac1039 lappend _actors $ac1040 lappend _obj2vtk($dataobj) $ac1041 }1042 1043 #1044 # CUT PLANE READOUT1045 #1046 set tx $this-text$id1047 vtkTextMapper $tx1048 set tp [$tx GetTextProperty]1049 eval $tp SetColor [_color2rgb $itk_option(-plotforeground)]1050 $tp SetVerticalJustificationToTop1051 set _slicer(readout) $tx1052 1053 set txa $this-texta$id1054 vtkActor2D $txa1055 $txa SetMapper $tx1056 [$txa GetPositionCoordinate] \1057 SetCoordinateSystemToNormalizedDisplay1058 [$txa GetPositionCoordinate] SetValue 0.02 0.981059 1060 $_renderer AddActor $txa1061 lappend _actors $txa1062 1063 lappend _obj2vtk($dataobj) $tx $txa1064 1065 # turn off all slicers by default1066 foreach axis {x y z} {1067 $itk_component(${axis}slicer) configure -state normal1068 $itk_component(${axis}slicer) set 501069 Slice move $axis 501070 Slice axis $axis off1071 }1072 }1073 1074 } else {1075 pack forget $itk_component(slicers)1076 pack $itk_component(reset) -side top1077 pack $itk_component(zoomin) -side top1078 pack $itk_component(zoomout) -side top1079 1080 set pd $this-polydata$id1081 vtkPolyData $pd1082 $pd SetPoints [$dataobj mesh $comp]1083 [$pd GetPointData] SetScalars [$dataobj values $comp]1084 1085 set tr $this-triangles$id1086 vtkDelaunay2D $tr1087 $tr SetInput $pd1088 $tr SetTolerance 0.00000000000011089 set source [$tr GetOutput]1090 1091 set mp $this-mapper$id1092 vtkPolyDataMapper $mp1093 $mp SetInput $source1094 $mp SetScalarRange $v0 $v11095 $mp SetLookupTable $lu1096 1097 set ac $this-actor$id1098 vtkActor $ac1099 $ac SetMapper $mp1100 $ac SetPosition 0 0 01101 [$ac GetProperty] SetColor 0 0 01102 $_renderer AddActor $ac1103 lappend _actors $ac1104 1105 lappend _obj2vtk($dataobj) $pd $tr $mp $ac1106 }1107 } else {1108 #1109 # Add color lines1110 #1111 set cf $this-clfilter$id1112 vtkContourFilter $cf1113 $cf SetInput $source1114 $cf GenerateValues 20 $v0 $v11115 1116 set mp $this-clmapper$id1117 vtkPolyDataMapper $mp1118 $mp SetInput [$cf GetOutput]1119 $mp SetScalarRange $v0 $v11120 $mp SetLookupTable $lu1121 1122 set ac $this-clactor$id1123 vtkActor $ac1124 $ac SetMapper $mp1125 [$ac GetProperty] SetColor 1 1 11126 $ac SetPosition 0 0 01127 $_renderer AddActor $ac1128 lappend _actors $ac1129 1130 lappend _obj2vtk($dataobj) $cf $mp $ac1131 }1132 1133 #1134 # Add an outline around the data1135 #1136 if {$id == 0} {1137 set olf $this-olfilter$id1138 vtkOutlineFilter $olf1139 $olf SetInput $source1140 1141 set olm $this-olmapper$id1142 vtkPolyDataMapper $olm1143 $olm SetInput [$olf GetOutput]1144 1145 set ola $this-olactor$id1146 vtkActor $ola1147 $ola SetMapper $olm1148 eval [$ola GetProperty] SetColor [_color2rgb $itk_option(-plotforeground)]1149 $_renderer AddActor $ola1150 lappend _actors $ola1151 1152 lappend _obj2vtk($dataobj) $olf $olm $ola1153 1154 if {$_dims == "3D"} {1155 # pick a good scale factor for text1156 if {$xr < $yr} {1157 set tscale [expr {0.1*$xr}]1158 } else {1159 set tscale [expr {0.1*$yr}]1160 }1161 1162 foreach {i axis px py pz rx ry rz} {1163 0 x $xm 0 0 90 0 01164 1 y 0 $ym 0 90 -90 01165 2 z $x1 0 $zm 90 0 -451166 } {1167 set length "[expr {[set ${axis}1]-[set ${axis}0]}]"1168 1169 set vtx $this-${axis}label$id1170 vtkVectorText $vtx1171 $vtx SetText "$axis"1172 1173 set vmp $this-${axis}lmap$id1174 vtkPolyDataMapper $vmp1175 $vmp SetInput [$vtx GetOutput]1176 1177 set vac $this-${axis}lact$id1178 vtkActor $vac1179 $vac SetMapper $vmp1180 $vac SetPosition [expr $px] [expr $py] [expr $pz]1181 $vac SetOrientation $rx $ry $rz1182 $vac SetScale $tscale1183 $_renderer AddActor $vac1184 1185 lappend _obj2vtk($dataobj) $vtx $vmp $vac1186 lappend _actors $vac1187 1188 $vmp Update1189 foreach {xx0 xx1 yy0 yy1 zz0 zz1} [$vac GetBounds] break1190 switch -- $axis {1191 x {1192 set dx [expr {-0.5*($xx1-$xx0)}]1193 set dy 01194 set dz [expr {1.3*($zz0-$zz1)}]1195 }1196 y {1197 set dx 01198 set dy [expr {0.5*($yy1-$yy0)}]1199 set dz [expr {$zz0-$zz1}]1200 }1201 z {1202 set dx [expr {0.2*$tscale}]1203 set dy $dx1204 set dz [expr {-0.5*($zz1-$zz0)}]1205 }1206 }1207 $vac AddPosition $dx $dy $dz1208 }1209 }1210 }1211 1212 #1213 # Add a legend with the scale.1214 #1215 if {$id == 0} {1216 set lg $this-legend$id1217 vtkScalarBarActor $lg1218 $lg SetLookupTable $lu1219 [$lg GetPositionCoordinate] SetCoordinateSystemToNormalizedViewport1220 [$lg GetPositionCoordinate] SetValue 0.1 0.11221 $lg SetOrientationToHorizontal1222 $lg SetWidth 0.81223 $lg SetHeight 1.01224 1225 set tp [$lg GetLabelTextProperty]1226 eval $tp SetColor [_color2rgb $itk_option(-plotforeground)]1227 $tp BoldOff1228 $tp ItalicOff1229 $tp ShadowOff1230 #eval $tp SetShadowColor [_color2rgb gray]1231 1232 if 0 {1233 $this-vtkRenderer2 AddActor2D $lg1234 lappend _actors $lg1235 lappend _obj2vtk($dataobj) $lg1236 }1237 }1238 }1239 722 incr id 1240 723 } 1241 724 set firstobj 0 725 } 726 set top [lindex [get] end] 727 foreach axis { x y z } { 728 set title [$top hints ${axis}label] 729 set units [$top hints ${axis}units] 730 set method Set[string toupper $axis]Title 731 set label "$title" 732 if { $units != "" } { 733 append label " ($units)" 734 } 735 $_cubeAxesActor $method $label 1242 736 } 1243 737 _fixLimits … … 1245 739 $_interactor Start 1246 740 $_window Render 741 1247 742 1248 743 # … … 1273 768 wireframe 0 1274 769 volume 1 1275 legend 11276 770 particles 1 1277 771 lic 1 … … 1286 780 -title "View Settings" \ 1287 781 -icon [Rappture::icon wrench]] 782 set inner $tab 783 if 0 { 1288 784 blt::scrollset $tab.ss \ 1289 785 -xscrollbar $tab.ss.xs \ … … 1295 791 set inner [blt::tk::frame $tab.ss.frame] 1296 792 $inner configure -borderwidth 4 1297 793 } 1298 794 set ::Rappture::VtkViewer::_settings($this-isosurface) 0 1299 795 checkbutton $inner.isosurface \ … … 1321 817 -font "Arial 9" 1322 818 1323 checkbutton $inner.legend \1324 -text "Legend" \1325 -variable [itcl::scope _settings($this-legend)] \1326 -command [itcl::code $this FixSettings legend] \1327 -font "Arial 9"1328 1329 checkbutton $inner.volume \1330 -text "Volume" \1331 -variable [itcl::scope _settings($this-volume)] \1332 -command [itcl::code $this FixSettings volume] \1333 -font "Arial 9"1334 1335 819 blt::table $inner \ 1336 820 0,0 $inner.axes -columnspan 2 -anchor w \ 1337 821 1,0 $inner.edges -columnspan 2 -anchor w \ 1338 2,0 $inner.wireframe -columnspan 2 -anchor w \ 1339 3,0 $inner.volume -columnspan 2 -anchor w \ 1340 4,0 $inner.legend -columnspan 2 -anchor w 1341 1342 if 0 { 1343 bind $inner <Map> [itcl::code $this GetVolumeInfo $inner] 1344 } 822 2,0 $inner.wireframe -columnspan 2 -anchor w 823 1345 824 blt::table configure $inner r* -resize none 1346 825 blt::table configure $inner r5 -resize expand … … 1359 838 -title "Volume Settings" \ 1360 839 -icon [Rappture::icon volume-on]] 840 set inner $tab 841 if 0 { 1361 842 blt::scrollset $tab.ss \ 1362 843 -xscrollbar $tab.ss.xs \ … … 1368 849 set inner [blt::tk::frame $tab.ss.frame] 1369 850 $inner configure -borderwidth 4 1370 851 } 1371 852 set fg [option get $itk_component(hull) font Font] 1372 853 #set bfg [option get $itk_component(hull) boldFont Font] … … 1415 896 } 1416 897 1417 itcl::body Rappture::VtkViewer::BuildCutplanesTab {} {1418 1419 set tab [$itk_component(main) insert end \1420 -title "Cutplane Settings" \1421 -icon [Rappture::icon cutbutton]]1422 blt::scrollset $tab.ss \1423 -xscrollbar $tab.ss.xs \1424 -yscrollbar $tab.ss.ys \1425 -window $tab.ss.frame1426 pack $tab.ss -fill both -expand yes1427 blt::tk::scrollbar $tab.ss.xs1428 blt::tk::scrollbar $tab.ss.ys1429 set inner [blt::tk::frame $tab.ss.frame]1430 $inner configure -borderwidth 41431 1432 # X-value slicer...1433 itk_component add xCutButton {1434 Rappture::PushButton $inner.xbutton \1435 -onimage [Rappture::icon x-cutplane] \1436 -offimage [Rappture::icon x-cutplane] \1437 -command [itcl::code $this FixSettings xcutplane] \1438 -variable [itcl::scope _settings($this-xcutplane)]1439 }1440 Rappture::Tooltip::for $itk_component(xCutButton) \1441 "Toggle the X cut plane on/off"1442 1443 itk_component add xCutScale {1444 ::scale $inner.xval -from 100 -to 0 \1445 -width 10 -orient vertical -showvalue off -state disabled \1446 -borderwidth 1 -highlightthickness 0 \1447 -command [itcl::code $this Slice move x]1448 } {1449 usual1450 ignore -borderwidth -highlightthickness1451 }1452 # Set the default cutplane value before disabling the scale.1453 $itk_component(xCutScale) set 501454 $itk_component(xCutScale) configure -state disabled1455 Rappture::Tooltip::for $itk_component(xCutScale) \1456 "@[itcl::code $this SlicerTip x]"1457 1458 # Y-value slicer...1459 itk_component add yCutButton {1460 Rappture::PushButton $inner.ybutton \1461 -onimage [Rappture::icon y-cutplane] \1462 -offimage [Rappture::icon y-cutplane] \1463 -command [itcl::code $this FixSettings ycutplane] \1464 -variable [itcl::scope _settings($this-ycutplane)]1465 }1466 Rappture::Tooltip::for $itk_component(yCutButton) \1467 "Toggle the Y cut plane on/off"1468 1469 itk_component add yCutScale {1470 ::scale $inner.yval -from 100 -to 0 \1471 -width 10 -orient vertical -showvalue off -state disabled \1472 -borderwidth 1 -highlightthickness 0 \1473 -command [itcl::code $this Slice move y]1474 } {1475 usual1476 ignore -borderwidth -highlightthickness1477 }1478 Rappture::Tooltip::for $itk_component(yCutScale) \1479 "@[itcl::code $this SlicerTip y]"1480 # Set the default cutplane value before disabling the scale.1481 $itk_component(yCutScale) set 501482 $itk_component(yCutScale) configure -state disabled1483 1484 # Z-value slicer...1485 itk_component add zCutButton {1486 Rappture::PushButton $inner.zbutton \1487 -onimage [Rappture::icon z-cutplane] \1488 -offimage [Rappture::icon z-cutplane] \1489 -command [itcl::code $this FixSettings zcutplane] \1490 -variable [itcl::scope _settings($this-zcutplane)]1491 }1492 Rappture::Tooltip::for $itk_component(zCutButton) \1493 "Toggle the Z cut plane on/off"1494 1495 itk_component add zCutScale {1496 ::scale $inner.zval -from 100 -to 0 \1497 -width 10 -orient vertical -showvalue off -state disabled \1498 -borderwidth 1 -highlightthickness 0 \1499 -command [itcl::code $this Slice move z]1500 } {1501 usual1502 ignore -borderwidth -highlightthickness1503 }1504 $itk_component(zCutScale) set 501505 $itk_component(zCutScale) configure -state disabled1506 #$itk_component(zCutScale) configure -state disabled1507 Rappture::Tooltip::for $itk_component(zCutScale) \1508 "@[itcl::code $this SlicerTip z]"1509 1510 blt::table $inner \1511 1,1 $itk_component(xCutButton) \1512 1,2 $itk_component(yCutButton) \1513 1,3 $itk_component(zCutButton) \1514 0,1 $itk_component(xCutScale) \1515 0,2 $itk_component(yCutScale) \1516 0,3 $itk_component(zCutScale)1517 1518 blt::table configure $inner r0 r1 c* -resize none1519 blt::table configure $inner r2 c4 -resize expand1520 blt::table configure $inner c0 -width 21521 blt::table configure $inner c1 c2 c3 -padx 21522 }1523 1524 itcl::body Rappture::VtkViewer::BuildCameraTab {} {1525 set tab [$itk_component(main) insert end \1526 -title "Camera Settings" \1527 -icon [Rappture::icon camera]]1528 blt::scrollset $tab.ss \1529 -xscrollbar $tab.ss.xs \1530 -yscrollbar $tab.ss.ys \1531 -window $tab.ss.frame1532 blt::tk::scrollbar $tab.ss.xs1533 blt::tk::scrollbar $tab.ss.ys1534 pack $tab.ss -fill both -expand yes1535 set inner [blt::tk::frame $tab.ss.frame]1536 $inner configure -borderwidth 41537 1538 set labels { phi theta psi pan-x pan-y zoom }1539 set row 01540 foreach tag $labels {1541 label $inner.${tag}label -text $tag -font "Arial 9"1542 entry $inner.${tag} -font "Arial 9" -bg white \1543 -textvariable [itcl::scope _settings($this-$tag)]1544 bind $inner.${tag} <KeyPress-Return> \1545 [itcl::code $this camera set ${tag}]1546 blt::table $inner \1547 $row,0 $inner.${tag}label -anchor e -pady 2 \1548 $row,1 $inner.${tag} -anchor w -pady 21549 blt::table configure $inner r$row -resize none1550 incr row1551 }1552 blt::table configure $inner c0 c1 -resize none1553 blt::table configure $inner c2 -resize expand1554 blt::table configure $inner r$row -resize expand1555 }1556 898 1557 899 # ---------------------------------------------------------------------- … … 1618 960 $_window Render 1619 961 } 1620 "legend" {1621 if { $_settings($this-legend) } {1622 blt::table $itk_component(plotarea) \1623 0,0 $itk_component(3dview) -fill both \1624 1,0 $itk_component(legend) -fill x1625 blt::table configure $itk_component(plotarea) r1 -resize none1626 } else {1627 blt::table forget $itk_component(legend)1628 }1629 }1630 "volume" {1631 }1632 "xcutplane" - "ycutplane" - "zcutplane" {1633 set axis [string range $what 0 0]1634 set bool $_settings($this-$what)1635 if { $bool } {1636 $itk_component(${axis}CutScale) configure -state normal \1637 -troughcolor white1638 } else {1639 $itk_component(${axis}CutScale) configure -state disabled \1640 -troughcolor grey821641 }1642 }1643 962 default { 1644 963 error "don't know how to fix $what" 1645 964 } 1646 965 } 1647 }1648 1649 if 0 {1650 #1651 # Create slicer controls...1652 #1653 itk_component add slicers {1654 frame $itk_component(controls).slicers1655 } {1656 usual1657 rename -background -controlbackground controlBackground Background1658 }1659 pack $itk_component(slicers) -side bottom -padx 4 -pady 41660 grid rowconfigure $itk_component(slicers) 1 -weight 11661 1662 #1663 # X-value slicer...1664 #1665 itk_component add xslice {1666 label $itk_component(slicers).xslice \1667 -borderwidth 1 -relief raised -padx 1 -pady 1 \1668 -bitmap [Rappture::icon x]1669 } {1670 usual1671 ignore -borderwidth1672 rename -highlightbackground -controlbackground controlBackground Background1673 }1674 bind $itk_component(xslice) <ButtonPress> \1675 [itcl::code $this Slice axis x toggle]1676 Rappture::Tooltip::for $itk_component(xslice) \1677 "Toggle the X cut plane on/off"1678 grid $itk_component(xslice) -row 0 -column 0 -sticky ew -padx 11679 1680 itk_component add xslicer {1681 ::scale $itk_component(slicers).xval -from 100 -to 0 \1682 -width 10 -orient vertical -showvalue off -state disabled \1683 -borderwidth 1 -highlightthickness 0 \1684 -command [itcl::code $this Slice move x]1685 } {1686 usual1687 ignore -borderwidth1688 ignore -highlightthickness1689 rename -highlightbackground -controlbackground controlBackground Background1690 rename -troughcolor -controldarkbackground controlDarkBackground Background1691 }1692 grid $itk_component(xslicer) -row 1 -column 0 -padx 11693 Rappture::Tooltip::for $itk_component(xslicer) \1694 "@[itcl::code $this Slicertip x]"1695 1696 #1697 # Y-value slicer...1698 #1699 itk_component add yslice {1700 label $itk_component(slicers).yslice \1701 -borderwidth 1 -relief raised -padx 1 -pady 1 \1702 -bitmap [Rappture::icon y]1703 } {1704 usual1705 ignore -borderwidth1706 rename -highlightbackground -controlbackground controlBackground Background1707 }1708 bind $itk_component(yslice) <ButtonPress> \1709 [itcl::code $this Slice axis y toggle]1710 Rappture::Tooltip::for $itk_component(yslice) \1711 "Toggle the Y cut plane on/off"1712 grid $itk_component(yslice) -row 0 -column 1 -sticky ew -padx 11713 1714 itk_component add yslicer {1715 ::scale $itk_component(slicers).yval -from 100 -to 0 \1716 -width 10 -orient vertical -showvalue off -state disabled \1717 -borderwidth 1 -highlightthickness 0 \1718 -command [itcl::code $this Slice move y]1719 } {1720 usual1721 ignore -borderwidth1722 ignore -highlightthickness1723 rename -highlightbackground -controlbackground controlBackground Background1724 rename -troughcolor -controldarkbackground controlDarkBackground Background1725 }1726 grid $itk_component(yslicer) -row 1 -column 1 -padx 11727 Rappture::Tooltip::for $itk_component(yslicer) \1728 "@[itcl::code $this Slicertip y]"1729 1730 #1731 # Z-value slicer...1732 #1733 itk_component add zslice {1734 label $itk_component(slicers).zslice \1735 -borderwidth 1 -relief raised -padx 1 -pady 1 \1736 -bitmap [Rappture::icon z]1737 } {1738 usual1739 ignore -borderwidth1740 rename -highlightbackground -controlbackground controlBackground Background1741 }1742 grid $itk_component(zslice) -row 0 -column 2 -sticky ew -padx 11743 bind $itk_component(zslice) <ButtonPress> \1744 [itcl::code $this Slice axis z toggle]1745 Rappture::Tooltip::for $itk_component(zslice) \1746 "Toggle the Z cut plane on/off"1747 1748 itk_component add zslicer {1749 ::scale $itk_component(slicers).zval -from 100 -to 0 \1750 -width 10 -orient vertical -showvalue off -state disabled \1751 -borderwidth 1 -highlightthickness 0 \1752 -command [itcl::code $this Slice move z]1753 } {1754 usual1755 ignore -borderwidth1756 ignore -highlightthickness1757 rename -highlightbackground -controlbackground controlBackground Background1758 rename -troughcolor -controldarkbackground controlDarkBackground Background1759 }1760 grid $itk_component(zslicer) -row 1 -column 2 -padx 11761 Rappture::Tooltip::for $itk_component(zslicer) \1762 "@[itcl::code $this Slicertip z]"1763 1764 966 } 1765 967 -
trunk/packages/vizservers/configure
r2073 r2088 8228 8228 8229 8229 8230 for ac_header in <opencv/cv.h opencv/highgui.h 8231 do : 8232 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 8233 ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 8234 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 8235 cat >>confdefs.h <<_ACEOF 8236 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 8237 _ACEOF 8238 8239 fi 8240 8241 done 8242 8243 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cvLoadImage in -lcv" >&5 8244 $as_echo_n "checking for cvLoadImage in -lcv... " >&6; } 8245 if ${ac_cv_lib_cv_cvLoadImage+:} false; then : 8246 $as_echo_n "(cached) " >&6 8247 else 8248 ac_check_lib_save_LIBS=$LIBS 8249 LIBS="-lcv $LIBS" 8250 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 8251 /* end confdefs.h. */ 8252 8253 /* Override any GCC internal prototype to avoid an error. 8254 Use char because int might match the return type of a GCC 8255 builtin and then its argument prototype would still apply. */ 8256 #ifdef __cplusplus 8257 extern "C" 8258 #endif 8259 char cvLoadImage (); 8260 int 8261 main () 8262 { 8263 return cvLoadImage (); 8264 ; 8265 return 0; 8266 } 8267 _ACEOF 8268 if ac_fn_cxx_try_link "$LINENO"; then : 8269 ac_cv_lib_cv_cvLoadImage=yes 8270 else 8271 ac_cv_lib_cv_cvLoadImage=no 8272 fi 8273 rm -f core conftest.err conftest.$ac_objext \ 8274 conftest$ac_exeext conftest.$ac_ext 8275 LIBS=$ac_check_lib_save_LIBS 8276 fi 8277 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cv_cvLoadImage" >&5 8278 $as_echo "$ac_cv_lib_cv_cvLoadImage" >&6; } 8279 if test "x$ac_cv_lib_cv_cvLoadImage" = xyes; then : 8280 cat >>confdefs.h <<_ACEOF 8281 #define HAVE_LIBCV 1 8282 _ACEOF 8283 8284 LIBS="-lcv $LIBS" 8285 8286 fi 8287 8288 8230 8289 for ac_header in ffmpeg/avcodec.h libavcodec/avcodec.h ffmpeg/avformat.h libavformat/avformat.h ffmpeg/avutil.h libavutil/avutil.h 8231 8290 do : … … 8250 8309 8251 8310 done 8252 8253 8311 8254 8312 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_alloc_frame in -lavcodec" >&5 -
trunk/packages/vizservers/configure.in
r2073 r2088 232 232 AC_SUBST(DX_LIB_SPEC) 233 233 234 AC_CHECK_HEADERS([<opencv/cv.h opencv/highgui.h]) 235 AC_CHECK_LIB([cv], [cvLoadImage]) 236 234 237 AC_CHECK_HEADERS([ffmpeg/avcodec.h libavcodec/avcodec.h ffmpeg/avformat.h libavformat/avformat.h ffmpeg/avutil.h libavutil/avutil.h],,,[ 235 238 #define SIZEOF_LONG ${ac_cv_sizeof_long} … … 242 245 #endif 243 246 ]) 244 245 247 AC_CHECK_LIB([avcodec], [avcodec_alloc_frame]) 246 248 AC_CHECK_LIB([avformat], [avformat_alloc_context]) -
trunk/packages/vizservers/nanovis/Makefile.in
r2041 r2088 35 35 DX_INC_SPEC = @DX_INC_SPEC@ 36 36 DX_LIB_SPEC = @DX_LIB_SPEC@ -lDXcallm 37 FF_LIB_SPEC = -lavformat -lavcodec -lavutil38 # might also need -lavutil 37 FF_LIB_SPEC = @LIBS@ 38 39 39 GL_INC_SPEC = -I/usr/include/GL 40 40 GL_LIB_SPEC = -lGL -lglut -lGLEW -lGLU -
trunk/packages/vizservers/nanovis/nvconf.h.in
r2073 r2088 40 40 #undef HAVE_LIBAVUTIL_AVUTIL_H 41 41 42 /* Define to 1 if you have the `cv' library (-lcv). */ 43 #undef HAVE_LIBCV 44 42 45 /* Define to 1 if you have the <memory.h> header file. */ 43 46 #undef HAVE_MEMORY_H … … 48 51 /* Define to 1 if you have the <netinet/in.h> header file. */ 49 52 #undef HAVE_NETINET_IN_H 53 54 /* Define to 1 if you have the <opencv/highgui.h> header file. */ 55 #undef HAVE_OPENCV_HIGHGUI_H 50 56 51 57 /* Define to 1 if you have the <rappture.h> header file. */
Note: See TracChangeset
for help on using the changeset viewer.