Geant4  10.01.p03
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 76884 2013-11-18 12:54:03Z 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()
46 
49 
50 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_SetColor, SetColor, 3, 4)
51 
52 // SetColour()
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_readonly("Invisible", &G4VisAttributes::Invisible)
79  .def("GetInvisible", &G4VisAttributes::GetInvisible,
80  return_value_policy<reference_existing_object>())
81  .staticmethod("GetInvisible")
82  .def("IsVisible", &G4VisAttributes::IsVisible)
83  .def("IsDaughtersInvisible", &G4VisAttributes::IsDaughtersInvisible)
84  // ---
85  .def("GetColour", &G4VisAttributes::GetColour,
86  return_internal_reference<>())
87  .def("GetColor", &G4VisAttributes::GetColor,
88  return_internal_reference<>())
89  // ---
90  .def("GetLineStyle", &G4VisAttributes::GetLineStyle)
91  .def("GetLineWidth", &G4VisAttributes::GetLineWidth)
92  .def("IsForceDrawingStyle", &G4VisAttributes::IsForceDrawingStyle)
93  .def("GetForcedDrawingStyle", &G4VisAttributes::GetForcedDrawingStyle)
94  .def("IsForceAuxEdgeVisible", &G4VisAttributes::IsForceAuxEdgeVisible)
95  .def("SetVisibility", &G4VisAttributes::SetVisibility)
96  .def("SetDaughtersInvisible", &G4VisAttributes::SetDaughtersInvisible)
97  .def("SetColor", f1_SetColor)
98  .def("SetColour", f1_SetColour)
99  .def("SetColor", f2_SetColor, f_SetColor())
100  .def("SetColour", f2_SetColour, f_SetColour())
101  .def("SetLineStyle", &G4VisAttributes::SetLineStyle)
102  .def("SetLineWidth", &G4VisAttributes::SetLineWidth)
103  .def("SetForceWireframe", &G4VisAttributes::SetForceWireframe)
104  .def("SetForceSolid", &G4VisAttributes::SetForceSolid)
105  .def("SetForceAuxEdgeVisible", &G4VisAttributes::SetForceAuxEdgeVisible)
106  .def("SetAttValues", &G4VisAttributes::SetAttValues)
107  .def("SetAttDefs", &G4VisAttributes::SetAttDefs)
108  // operators
109  .def(self_ns::str(self))
110  .def(self == self)
111  .def(self != self)
112  ;
113 
114  // enum LineStyle
115  enum_<G4VisAttributes::LineStyle>("LineStyle")
116  .value("unbroken", G4VisAttributes::unbroken)
117  .value("dashed", G4VisAttributes::dashed)
118  .value("dotted", G4VisAttributes::dotted)
119  ;
120 
121  // enum ForcedDrawingStyle
122  enum_<G4VisAttributes::ForcedDrawingStyle>("ForcedDrawingStyle")
123  .value("wireframe", G4VisAttributes::wireframe)
124  .value("solid", G4VisAttributes::solid)
125  ;
126 
127 }
static const G4VisAttributes & GetInvisible()
G4bool IsForceAuxEdgeVisible() const
void SetForceWireframe(G4bool)
void SetColor(const G4Color &)
G4double GetLineWidth() const
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateTubeVolume, CreateTubeVolume, 4, 6) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateConeVolume
void SetLineStyle(LineStyle)
void SetLineWidth(G4double)
void SetVisibility(G4bool)
G4bool IsVisible() const
const G4Colour & GetColour() const
void SetForceSolid(G4bool)
LineStyle GetLineStyle() const
void SetAttValues(const std::vector< G4AttValue > *)
G4bool IsDaughtersInvisible() const
void export_G4VisAttributes()
void SetAttDefs(const std::map< G4String, G4AttDef > *)
void(G4VisAttributes::* f1_SetColor)(const G4Color &)
void SetForceAuxEdgeVisible(G4bool)
void(G4VisAttributes::* f1_SetColour)(const G4Colour &)
const G4Color & GetColor() const
G4bool IsForceDrawingStyle() const
static const G4VisAttributes Invisible
void(G4VisAttributes::* f2_SetColour)(G4double, G4double, G4double, G4double)
double G4double
Definition: G4Types.hh:76
void(G4VisAttributes::* f2_SetColor)(G4double, G4double, G4double, G4double)
void SetDaughtersInvisible(G4bool)
ForcedDrawingStyle GetForcedDrawingStyle() const