コード例 #1
0
    def __init__(self, glpane):
        "create an expr instance, to draw in addition to the model"
        super(ExampleCommand2E, self).__init__(glpane)
        expr1 = TextState()
        expr2 = DraggablyBoxed(expr1, resizable = True)
            ###BUG: resizing is projecting mouseray in the wrong way, when plane is tilted!
            # I vaguely recall that the Boxed resizable option was only coded for use in 2D widgets,
            # whereas some other constrained drag code is correct for 3D but not yet directly usable in Boxed.
            # So this is just an example interactive expr, not the best way to do resizing in 3D. (Though it could be fixed.)

        # note: this code is similar to _expr_instance_for_imagename in confirmation_corner.py
        ih = get_glpane_InstanceHolder(glpane)
        expr = expr2
        index = (id(self),) # WARNING: needs to be unique, we're sharing this InstanceHolder with everything else in NE1
        self._expr_instance = ih.Instance( expr, index, skip_expr_compare = True)

        return
コード例 #2
0
    def __init__(self, glpane):
        "create an expr instance, to draw in addition to the model"
        super(ExampleCommand2E, self).__init__(glpane)
        expr1 = TextState()
        expr2 = DraggablyBoxed(expr1, resizable=True)
        ###BUG: resizing is projecting mouseray in the wrong way, when plane is tilted!
        # I vaguely recall that the Boxed resizable option was only coded for use in 2D widgets,
        # whereas some other constrained drag code is correct for 3D but not yet directly usable in Boxed.
        # So this is just an example interactive expr, not the best way to do resizing in 3D. (Though it could be fixed.)

        # note: this code is similar to _expr_instance_for_imagename in confirmation_corner.py
        ih = get_glpane_InstanceHolder(glpane)
        expr = expr2
        index = (
            id(self),
        )  # WARNING: needs to be unique, we're sharing this InstanceHolder with everything else in NE1
        self._expr_instance = ih.Instance(expr, index, skip_expr_compare=True)

        return
コード例 #3
0
 def _expr_instance_for_vector(self, pointPair, crossoverPairs):
     ih = get_glpane_InstanceHolder(self.glpane)
     expr = self._expr_for_vector(pointPair, crossoverPairs)
     expr_instance = ih.Instance( expr,
                                  skip_expr_compare = True)
     return expr_instance
コード例 #4
0
 def _expr_instance_for_vector(self, pointPair, crossoverPairs):
     ih = get_glpane_InstanceHolder(self.glpane)
     expr = self._expr_for_vector(pointPair, crossoverPairs)
     expr_instance = ih.Instance(expr, skip_expr_compare=True)
     return expr_instance
コード例 #5
0
 def _expr_instance_for_overlay_imagename(self, imagename, dx = 0, dy = 0):
     ih = get_glpane_InstanceHolder(self.glpane)
     index = 1, imagename # might have to be more unique if we start sharing this InstanceHolder with anything else
     expr = _expr_for_overlay_imagename(imagename, dx, dy)
     expr_instance = ih.Instance( expr, index, skip_expr_compare = True)
     return expr_instance