Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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,v 1.5 2010-12-02 08:23:49 kmura Exp $
27 // $Name: not supported by cvs2svn $
28 // ====================================================================
29 // pyG4VisAttributes.cc
30 //
31 // 2005 Q
32 // ====================================================================
33 #include <boost/python.hpp>
34 #include "G4AttDef.hh"
35 #include "G4VisAttributes.hh"
36 
37 using namespace boost::python;
38 
39 // ====================================================================
40 // thin wrappers
41 // ====================================================================
42 namespace pyG4VisAttributes {
43 
44 // SetColor()
47 
50 
51 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetColor, SetColor, 3, 4);
52 
53 // SetColour()
56 
59 
60 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetColour, SetColour, 3, 4);
61 
62 };
63 
64 using namespace pyG4VisAttributes;
65 
66 // ====================================================================
67 // module definition
68 // ====================================================================
70 {
71  scope in_G4VisAttributes=
72  class_<G4VisAttributes, G4VisAttributes*>
73  ("G4VisAttributes", "visualization attributes")
74  // constructors
75  .def(init<G4bool>())
76  .def(init<const G4Colour&>())
77  .def(init<G4bool, const G4Colour&>())
78  // ---
79  .def_readonly("Invisible", &G4VisAttributes::Invisible)
80  .def("GetInvisible", &G4VisAttributes::GetInvisible,
81  return_value_policy<reference_existing_object>())
82  .staticmethod("GetInvisible")
83  .def("IsVisible", &G4VisAttributes::IsVisible)
84  .def("IsDaughtersInvisible", &G4VisAttributes::IsDaughtersInvisible)
85  // ---
86  .def("GetColour", &G4VisAttributes::GetColour,
87  return_internal_reference<>())
88  .def("GetColor", &G4VisAttributes::GetColor,
89  return_internal_reference<>())
90  // ---
91  .def("GetLineStyle", &G4VisAttributes::GetLineStyle)
92  .def("GetLineWidth", &G4VisAttributes::GetLineWidth)
93  .def("IsForceDrawingStyle", &G4VisAttributes::IsForceDrawingStyle)
94  .def("GetForcedDrawingStyle", &G4VisAttributes::GetForcedDrawingStyle)
95  .def("IsForceAuxEdgeVisible", &G4VisAttributes::IsForceAuxEdgeVisible)
96  .def("SetVisibility", &G4VisAttributes::SetVisibility)
97  .def("SetDaughtersInvisible", &G4VisAttributes::SetDaughtersInvisible)
98  .def("SetColor", f1_SetColor)
99  .def("SetColour", f1_SetColour)
100  .def("SetColor", f2_SetColor, f_SetColor())
101  .def("SetColour", f2_SetColour, f_SetColour())
102  .def("SetLineStyle", &G4VisAttributes::SetLineStyle)
103  .def("SetLineWidth", &G4VisAttributes::SetLineWidth)
104  .def("SetForceWireframe", &G4VisAttributes::SetForceWireframe)
105  .def("SetForceSolid", &G4VisAttributes::SetForceSolid)
106  .def("SetForceAuxEdgeVisible", &G4VisAttributes::SetForceAuxEdgeVisible)
107  .def("SetAttValues", &G4VisAttributes::SetAttValues)
108  .def("SetAttDefs", &G4VisAttributes::SetAttDefs)
109  // operators
110  .def(self_ns::str(self))
111  .def(self == self)
112  .def(self != self)
113  ;
114 
115  // enum LineStyle
116  enum_<G4VisAttributes::LineStyle>("LineStyle")
117  .value("unbroken", G4VisAttributes::unbroken)
118  .value("dashed", G4VisAttributes::dashed)
119  .value("dotted", G4VisAttributes::dotted)
120  ;
121 
122  // enum ForcedDrawingStyle
123  enum_<G4VisAttributes::ForcedDrawingStyle>("ForcedDrawingStyle")
124  .value("wireframe", G4VisAttributes::wireframe)
125  .value("solid", G4VisAttributes::solid)
126  ;
127 
128 }