Geant4  10.03
G4AssemblyTriplet.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: G4AssemblyTriplet.icc 66356 2012-12-18 09:02:32Z gcosmo $
28 //
29 //
30 // Class G4AssemblyTriplet - inline implementation
31 //
32 // ----------------------------------------------------------------------
33 
34 inline
35 G4AssemblyTriplet::G4AssemblyTriplet()
36  : fVolume( 0 ), fRotation( 0 ), fAssembly(0), fIsReflection(false)
37 {
38  G4ThreeVector v(0.,0.,0.);
39  fTranslation = v;
40 }
41 
42 inline
43 G4AssemblyTriplet::G4AssemblyTriplet( G4LogicalVolume* pVolume,
44  G4ThreeVector& translation,
45  G4RotationMatrix* pRotation,
46  G4bool isReflection )
47  : fVolume( pVolume ), fTranslation( translation ), fRotation( pRotation ),
48  fAssembly( 0 ), fIsReflection(isReflection)
49 {
50 }
51 
52 inline
53 G4AssemblyTriplet::G4AssemblyTriplet( G4AssemblyVolume* pAssembly,
54  G4ThreeVector& translation,
55  G4RotationMatrix* pRotation,
56  G4bool isReflection )
57  : fVolume( 0 ), fTranslation( translation ), fRotation( pRotation ),
58  fAssembly( pAssembly ), fIsReflection(isReflection)
59 {
60 }
61 
62 inline
63 G4AssemblyTriplet::G4AssemblyTriplet( const G4AssemblyTriplet& scopy )
64 {
65  fVolume = scopy.GetVolume();
66  fRotation = scopy.GetRotation();
67  fTranslation = scopy.GetTranslation();
68  fAssembly = scopy.GetAssembly();
69  fIsReflection = scopy.IsReflection();
70 }
71 
72 inline
73 G4AssemblyTriplet::~G4AssemblyTriplet()
74 {
75 }
76 
77 inline
78 G4LogicalVolume* G4AssemblyTriplet::GetVolume() const
79 {
80  return fVolume;
81 }
82 
83 inline
84 void G4AssemblyTriplet::SetVolume( G4LogicalVolume* pVolume )
85 {
86  if ( fAssembly )
87  {
88  G4Exception("G4AssemblyTriplet::SetVolume()",
89  "GeomVol1001", JustWarning,
90  "There is an assembly already set, it will be ignored.");
91  }
92  fVolume = pVolume;
93  fAssembly = 0;
94 }
95 
96 inline
97 G4AssemblyVolume* G4AssemblyTriplet::GetAssembly() const
98 {
99  return fAssembly;
100 }
101 
102 inline
103 void G4AssemblyTriplet::SetAssembly( G4AssemblyVolume* pAssembly )
104 {
105  if ( fVolume )
106  {
107  G4Exception("G4AssemblyTriplet::SetAssembly()",
108  "GeomVol1001", JustWarning,
109  "There is a volume already set, it will be ignored.");
110  }
111  fAssembly = pAssembly;
112  fVolume = 0;
113 }
114 
115 inline
116 G4ThreeVector G4AssemblyTriplet::GetTranslation() const
117 {
118  return fTranslation;
119 }
120 
121 inline
122 void G4AssemblyTriplet::SetTranslation( G4ThreeVector& translation )
123 {
124  fTranslation = translation;
125 }
126 
127 inline
128 G4RotationMatrix* G4AssemblyTriplet::GetRotation() const
129 {
130  return fRotation;
131 }
132 
133 inline
134 void G4AssemblyTriplet::SetRotation( G4RotationMatrix* pRotation )
135 {
136  fRotation = pRotation;
137 }
138 
139 inline
140 G4bool G4AssemblyTriplet::IsReflection() const
141 {
142  return fIsReflection;
143 }
144 
145 inline
146 G4AssemblyTriplet&
147 G4AssemblyTriplet::operator=( const G4AssemblyTriplet& scopy )
148 {
149  if( this != &scopy )
150  {
151  fVolume = scopy.GetVolume();
152  fRotation = scopy.GetRotation();
153  fTranslation = scopy.GetTranslation();
154  fAssembly = scopy.GetAssembly();
155  fIsReflection = scopy.IsReflection();
156  }
157 
158  return *this;
159 }