Changeset 161
- Timestamp:
- Oct 5, 2010 3:31:16 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r155 r161 194 194 def _init_ctrls(self, parent): 195 195 wx.Frame.__init__(self, name='GSASII', parent=parent, 196 size=wx.Size(300, 250),style=wx.DEFAULT_FRAME_STYLE, title='GSAS-II ')196 size=wx.Size(300, 250),style=wx.DEFAULT_FRAME_STYLE, title='GSAS-II data tree') 197 197 screenSize = wx.DisplaySize() 198 198 Size = self.GetSize() -
trunk/GSASIIphsGUI.py
r158 r161 127 127 self.SelectedRow = 0 128 128 129 def BookResize(event):130 w,h = self.GetSize()131 self.dataDisplay.SetSize(wx.Size(w,h))132 129 # def BookResize(event): 130 # w,h = self.GetSize() 131 # self.dataDisplay.SetSize(wx.Size(w,h)) 132 # 133 133 def UpdateGeneral(): 134 134 generalData = data['General'] … … 141 141 generalData['AtomMass'] = [] 142 142 generalData['Color'] = [] 143 generalData['Myself'] = self 143 144 colType = 1 144 145 colSS = 7 -
trunk/GSASIIplot.py
r158 r161 110 110 return 111 111 112 def OnPageChanged(self,event): 112 def OnPageChanged(self,event): 113 if self.plotList: 114 self.status.SetStatusText('Better to select this from GSAS-II data tree',1) 113 115 self.status.DestroyChildren() #get rid of special stuff on status bar 114 116 … … 1120 1122 def PlotStructure(self,data): 1121 1123 generalData = data['General'] 1124 Myself = generalData['Myself'] 1122 1125 atomData = data['Atoms'] 1123 1126 drawingData = data['Drawing'] … … 1133 1136 [uBox[4],uBox[5]],[uBox[5],uBox[6]],[uBox[6],uBox[7]],[uBox[7],uBox[4]]]) 1134 1137 uColors = [Rd,Gr,Bl,Wt, Wt,Wt,Wt,Wt, Wt,Wt,Wt,Wt] 1138 1139 def OnKeyBox(event): 1140 import Image 1141 Draw() 1142 mode = cb.GetValue() 1143 dirname = Myself.dirname 1144 Fname = dirname+'\\'+generalData['Name']+'.'+mode 1145 size = Page.canvas.GetSize() 1146 glPixelStorei(GL_UNPACK_ALIGNMENT, 1) 1147 if mode in ['jpeg',]: 1148 Pix = glReadPixels(0,0,size[0],size[1],GL_RGBA, GL_UNSIGNED_BYTE) 1149 im = Image.new("RGBA", (size[0],size[1])) 1150 else: 1151 Pix = glReadPixels(0,0,size[0],size[1],GL_RGB, GL_UNSIGNED_BYTE) 1152 im = Image.new("RGB", (size[0],size[1])) 1153 im.fromstring(Pix) 1154 im.save(Fname,mode) 1155 cb.SetValue(' save as:') 1156 Draw() 1135 1157 1136 1158 def OnMouseDown(event): … … 1298 1320 def RenderBox(): 1299 1321 glEnable(GL_COLOR_MATERIAL) 1322 glLineWidth(3) 1323 glEnable(GL_BLEND) 1324 glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA) 1325 glEnable(GL_LINE_SMOOTH) 1300 1326 glBegin(GL_LINES) 1301 1327 for line,color in zip(uEdges,uColors): … … 1305 1331 glEnd() 1306 1332 glColor4ubv([0,0,0,0]) 1333 glDisable(GL_LINE_SMOOTH) 1334 glDisable(GL_BLEND) 1307 1335 glDisable(GL_COLOR_MATERIAL) 1308 1336 … … 1310 1338 xyz = np.array([x,y,z]) 1311 1339 glEnable(GL_COLOR_MATERIAL) 1340 glLineWidth(1) 1312 1341 glPushMatrix() 1313 1342 glTranslate(x,y,z) … … 1367 1396 xyz = np.array([x,y,z]) 1368 1397 glEnable(GL_COLOR_MATERIAL) 1398 glLineWidth(1) 1369 1399 glColor4fv(color) 1370 1400 glPushMatrix() … … 1556 1586 view = False 1557 1587 Page.SetFocus() 1588 cb = wx.ComboBox(self.G2plotNB.status,style=wx.CB_DROPDOWN|wx.CB_READONLY, 1589 choices=(' save as:','jpeg','tiff','bmp')) 1590 cb.Bind(wx.EVT_COMBOBOX, OnKeyBox) 1591 cb.SetValue(' save as:') 1558 1592 Page.canvas.Bind(wx.EVT_MOUSEWHEEL, OnMouseWheel) 1559 1593 Page.canvas.Bind(wx.EVT_LEFT_DOWN, OnMouseDown)
Note: See TracChangeset
for help on using the changeset viewer.