当前位置: 首页>>代码示例>>Python>>正文


Python visuals.Markers方法代码示例

本文整理汇总了Python中vispy.scene.visuals.Markers方法的典型用法代码示例。如果您正苦于以下问题:Python visuals.Markers方法的具体用法?Python visuals.Markers怎么用?Python visuals.Markers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vispy.scene.visuals的用法示例。


在下文中一共展示了visuals.Markers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from vispy.scene import visuals [as 别名]
# 或者: from vispy.scene.visuals import Markers [as 别名]
def __init__(self, layer):
        # Create a compound visual with the following four subvisuals:
        # Markers: corresponding to the vertices of the interaction box or the
        # shapes that are used for highlights.
        # Lines: The lines of the interaction box used for highlights.
        # Mesh: The mesh of the outlines for each shape used for highlights.
        # Mesh: The actual meshes of the shape faces and edges
        node = Compound([Mesh(), Mesh(), Line(), Markers()])

        super().__init__(layer, node)

        self.layer.events.edge_width.connect(self._on_slice_data_change)
        self.layer.events.edge_color.connect(self._on_slice_data_change)
        self.layer.events.face_color.connect(self._on_slice_data_change)
        self.layer.events.highlight.connect(self._on_highlight_change)

        self._reset_base()
        self._on_slice_data_change()
        self._on_highlight_change() 
开发者ID:napari,项目名称:napari,代码行数:21,代码来源:vispy_shapes_layer.py

示例2: __init__

# 需要导入模块: from vispy.scene import visuals [as 别名]
# 或者: from vispy.scene.visuals import Markers [as 别名]
def __init__(self, keyupdateCB):
        scene.SceneCanvas.__init__(self, keys=None)
        self.size = 800, 600
        self.unfreeze()
        self.view = self.central_widget.add_view()
        self.view.bgcolor = '#ffffff'
        self.view.camera = TurntableCamera(
            fov=10.0, distance=30.0, up='+z', center=(0.0, 0.0, 0.0))
        self.last_pos = [0, 0, 0]
        self.pos_markers = visuals.Markers()
        self.meas_markers = visuals.Markers()
        self.pos_data = np.array([0, 0, 0], ndmin=2)
        self.meas_data = np.array([0, 0, 0], ndmin=2)
        self.lines = []

        self.view.add(self.pos_markers)
        self.view.add(self.meas_markers)
        for i in range(6):
            line = visuals.Line()
            self.lines.append(line)
            self.view.add(line)

        self.keyCB = keyupdateCB

        self.freeze()

        scene.visuals.XYZAxis(parent=self.view.scene) 
开发者ID:bitcraze,项目名称:crazyflie-lib-python,代码行数:29,代码来源:multiranger_pointcloud.py

示例3: add_chan

# 需要导入模块: from vispy.scene import visuals [as 别名]
# 或者: from vispy.scene.visuals import Markers [as 别名]
def add_chan(self, chan, color=None, values=None, limits_c=None,
                 colormap=CHAN_COLORMAP, alpha=None, colorbar=False):
        """Add channels to visualization

        Parameters
        ----------
        chan : instance of Channels
            channels to plot
        color : tuple
            3-, 4-element tuple, representing RGB and alpha, between 0 and 1
        values : ndarray
            array with values for each channel
        limits_c : tuple of 2 floats, optional
            min and max values to normalize the color
        colormap : str
            one of the colormaps in vispy
        alpha : float
            transparency (0 = transparent, 1 = opaque)
        colorbar : bool
            add a colorbar at the back of the surface
        """
        # reuse previous limits
        if limits_c is None and self._chan_limits is not None:
            limits_c = self._chan_limits

        chan_colors, limits = _prepare_colors(color=color, values=values,
                                              limits_c=limits_c,
                                              colormap=colormap, alpha=alpha,
                                              chan=chan)

        self._chan_limits = limits

        xyz = chan.return_xyz()
        marker = Markers()
        marker.set_data(pos=xyz, size=CHAN_SIZE, face_color=chan_colors)
        self._add_mesh(marker)

        if colorbar:
            self._view.add(_colorbar_for_surf(colormap, limits)) 
开发者ID:wonambi-python,项目名称:wonambi,代码行数:41,代码来源:plot_3d.py


注:本文中的vispy.scene.visuals.Markers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。