Handling View banks

+-------------+                                               +----------##
| Geant 3.15  |               GEANT User's Guide              | DRAW300  ##
+-------------+                                               +----------##
                                   

Author(s) : F.Carminati Submitted: 01.10.83 Origin : R.Brun, P.Zanarini Revised: 09.11.92

The view banks

The basic detector drawing routines (GDRAW, GDRAWC, GDRAWX) scan the data structure JVOLUM repeatedly. This can be a rather lengthy process even on fast worksations. For drawing with hidden line removal an auxiliary data structure has to be built and the relative visibility of all the volumes has to be analysed. With complicated detectors the time spent in this process can be substantial, depending on the drawing options chosen and on the speed of the machine on which the program is run. In order to alleviate this problem the bank mode routines have been developed.

The basic idea is to separate the interpretation of the structure (for instance the scanning of the volumes' data structure to convert the 3D geometry structure into a set of 2D lines, the visibility analysis, and the surface creation or the light processing) from the drawing itself. In this way, the interpretation is performed only once and all the 2D information is stored in view banks (data structure JDRAW) [DRAW399]. These views can then be looked at quickly, having only to draw the 2D vectors or the fill areas previously stored. For a detector with more than 100 different volume names, for example, this is achieved at the cost of only a few thousand words of memory for each drawing stored. One can open a view bank (GDOPEN), identified by a number, perform appropriate drawings (only interpretation will be made, no output will be generated), close the bank (GDCLOS) and finally look at the picture stored in it (GDSHOW). When a view bank has been closed it cannot be modified, but it can be displayed as many times as wanted (GDSHOW) or deleted (GDELET).

Once a drawing (detectors, tracks or hits) is in a view bank, it is possible to scan it in detail via the LENS interactive facility (only available with X11). For more information see the [XINT] section.

                +----------------------------------------+
                | CALL GDOPEN (IVIEW) |
                +----------------------------------------+
                                  

Opens a view bank, used to store 2D graphics information coming from the interpretation of 3D structures (but also 2D annotation). All the calls to the drawing routines will fill the view bank IVIEW, without displaying anything on the terminal screen. For geometrical structures with many different volume names, it can happen that the interpretation of the JVOLUM bank takes much longer than the actual drawing, so it would be worthwhile interpreting JVOLUM only once and saving somewhere the interpreted 2D stream of polylines and text, then drawing the picture as many times as wanted just replaying the 2D information.

IVIEW
(INTEGER) view number (IVIEW>0)

                    +--------------------------------+
                    |CALL GDCLOS  |
                    +--------------------------------+
                                  

Closes the current opened view bank. Once a view bank has been closed no more drawing can be added to it. A call to GDCLOS also restores the screen.

                +----------------------------------------+
                | CALL GDSHOW (IVIEW) |
                +----------------------------------------+
                                  

IVIEW
(INTEGER) view number (IVIEW>0)

Shows a given view. GDSHOW can be called either before or after a view bank has been closed. A bank to bank copy from 'isource' to 'idest' is possible by calling GDSHOW(isource) between GDOPEN(idest) and GDCLOS.

                +----------------------------------------+
                | CALL GDELET (IVIEW) |
                +----------------------------------------+
                                  

IVIEW
(INTEGER) view number (IVIEW>0)

Deletes a view bank from memory. If called before a bank has been closed, GDELET will also restore the screen mode.

Note: The data structure containing the view banks has a fan-out bank at the top level which contains one word for each view bank. This word is a key which determines the status of the bank. View bank IVIEW has its key in word Q(JDRAW+IVIEW) of the ZEBRA store. If this key is 3, the bank itself is protected against deletion, and it cannot be deleted by GDELET.

Here follows an example of use of view banks:

      CALL GDOPEN(3)
      CALL GDRAWC('OPAL',2,5.,10.,10.,0.013,0.013)
      CALL GDRAWT(14.,17.,'A M E