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.

VisualizationG4VisAttributes::G4VisAttributes (const G4Colour& colour);Note that colour assigned to a G4VisAttributes object is not always the colour that ultimately appears in the visualization.The ultimate appearance may be affected by shading and lighting models applied in the selected visualizationdriver or stand-alone graphics system.8.6.3. Forcing attributesAs you will see later, you can select a "drawing style" from various options. For example, you can select yourdetector components to be visualized in "wireframe" or with "surfaces". In the <strong>for</strong>mer, only the edges of yourdetector are drawn and so the detector looks transparent. In the latter, your detector looks opaque with shadingeffects.The <strong>for</strong>ced wireframe and <strong>for</strong>ced solid styles make it possible to mix the wireframe and surface visualization (ifyour selected graphics system supports such visualization). For example, you can make only the outer wall of yourdetector "wired" (transparent) and can see inside in detail.Forced wireframe style is set with the following access function:void G4VisAttributes::SetForceWireframe (G4bool <strong>for</strong>ce);If you give true as the argument, objects <strong>for</strong> which this set of visualization attributes is assigned are alwaysvisualized in wireframe even if in general, the surface drawing style has been requested. The default value of the<strong>for</strong>ced wireframe style is false.Similarly, <strong>for</strong>ced solid style, i.e., to <strong>for</strong>ce that objects are always visualized with surfaces, is set with:void G4VisAttributes::SetForceSolid (G4bool <strong>for</strong>ce);The default value of the <strong>for</strong>ced solid style is false, too.You can also <strong>for</strong>ce auxiliary edges to be visible. Normally they are not visible unless you set the appropriate viewparameter. Forcing the auxiliary edges to be visible means that auxiliary edges will be seen whatever the viewparameters.Auxiliary edges are not genuine edges of the volume. They may be in a curved surface made out of polygons, <strong>for</strong>example, or in plane surface of complicated shape that has to be broken down into simpler polygons. HepPolyhedronbreaks all surfaces into triangles or quadrilaterals. There will be auxiliary edges <strong>for</strong> any volumes with acurved surface, such as a tube or a sphere, or a volume resulting from a Boolean operation. Normally, they are notshown, but sometimes it is useful to see them. In particular, a sphere, because it has no egdes, will not be seen inwireframe mode in some graphics systems unless requested by the view parameters or <strong>for</strong>ced, as described here.To <strong>for</strong>ce auxiliary edges to be visible, use:void G4VisAttributes::SetForceAuxEdgeVisible (G4bool <strong>for</strong>ce);The default value of the <strong>for</strong>ce auxiliary edges visible flag is false.For volumes with edges that are parts of a circle, such as a tube (G4Tubs), etc., it is possible to <strong>for</strong>ce the precisionof polyhedral representation <strong>for</strong> visualisation. This is recommended <strong>for</strong> volumes containing only a small angle ofcircle, <strong>for</strong> example, a thin tube segment.For visualisation, a circle is represented by an N-sided polygon. The default is 24 sides or segments. The usermay change this <strong>for</strong> all volumes in a particular viewer at run time with /vis/viewer/set/lineSegmentsPerCircle;alternatively it can be <strong>for</strong>ced <strong>for</strong> a particular volume with:void G4VisAttributes::SetForceLineSegmentsPerCircle (G4int nSegments);255

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

Saved successfully!

Ooh no, something went wrong!