source: trunk/environments/g4py/source/geometry/pyG4FieldManager.cc @ 1358

Last change on this file since 1358 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 4.8 KB
Line 
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// $Id: pyG4FieldManager.cc,v 1.5 2008/03/13 07:32:18 kmura Exp $
27// $Name: geant4-09-04-beta-01 $
28// ====================================================================
29//   pyG4FieldManager.cc
30//
31//                                         2005 Q
32// ====================================================================
33#include <boost/python.hpp>
34#include "G4Version.hh"
35#include "G4FieldManager.hh"
36#include "G4Field.hh"
37#include "G4ChordFinder.hh"
38#include "G4MagneticField.hh"
39#include "G4Track.hh"
40
41using namespace boost::python;
42
43// ====================================================================
44// miscs
45// ====================================================================
46#if G4VERSION_NUMBER <= 801
47// What a hell!
48inline const G4ChordFinder* G4FieldManager::GetChordFinder() const
49{
50  return fChordFinder;
51}
52#endif
53
54// ====================================================================
55// thin wrappers
56// ====================================================================
57namespace pyG4FieldManager {
58
59G4ChordFinder*(G4FieldManager::*f1_GetChordFinder)()
60  = &G4FieldManager::GetChordFinder;
61const G4ChordFinder*(G4FieldManager::*f2_GetChordFinder)() const 
62  = &G4FieldManager::GetChordFinder;
63
64};
65
66using namespace pyG4FieldManager;
67
68// ====================================================================
69// module definition
70// ====================================================================
71void export_G4FieldManager()
72{
73  class_<G4FieldManager, G4FieldManager*, boost::noncopyable>
74    ("G4FieldManager", "field manager class")
75    // constructors
76    .def(init<>())
77    .def(init<G4Field*>())
78    .def(init<G4Field*, G4ChordFinder*>())
79    .def(init<G4Field*, G4ChordFinder*, G4bool>())
80    .def(init<G4MagneticField*>())
81    // ---
82    .def("SetDetectorField",      &G4FieldManager::SetDetectorField)
83    .def("GetDetectorField",      &G4FieldManager::GetDetectorField,
84         return_internal_reference<>())
85    .def("DoesFieldExist",        &G4FieldManager::DoesFieldExist)
86    .def("CreateChordFinder",     &G4FieldManager::CreateChordFinder)
87    .def("SetChordFinder",        &G4FieldManager::SetChordFinder)
88    .def("GetChordFinder",        f1_GetChordFinder,
89         return_internal_reference<>())
90    .def("GetChordFinder",        f2_GetChordFinder,
91         return_internal_reference<>())
92    .def("ConfigureForTrack",     &G4FieldManager::ConfigureForTrack)
93    .def("GetDeltaIntersection",  &G4FieldManager::GetDeltaIntersection)
94    .def("GetDeltaOneStep",       &G4FieldManager::GetDeltaOneStep)
95    .def("SetAccuraciesWithDeltaOneStep", 
96         &G4FieldManager::SetAccuraciesWithDeltaOneStep)
97    .def("SetDeltaOneStep",       &G4FieldManager::SetDeltaOneStep)
98    .def("SetDeltaIntersection",  &G4FieldManager::SetDeltaIntersection)
99    .def("GetMinimumEpsilonStep", &G4FieldManager::GetMinimumEpsilonStep)
100    .def("SetMinimumEpsilonStep", &G4FieldManager::SetMinimumEpsilonStep)
101    .def("GetMaximumEpsilonStep", &G4FieldManager::GetMaximumEpsilonStep)
102    .def("SetMaximumEpsilonStep", &G4FieldManager::SetMaximumEpsilonStep)
103    .def("DoesFieldChangeEnergy", &G4FieldManager::DoesFieldChangeEnergy)
104    .def("SetFieldChangesEnergy", &G4FieldManager::SetFieldChangesEnergy)
105    ;
106}
107
Note: See TracBrowser for help on using the repository browser.