00001
00002
00003
00004 #include "BDSGlobalConstants.hh"
00005
00006 #include "BDSTransform3D.hh"
00007 #include "G4Box.hh"
00008 #include "G4Tubs.hh"
00009 #include "G4VisAttributes.hh"
00010 #include "G4LogicalVolume.hh"
00011 #include "G4VPhysicalVolume.hh"
00012 #include "G4UserLimits.hh"
00013 #include "G4TransportationManager.hh"
00014
00015 #include <map>
00016
00017
00018
00019 typedef std::map<G4String,int> LogVolCountMap;
00020 extern LogVolCountMap* LogVolCount;
00021
00022 typedef std::map<G4String,G4LogicalVolume*> LogVolMap;
00023 extern LogVolMap* LogVol;
00024
00025 extern BDSMaterials* theMaterials;
00026
00027
00028 BDSTransform3D::BDSTransform3D(G4String aName, G4double x,G4double y,G4double z,
00029 G4double phi,G4double theta, G4double psi):
00030 BDSAcceleratorComponent(
00031 aName,
00032 0,
00033 0,
00034 0,
00035 0,
00036 itsVisAttributes,
00037 "",
00038 0,
00039 x,
00040 y,
00041 z)
00042 {
00043 SetTheta(theta);
00044 SetPsi(psi);
00045 SetPhi(phi);
00046 SetType("transform3d");
00047
00048 if (!(*LogVolCount)[itsName])
00049 {
00050
00051
00052 (*LogVolCount)[itsName]=1;
00053 (*LogVol)[itsName]=itsMarkerLogicalVolume;
00054 }
00055 else
00056 {
00057 (*LogVolCount)[itsName]++;
00058 itsMarkerLogicalVolume=(*LogVol)[itsName];
00059 }
00060
00061 }
00062
00063
00064 G4VisAttributes* BDSTransform3D::SetVisAttributes()
00065 {
00066 itsVisAttributes=new G4VisAttributes(G4Colour(0,1,0));
00067 return itsVisAttributes;
00068 }
00069
00070
00071 BDSTransform3D::~BDSTransform3D()
00072 {
00073 if(itsVisAttributes) delete itsVisAttributes;
00074 if(itsMarkerLogicalVolume) delete itsMarkerLogicalVolume;
00075 if(itsOuterLogicalVolume) delete itsOuterLogicalVolume;
00076 if(itsPhysiComp) delete itsPhysiComp;
00077 }