本文整理汇总了Python中command_support.EditCommand.EditCommand.editStructure方法的典型用法代码示例。如果您正苦于以下问题:Python EditCommand.editStructure方法的具体用法?Python EditCommand.editStructure怎么用?Python EditCommand.editStructure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类command_support.EditCommand.EditCommand
的用法示例。
在下文中一共展示了EditCommand.editStructure方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: editStructure
# 需要导入模块: from command_support.EditCommand import EditCommand [as 别名]
# 或者: from command_support.EditCommand.EditCommand import editStructure [as 别名]
def editStructure(self, struct = None):
EditCommand.editStructure(self, struct)
if self.hasValidStructure():
#When the structure (segment) is finalized (after the modifications)
#it will be added to the original NanotubeGroup to which it belonged
#before we began editing (modifying) it.
self._parentNanotubeGroup = self.struct.getNanotubeGroup()
#Set the endpoints
#@ DOES THIS DO ANYTHING? I don't think so. --Mark 2008-04-01
#@endPoint1, endPoint2 = self.struct.nanotube.getEndPoints()
#@params_for_propMgr = (endPoint1, endPoint2)
#TODO 2008-03-25: better to get all parameters from self.struct and
#set it in propMgr? This will mostly work except that reverse is
#not true. i.e. we can not specify same set of params for
#self.struct.setProps ...because endPoint1 and endPoint2 are derived.
#by the structure when needed. Commenting out following line of code
self.propMgr.setParameters(self.struct.getProps())
#Store the previous parameters. Important to set it after you
#set nanotube attrs in the propMgr.
#self.previousParams is used in self._previewStructure and
#self._finalizeStructure to check if self.struct changed.
self.previousParams = self._gatherParameters()
self._updateHandleList()
self.updateHandlePositions()
return
示例2: editStructure
# 需要导入模块: from command_support.EditCommand import EditCommand [as 别名]
# 或者: from command_support.EditCommand.EditCommand import editStructure [as 别名]
def editStructure(self, struct = None):
"""
Overrides EditCommand.editStructure method. Provides a way to edit an
existing structure. This implements a topLevel command that the client
can execute to edit an existing object(i.e. self.struct) that it wants.
Example: If its a plane edit controller, this method will be used to
edit an object of class Plane.
This method also creates a propMgr objects if it doesn't exist and
shows this property manager
@see: L{self.createStructure} (another top level command that
facilitates creation of a model object created by this
editCommand
@see: L{Plane.edit} and L{Plane_EditCommand._createPropMgrObject}
"""
if struct is not None:
#Should we always unpick the structure while editing it?
#Makes sense for editing a Dna. If this is problematic, the
#following should be done in the subclasses that need this.
if hasattr(struct, 'picked') and struct.picked:
struct.unpick()
EditCommand.editStructure(self, struct)
示例3: editStructure
# 需要导入模块: from command_support.EditCommand import EditCommand [as 别名]
# 或者: from command_support.EditCommand.EditCommand import editStructure [as 别名]
def editStructure(self, struct = None):
"""
"""
EditCommand.editStructure(self, struct)
if self.hasValidStructure():
self._updatePropMgrParams()
#Store the previous parameters. Important to set it after you
#set attrs in the propMgr.
#self.previousParams is used in self._previewStructure and
#self._finalizeStructure to check if self.struct changed.
self.previousParams = self._gatherParameters()
示例4: editStructure
# 需要导入模块: from command_support.EditCommand import EditCommand [as 别名]
# 或者: from command_support.EditCommand.EditCommand import editStructure [as 别名]
def editStructure(self, struct = None):
"""
Edit the structure
@param struct: structure to be edited (in this case its a strand chunk)
@type struct: chunk or None (this will change post dna data model)
"""
EditCommand.editStructure(self, struct)
if self.hasValidStructure():
self._updatePropMgrParams()
#For Rattlesnake, we do not support resizing of PAM5 model.
#So don't append the exprs handles to the handle list (and thus
#don't draw those handles. See self.model_changed()
isStructResizable, why_not = self.hasResizableStructure()
if not isStructResizable:
self.handles = []
else:
self._updateHandleList()
self.updateHandlePositions()
示例5: editStructure
# 需要导入模块: from command_support.EditCommand import EditCommand [as 别名]
# 或者: from command_support.EditCommand.EditCommand import editStructure [as 别名]
def editStructure(self, struct = None):
EditCommand.editStructure(self, struct)
if self.hasValidStructure():
#TODO 2008-03-25: better to get all parameters from self.struct and
#set it in propMgr? This will mostly work except that reverse is
#not true. i.e. we can not specify same set of params for
#self.struct.setProps ...because endPoint1 and endPoint2 are derived.
#by the structure when needed.
self.propMgr.setParameters(self.struct.getProps())
#Store the previous parameters. Important to set it after you
#set nanotube attrs in the propMgr.
#self.previousParams is used in self._previewStructure and
#self._finalizeStructure to check if self.struct changed.
self.previousParams = self._gatherParameters()
self._updateHandleList()
self.updateHandlePositions()
return
示例6: editStructure
# 需要导入模块: from command_support.EditCommand import EditCommand [as 别名]
# 或者: from command_support.EditCommand.EditCommand import editStructure [as 别名]
def editStructure(self, struct=None):
EditCommand.editStructure(self, struct)
if self.hasValidStructure():
self._updatePropMgrParams()
# Store the previous parameters. Important to set it after you
# set duplexRise and basesPerTurn attrs in the propMgr.
# self.previousParams is used in self._previewStructure and
# self._finalizeStructure to check if self.struct changed.
self.previousParams = self._gatherParameters()
# For Rattlesnake, we do not support resizing of PAM5 model.
# So don't append the exprs handles to the handle list (and thus
# don't draw those handles. See self.model_changed()
isStructResizable, why_not = self.hasResizableStructure()
if not isStructResizable:
self.handles = []
else:
self._updateHandleList()
self.updateHandlePositions()