def __init__(self, win, plane = None, lst = None, pointList = None, READ_FROM_MMP = False): self.w = self.win = win ReferenceGeometry.__init__(self, win) self.plane = plane self.controlPoints = [] self.handles = [] self.quat = None self.center = None self.color = blue if lst: for a in lst: self.controlPoints.append(a.posn()) elif pointList: for a in pointList: self.controlPoints.append(a) self.win.assy.place_new_geometry(self)
def __init__(self, win, editCommand = None, atomList = None, READ_FROM_MMP = False): """ Constructs a plane. @param win: The NE1 main window. @type win: L{MainWindow} @param editCommand: The Plane Edit Controller object. If this is None, it means the Plane is created by reading the data from the MMP file and it doesn't have an EditCommand assigned. The EditCommand may be created at a later stage in this case. See L{self.edit} for an example. @type editCommand: B{Plane_EditCommand} or None @param atomList: List of atoms. @type atomList: list @param READ_FROM_MMP: True if the plane is read from a MMP file. @type READ_FROM_MMP: bool """ self.win = win ReferenceGeometry.__init__(self, win) self.fill_color = self.default_fill_color self.border_color = self.default_border_color self.opacity = self.default_opacity self.handles = [] self.directionArrow = None # This is used to notify drawing code if it's just for picking purpose # copied from class ESPImage self.pickCheckOnly = False self.editCommand = editCommand self.imagePath = "" self.heightfield = None self.heightfield_scale = 1.0 self.heightfield_use_texture = True # piotr 080528 # added tex_image attribute for texture image self.tex_coords = [[0.0, 0.0], [0.0, 1.0], [1.0, 1.0], [1.0, 0.0]] self.display_image = False self.display_heightfield = False self.heightfield_hq = False self.tex_image = None self.image = None #related to grid self.gridColor = yellow self.gridLineType = 3 self.gridXSpacing = 4.0 self.gridYSpacing = 4.0 self.originLocation = LOWER_LEFT self.displayLabelStyle = LABELS_ALONG_ORIGIN if not READ_FROM_MMP: self.width = 16.0 # piotr 080605 - change default dimensions to square self.height = 16.0 self.normcolor = black self.setup_quat_center(atomList) self.directionArrow = DirectionArrow(self, self.glpane, self.center, self.getaxis())
def __init__(self, win, editCommand=None, atomList=None, READ_FROM_MMP=False): """ Constructs a plane. @param win: The NE1 main window. @type win: L{MainWindow} @param editCommand: The Plane Edit Controller object. If this is None, it means the Plane is created by reading the data from the MMP file and it doesn't have an EditCommand assigned. The EditCommand may be created at a later stage in this case. See L{self.edit} for an example. @type editCommand: B{Plane_EditCommand} or None @param atomList: List of atoms. @type atomList: list @param READ_FROM_MMP: True if the plane is read from a MMP file. @type READ_FROM_MMP: bool """ self.win = win ReferenceGeometry.__init__(self, win) self.fill_color = self.default_fill_color self.border_color = self.default_border_color self.opacity = self.default_opacity self.handles = [] self.directionArrow = None # This is used to notify drawing code if it's just for picking purpose # [copied from class ESPImage ] self.pickCheckOnly = False ### REVIEW/TODO: understanding how self.pickCheckOnly might be # left over from one drawing call to another (potentially causing # bugs) is a mess. It needs to be refactored so that it's just an # argument to all methods it's passed through. This involves some # superclass methods; maybe they can be overridden so the argument # is only needed in local methods, I don't know. This is done in # several Node classes, so I added this comment to all of them. # [bruce 090310 comment] self.editCommand = editCommand self.imagePath = "" self.heightfield = None self.heightfield_scale = 1.0 self.heightfield_use_texture = True # piotr 080528 # added tex_image attribute for texture image self.tex_coords = [[0.0, 0.0], [0.0, 1.0], [1.0, 1.0], [1.0, 0.0]] self.display_image = False self.display_heightfield = False self.heightfield_hq = False self.tex_image = None self.image = None #related to grid self.gridColor = yellow self.gridLineType = 3 self.gridXSpacing = 4.0 self.gridYSpacing = 4.0 self.originLocation = PLANE_ORIGIN_LOWER_LEFT self.displayLabelStyle = LABELS_ALONG_ORIGIN if not READ_FROM_MMP: self.width = 16.0 # piotr 080605 - change default dimensions to square self.height = 16.0 self.normcolor = black self.setup_quat_center(atomList) self.directionArrow = DirectionArrow(self, self.glpane, self.center, self.getaxis())
def __init__(self, win, editCommand = None, atomList = None, READ_FROM_MMP = False): """ Constructs a plane. @param win: The NE1 main window. @type win: L{MainWindow} @param editCommand: The Plane Edit Controller object. If this is None, it means the Plane is created by reading the data from the MMP file and it doesn't have an EditCommand assigned. The EditCommand may be created at a later stage in this case. See L{self.edit} for an example. @type editCommand: B{Plane_EditCommand} or None @param atomList: List of atoms. @type atomList: list @param READ_FROM_MMP: True if the plane is read from a MMP file. @type READ_FROM_MMP: bool """ self.win = win ReferenceGeometry.__init__(self, win) self.fill_color = self.default_fill_color self.border_color = self.default_border_color self.opacity = self.default_opacity self.handles = [] self.directionArrow = None # This is used to notify drawing code if it's just for picking purpose # [copied from class ESPImage ] self.pickCheckOnly = False ### REVIEW/TODO: understanding how self.pickCheckOnly might be # left over from one drawing call to another (potentially causing # bugs) is a mess. It needs to be refactored so that it's just an # argument to all methods it's passed through. This involves some # superclass methods; maybe they can be overridden so the argument # is only needed in local methods, I don't know. This is done in # several Node classes, so I added this comment to all of them. # [bruce 090310 comment] self.editCommand = editCommand self.imagePath = "" self.heightfield = None self.heightfield_scale = 1.0 self.heightfield_use_texture = True # piotr 080528 # added tex_image attribute for texture image self.tex_coords = [[0.0, 0.0], [0.0, 1.0], [1.0, 1.0], [1.0, 0.0]] self.display_image = False self.display_heightfield = False self.heightfield_hq = False self.tex_image = None self.image = None #related to grid self.gridColor = yellow self.gridLineType = 3 self.gridXSpacing = 4.0 self.gridYSpacing = 4.0 self.originLocation = PLANE_ORIGIN_LOWER_LEFT self.displayLabelStyle = LABELS_ALONG_ORIGIN if not READ_FROM_MMP: self.width = 16.0 # piotr 080605 - change default dimensions to square self.height = 16.0 self.normcolor = black self.setup_quat_center(atomList) self.directionArrow = DirectionArrow(self, self.glpane, self.center, self.getaxis())