MCPcopy Create free account
hub / github.com/vispy/vispy / __init__

Method __init__

vispy/visuals/mesh.py:99–134  ·  view source on GitHub ↗
(self, vertices=None, faces=None, vertex_colors=None,
                 face_colors=None, color=(0.5, 0.5, 1, 1), vertex_values=None,
                 meshdata=None, shading=None, mode='triangles', **kwargs)

Source from the content-addressed store, hash-verified

97 }
98
99 def __init__(self, vertices=None, faces=None, vertex_colors=None,
100 face_colors=None, color=(0.5, 0.5, 1, 1), vertex_values=None,
101 meshdata=None, shading=None, mode='triangles', **kwargs):
102 Visual.__init__(self, vcode=self._shaders['vertex'], fcode=self._shaders['fragment'],
103 **kwargs)
104 self.set_gl_state('translucent', depth_test=True, cull_face=False)
105
106 self.events.add(data_updated=Event)
107
108 self._meshdata = None
109
110 # Define buffers
111 self._vertices = VertexBuffer(np.zeros((0, 3), dtype=np.float32))
112 self._cmap = CubeHelixColormap()
113 self._clim = 'auto'
114
115 # Uniform color
116 self._color = Color(color)
117
118 # add filters for various modifiers
119 self.shading_filter = None
120 self.shading = shading
121
122 # Init
123 self._bounds = None
124 # Note we do not call subclass set_data -- often the signatures
125 # do no match.
126 MeshVisual.set_data(
127 self, vertices=vertices, faces=faces, vertex_colors=vertex_colors,
128 face_colors=face_colors, vertex_values=vertex_values,
129 meshdata=meshdata, color=color)
130
131 # primitive mode
132 self._draw_mode = mode
133
134 self.freeze()
135
136 @property
137 def shading(self):

Callers

nothing calls this directly

Calls 7

VertexBufferClass · 0.85
CubeHelixColormapClass · 0.85
freezeMethod · 0.80
ColorClass · 0.50
set_gl_stateMethod · 0.45
addMethod · 0.45
set_dataMethod · 0.45

Tested by

no test coverage detected