geombuilder.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:notebook-molecular-visualization 作者: Autodesk 项目源码 文件源码
def _set_tool_state(self, *args):
        """ Observes the `viewer.selected_atom_indices` list and updates the tool panel accordingly

        Returns:
            Tuple(ipywidgets.BaseWidget): children of the tool panel
        """
        atoms = self.viewer.selected_atoms
        with self.viewer.hold_trait_notifications():
            for shape in self._widgetshapes.values():
                if shape == '_axes':
                    self.viewer.draw_axes(False)
                else:
                    self.viewer.remove(shape)
            self._widgetshapes = {}

        if len(atoms) == 1:
            self._setup_atom_tools(atoms)
        elif len(atoms) == 2:
            self._setup_distance_tools(atoms)
        elif len(atoms) == 3:
            self._setup_angle_tools(atoms)
        elif len(atoms) == 4:
            self._setup_dihedral_tools(atoms)
        else:
            self.tool_holder.children = (ipy.HTML('Please click on 1-4 atoms'),)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号