12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

VisualizationInteractive filtering can then be done through the commands in /vis/filtering/hits.8.9. Polylines, Markers and TextPolylines, markers and text are defined in the graphics_reps category, and are used only <strong>for</strong> visualization.Here we explain their definitions and usages.8.9.1. PolylinesA polyline is a set of successive line segments. It is defined with a class G4Polyline defined in thegraphics_reps category. A polyline is used to visualize tracking steps, particle trajectories, coordinate axes,and any other user-defined objects made of line segments.G4Polyline is defined as a list of G4Point3D objects, i.e., vertex positions. The vertex positions are set to aG4Polyline object with the push_back() method.For example, an x-axis with length 5 cm and with red color is defined in Example 8.5.Example 8.5. Defining an x-axis with length 5 cm and with colour red.//----- C++ source codes: An example of defining a line segment// Instantiate an emply polyline objectG4Polyline x_axis;// Set red line colourG4Colour red(1.0, 0.0, 0.0);G4VisAttributes att(red);x_axis.SetVisAttributes(&att);// Set vertex positionsx_axis.push_back( G4Point3D(0., 0., 0.) );x_axis.push_back( G4Point3D(5.*cm, 0., 0.) );//----- end of C++ source codes8.9.2. MarkersHere we explain how to use 3D markers in <strong>Geant4</strong> Visualization.What are Markers?Markers set marks at arbitrary positions in the 3D space. They are often used to visualize hits of particles at detectorcomponents. A marker is a 2-dimensional primitive with shape (square, circle, etc), color, and special properties(a) of always facing the camera and (b) of having the possibility of a size defined in screen units (pixels). Here"size" means "overall size", e.g., diameter of circle and side of square (but diameter and radius access functionsare defined to avoid ambiguity).So the user who constructs a marker should decide whether or not it should be visualized to a given size in worldcoordinates by setting the world size. Alternatively, the user can set the screen size and the marker is visualizedto its screen size. Finally, the user may decide not to set any size; in that case, it is drawn according to the sizesspecified in the default marker specified in the class G4ViewParameters.By default, "square" and "circle" are supported in <strong>Geant4</strong> Visualization. The <strong>for</strong>mer is described with classG4Square, and the latter with class G4Circle:Marker Typecircleright squareClass NameG4CircleG4SquareThese classes are inherited from class G4VMarker. They have constructors as follows:264

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!