Changeset 3498


Ignore:
Timestamp:
Mar 14, 2013 8:01:36 AM (11 years ago)
Author:
ldelgass
Message:

Delay Rebuild until window size larger than 1x1 - copying this code from
VTK viewers to nanovis viewers. Helps get proper aspect for initial camera
reset. There is still a problem with the updir coming too late (needs to come
before camera reset).

Location:
trunk/gui/scripts
Files:
3 edited

Legend:

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

    r3492 r3498  
    11551155#
    11561156itcl::body Rappture::FlowvisViewer::Rebuild {} {
    1157 
    1158     # Hide all the isomarkers. Can't remove them. Have to remember the
    1159     # settings since the user may have created/deleted/moved markers.
    1160 
    1161     foreach tf [array names _isomarkers] {
    1162         foreach m $_isomarkers($tf) {
    1163             $m visible no
    1164         }
    1165     }
    1166 
    1167     set _first ""
     1157    set w [winfo width $itk_component(3dview)]
     1158    set h [winfo height $itk_component(3dview)]
     1159    if { $w < 2 || $h < 2 } {
     1160        $_dispatcher event -idle !rebuild
     1161        return
     1162    }
     1163
    11681164    # Turn on buffering of commands to the server.  We don't want to
    11691165    # be preempted by a server disconnect/reconnect (which automatically
    11701166    # generates a new call to Rebuild).   
    11711167    StartBufferingCommands
     1168
     1169    # Hide all the isomarkers. Can't remove them. Have to remember the
     1170    # settings since the user may have created/deleted/moved markers.
     1171
     1172    foreach tf [array names _isomarkers] {
     1173        foreach m $_isomarkers($tf) {
     1174            $m visible no
     1175        }
     1176    }
     1177
     1178    if { $_width != $w || $_height != $h || $_reset } {
     1179        set _width $w
     1180        set _height $h
     1181        $_arcball resize $w $h
     1182        Resize
     1183    }
     1184
     1185    set _first ""
    11721186
    11731187    if { $_reset } {
     
    11941208            SendCmd "clientinfo [list $info]"
    11951209        }
    1196         set _width [winfo width $itk_component(3dview)]
    1197         set _height [winfo height $itk_component(3dview)]
    1198         Resize
    11991210    }
    12001211    foreach dataobj [get] {
     
    12361247
    12371248    # Reset the camera and other view parameters
    1238     InitSettings isosurface grid axes volume outline light2side light transp
     1249    InitSettings light2side light transp isosurface grid axes volume outline
    12391250   
    12401251    # nothing to send -- activate the proper volume
  • trunk/gui/scripts/nanovisviewer.tcl

    r3492 r3498  
    838838# ----------------------------------------------------------------------
    839839itcl::body Rappture::NanovisViewer::Rebuild {} {
     840    set w [winfo width $itk_component(3dview)]
     841    set h [winfo height $itk_component(3dview)]
     842    if { $w < 2 || $h < 2 } {
     843        $_dispatcher event -idle !rebuild
     844        return
     845    }
    840846
    841847    # Turn on buffering of commands to the server.  We don't want to
     
    853859    }
    854860
     861    if { $_width != $w || $_height != $h || $_reset } {
     862        set _width $w
     863        set _height $h
     864        $_arcball resize $w $h
     865        DoResize
     866    }
    855867    if { $_reset } {
    856         set _width [winfo width $itk_component(3dview)]
    857         set _height [winfo height $itk_component(3dview)]
    858         DoResize
    859868        if { $_reportClientInfo }  {
     869            # Tell the server the name of the tool, the version, and
     870            # dataset that we are rendering.  Have to do it here because
     871            # we don't know what data objects are using the renderer until
     872            # be get here.
    860873            global env
    861874
  • trunk/gui/scripts/vtkheightmapviewer.tcl

    r3482 r3498  
    859859    }
    860860
    861     StartBufferingCommands
    862861    # Turn on buffering of commands to the server.  We don't want to
    863862    # be preempted by a server disconnect/reconnect (which automatically
    864863    # generates a new call to Rebuild).   
     864    StartBufferingCommands
     865
    865866    if { $_width != $w || $_height != $h || $_reset } {
    866867        set _width $w
Note: See TracChangeset for help on using the changeset viewer.