from OpenGL.GL import * | from minigl import * from OpenGL.GLU import * | import itertools | | 'cone_xy_alpha': 1/4., | 'cone_uv_alpha': 1/4., | 'axis_z_alpha': 1/4., | 'overlay_foreground_alpha_xy': 1/3., | 'overlay_background_alpha_xy': 1/3., 'overlay_alpha': 0.75, | 'overlay_alpha': 0.35, 'tool_alpha': 0.20, | 'tool_alpha': 0.50, geometry_chars = "XYZABCUVW-!;" | geometry_chars = "XYZABCUVW-!" buffer = glRenderMode(GL_RENDER) | buffer = list(glRenderMode(GL_RENDER)) min_depth, max_depth, names = (buffer[0].near, buffer[0].far, buffer[0].names) | min_depth, max_depth, names = min(buffer) for x in buffer: | if min_depth < x.near: | min_depth, max_depth, names = (x.near, x.far, x.names) | | glEnable(GL_BLEND); | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | | | | | | glEnable(GL_BLEND); | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | | | | glLoadIdentity (); | glMatrixMode (GL_PROJECTION); | glPushMatrix (); | glLoadIdentity (); | | glDisable(GL_DEPTH_TEST); | | glBegin (GL_QUADS); | glColor3f(0.1,0.1,0.125); # bottom left color | glVertex3f (-1.0, -1.0, -1.0); | glVertex3f (1.0, -1.0, -1.0); | | glColor3f(0.08,0.08,0.4); # top right color | glVertex3f (1.0, 1.0, -1.0); | glVertex3f (-1.0, 1.0, -1.0); | glEnd () | | glEnable(GL_BLEND); | glEnable(GL_LIGHTING); | glEnable(GL_DEPTH_TEST); | glPopMatrix (); | glMatrixMode (GL_MODELVIEW); | glPopMatrix (); | glMatrixMode (GL_PROJECTION); | glPopMatrix() # Restore the matrix | | | | | glEnable(GL_BLEND); | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | | | glBegin (GL_QUADS); | glColor3f(0.1,0.1,0.125); # bottom left color | glVertex3f (-w, -1.0, -1.0); | glVertex3f (w, -w, -1.0); | | glColor3f(0.08,0.08,0.4); # top right color | glVertex3f (h, 1.0, -1.0); | glVertex3f (-h, h, -1.0); | glEnd () | | | | | | if sys.version_info[0] == 3: | else: | glBitmap(13, 16, 0, 3, 17, 0, icon.tostring()) spd = self.to_internal_linear_unit(s.current_vel) | | spd = self.to_internal_linear_unit(s.current_vel) return self.dro_format(self.stat,spd,dtg,limit,homed,positions, | axisdtg,g5x_offset,g92_offset,tlo_offset) | # Note: hal_gremlin overrides dro_format() for different dro behavior | limit, homed, posstrs, droposstrs = self.dro_format(self.stat,spd,dtg,limit,homed,positions,axisdtg,g5x_offset,g92_offset,tlo_offset) return self.joint_dro_format(s,spd,self.get_num_joints(),limit, homed) | | # Note: this is overridden in other guis (then AXIS) for different dro behavior | def joint_dro_format(self,s,spd,num_of_joints,limit, homed): | # Note: this is overridden in other guis (then AXIS) for different dro behavior |