Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
Lesson1Wx.VisPanel Class Reference
Inheritance diagram for Lesson1Wx.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 189 of file Lesson1Wx.py.

Constructor & Destructor Documentation

def Lesson1Wx.VisPanel.__init__ (   self,
  parent 
)

Definition at line 190 of file Lesson1Wx.py.

191  def __init__(self, parent):
192  wx.Panel.__init__(self, parent, -1)
194  self.visZoomIn = wx.Button(parent, -1, "Zoom In", pos=(10,100), size=(80,30))
195  self.visZoomOut = wx.Button(parent, -1, "Zoom out", pos=(100,100), size=(80,30))
196  self.visUp = wx.Button(parent, -1, "Up", pos=(190,100), size=(80,30))
197  self.visDown = wx.Button(parent, -1, "Down", pos=(270,100), size=(80,30))
198  self.visLeft = wx.Button(parent, -1, "Left", pos=(360,100), size=(80,30))
199  self.visRight = wx.Button(parent, -1, "Left", pos=(450,100), size=(80,30))
200 
201  viewerList = ["OpenGL", "VRML", "Wired"]
202  self.viewer = wx.RadioBox(self, -1, "Viewer", pos=(10,10),
203  size=(210,60), choices=viewerList, majorDimension=1, style=wx.RA_SPECIFY_ROWS)
204  self.viewer.Bind(wx.EVT_RADIOBOX, self.ViewerSelected, self.viewer)
205  self.viewer.SetToolTip(wx.ToolTip("Select one"))
206  self.viewer.SetSelection(0)
207  if vrmlViewer == None: self.viewer.EnableItem(1, False)
208  if heprepViewer == None: self.viewer.EnableItem(2, False)
209 
210  self.visZoomIn.Bind(wx.EVT_BUTTON, self.cmdExpand, self.visZoomIn)
211  self.visZoomOut.Bind(wx.EVT_BUTTON, self.cmdShrink, self.visZoomOut)
212  self.visUp.Bind(wx.EVT_BUTTON, self.cmdUp, self.visUp)
213  self.visDown.Bind(wx.EVT_BUTTON, self.cmdDown, self.visDown)
214  self.visRight.Bind(wx.EVT_BUTTON, self.cmdRight, self.visRight)
215  self.visLeft.Bind(wx.EVT_BUTTON, self.cmdLeft, self.visLeft)
216 

Member Function Documentation

def Lesson1Wx.VisPanel.cmdDown (   self,
  event 
)

Definition at line 223 of file Lesson1Wx.py.

References python.gApplyUICommand.

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

Definition at line 217 of file Lesson1Wx.py.

References python.gApplyUICommand.

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

Definition at line 227 of file Lesson1Wx.py.

References python.gApplyUICommand.

228  def cmdLeft(self, event):
229  gApplyUICommand("/vis/viewer/pan " + " 1. 0. mm")
def Lesson1Wx.VisPanel.cmdRight (   self,
  event 
)

Definition at line 225 of file Lesson1Wx.py.

References python.gApplyUICommand.

226  def cmdRight(self, event):
gApplyUICommand("/vis/viewer/pan " + " -1. 0. mm")
def Lesson1Wx.VisPanel.cmdShrink (   self,
  event 
)

Definition at line 219 of file Lesson1Wx.py.

References python.gApplyUICommand.

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

Definition at line 221 of file Lesson1Wx.py.

References python.gApplyUICommand.

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

Definition at line 230 of file Lesson1Wx.py.

231  def ViewerSelected(self, event):
232  self.viewerName = event.GetString()
233 
234  if self.viewerName == "OpenGL":
235  gApplyUICommand("/vis/viewer/select oglsxviewer")
236  gApplyUICommand("/vis/drawVolume")
237  gApplyUICommand("/vis/scene/add/trajectories")
238 
239  gApplyUICommand("/tracking/storeTrajectory 1")
240  gApplyUICommand("/vis/scene/endOfEventAction accumulate")
241  gApplyUICommand("/vis/scene/endOfRunAction accumulate")
242 
243  if self.viewerName == "VRML":
244  gApplyUICommand("/vis/viewer/select vrmlviewer")
245 
246  gApplyUICommand("/vis/viewer/set/viewpointThetaPhi 90. 0.")
247  gApplyUICommand("/vis/viewer/set/style s")
248  gApplyUICommand("/vis/drawVolume")
249  gApplyUICommand("/vis/scene/add/trajectories")
250 
251  gApplyUICommand("/tracking/storeTrajectory 1")
252  gApplyUICommand("/vis/scene/endOfEventAction accumulate")
253  gApplyUICommand("/vis/scene/endOfRunAction accumulate")
254 
255  if self.viewerName == "Wired":
256 
257  gApplyUICommand("/vis/viewer/select wired")
258 
259  gApplyUICommand("/vis/viewer/set/viewpointThetaPhi 90. 0.")
260  gApplyUICommand("/vis/viewer/set/style s")
261  gApplyUICommand("/vis/drawVolume")
262  gApplyUICommand("/vis/scene/add/trajectories")
263 
264  gApplyUICommand("/tracking/storeTrajectory 1")
265  gApplyUICommand("/vis/scene/endOfEventAction accumulate")
266  gApplyUICommand("/vis/scene/endOfRunAction accumulate")
267 
268 # everytime wired is chosen, a new instance of wired is created
269 # to reuse single wired, g4pipe.poll() must be checked BEFORE the SECOND Popen
270 # if g4pipe.poll() == None:
271  g4pipe=Popen(heprepViewer+ " -file " + heprepDir+"/" +heprepName +".heprep", shell=True)
272 
273 
# not used

Field Documentation

Lesson1Wx.VisPanel.viewer

Definition at line 201 of file Lesson1Wx.py.

Lesson1Wx.VisPanel.viewerName

Definition at line 231 of file Lesson1Wx.py.

Lesson1Wx.VisPanel.visDown

Definition at line 196 of file Lesson1Wx.py.

Lesson1Wx.VisPanel.visLeft

Definition at line 197 of file Lesson1Wx.py.

Lesson1Wx.VisPanel.visRight

Definition at line 198 of file Lesson1Wx.py.

Lesson1Wx.VisPanel.visUp

Definition at line 195 of file Lesson1Wx.py.

Lesson1Wx.VisPanel.visZoomIn

Definition at line 193 of file Lesson1Wx.py.

Lesson1Wx.VisPanel.visZoomOut

Definition at line 194 of file Lesson1Wx.py.


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