Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
pyG4VisAttributes.cc
이 파일의 문서화 페이지로 가기
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()
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("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(G4EzVolume::* f2_SetColor)(G4double, G4double, G4double)
Definition: pyEzgeom.cc:105
const G4Color & GetColor() const
void SetForceAuxEdgeVisible(G4bool=true)
void(G4VisAttributes::* f2_SetColour)(G4double, G4double, G4double, G4double)
void SetLineStyle(LineStyle)
ForcedDrawingStyle GetForcedDrawingStyle() const
G4bool IsVisible() const
void(G4EzVolume::* f1_SetColor)(const G4Color &)
Definition: pyEzgeom.cc:104
void(G4VisAttributes::* f1_SetColour)(const G4Colour &)
G4bool IsForceAuxEdgeVisible() const
static const G4VisAttributes & GetInvisible()
void SetAttValues(const std::vector< G4AttValue > *)
double G4double
Definition: G4Types.hh:76
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4double GetLineWidth() const
void SetColor(const G4Color &)
const G4ThreeVector const G4double const
void SetAttDefs(const std::map< G4String, G4AttDef > *)
void SetForceSolid(G4bool=true)
void SetVisibility(G4bool=true)
G4bool IsForceDrawingStyle() const
void export_G4VisAttributes()
void SetDaughtersInvisible(G4bool=true)
void SetLineWidth(G4double)
void SetForceWireframe(G4bool=true)
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData
LineStyle GetLineStyle() const
const G4Colour & GetColour() const
G4bool IsDaughtersInvisible() const