source: trunk/environments/g4py/source/geometry/pyG4Polycone.cc@ 1344

Last change on this file since 1344 was 1337, checked in by garnier, 15 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 4.2 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: pyG4Polycone.cc,v 1.1 2007/07/11 05:39:50 kmura Exp $
27// $Name: geant4-09-04-beta-01 $
28// ====================================================================
29// pyG4Polycone.cc
30//
31// 2007 Q
32// ====================================================================
33#include <boost/python.hpp>
34#include "G4Polycone.hh"
35
36using namespace boost::python;
37
38// ====================================================================
39// thin wrappers
40// ====================================================================
41namespace pyG4Polycone {
42
43// create solid methods
44
45G4Polycone* f1_CreatePolycone(const G4String& name, G4double phiStart,
46 G4double phiTotal, G4int numZPlanes,
47 const std::vector<G4double>& zPlane,
48 const std::vector<G4double>& rInner,
49 const std::vector<G4double>& rOuter)
50{
51 G4double zlist[numZPlanes];
52 G4double r0list[numZPlanes];
53 G4double r1list[numZPlanes];
54
55 for (G4int i=0; i< numZPlanes; i++) {
56 zlist[i]= zPlane[i];
57 r0list[i]= rInner[i];
58 r1list[i]= rOuter[i];
59 }
60
61 return new G4Polycone(name, phiStart, phiTotal, numZPlanes,
62 zlist, r0list, r1list);
63}
64
65
66G4Polycone* f2_CreatePolycone(const G4String& name, G4double phiStart,
67 G4double phiTotal, G4int numRZ,
68 const std::vector<G4double>& r,
69 const std::vector<G4double>& z)
70{
71 G4double zlist[numRZ];
72 G4double rlist[numRZ];
73
74 for (G4int i=0; i< numRZ; i++) {
75 rlist[i]= r[i];
76 zlist[i]= z[i];
77 }
78
79 return new G4Polycone(name, phiStart, phiTotal, numRZ,
80 rlist, zlist);
81
82}
83
84}
85
86using namespace pyG4Polycone;
87
88
89// ====================================================================
90// module definition
91// ====================================================================
92void export_G4Polycone()
93{
94 class_<G4Polycone, G4Polycone*, bases<G4VSolid> >
95 ("G4Polycone", "Polycone solid class", no_init)
96 // ---
97 .def("GetStartPhi", &G4Polycone::GetStartPhi)
98 .def("GetEndPhi", &G4Polycone::GetEndPhi)
99 .def("IsOpen", &G4Polycone::IsOpen)
100 .def("IsGeneric", &G4Polycone::IsGeneric)
101 .def("GetNumRZCorner", &G4Polycone::GetNumRZCorner)
102
103 // operators
104 .def(self_ns::str(self))
105 ;
106
107 // Create solid
108 def("CreatePolycone", f1_CreatePolycone,
109 return_value_policy<manage_new_object>());
110 def("CreatePolycone", f2_CreatePolycone,
111 return_value_policy<manage_new_object>());
112
113}
114
Note: See TracBrowser for help on using the repository browser.