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

Class TextExpression

vispy/visuals/shaders/expression.py:17–50  ·  view source on GitHub ↗

Plain GLSL text to insert inline

Source from the content-addressed store, hash-verified

15
16
17class TextExpression(Expression):
18 """Plain GLSL text to insert inline"""
19
20 def __init__(self, text):
21 super(TextExpression, self).__init__()
22 if not isinstance(text, str):
23 raise TypeError("Argument must be string.")
24 self._text = text
25
26 def __repr__(self):
27 return '<TextExpression %r for at 0x%x>' % (self.text, id(self))
28
29 def expression(self, names=None):
30 return self._text
31
32 @property
33 def text(self):
34 return self._text
35
36 @text.setter
37 def text(self, t):
38 self._text = t
39 self.changed()
40
41 def __eq__(self, a):
42 if isinstance(a, TextExpression):
43 return a._text == self._text
44 elif isinstance(a, str):
45 return a == self._text
46 else:
47 return False
48
49 def __hash__(self):
50 return self._text.__hash__()
51
52
53class FunctionCall(Expression):

Callers 2

test_TextExpressionFunction · 0.90
createMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_TextExpressionFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…