12 may 2007 geant4 visualization commands j. perl 1 dawn opengl geant4 visualization commands basic...

20
12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

Post on 21-Dec-2015

245 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 Geant4 Visualization Commands J. Perl 1

DAWN

OpenGL

Geant4 Visualization Commands

Basic Visualization Commands

Joseph Perl, SLACHepRep/HepRApp

Page 2: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 2Geant4 Visualization Commands J. Perl

How this Document Fits withHow this Document Fits withOther Tutorial MaterialsOther Tutorial Materials

This presentation can be used on its own, but gives the most This presentation can be used on its own, but gives the most comprehensive introduction to Geant4 visualization when used as part of comprehensive introduction to Geant4 visualization when used as part of the following full set of documents: the following full set of documents:

Introduction to Geant4 VisualizationIntroduction to Geant4 Visualization Geant4 Installation GuidesGeant4 Installation Guides Geant4 Visualization Tutorial using the HepRApp HepRep BrowserGeant4 Visualization Tutorial using the HepRApp HepRep Browser Geant4 Visualization Tutorial using the DAWN Event DisplayGeant4 Visualization Tutorial using the DAWN Event Display Geant4 Visualization Tutorial using the OpenGL Event DisplayGeant4 Visualization Tutorial using the OpenGL Event Display Geant4 Visualization CommandsGeant4 Visualization Commands Geant4 Advanced VisualizationGeant4 Advanced Visualization See the URLS at the end of this presentationSee the URLS at the end of this presentation

This presentation discusses seven visualization drivers:This presentation discusses seven visualization drivers: OpenGLOpenGL OpenInventorOpenInventor HepRepHepRep DAWNDAWN VRMLVRML RayTracerRayTracer ASCIITreeASCIITree

Page 3: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 3Geant4 Visualization Commands J. Perl

What’s in this PresentationWhat’s in this Presentation

This presentation covers just enough about Geant4 Visualization CommandsThis presentation covers just enough about Geant4 Visualization Commandsto get you started (plus a few interesting small digressions)to get you started (plus a few interesting small digressions)

Further presentations cover more advanced topicsFurther presentations cover more advanced topics modelingmodeling filteringfiltering moviesmovies etc.etc. See references at the end of this presentationSee references at the end of this presentation

Page 4: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 4Geant4 Visualization Commands J. Perl

Visualization CommandsVisualization Commands Open a visualization driver, such as:Open a visualization driver, such as:

/vis/open HepRepFile/vis/open HepRepFile

Add the detector geometryAdd the detector geometry /vis/drawVolume/vis/drawVolume

If using an immediate viewer, such as OpenGL, set camera parameters and drawing If using an immediate viewer, such as OpenGL, set camera parameters and drawing style (wireframe/surface), such as:style (wireframe/surface), such as:

/vis/viewer/set/style wireframe /vis/viewer/set/style wireframe /vis/viewer/set/viewpointThetaPhi 70 20/vis/viewer/set/viewpointThetaPhi 70 20

Declare what data should be added to the scene (default is to just add full set of Declare what data should be added to the scene (default is to just add full set of detector volumes)detector volumes)

/vis/scene/add/trajectories/vis/scene/add/trajectories /vis/scene/add/hits/vis/scene/add/hits

Run simulation with appropriate options to store trajectory information:Run simulation with appropriate options to store trajectory information: /run/beamOn 1/run/beamOn 1

Execute the visualization (done automatically with each /run/beamOn, but needed by Execute the visualization (done automatically with each /run/beamOn, but needed by some drivers if you want to output geometry without running an event):some drivers if you want to output geometry without running an event):

/vis/viewer/flush/vis/viewer/flush

If using an external viewer, such as for HepRepFile or DAWNFILE:If using an external viewer, such as for HepRepFile or DAWNFILE: import the .heprep or .prim file into HepRApp or DAWN, set camera parameters, drawing import the .heprep or .prim file into HepRApp or DAWN, set camera parameters, drawing

style, etc., view the visualizationstyle, etc., view the visualization

Page 5: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 5Geant4 Visualization Commands J. Perl

Example Visualization Command SequencesExample Visualization Command Sequences

Visualize a detector in OpenGL (Linux or Mac):Visualize a detector in OpenGL (Linux or Mac): /vis/open OGLIX/vis/open OGLIX /vis/drawVolume/vis/drawVolume

Visualize a detector in OpenGL (Windows):Visualize a detector in OpenGL (Windows): /vis/open OGLSWin32/vis/open OGLSWin32 /vis/drawVolume/vis/drawVolume

Visualize trajectories and hits for 10 events using HepRep/HepRAppVisualize trajectories and hits for 10 events using HepRep/HepRApp /vis/open HepRepFile/vis/open HepRepFile /vis/drawVolume/vis/drawVolume /vis/scene/add/trajectories/vis/scene/add/trajectories /vis/scene/add/hits/vis/scene/add/hits /run/beamOn 10/run/beamOn 10

Page 6: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 6Geant4 Visualization Commands J. Perl

Command GuidanceCommand Guidance Complete guidance on all commands is available from the command line:Complete guidance on all commands is available from the command line:

Idle> helpIdle> help Command directory path : /Command directory path : / Sub-directories :Sub-directories : 1) /control/ UI control commands.1) /control/ UI control commands. 2) /units/ Available units.2) /units/ Available units. 3) /geometry/ Geometry control commands.3) /geometry/ Geometry control commands. 4) /tracking/ TrackingManager and SteppingManager control commands.4) /tracking/ TrackingManager and SteppingManager control commands. 5) /event/ EventManager control commands.5) /event/ EventManager control commands. 6) /run/ Run control commands.6) /run/ Run control commands. 7) /random/ Random number status control commands.7) /random/ Random number status control commands. 8) /particle/ Particle control commands.8) /particle/ Particle control commands. 9) /process/ Process Table control commands.9) /process/ Process Table control commands. 10) /vis/ Visualization commands.10) /vis/ Visualization commands. 11) /mydet/ A01 detector setup control commands.11) /mydet/ A01 detector setup control commands. 12) /hits/ Sensitive detectors and Hits12) /hits/ Sensitive detectors and Hits 13) /gun/ Particle Gun control commands.13) /gun/ Particle Gun control commands. Commands :Commands : Type the number ( 0:end, -n:n level back ) :Type the number ( 0:end, -n:n level back ) :

Page 7: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 7Geant4 Visualization Commands J. Perl

Guidance DetailGuidance Detail Guidance is hierarchical, providing full detail on all commands.Guidance is hierarchical, providing full detail on all commands.

Command /vis/openCommand /vis/open

Creates a scene handler ready for drawing.Creates a scene handler ready for drawing. The scene handler becomes currentThe scene handler becomes current

(the name is auto-generated).(the name is auto-generated).

Parameter : graphics-system-nameParameter : graphics-system-name Parameter type : sParameter type : s Omittable : FalseOmittable : False Candidates : ATree DAWNFILECandidates : ATree DAWNFILE

GAGTree HepRepXML HepRepFileGAGTree HepRepXML HepRepFileRayTracer VRML1FILE VRML2FILERayTracer VRML1FILE VRML2FILEOGLIX OGLSXOGLIX OGLSX

Parameter : window-size-hintParameter : window-size-hint pixelspixels

Parameter type : iParameter type : i Omittable : TrueOmittable : True Default value : 600Default value : 600

Sub-directories : Sub-directories : 1) /vis/ASCIITree/ Commands for ASCIITree control.1) /vis/ASCIITree/ Commands for ASCIITree control. 2) /vis/GAGTree/ Commands for GAGTree control.2) /vis/GAGTree/ Commands for GAGTree control. 3) /vis/heprep/ HepRep commands.3) /vis/heprep/ HepRep commands. 4) /vis/rayTracer/ RayTracer commands.4) /vis/rayTracer/ RayTracer commands. 5) /vis/scene/ Operations on Geant4 scenes.5) /vis/scene/ Operations on Geant4 scenes. 6) /vis/sceneHandler/ Operations on Geant4 scene handlers.6) /vis/sceneHandler/ Operations on Geant4 scene handlers. 7) /vis/viewer/ Operations on Geant4 viewers.7) /vis/viewer/ Operations on Geant4 viewers. Commands : Commands : 8) enable * Enables/disables visualization system.8) enable * Enables/disables visualization system. 9) disable * Disables visualization system.9) disable * Disables visualization system. 10) verbose * Simple graded message scheme -10) verbose * Simple graded message scheme -

digit or string (1st character defines):digit or string (1st character defines): 11) drawTree * (DTREE) Creates a scene consisting of this 11) drawTree * (DTREE) Creates a scene consisting of this

physical volume and produces a representation of the geometry physical volume and produces a representation of the geometry hierarchy.hierarchy.

12) drawView * Draw view from this angle, etc.12) drawView * Draw view from this angle, etc. 13) drawVolume * Creates a scene consisting of this13) drawVolume * Creates a scene consisting of this

physical volume and asks the current viewer to draw it.physical volume and asks the current viewer to draw it. 14) open * Creates a scene handler ready for drawing.14) open * Creates a scene handler ready for drawing. 15) specify * Draws logical volume with Boolean components, 15) specify * Draws logical volume with Boolean components,

voxels and readout geometry.voxels and readout geometry.

Page 8: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 8Geant4 Visualization Commands J. Perl

Details of the /vis/open CommandDetails of the /vis/open Command To Open a DriverTo Open a Driver

/vis/open <driver name>/vis/open <driver name> for examplefor example

/vis/open OGLIX/vis/open OGLIX /vis/open HepRepFile/vis/open HepRepFile /vis/open DAWNFILE/vis/open DAWNFILE

The set of available drivers is listed when you first start Geant4,The set of available drivers is listed when you first start Geant4,but you can also get this list with the command:but you can also get this list with the command: help /vis/openhelp /vis/open

You can open more than one driver at a time:You can open more than one driver at a time: /vis/open OGLIX/vis/open OGLIX /vis/open HepRepFile/vis/open HepRepFile /vis/viewer/list/vis/viewer/list /vis/viewer/select viewer-0/vis/viewer/select viewer-0 /vis/viewer/select viewer-1/vis/viewer/select viewer-1

Page 9: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 9Geant4 Visualization Commands J. Perl

Details of the /vis/viewer/… CommandsDetails of the /vis/viewer/… Commands To Set Camera Parameters and Drawing Style.To Set Camera Parameters and Drawing Style.

Only needed if using an immediate viewer, such as OpenGLOnly needed if using an immediate viewer, such as OpenGL For HepRepFile or DAWNFILE, these sorts of adjustments are made later,For HepRepFile or DAWNFILE, these sorts of adjustments are made later,

in the HepRApp or DAWN viewer programsin the HepRApp or DAWN viewer programs

Reset viewpointReset viewpoint /vis/viewer/reset/vis/viewer/reset

Set view anglesSet view angles /vis/viewer/set/viewpointThetaPhi <theta_angle> <phi_angle>/vis/viewer/set/viewpointThetaPhi <theta_angle> <phi_angle> for examplefor example

/vis/viewer/set/viewpointThetaPhi 70 20/vis/viewer/set/viewpointThetaPhi 70 20

Set drawing styleSet drawing style /vis/viewer/set/style <style>/vis/viewer/set/style <style> for examplefor example

/vis/viewer/set/style wireframe/vis/viewer/set/style wireframe /vis/viewer/set/style surface/vis/viewer/set/style surface

but note that this will not affect volumes that have style explicitly forced by but note that this will not affect volumes that have style explicitly forced by “setForceWireframe” or “setForceSolid” commands in the c++ code“setForceWireframe” or “setForceSolid” commands in the c++ code

Page 10: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 10Geant4 Visualization Commands J. Perl

More Details of the /vis/viewer/… CommandsMore Details of the /vis/viewer/… Commands

ZoomZoom /vis/viewer/zoom <scale factor>/vis/viewer/zoom <scale factor> for examplefor example

/vis/viewer/zoom 2./vis/viewer/zoom 2.

Some drivers support different zoom along different axesSome drivers support different zoom along different axes(e.g., zoom more in X and Y but not in Z) (e.g., zoom more in X and Y but not in Z)

/vis/viewer/scale <3 vector of scale factors>/vis/viewer/scale <3 vector of scale factors>

Some drivers allow you to section the view, that is, cut it away along a Some drivers allow you to section the view, that is, cut it away along a specified plane (but this generally works only for simple geometries)specified plane (but this generally works only for simple geometries)

/vis/viewer/set/sectionPlane [on|off]/vis/viewer/set/sectionPlane [on|off] <3 vector of point> [unit of point] <3 vector of plane normal> <3 vector of point> [unit of point] <3 vector of plane normal>

e.g., for a y-z plane at x = 1 cm:e.g., for a y-z plane at x = 1 cm:/vis/viewer/set/sectionPlane on 1 0 0 cm 1 0 0/vis/viewer/set/sectionPlane on 1 0 0 cm 1 0 0

Page 11: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 11Geant4 Visualization Commands J. Perl

Hidden Line RemovalHidden Line Removal OpenGL supports hidden line removal.OpenGL supports hidden line removal. You can control whether this removal is done and whether trajectories and hits are You can control whether this removal is done and whether trajectories and hits are

affected by this feature.affected by this feature.

By default, hidden line removal is disabledBy default, hidden line removal is disabled

To turn on hidden line removalTo turn on hidden line removal /vis/viewer/set/hiddenEdge 1/vis/viewer/set/hiddenEdge 1

This hides edges of geometry,This hides edges of geometry,but lets trajectories through.but lets trajectories through.

To hide trajectories and hits as wellTo hide trajectories and hits as well /vis/viewer/set/hiddenMarker 1/vis/viewer/set/hiddenMarker 1

Page 12: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 12Geant4 Visualization Commands J. Perl

Controlling Detail Level of Detector GeometryControlling Detail Level of Detector Geometry By default, /vis/drawVolume will draw the entire detector geometry.By default, /vis/drawVolume will draw the entire detector geometry.

This is equivalent to the commands:This is equivalent to the commands: /vis/scene/create/vis/scene/create /vis/scene/add/volume world/vis/scene/add/volume world

You can specify additional arguments to limit the amount of You can specify additional arguments to limit the amount of geometry detail shown:geometry detail shown: /vis/scene/add/volume [<physical-volume-name>] [<copy-no>] [<depth-/vis/scene/add/volume [<physical-volume-name>] [<copy-no>] [<depth-

of-descending>]of-descending>] 1st parameter: volume name1st parameter: volume name

(default "world").(default "world"). 2nd parameter: copy number2nd parameter: copy number

(default -1 meaning first occurrence of physical-volume-name is (default -1 meaning first occurrence of physical-volume-name is selected.selected.

3rd parameter: depth of descending geometry hierarchy3rd parameter: depth of descending geometry hierarchy(default G4Scene::UNLIMITED (-1)).(default G4Scene::UNLIMITED (-1)).

Still more arguments can be given to specify a clipping volume.Still more arguments can be given to specify a clipping volume. vis/scene/add/volume world -1 -1 box km 0 1 0 1 0 1vis/scene/add/volume world -1 -1 box km 0 1 0 1 0 1

will draw the world with the positive octant cut away.will draw the world with the positive octant cut away.

Page 13: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 13Geant4 Visualization Commands J. Perl

Even more Control over Level of Detail in Even more Control over Level of Detail in Detector GeometryDetector Geometry

Additional commands allow finer control including whether or not to draw Additional commands allow finer control including whether or not to draw Boolean components, voxels and readout geometries:Boolean components, voxels and readout geometries:

/vis/specify <logical-volume-name> [depth-of-descent] [<booleans-flag>] [<voxels-flag>] [<readout-flag>]

/vis/scene/add/logicalVolume <logical-volume-name> [<depth-of-descending>] [<voxels-flag>] [<readout-flag>]

Culling allows you to specify that covered daughters or low density Culling allows you to specify that covered daughters or low density volumes are omitted:volumes are omitted:

/vis/viewer/set/culling global|coveredDaughters|invisible|density [true|false] [density] [unit]

HepRepFile will still include these culled objects, but just make them initially invisible.

Idea is that you might later decide you want to see these. To really omit them from the HepRepFile, as you may wish to do to make

the file smaller, set the environment variable before you run: G4HEPREPFILE_CULL=1

Page 14: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 14Geant4 Visualization Commands J. Perl

Details of Visualizing Trajectories and HitsDetails of Visualizing Trajectories and Hits

To add trajectories or hits to the sceneTo add trajectories or hits to the scene /vis/scene/add/trajectories/vis/scene/add/trajectories /vis/scene/add/hits/vis/scene/add/hits

Run using the commandRun using the command /run/beamOn/run/beamOn

If you place a number after beamOn, the run will go for that many If you place a number after beamOn, the run will go for that many eventsevents /run/beamOn 10/run/beamOn 10

Page 15: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 15Geant4 Visualization Commands J. Perl

Accumulating Trajectories and HitsAccumulating Trajectories and Hits

By default, you will get a drawing after each event. To instead get By default, you will get a drawing after each event. To instead get just one drawing with all of the accumulated events from that runjust one drawing with all of the accumulated events from that run /vis/scene/endOfEventAction accumulate/vis/scene/endOfEventAction accumulate

This overrides the defaultThis overrides the default /vis/scene/endOfEventAction refresh/vis/scene/endOfEventAction refresh

To even suppress that one drawing from the end of the To even suppress that one drawing from the end of the /run/beamOn, use/run/beamOn, use /vis/scene/endOfRunAction accumulate/vis/scene/endOfRunAction accumulate

This overrides the defaultThis overrides the default /vis/scene/endOfRunAction refresh/vis/scene/endOfRunAction refresh

When you actually want to draw, you then have to explicitly issue When you actually want to draw, you then have to explicitly issue the commandthe command /vis/viewer/flush/vis/viewer/flush

Page 16: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 16Geant4 Visualization Commands J. Perl

Reviewing Kept EventsReviewing Kept Events

If you have accumulated several events in your visualization,If you have accumulated several events in your visualization,you can still go back afterwards and view the events individually.you can still go back afterwards and view the events individually.For each event, you can execute various vis commands to rotate, zoom, For each event, you can execute various vis commands to rotate, zoom, output to a different vis driver, etc.output to a different vis driver, etc.

/vis/reviewKeptEvents/vis/reviewKeptEvents Each time you type “continue”, you will get to the next kept event.Each time you type “continue”, you will get to the next kept event.

To quit reviewing events:To quit reviewing events: /vis/abortReviewKeptEvents/vis/abortReviewKeptEvents and then again type “continue”and then again type “continue”

You can also use a command or c++ calls to force keeping of specific You can also use a command or c++ calls to force keeping of specific events regardless of how visualization is accumulating them.events regardless of how visualization is accumulating them.

e.g., keep events based on a particular hit or trigger patterne.g., keep events based on a particular hit or trigger pattern From the command line:From the command line:

/event/keepCurrentEvent/event/keepCurrentEvent From C++From C++

G4EventManager->KeepTheCurrentEvent()G4EventManager->KeepTheCurrentEvent() This feature makes it easy to do a large run and then recall for visualization This feature makes it easy to do a large run and then recall for visualization

only those events that are of interestonly those events that are of interest

Page 17: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 17Geant4 Visualization Commands J. Perl

Compound CommandsCompound Commands

To allow you to work quickly, Geant4 visualization lets you issue the To allow you to work quickly, Geant4 visualization lets you issue the equivalent of several common commands at one time by using a equivalent of several common commands at one time by using a “compound command”.“compound command”.

Some of the commands you have already seen in this presentation are Some of the commands you have already seen in this presentation are actually compound commands:actually compound commands: /vis/open/vis/open

/vis/sceneHandler/create/vis/sceneHandler/create /vis/viewer/create/vis/viewer/create

/vis/drawVolume/vis/drawVolume /vis/scene/create/vis/scene/create /vis/scene/add/volume/vis/scene/add/volume

/vis/viewer/flush/vis/viewer/flush /vis/viewer/refresh/vis/viewer/refresh /vis/viewer/update/vis/viewer/update

Page 18: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 18Geant4 Visualization Commands J. Perl

Geant4 Visualization in Standalone ModeGeant4 Visualization in Standalone Mode The Geant4 Visualization system can be used on its own - without the rest The Geant4 Visualization system can be used on its own - without the rest

of Geant4.of Geant4. Build something “by hand” from the Geant4 geometry primitives and Build something “by hand” from the Geant4 geometry primitives and

placement apparatus, but without any of the main parts of Geant4 such as placement apparatus, but without any of the main parts of Geant4 such as detector construction, run manager or physics list.detector construction, run manager or physics list.

Still preserves all of the interactive apparatus of the visualization system.Still preserves all of the interactive apparatus of the visualization system. From next Geant4 release (Geant4.8.0) there will be an example:From next Geant4 release (Geant4.8.0) there will be an example:

/examples/extended/visualization/standalone/examples/extended/visualization/standalone

// Simple box...// Simple box...pVisManager->Draw(pVisManager->Draw( G4Box("box",2*m,2*m,2*m), G4Box("box",2*m,2*m,2*m),

G4VisAttributes(G4Colour(1,1,0)));G4VisAttributes(G4Colour(1,1,0)));

// Boolean solid...// Boolean solid...G4Box boxA("boxA",3*m,3*m,3*m);G4Box boxA("boxA",3*m,3*m,3*m);G4Box boxB("boxB",1*m,1*m,1*m);G4Box boxB("boxB",1*m,1*m,1*m);G4SubtractionSolid subtracted(G4SubtractionSolid subtracted("subtracted_boxes",&boxA,&boxB, "subtracted_boxes",&boxA,&boxB,

G4Translate3D(3*m,3*m,3*m));G4Translate3D(3*m,3*m,3*m));pVisManager->Draw(pVisManager->Draw( subtracted,subtracted,

G4VisAttributes(G4Colour(0,1,1)), G4VisAttributes(G4Colour(0,1,1)), G4Translate3D(-6*m,-6*m,-G4Translate3D(-6*m,-6*m,-6*m));6*m));

Page 19: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 19Geant4 Visualization Commands J. Perl

Complete List of CommandsComplete List of Commands This presentation has shown only a very small subset of Geant4 vis commands.This presentation has shown only a very small subset of Geant4 vis commands.

Even for those commands shown, only a few of the options have been presented.Even for those commands shown, only a few of the options have been presented.

Each visualization driver may have its own set of additional commands.Each visualization driver may have its own set of additional commands.

To see the complete set of commands, use the interactive command guidance (i.e., To see the complete set of commands, use the interactive command guidance (i.e., type help and then type the appropriate number for “vis”).type help and then type the appropriate number for “vis”).

Note that many of the command details are only loaded into the help system once you start using the given command

e.g., when you first look at the help for /vis/modeling, you will see only /vis/modeling/trajectories/create /vis/modeling/trajectories/list

But once you have done your first /vis/modeling/trajectories/create/drawByParticleID

you will see many subcommands such as /vis/modeling/trajectories/drawByParticleID-0/set /vis/modeling/trajectories/drawByParticleID-0/setRGBA etc.

Page 20: 12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp

12 May 2007 20Geant4 Visualization Commands J. Perl

Geant4 Visualization ResourcesGeant4 Visualization ResourcesGeant4 Installation Guideshttp://geant4.slac.stanford.edu/installationHands on HepRApp Tutorialhttp://geant4.slac.stanford.edu/Presentations/vis/G4HepRAppTutorial/G4HepRAppTutorial.html

Hands on DAWN Tutorialhttp://geant4.slac.stanford.edu/Presentations/vis/G4DAWNTutorial/G4DAWNTutorial.htmlHands on OpenGL Tutorialhttp://geant4.slac.stanford.edu/Presentations/vis/G4OpenGLTutorial/G4OpenGLTutorial.html

Geant4 Visualization Commandshttp://geant4.slac.stanford.edu/Presentations/vis/G4VisCommands.ppt (and .pdf)

Geant4 Advanced Visualizationhttp://geant4.slac.stanford.edu/Presentations/vis/G4VisAdvanced.ppt (and .pdf)

How to Make a Moviehttp://geant4.slac.stanford.edu/Presentations/vis/HowToMakeAMovie.ppt (and .pdf)

Visualization Chapter of the Geant4 User’s Guide for Application Developershttp://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/

List of Visualization Commands:http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/AllResources/Control/UIcommands/_vis_.html

For Questions or Comments: Geant4 Visualization Online Forum:http://geant4-hn.slac.stanford.edu:5090/HyperNews/public/get/visualization.html