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