Changeset 4766


Ignore:
Timestamp:
Jan 14, 2021 11:15:32 AM (4 years ago)
Author:
vondreele
Message:

modify atom labeling routine to allow specified offset as wx.RealPoint? - now only used for MapPeaks? plotting

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASIIplot.py

    r4765 r4766  
    91539153        GL.glDisable(GL.GL_COLOR_MATERIAL)
    91549154       
    9155     def RenderLabel(x,y,z,label,r,color,matRot):
     9155    def RenderLabel(x,y,z,label,r,color,matRot,offset=wx.RealPoint(0.,0.)):
    91569156        '''
    91579157        color wx.Colour object
     
    91659165        GL.glRotate(180,1,0,0)             #fix to flip about x-axis
    91669166        text = gltext.Text(text='   '+label,font=Font,foreground=color)
    9167         text.draw_text(scale=0.025)
     9167        text.draw_text(scale=0.025,position=offset)
    91689168        GL.glEnable(GL.GL_LIGHTING)
    91699169        GL.glPopMatrix()
     
    92509250                        RenderLabel(lx,ly,lz,lbl,radius,wxGreen,matRot)
    92519251                        ax,ay,az = xyz
    9252                         RenderLabel(ax,ay,az,'  '+atomB[0],radius,wxGreen,matRot)
     9252                        RenderLabel(ax,ay,az,atomB[0],radius,wxGreen,matRot,offset=wx.RealPoint(0.,-.5))
    92539253        # find bonds
    92549254        bondData = [[] for i in range(len(Atoms))]
  • TabularUnified trunk/gltext.py

    r3136 r4766  
    9999    #---Functions
    100100   
    101     def draw_text(self, position = wx.Point(0,0), scale = 1.0, rotation = 0):
    102         """
    103         position (wx.Point)    - x/y Position to draw in scene
     101    def draw_text(self, position = wx.RealPoint(0.,0.), scale = 1.0, rotation = 0):
     102        """
     103        position (wx.RealPoint)    - x/y Position to draw in scene
    104104        scale    (float)       - Scale
    105105        rotation (int)         - Rotation in degree
     
    121121        #Perform transformations
    122122        GL.glPushMatrix()
    123         GL.glTranslated(position.x, position.y, 0)
     123        GL.glTranslatef(position.x, position.y, 0)
    124124        GL.glRotate(-rotation, 0, 0, 1)
    125125        GL.glScaled(scale, scale, scale)
     
    415415    #---Functions
    416416       
    417     def draw_text(self, position = wx.Point(0,0), scale = 1.0, rotation = 0):
    418         """
    419         position (wx.Point)    - x/y Position to draw in scene
     417    def draw_text(self, position = wx.RealPoint(0.,0.), scale = 1.0, rotation = 0):
     418        """
     419        position (wx.RealPoint)    - x/y Position to draw in scene
    420420        scale    (float)       - Scale
    421421        rotation (int)         - Rotation in degree
Note: See TracChangeset for help on using the changeset viewer.