Exemple #1
0
  def make_skelscreenedges(self, arrow='none', circle=0, DEBUG=0):
    if DEBUG:
      print "make_sse starting"

# I need the number of joints in self.  We don't store this value
# in the class, but we can get it by looking at the length of any
# edge array self.edges[t] for any t.  So we make sure that self.edges[1]
# is set up, then we take its length.
    if not (self.edges.has_key(1)):
      self.create_edges_onet(1)

    jointcount = len(self.edges[1])
    if DEBUG:
      print "make_skelscreenedges: jointcount=",jointcount
    skelscreenedges = []

    for x in range(jointcount):
      sv1 = screenvert(0.,0.,0.,description='make_sse_sv1')
      sv2 = screenvert(0.,0.,0.,description='make_sse_sv2')
      se1 = screenedge(sv1, sv2, arrow=arrow, circle=circle, DEBUG=DEBUG, \
                           description='created_by_make_skelscreenedges' )
      skelscreenedges.append(se1)
    return skelscreenedges
Exemple #2
0
    def make_skelscreenedges(self, arrow='none', circle=0, DEBUG=0):
        if DEBUG:
            print "make_sse starting"

# I need the number of joints in self.  We don't store this value
# in the class, but we can get it by looking at the length of any
# edge array self.edges[t] for any t.  So we make sure that self.edges[1]
# is set up, then we take its length.
        if not (self.edges.has_key(1)):
            self.create_edges_onet(1)

        jointcount = len(self.edges[1])
        if DEBUG:
            print "make_skelscreenedges: jointcount=", jointcount
        skelscreenedges = []

        for x in range(jointcount):
            sv1 = screenvert(0., 0., 0., description='make_sse_sv1')
            sv2 = screenvert(0., 0., 0., description='make_sse_sv2')
            se1 = screenedge(sv1, sv2, arrow=arrow, circle=circle, DEBUG=DEBUG, \
                                 description='created_by_make_skelscreenedges' )
            skelscreenedges.append(se1)
        return skelscreenedges
    # Call Config() when CANVAS FRAME is resized.  We don't want to
    # do this as root.bind() because then we get callback calls for every
    # widget and frame on the screen whenever we resize the window.  We
    # just want a callback for the frame that holds the canvas.
    myviewport.bind('<Configure>', canvas_frame_change)

    # Must init myskeleton to 0.  At least one routine uses this as a test
    # for whether a skeleton exists or not.
    myskeleton = 0
    skelscreenedges = []
    axisedges = []

    # X axis
    sv1 = screenvert(0., 0., 0.)
    sv2 = screenvert(10., 0., 0.)
    se1 = screenedge(sv1, sv2, color='red', description='red x axis')
    axisedges.append(se1)

    # Y axis
    sv1 = screenvert(0., 0., 0.)
    sv2 = screenvert(0., 10., 0.)
    se1 = screenedge(sv1, sv2, color='green', description='green y axis')
    axisedges.append(se1)

    # Z axis
    sv1 = screenvert(0., 0., 0.)
    sv2 = screenvert(0., 0., 10.)
    se1 = screenedge(sv1, sv2, color='blue', description='blue z axis')
    axisedges.append(se1)
    redraw_axes = 1
# Call Config() when CANVAS FRAME is resized.  We don't want to
# do this as root.bind() because then we get callback calls for every
# widget and frame on the screen whenever we resize the window.  We
# just want a callback for the frame that holds the canvas.
myviewport.bind('<Configure>', canvas_frame_change)  

# Must init myskeleton to 0.  At least one routine uses this as a test
# for whether a skeleton exists or not.
myskeleton = 0  
skelscreenedges = []
axisedges = []

# X axis
sv1 = screenvert(0.,0.,0.)
sv2 = screenvert(10.,0.,0.)
se1 = screenedge(sv1, sv2, color='red', description='red x axis')
axisedges.append(se1)


# Y axis
sv1 = screenvert(0.,0.,0.)
sv2 = screenvert(0.,10.,0.)
se1 = screenedge(sv1, sv2, color='green', description='green y axis')
axisedges.append(se1)


# Z axis
sv1 = screenvert(0.,0.,0.)
sv2 = screenvert(0.,0.,10.)
se1 = screenedge(sv1, sv2, color='blue', description='blue z axis')
axisedges.append(se1)