Changeset 2149 for trunk


Ignore:
Timestamp:
Mar 24, 2011, 9:16:33 PM (13 years ago)
Author:
gah
Message:

more drawing3d camera fixes

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/resultviewer.tcl

    r2144 r2149  
    220220            if {![info exists _mode2widget($mode)]} {
    221221                set w $itk_interior.vtkviewer
    222                 Rappture::VtkViewer $w
     222                catch { Rappture::VtkViewer $w } errs
     223                puts stderr errs=$errs
    223224                set _mode2widget($mode) $w
    224225            }
  • trunk/gui/scripts/vtkviewer.tcl

    r2148 r2149  
    477477                xpos 1.73477e-06 ypos 74.7518 zpos -1.73477e-06
    478478                xviewup 5.38569e-16 yviewup 2.32071e-08 zviewup 1.0
    479                 xfocal 0.0 yfocal 0.0 zfocal 0.0
     479                xfocal 0.0 yfocal 0.0 zfocal 0.0
     480                angle 30
    480481            }
    481482            set dataobj [lindex $_dlist end]
     
    483484                array set camera [$dataobj hints camera]
    484485            }
     486            if { [info exists camera(clipmin)] } {
     487                $cam SetClippingRange $camera(clipmin) $camera(clipmax)
     488            }
     489            if { [info exists camera(parallelscale)] } {
     490                $cam SetParallelScale $camera(parallelscale)
     491            }
     492            $cam SetViewAngle $camera(angle)
    485493            $cam SetFocalPoint $camera(xfocal) $camera(yfocal) $camera(zfocal)
    486494            $cam SetPosition $camera(xpos) $camera(ypos) $camera(zpos)
     
    489497                set _settings($this-$key) $camera($key)
    490498            }
     499            $cam ComputeViewPlaneNormal
    491500            $_window Render
    492501        }
     
    572581# ----------------------------------------------------------------------
    573582itcl::body Rappture::VtkViewer::_3dView {theta phi} {
     583    return
    574584    set deg2rad 0.0174532927778
    575585    set xn [expr {sin($theta*$deg2rad)*cos($phi*$deg2rad)}]
     
    907917            pt  [$cam GetFocalPoint] \
    908918            up  [$cam GetViewUp] \
    909             pos [$cam GetPosition] {
     919            pos [$cam GetPosition] {
    910920        set _settings($this-${key}focal) $pt
    911921        set _settings($this-${key}up) $up
    912922        set _settings($this-${key}pos) $pos
    913923    }
     924    foreach {min max} [$cam GetClippingRange] break
     925    set _settings($this-clipmin) $min
     926    set _settings($this-clipmax) $max
     927    set _settings($this-parallelscale) [$cam GetParallelScale]
     928    set _settings($this-angle) [$cam GetViewAngle]
     929    foreach key { xpos ypos zpos xviewup yviewup zviewup
     930        xfocal yfocal zfocal angle clipmin clipmax parallelscale
     931    } {
     932        set out($key) $_settings($this-$key)
     933    }
     934    puts \"[array get out]\"
    914935}
    915936
     
    942963    entry $inner.zfocal -bg white \
    943964        -textvariable [itcl::scope _settings($this-zfocal)]
     965    label $inner.anglel -text "View Angle"
     966    entry $inner.angle -bg white \
     967        -textvariable [itcl::scope _settings($this-angle)]
     968    label $inner.clipl -text "Clipping Range"
     969    entry $inner.clipmin -bg white \
     970        -textvariable [itcl::scope _settings($this-clipmin)]
     971    entry $inner.clipmax -bg white \
     972        -textvariable [itcl::scope _settings($this-clipmax)]
     973    label $inner.pscalel -text "Parallel Scale"
     974    entry $inner.pscale -bg white \
     975        -textvariable [itcl::scope _settings($this-parallelscale)]
    944976
    945977    button $inner.refresh -text "Refresh" \
     
    958990        10,0 $inner.yfocal -pady 2 -fill x \
    959991        11,0 $inner.zfocal -pady 2 -fill x \
    960         12,0 $inner.refresh
     992        16,0 $inner.anglel -anchor w -pady 2 \
     993        17,0 $inner.angle -pady 2 -fill x \
     994        18,0 $inner.clipl -anchor w -pady 2 \
     995        19,0 $inner.clipmin -pady 2 -fill x \
     996        20,0 $inner.clipmax -pady 2 -fill x \
     997        21,0 $inner.pscalel -anchor w -pady 2 \
     998        22,0 $inner.pscale -pady 2 -fill x \
     999        23,0 $inner.refresh
    9611000
    9621001    blt::table configure $inner r* c* -resize none
    9631002    blt::table configure $inner c0 -resize expand
    964     blt::table configure $inner r13 -resize expand
     1003    blt::table configure $inner r24 -resize expand
    9651004}
    9661005
Note: See TracChangeset for help on using the changeset viewer.