Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
Lesson2Wx.VisPanel Class Reference
Inheritance diagram for Lesson2Wx.VisPanel:

Public Member Functions

def __init__
 
def cmdExpand
 
def cmdShrink
 
def cmdUp
 
def cmdDown
 
def cmdRight
 
def cmdLeft
 
def ViewerSelected
 

Data Fields

 visZoomIn
 
 visZoomOut
 
 visUp
 
 visDown
 
 visLeft
 
 visRight
 
 viewer
 
 viewerName
 

Detailed Description

Definition at line 205 of file Lesson2Wx.py.

Constructor & Destructor Documentation

def Lesson2Wx.VisPanel.__init__ (   self,
  parent 
)

Definition at line 206 of file Lesson2Wx.py.

207  def __init__(self, parent):
208  wx.Panel.__init__(self, parent, -1)
210  self.visZoomIn = wx.Button(parent, -1, "Zoom In", pos=(10,100), size=(80,30))
211  self.visZoomOut = wx.Button(parent, -1, "Zoom out", pos=(100,100), size=(80,30))
212  self.visUp = wx.Button(parent, -1, "Up", pos=(190,100), size=(80,30))
213  self.visDown = wx.Button(parent, -1, "Down", pos=(270,100), size=(80,30))
214  self.visLeft = wx.Button(parent, -1, "Left", pos=(360,100), size=(80,30))
215  self.visRight = wx.Button(parent, -1, "Left", pos=(450,100), size=(80,30))
216 
217  viewerList = ["OpenGL", "VRML", "Wired"]
218  self.viewer = wx.RadioBox(self, -1, "Viewer", pos=(10,10),
219  size=(210,60), choices=viewerList, majorDimension=1, style=wx.RA_SPECIFY_ROWS)
220  self.viewer.Bind(wx.EVT_RADIOBOX, self.ViewerSelected, self.viewer)
221  self.viewer.SetToolTip(wx.ToolTip("Select one"))
222  self.viewer.SetSelection(0)
223  if vrmlViewer == None: self.viewer.EnableItem(1, False)
224  if heprepViewer == None: self.viewer.EnableItem(2, False)
225 # self.sizer = wx.BoxSizer(wx.HORIZONTAL)
226 # self.sizer.Add((20,30))
227 # self.sizer.Add(self.visZoomIn)
228 # self.sizer.Add(self.visZoomOut)
229 # self.sizer.Add(self.visUp)
230 # self.sizer.Add(self.visDown)
231 # self.sizer.Add(self.visRight)
232 # self.sizer.Add(self.visLeft)
233 # self.SetSizer(self.sizer)
234 
235 # self.visZoomIn = wx.Button(parent, -1, "Zoom In", pos=(10,70), size=(80,30))
236 # self.visZoomOut = wx.Button(parent, -1, "Zoom out", pos=(100,70), size=(80,30))
237 # self.visUp = wx.Button(parent, -1, "Up", pos=(10,50), size=(190,70))
238 # self.visDown = wx.Button(parent, -1, "Down", pos=(100,50), size=(270,70))
239 # self.visLeft = wx.Button(parent, -1, "Left", pos=(10,90), size=(360,70))
240 # self.visRight = wx.Button(parent, -1, "Left", pos=(100,90), size=(450,70))
241 
242 
243 
244  self.visZoomIn.Bind(wx.EVT_BUTTON, self.cmdExpand, self.visZoomIn)
245  self.visZoomOut.Bind(wx.EVT_BUTTON, self.cmdShrink, self.visZoomOut)
246  self.visUp.Bind(wx.EVT_BUTTON, self.cmdUp, self.visUp)
247  self.visDown.Bind(wx.EVT_BUTTON, self.cmdDown, self.visDown)
248  self.visRight.Bind(wx.EVT_BUTTON, self.cmdRight, self.visRight)
249  self.visLeft.Bind(wx.EVT_BUTTON, self.cmdLeft, self.visLeft)

Member Function Documentation

def Lesson2Wx.VisPanel.cmdDown (   self,
  event 
)

Definition at line 256 of file Lesson2Wx.py.

References python.gApplyUICommand.

257  def cmdDown(self, event):
gApplyUICommand("/vis/viewer/pan " + " 0. -10. mm")
def Lesson2Wx.VisPanel.cmdExpand (   self,
  event 
)

Definition at line 250 of file Lesson2Wx.py.

References python.gApplyUICommand.

251  def cmdExpand(self, event):
gApplyUICommand("/vis/viewer/zoom 1.2")
def Lesson2Wx.VisPanel.cmdLeft (   self,
  event 
)

Definition at line 260 of file Lesson2Wx.py.

References python.gApplyUICommand.

261  def cmdLeft(self, event):
262  gApplyUICommand("/vis/viewer/pan " + " 10. 0. mm")
def Lesson2Wx.VisPanel.cmdRight (   self,
  event 
)

Definition at line 258 of file Lesson2Wx.py.

References python.gApplyUICommand.

259  def cmdRight(self, event):
gApplyUICommand("/vis/viewer/pan " + " -10. 0. mm")
def Lesson2Wx.VisPanel.cmdShrink (   self,
  event 
)

Definition at line 252 of file Lesson2Wx.py.

References python.gApplyUICommand.

253  def cmdShrink(self, event):
gApplyUICommand("/vis/viewer/zoom 0.8")
def Lesson2Wx.VisPanel.cmdUp (   self,
  event 
)

Definition at line 254 of file Lesson2Wx.py.

References python.gApplyUICommand.

255  def cmdUp(self, event):
gApplyUICommand("/vis/viewer/pan " + " 0. 10. mm")
def Lesson2Wx.VisPanel.ViewerSelected (   self,
  event 
)

Definition at line 263 of file Lesson2Wx.py.

264  def ViewerSelected(self, event):
265  self.viewerName = event.GetString()
266 
267  if self.viewerName == "OpenGL":
268  gApplyUICommand("/vis/viewer/select oglsxviewer")
269  gApplyUICommand("/vis/scene/add/trajectories")
270 
271  gApplyUICommand("/tracking/storeTrajectory 1")
272  gApplyUICommand("/vis/scene/endOfEventAction accumulate")
273  gApplyUICommand("/vis/scene/endOfRunAction accumulate")
274 
275  if self.viewerName == "VRML":
276  gApplyUICommand("/vis/viewer/select vrmlviewer")
277  gApplyUICommand("/vis/scene/add/trajectories")
278 
279  gApplyUICommand("/tracking/storeTrajectory 1")
280  gApplyUICommand("/vis/scene/endOfEventAction accumulate")
281  gApplyUICommand("/vis/scene/endOfRunAction accumulate")
282 
283  if self.viewerName == "Wired":
284 
285  gApplyUICommand("/vis/viewer/select wired")
286  gApplyUICommand("/vis/scene/add/trajectories")
287 
288  gApplyUICommand("/tracking/storeTrajectory 1")
289  gApplyUICommand("/vis/scene/endOfEventAction accumulate")
290  gApplyUICommand("/vis/scene/endOfRunAction accumulate")
291 
292 # everytime wired is chosen, a new instance of wired is created
293 # to reuse single wired, g4pipe.poll() must be checked BEFORE the SECOND Popen
294 # if g4pipe.poll() == None:
295  g4pipe=Popen(heprepViewer+ " -file " + heprepDir+"/" +heprepName +".heprep", shell=True)
296 
297 
298 
# not used

Field Documentation

Lesson2Wx.VisPanel.viewer

Definition at line 217 of file Lesson2Wx.py.

Lesson2Wx.VisPanel.viewerName

Definition at line 264 of file Lesson2Wx.py.

Lesson2Wx.VisPanel.visDown

Definition at line 212 of file Lesson2Wx.py.

Lesson2Wx.VisPanel.visLeft

Definition at line 213 of file Lesson2Wx.py.

Lesson2Wx.VisPanel.visRight

Definition at line 214 of file Lesson2Wx.py.

Lesson2Wx.VisPanel.visUp

Definition at line 211 of file Lesson2Wx.py.

Lesson2Wx.VisPanel.visZoomIn

Definition at line 209 of file Lesson2Wx.py.

Lesson2Wx.VisPanel.visZoomOut

Definition at line 210 of file Lesson2Wx.py.


The documentation for this class was generated from the following file: