]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant3/AliGeant3GeometryGUI.cxx
Bugfix in AddTracks
[u/mrichter/AliRoot.git] / TGeant3 / AliGeant3GeometryGUI.cxx
1 /* *************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /*
17 $Log$
18 Revision 1.2  2001/07/09 11:45:15  morsch
19 Reduced functionality: mediate between GUI and Geometry Conversion.
20
21 Revision 1.1  2000/07/13 16:19:10  fca
22 Mainly coding conventions + some small bug fixes
23
24 Revision 1.8  2000/07/12 08:56:32  fca
25 Coding convention correction and warning removal
26
27 Revision 1.7  2000/06/28 21:27:45  morsch
28 Most coding rule violations corrected.
29 Still to do: Split the file (on file per class) ? Avoid the global variables.
30 Copy constructors and assignment operators (dummy ?)
31
32 Revision 1.6  2000/04/14 11:07:46  morsch
33 Correct volume to medium assignment in case several media are asigned to the
34 same material.
35
36 Revision 1.5  2000/03/20 15:11:03  fca
37 Mods to make the code compile on HP
38
39 Revision 1.4  2000/01/18 16:12:08  morsch
40 Bug in calculation of number of volume divisions and number of positionings corrected
41 Browser for Material and Media properties added
42
43 Revision 1.3  1999/11/14 14:31:14  fca
44 Correct small error and remove compilation warnings on HP
45
46 Revision 1.2  1999/11/10 16:53:35  fca
47 The new geometry viewer from A.Morsch
48
49 */
50
51 /* 
52  *  Version: 0
53  *  Written by Andreas Morsch
54  *  
55  * 
56  *
57  * For questions critics and suggestions to this part of the code
58  * contact andreas.morsch@cern.ch
59  * 
60  **************************************************************************/
61
62
63 #include "AliGeant3GeometryGUI.h"
64 #include "AliG3Volume.h"
65 #include "AliG3Material.h"
66 #include "AliG3Medium.h"
67 #include "AliGuiGeomMain.h"
68 #include "AliRun.h"
69 #include "AliG3toRoot.h"
70
71 #include <TArrayF.h>
72 #include <TRotMatrix.h>
73 #include <TGeometry.h>
74 #include <TFile.h>
75 #include <TFolder.h>
76
77 AliG3Volume    *gCurrentVolume   = new AliG3Volume("NULL");
78 AliG3Material  *gCurrentMaterial = new AliG3Material();
79 AliG3Medium    *gCurrentMedium   = new AliG3Medium();
80
81 ClassImp(AliGeant3GeometryGUI)
82
83     AliGeant3GeometryGUI::AliGeant3GeometryGUI(const char* opt)
84 {
85     char tmp[20];
86     strcpy(tmp, opt);
87
88 // Constructor
89     fPanel     = new AliGuiGeomMain(gClient->GetRoot(), 500, 500);
90 //  Store local copy of zebra bank entries
91     AliG3toRoot* geometry = new AliG3toRoot();
92     if (strcmp(tmp, "expand") == 0) geometry->SetExpandDivisions();
93     geometry->G3toRoot();
94     geometry->ConvertToRootShapes();
95     
96     AliG3Volume* top = (AliG3Volume*) 
97         (geometry->GetTopFolder()->FindObject("ALIC"));
98     gCurrentVolume = top;
99 //
100 //  Mediate between g3 Geometry and GUI
101     fPanel->SetMaterialComboEntries(geometry->GetMaterials());
102     fPanel->SetMediaComboEntries(geometry->GetMedia());
103     fPanel->AddFoldersRecursively(geometry->GetTopFolder());
104     fPanel->Update();
105 }
106
107 void AliGeant3GeometryGUI::Streamer(TBuffer &)
108 {
109 // Dummy Streamer
110 ;
111 }
112
113
114
115
116