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