當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。