예제 #1
0
    def handle_actions(self):
        self.actions = {}

        shape_actions = {}
        shape_actions['pt'] = BendAction(self)
        shape_actions['y'] = AttrAction(self, 'sd')
        shape_actions['glass'] = ReplaceGlassAction(self.gap)
        self.actions['shape'] = shape_actions

        s1_prof_actions = {}
        s1_prof_actions['pt'] = SagAction(self.s1)
        self.actions['s1_profile'] = s1_prof_actions

        s2_prof_actions = {}
        s2_prof_actions['pt'] = SagAction(self.s2)
        self.actions['s2_profile'] = s2_prof_actions

        sd_upr_action = {}
        sd_upr_action['y'] = AttrAction(self, 'sd')
        self.actions['sd_upr'] = sd_upr_action

        sd_lwr_action = {}
        sd_lwr_action['y'] = AttrAction(self, 'sd')
        self.actions['sd_lwr'] = sd_lwr_action

        ct_action = {}
        ct_action['x'] = AttrAction(self.gap, 'thi')
        self.actions['ct'] = ct_action

        return self.actions
예제 #2
0
 def dropEvent(self, view, event):
     dropped_it = False
     fig = view.figure
     if fig.hilited is not None:
         target = fig.hilited
         shape, handle = target.artist.shape
         if handle == 'area' and 'area' in shape.actions:
             sm = shape.diagram.opt_model.seq_model
             gap = sm.gaps[shape.node]
             action = ReplaceGlassAction(gap)
             action(fig, event)
             dropped_it = True
     view.figure.artist_filter = None
     return dropped_it
예제 #3
0
 def dropEvent(self, view, event):
     dropped_it = False
     fig = view.figure
     if fig.hilited is not None:
         target = fig.hilited
         shape, handle = target.artist.shape
         if handle == 'area' and 'area' in shape.actions:
             sm = shape.diagram.opt_model.seq_model
             gap = sm.gaps[shape.node]
             action = ReplaceGlassAction(gap, update=False)
             action(fig, event)
             pm = shape.diagram.parax_model
             pm.update_rindex(shape.node)
             pm.paraxial_lens_to_seq_model()
             fig.refresh_gui()
             dropped_it = True
     view.figure.artist_filter = None
     return dropped_it