LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pyG4VisAttributes.cc
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 // pyG4VisAttributes.cc
28 //
29 // 2005 Q
30 // ====================================================================
31 #include <boost/python.hpp>
32 #include "G4AttDef.hh"
33 #include "G4VisAttributes.hh"
34 
35 using namespace boost::python;
36 
37 // ====================================================================
38 // thin wrappers
39 // ====================================================================
40 namespace pyG4VisAttributes {
41 
42 // SetColor()
43 void(G4VisAttributes::*f1_SetColor)(const G4Color&)=
44  &G4VisAttributes::SetColor;
45 
46 void(G4VisAttributes::*f2_SetColor)(G4double, G4double, G4double, G4double)=
47  &G4VisAttributes::SetColor;
48 
49 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetColor, SetColor, 3, 4)
50 
51 // SetColour()
52 void(G4VisAttributes::*f1_SetColour)(const G4Colour&)=
53  &G4VisAttributes::SetColour;
54 
55 void(G4VisAttributes::*f2_SetColour)(G4double, G4double, G4double, G4double)=
56  &G4VisAttributes::SetColour;
57 
58 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetColour, SetColour, 3, 4)
59 
60 }
61 
62 using namespace pyG4VisAttributes;
63 
64 // ====================================================================
65 // module definition
66 // ====================================================================
68 {
69  scope in_G4VisAttributes=
70  class_<G4VisAttributes, G4VisAttributes*>
71  ("G4VisAttributes", "visualization attributes")
72  // constructors
73  .def(init<G4bool>())
74  .def(init<const G4Colour&>())
75  .def(init<G4bool, const G4Colour&>())
76  // ---
77  .def("GetInvisible", &G4VisAttributes::GetInvisible,
78  return_value_policy<reference_existing_object>())
79  .staticmethod("GetInvisible")
80  .def("IsVisible", &G4VisAttributes::IsVisible)
81  .def("IsDaughtersInvisible", &G4VisAttributes::IsDaughtersInvisible)
82  // ---
83  .def("GetColour", &G4VisAttributes::GetColour,
84  return_internal_reference<>())
85  .def("GetColor", &G4VisAttributes::GetColor,
86  return_internal_reference<>())
87  // ---
88  .def("GetLineStyle", &G4VisAttributes::GetLineStyle)
89  .def("GetLineWidth", &G4VisAttributes::GetLineWidth)
90  .def("IsForceDrawingStyle", &G4VisAttributes::IsForceDrawingStyle)
91  .def("GetForcedDrawingStyle", &G4VisAttributes::GetForcedDrawingStyle)
92  .def("IsForceAuxEdgeVisible", &G4VisAttributes::IsForceAuxEdgeVisible)
93  .def("SetVisibility", &G4VisAttributes::SetVisibility)
94  .def("SetDaughtersInvisible", &G4VisAttributes::SetDaughtersInvisible)
95  .def("SetColor", f1_SetColor)
96  .def("SetColour", f1_SetColour)
97  .def("SetColor", f2_SetColor, f_SetColor())
98  .def("SetColour", f2_SetColour, f_SetColour())
99  .def("SetLineStyle", &G4VisAttributes::SetLineStyle)
100  .def("SetLineWidth", &G4VisAttributes::SetLineWidth)
101  .def("SetForceWireframe", &G4VisAttributes::SetForceWireframe)
102  .def("SetForceSolid", &G4VisAttributes::SetForceSolid)
103  .def("SetForceAuxEdgeVisible", &G4VisAttributes::SetForceAuxEdgeVisible)
104  .def("SetAttValues", &G4VisAttributes::SetAttValues)
105  .def("SetAttDefs", &G4VisAttributes::SetAttDefs)
106  // operators
107  .def(self_ns::str(self))
108  .def(self == self)
109  .def(self != self)
110  ;
111 
112  // enum LineStyle
113  enum_<G4VisAttributes::LineStyle>("LineStyle")
114  .value("unbroken", G4VisAttributes::unbroken)
115  .value("dashed", G4VisAttributes::dashed)
116  .value("dotted", G4VisAttributes::dotted)
117  ;
118 
119  // enum ForcedDrawingStyle
120  enum_<G4VisAttributes::ForcedDrawingStyle>("ForcedDrawingStyle")
121  .value("wireframe", G4VisAttributes::wireframe)
122  .value("solid", G4VisAttributes::solid)
123  ;
124 
125 }
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateTubeVolume, CreateTubeVolume, 4, 6) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateConeVolume
void(G4VisAttributes::* f1_SetColor)(const G4Color &)
void(G4VisAttributes::* f2_SetColor)(G4double, G4double, G4double, G4double)
void(G4VisAttributes::* f2_SetColour)(G4double, G4double, G4double, G4double)
void(G4VisAttributes::* f1_SetColour)(const G4Colour &)
double value
Definition: spectrum.C:18
void export_G4VisAttributes()
h_2 SetLineStyle(kDashed)
gr1 SetLineWidth(1)