Geant4  10.02.p02
G4VPhysicalVolume.icc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4VPhysicalVolume.icc 74466 2013-10-07 15:36:32Z gcosmo $
28 //
29 //
30 // class G4VPhysicalVolume Inline Implementation
31 //
32 // --------------------------------------------------------------------
33 
34 // These macros change the references to fields that are now encapsulated
35 // in the class G4PVData.
36 //
37 #define G4MT_rot ((subInstanceManager.offset[instanceID]).frot)
38 #define G4MT_trans ((subInstanceManager.offset[instanceID]).ftrans)
39 
40 #define G4MT_pvdata (subInstanceManager.offset[instanceID])
41 
42 inline
43 G4bool G4VPhysicalVolume::operator == (const G4VPhysicalVolume& right) const
44 {
45  return (this==&right) ? true : false;
46 }
47 
48 inline
49 G4int G4VPhysicalVolume::GetInstanceID() const
50 {
51  return instanceID;
52 }
53 
54 
55 inline
56 const G4ThreeVector& G4VPhysicalVolume::GetTranslation() const
57 {
58  return G4MT_trans;
59 }
60 
61 inline
62 void G4VPhysicalVolume::SetTranslation(const G4ThreeVector &vec)
63 {
64  G4MT_trans=vec;
65 }
66 
67 inline
68 const G4RotationMatrix* G4VPhysicalVolume::GetRotation() const
69 {
70  return G4MT_rot;
71 }
72 
73 inline
74 G4RotationMatrix* G4VPhysicalVolume::GetRotation()
75 {
76  return G4MT_rot;
77 }
78 
79 inline
80 void G4VPhysicalVolume::SetRotation(G4RotationMatrix *pRot)
81 {
82  G4MT_rot=pRot;
83 }
84 
85 inline
86 G4LogicalVolume* G4VPhysicalVolume::GetLogicalVolume() const
87 {
88  return flogical;
89 }
90 
91 inline
92 void G4VPhysicalVolume::SetLogicalVolume(G4LogicalVolume *pLogical)
93 {
94  flogical=pLogical;
95 }
96 
97 inline
98 G4LogicalVolume* G4VPhysicalVolume::GetMotherLogical() const
99 {
100  return flmother;
101 }
102 
103 inline
104 void G4VPhysicalVolume::SetMotherLogical(G4LogicalVolume *pMother)
105 {
106  flmother=pMother;
107 }
108 
109 inline
110 const G4String& G4VPhysicalVolume::GetName() const
111 {
112  return fname;
113 }
114 
115 inline
116 void G4VPhysicalVolume::SetName(const G4String& pName)
117 {
118  fname=pName;
119 }
120 
121 inline
122 EVolume G4VPhysicalVolume::VolumeType() const
123 {
124  EVolume type;
125  EAxis axis;
126  G4int nReplicas;
127  G4double width,offset;
128  G4bool consuming;
129  if ( IsReplicated() )
130  {
131  GetReplicationData(axis,nReplicas,width,offset,consuming);
132  type = (consuming) ? kReplica : kParameterised;
133  }
134  else
135  {
136  type = kNormal;
137  }
138  return type;
139 }
140 
141 inline
142 G4RotationMatrix G4VPhysicalVolume::GetObjectRotationValue() const
143 {
144  G4RotationMatrix aRotM; // Initialised to identity
145 
146  // Insure against G4MT_rot being a null pointer
147  if(G4MT_rot)
148  {
149  aRotM= G4MT_rot->inverse();
150  }
151  return aRotM;
152 }
153 
154 inline
155 G4ThreeVector G4VPhysicalVolume::GetObjectTranslation() const
156 {
157  return G4MT_trans;
158 }
159 
160 inline
161 const G4RotationMatrix* G4VPhysicalVolume::GetFrameRotation() const
162 {
163  return G4MT_rot;
164 }
165 
166 inline
167 G4ThreeVector G4VPhysicalVolume::GetFrameTranslation() const
168 {
169  return -G4MT_trans;
170 }
171 
172 #undef G4MT_rot
173 #undef G4MT_trans