Esempio n. 1
0
    def __init__(self, assy, name, scale, pov, zoomFactor, wxyz):
        """
        @param pov: the inverse of the "center of view" in model coordinates
        @type pov: position vector (Numeric.array of 3 ints or floats, as made
                   by V(x,y,z))

        @param wxyz: orientation of view
        @type wxyz: a Quaternion (class VQT.Q), or a sequence of 4 floats
                    which can be passed to that class to make one, e.g.
                    Q(W, x, y, z) is the quaternion with axis vector x,y,z
                    and sin(theta/2) = W
        """
        self.const_pixmap = imagename_to_pixmap("modeltree/NamedView.png")
        if not name:
            name = gensym("%s" % self.sym, assy)
        Node.__init__(self, assy, name)
        self.scale = scale
        assert type(pov) is type(V(1, 0, 0))
        self.pov = V(pov[0], pov[1], pov[2])
        self.zoomFactor = zoomFactor
        self.quat = Q(wxyz)
            #bruce 050518/080303 comment: wxyz is passed as an array of 4 floats
            # (in same order as in mmp file's csys record), when parsing
            # csys mmp records, or with wxyz a quat in other places.
        return
Esempio n. 2
0
    def __init__(self, assy, name, scale, pov, zoomFactor, wxyz):
        """
        @param pov: the inverse of the "center of view" in model coordinates
        @type pov: position vector (Numeric.array of 3 ints or floats, as made
                   by V(x,y,z))

        @param wxyz: orientation of view
        @type wxyz: a Quaternion (class VQT.Q), or a sequence of 4 floats
                    which can be passed to that class to make one, e.g.
                    Q(W, x, y, z) is the quaternion with axis vector x,y,z
                    and sin(theta/2) = W
        """
        self.const_pixmap = imagename_to_pixmap("modeltree/NamedView.png")
        if not name:
            name = gensym("%s" % self.sym, assy)
        Node.__init__(self, assy, name)
        self.scale = scale
        assert type(pov) is type(V(1, 0, 0))
        self.pov = V(pov[0], pov[1], pov[2])
        self.zoomFactor = zoomFactor
        self.quat = Q(wxyz)
            #bruce 050518/080303 comment: wxyz is passed as an array of 4 floats
            # (in same order as in mmp file's csys record), when parsing
            # csys mmp records, or with wxyz a quat in other places.
        return
Esempio n. 3
0
 def __init__(self, assy, name, text=''):
     self.const_pixmap = imagename_to_pixmap("modeltree/comment.png")
     if not name:
         name = gensym("%s" % self.sym, assy)
     Node.__init__(self, assy, name)
     self.lines = [] # this makes set_text changed() test legal (result of test doesn't matter)
     self.set_text(text)
     return
Esempio n. 4
0
 def __init__(self, assy, name, text=''):
     self.const_pixmap = imagename_to_pixmap("modeltree/comment.png")
     if not name:
         name = gensym("%s" % self.sym, assy)
     Node.__init__(self, assy, name)
     self.lines = [] # this makes set_text changed() test legal (result of test doesn't matter)
     self.set_text(text)
     return
Esempio n. 5
0
    def __init__(self, assy, name, params=None):
        #bruce 060620 removed name from params list, made that optional, made name a separate argument,
        # all to make this __init__ method compatible with that of other nodes (see above for one reason);
        # also revised this routine in other ways, e.g. to avoid redundant sets of self.assy and self.name
        # (which are set by Node.__init__).
        if not name:
            # [Note: this code might be superceded by code in Node.__init__ once nodename suffix numbers are revised.]
            # If this code is superceded, Node.__init__ must provide a way to verify that the filename (derived from the name)
            # doesn't exist, since this would be an invalid name. Mark 060702.
            name = generate_povrayscene_name(assy, self.sym, self.extension)

        self.const_pixmap = imagename_to_pixmap("modeltree/povrayscene.png")
        # note: this might be changed later; this value is not always correct; that may be a bug when this node is copied.
        # [bruce 060620 comment]

        Node.__init__(self, assy, name)
        if params:
            self.set_parameters(params)
        else:
            def_params = (assy.o.width, assy.o.height, 'png')
            self.set_parameters(def_params)

        return
Esempio n. 6
0
 def __init__(self, assy, name, params = None):
     #bruce 060620 removed name from params list, made that optional, made name a separate argument,
     # all to make this __init__ method compatible with that of other nodes (see above for one reason);
     # also revised this routine in other ways, e.g. to avoid redundant sets of self.assy and self.name
     # (which are set by Node.__init__).
     if not name: 
         # [Note: this code might be superceded by code in Node.__init__ once nodename suffix numbers are revised.]
         # If this code is superceded, Node.__init__ must provide a way to verify that the filename (derived from the name)
         # doesn't exist, since this would be an invalid name. Mark 060702.
         name = generate_povrayscene_name(assy, self.sym, self.extension)
         
     self.const_pixmap = imagename_to_pixmap("modeltree/povrayscene.png")
         # note: this might be changed later; this value is not always correct; that may be a bug when this node is copied.
         # [bruce 060620 comment]
         
     Node.__init__(self, assy, name)
     if params:
         self.set_parameters(params)
     else:
         def_params = (assy.o.width, assy.o.height, 'png')
         self.set_parameters(def_params)
     
     return
Esempio n. 7
0
 def __init__(self, stuff, name = None):
     assy = env.mainwindow().assy #k wrongheaded??
     Node.__init__(self, assy, name)###WRONG now that Node is no longer a superclass
     self.stuff = stuff # exprs for what to draw (list of objects)
Esempio n. 8
0
 def __init__(self, assy, name = "prefnode"):
     Node.__init__(self, assy, name)
     return