Changeset 985


Ignore:
Timestamp:
Jul 10, 2013 4:25:58 AM (8 years ago)
Author:
vondreele
Message:

remove glFreeType & add gltext - works much better
implement gltext - works in 64 bit python/opengl
needs a bit of work for model rotation

Location:
trunk
Files:
1 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r984 r985  
    4040from  OpenGL.GL import *
    4141from OpenGL.GLU import *
    42 #from OpenGL.GLUT import *
     42from OpenGL.GLUT import *
    4343from OpenGL.GLE import *
    44 import glFreeType
     44import gltext
    4545from matplotlib.backends.backend_wx import _load_bitmap
    4646from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas
     
    26962696    Bl = np.array([0,0,255])
    26972697    Or = np.array([255,128,0])
    2698     our_font = getFont()
     2698#    our_font = getFont()
    26992699    uBox = np.array([[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]])
    27002700    uEdges = np.array([
     
    33083308        glColor3fv(color)
    33093309        glRasterPos3f(0,0,0)
    3310 #        our_font.glPrint(300,300,label)
    3311 #        for c in list(label):
    3312 #            glutBitmapCharacter(GLUT_BITMAP_8_BY_13,ord(c))
     3310        if bool(glutBitmapCharacter):       #seems to only exist in 32 bit Windows
     3311            for c in list(label):
     3312                glutBitmapCharacter(GLUT_BITMAP_8_BY_13,ord(c))
     3313        else:
     3314            text = gltext.TextElement(text=label,font=Font)
     3315            text.draw_text(scale=0.025)
     3316#           our_font.glPrint(0,0,label)
    33133317        glEnable(GL_LIGHTING)
    33143318        glPopMatrix()
     
    35543558        view = False
    35553559        altDown = False
     3560    Font = Page.GetFont()
    35563561    Page.SetFocus()
    35573562    Page.Choice = None
     
    36143619    uEdges = np.array([[uBox[0],uBox[1]],[uBox[0],uBox[2]],[uBox[0],uBox[3]]])
    36153620    uColors = [Rd,Gr,Bl]
    3616     our_font = getFont()
    36173621    if rbType == 'Vector':
    36183622        atNames = [str(i)+':'+Ty for i,Ty in enumerate(rbData['rbTypes'])]
     
    37893793        glColor3f(1.0,1.0,1.0)
    37903794        glRasterPos3f(0,0,0)
    3791 #        our_font.glPrint(0,0,label)
    3792 #        for c in list(label):
    3793 #            glutBitmapCharacter(GLUT_BITMAP_8_BY_13,ord(c))
     3795        if bool(glutBitmapCharacter):
     3796            for c in list(label):
     3797                glutBitmapCharacter(GLUT_BITMAP_8_BY_13,ord(c))
     3798        else:
     3799            text = gltext.TextElement(text=label,font=Font)
     3800            text.draw_text(scale=0.025)
    37943801        glEnable(GL_LIGHTING)
    37953802        glPopMatrix()
     
    38463853        altDown = False
    38473854    Page.SetFocus()
     3855    Font = Page.GetFont()
    38483856    Page.canvas.Bind(wx.EVT_MOUSEWHEEL, OnMouseWheel)
    38493857    Page.canvas.Bind(wx.EVT_LEFT_DOWN, OnMouseDown)
Note: See TracChangeset for help on using the changeset viewer.