Ignore:
Timestamp:
Apr 12, 2016, 7:12:53 PM (9 years ago)
Author:
ldelgass
Message:

Add "camera viewpoint go" to map viewer.

File:
1 edited

Legend:

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

    r6262 r6263  
    106106    private method GetImage { args }
    107107    private method GetNormalizedMouse { x y }
    108     private method GoToViewpoint { dataobj viewpoint }
     108    private method GoToViewpoint { dataobj viewpoint {duration 2.0} }
    109109    private method InitSettings { args  }
    110110    private method MapIsGeocentric {}
     
    23682368            Camera reset
    23692369        }
     2370        "viewpoint" {
     2371            if {[llength $args] < 1} {
     2372                error "wrong # args to camera viewpoint"
     2373            }
     2374            set vpopt [lindex $args 0]
     2375            switch -- $vpopt {
     2376                "go" {
     2377                    if {[llength $args] < 3} {
     2378                        error "wrong # of args to camera viewpoint go"
     2379                    }
     2380                    foreach {dataobj viewpoint} [lrange $args 1 end] break
     2381                    GoToViewpoint $dataobj $viewpoint
     2382                }
     2383                default {
     2384                    error "Unknown camera viewpoint option \"$vpopt\""
     2385                }
     2386            }
     2387        }
    23702388        "zoom" {
    23712389            if {[llength $args] < 1} {
     
    25032521}
    25042522
    2505 itcl::body Rappture::MapViewer::GoToViewpoint { dataobj viewpoint } {
     2523itcl::body Rappture::MapViewer::GoToViewpoint { dataobj viewpoint {duration 2.0}} {
    25062524    array set view [subst {
    25072525        x 0
     
    25242542        set _view(pitch) -90
    25252543    }
    2526     set duration 2.0
    25272544    SendCmd [list camera set $_view(x) $_view(y) $_view(z) $_view(heading) $_view(pitch) $_view(distance) $duration $_view(srs) $_view(verticalDatum)]
    25282545}
Note: See TracChangeset for help on using the changeset viewer.