MCPcopy Create free account
hub / github.com/aosabook/500lines / render

Method render

modeller/code/node.py:21–35  ·  view source on GitHub ↗

renders the item to the screen

(self)

Source from the content-addressed store, hash-verified

19 self.selected = False
20
21 def render(self):
22 """ renders the item to the screen """
23 glPushMatrix()
24 glMultMatrixf(numpy.transpose(self.translation_matrix))
25 glMultMatrixf(self.scaling_matrix)
26 cur_color = color.COLORS[self.color_index]
27 glColor3f(cur_color[0], cur_color[1], cur_color[2])
28 if self.selected: # emit light if the node is selected
29 glMaterialfv(GL_FRONT, GL_EMISSION, [0.3, 0.3, 0.3])
30
31 self.render_self()
32 if self.selected:
33 glMaterialfv(GL_FRONT, GL_EMISSION, [0.0, 0.0, 0.0])
34
35 glPopMatrix()
36
37 def render_self(self):
38 raise NotImplementedError("The Abstract Node Class doesn't define 'render_self'")

Callers 4

highcharts.jsFile · 0.45
getMethod · 0.45
render_selfMethod · 0.45
main.jsFile · 0.45

Calls 1

render_selfMethod · 0.95

Tested by

no test coverage detected