| 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.4 2006/06/29 15:33:57 gunter Exp $
|
|---|
| 27 | // $Name: geant4-09-04-beta-01 $
|
|---|
| 28 | // ====================================================================
|
|---|
| 29 | // pyG4VisAttributes.cc
|
|---|
| 30 | //
|
|---|
| 31 | // 2005 Q
|
|---|
| 32 | // ====================================================================
|
|---|
| 33 | #include <boost/python.hpp>
|
|---|
| 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 | // ====================================================================
|
|---|
| 68 | void export_G4VisAttributes()
|
|---|
| 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 | }
|
|---|