Changeset 570 for trunk


Ignore:
Timestamp:
05/18/11 15:22:39 (12 months ago)
Author:
ddangelo
Message:

get viewer functionality added

Location:
trunk/avango-display/python/avango/display
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/avango-display/python/avango/display/__init__.py

    r518 r570  
    114114    return _selected_display.get_camera(subdisplay) 
    115115 
     116def get_viewer(): 
     117    """ 
     118    Get the av::osg::viewer of the used display. Currently, all displays use a 
     119    CompositeViewer 
     120    """ 
     121    return _selected_display.get_viewer() 
     122 
     123def get_view(subdisplay): 
     124    """ 
     125    Get the osg.viewer.View object of the selected subdisplay. If no view for the 
     126    given subdisplay is found, None is returned 
     127    """ 
     128    return _selected_display.get_view(subdisplay) 
     129 
    116130def make_user(user=0, interface="", subdisplay=""): 
    117131    """Create a field container that represents the user position. 
  • trunk/avango-display/python/avango/display/_display.py

    r566 r570  
    9999 
    100100        return display_view 
     101     
     102    def get_viewer(self): 
     103        return self._composite_viewer 
     104     
     105    def get_view(self, subdisplay): 
     106        return None 
    101107 
    102108    def get_camera(self, subdisplay): 
  • trunk/avango-display/python/avango/display/setups/Monitor.py

    r532 r570  
    3838        self._subdisplay_keyboard = {} 
    3939        self._subdisplay_camera = {} 
     40        self._subdisplay_view = {} 
    4041 
    4142        self._screen_identifier = os.environ.get('DISPLAY', '') 
     
    99100         
    100101        #configure trackball 
    101         display_view.EnableTrackball.value = self._enable_trackball 
     102#        display_view.EnableTrackball.value = self._enable_trackball 
     103        toggle_field = avango.utils.make_key_toggle_trigger_alternate( 
     104                        avango.utils.make_bool2_and(self._subdisplay_keyboard[subdisplay].KeyShift, 
     105                                                    self._subdisplay_keyboard[subdisplay].KeyF1), 
     106                       self._enable_trackball) 
     107        display_view.EnableTrackball.connect_from(toggle_field) 
     108         
    102109        time_sensor = avango.nodes.TimeSensor() 
    103110        self.keep_alive(time_sensor) 
     
    122129        #TODO Enable the osg auto near/far plane computation 
    123130        display_view.Near.value = 0.1  
    124         display_view.Far.value = 100000 
     131        display_view.Far.value = 10000 
    125132         
    126133        #add some default actions 
     
    164171            self._subdisplay_window[subdisplay].MoveEvent.connect_from(window_event.MoveEvent) 
    165172            self._subdisplay_camera[subdisplay] = camera 
     173            self._subdisplay_view[subdisplay] = view 
     174             
    166175             
    167176             
     
    169178        if self._subdisplay_camera.has_key(subdisplay): 
    170179            return self._subdisplay_camera[subdisplay] 
     180        return None 
     181     
     182    def get_view(self, subdisplay): 
     183        if self._subdisplay_view.has_key(subdisplay): 
     184            return self._subdisplay_view[subdisplay] 
    171185        return None 
    172186         
Note: See TracChangeset for help on using the changeset viewer.