ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyG4LogicalVolume.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pyG4LogicalVolume.cc
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 // pyG4LogicalVolume.cc
28 //
29 // 2005 Q
30 // ====================================================================
31 #include <boost/python.hpp>
32 #include "G4Version.hh"
33 #include "G4LogicalVolume.hh"
34 #include "G4Material.hh"
35 #include "G4VSolid.hh"
36 #include "G4FieldManager.hh"
37 #include "G4VSensitiveDetector.hh"
38 #include "G4UserLimits.hh"
39 #include "G4SmartVoxelHeader.hh"
40 #include "G4MaterialCutsCouple.hh"
42 #include "G4VisAttributes.hh"
43 
44 using namespace boost::python;
45 
46 // ====================================================================
47 // thin wrappers
48 // ====================================================================
49 namespace pyG4LogicalVolume {
50 
53 
56 
58 
61 
62 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetMass, GetMass, 0, 3)
63 
64 }
65 
66 using namespace pyG4LogicalVolume;
67 
68 // ====================================================================
69 // module definition
70 // ====================================================================
72 {
73  class_<G4LogicalVolume, G4LogicalVolume*, boost::noncopyable>
74  ("G4LogicalVolume", "logical volume class", no_init)
75  // constructors
76  .def(init<G4VSolid*, G4Material*, const G4String& >())
77  .def(init<G4VSolid*, G4Material*, const G4String&,
78  G4FieldManager* >())
79  .def(init<G4VSolid*, G4Material*, const G4String&,
81  .def(init<G4VSolid*, G4Material*, const G4String&,
83  G4UserLimits* >())
84  .def(init<G4VSolid*, G4Material*, const G4String&,
86  G4UserLimits*, G4bool >())
87  // ---
88  .def("GetName", &G4LogicalVolume::GetName,
89  return_value_policy<reference_existing_object>())
90  .def("SetName", &G4LogicalVolume::SetName)
91  // ---
92  .def("GetNoDaughters", &G4LogicalVolume::GetNoDaughters)
93  .def("GetDaughter", &G4LogicalVolume::GetDaughter,
94  return_internal_reference<>())
95  .def("AddDaughter", &G4LogicalVolume::AddDaughter)
96  .def("IsDaughter", &G4LogicalVolume::IsDaughter)
97  .def("IsAncestor", &G4LogicalVolume::IsAncestor)
98  .def("RemoveDaughter", &G4LogicalVolume::RemoveDaughter)
99  .def("ClearDaughters", &G4LogicalVolume::ClearDaughters)
100  .def("TotalVolumeEntities", &G4LogicalVolume::TotalVolumeEntities)
101  // ----
102  .def("GetSolid", f1_GetSolid,
103  return_internal_reference<>())
104  .def("SetSolid", f1_SetSolid)
105  .def("GetMaterial", &G4LogicalVolume::GetMaterial,
106  return_internal_reference<>())
107  .def("SetMaterial", &G4LogicalVolume::SetMaterial)
108  .def("UpdateMaterial", &G4LogicalVolume::UpdateMaterial)
109  // ---
110  .def("GetMass", &G4LogicalVolume::GetMass, f_GetMass())
111  .def("GetFieldManager", &G4LogicalVolume::GetFieldManager,
112  return_internal_reference<>())
113  .def("SetFieldManager", &G4LogicalVolume::SetFieldManager)
114  .def("GetSensitiveDetector", &G4LogicalVolume::GetSensitiveDetector,
115  return_internal_reference<>())
116  .def("SetSensitiveDetector", &G4LogicalVolume::SetSensitiveDetector)
117  .def("GetUserLimits", &G4LogicalVolume::GetUserLimits,
118  return_internal_reference<>())
119  .def("SetUserLimits", &G4LogicalVolume::SetUserLimits)
120  // ---
121  .def("GetVoxelHeader", &G4LogicalVolume::GetVoxelHeader,
122  return_internal_reference<>())
123  .def("SetVoxelHeader", &G4LogicalVolume::SetVoxelHeader)
124  .def("GetSmartless", &G4LogicalVolume::GetSmartless)
125  .def("SetSmartless", &G4LogicalVolume::SetSmartless)
126  .def("IsToOptimise", &G4LogicalVolume::IsToOptimise)
127  .def("SetOptimisation", &G4LogicalVolume::SetOptimisation)
128  // ---
129  .def("IsRootRegion", &G4LogicalVolume::IsRootRegion)
130  .def("SetRegionRootFlag", &G4LogicalVolume::SetRegionRootFlag)
131  .def("IsRegion", &G4LogicalVolume::IsRegion)
132  .def("SetRegion", &G4LogicalVolume::SetRegion)
133  .def("GetRegion", &G4LogicalVolume::GetRegion,
134  return_internal_reference<>())
135  .def("PropagateRegion", &G4LogicalVolume::PropagateRegion)
136  .def("GetMaterialCutsCouple", &G4LogicalVolume::GetMaterialCutsCouple,
137  return_internal_reference<>())
138  .def("SetMaterialCutsCouple", &G4LogicalVolume::SetMaterialCutsCouple)
139  // ---
140  .def("GetVisAttributes", &G4LogicalVolume::GetVisAttributes,
141  return_internal_reference<>())
142  .def("SetVisAttributes", f1_SetVisAttributes)
143  .def("SetVisAttributes", f2_SetVisAttributes)
144  // ---
145  .def("GetFastSimulationManager",
147  return_internal_reference<>())
148  // ---
149  .def("SetBiasWeight", &G4LogicalVolume::SetBiasWeight)
150  .def("GetBiasWeight", &G4LogicalVolume::GetBiasWeight)
151  ;
152 }