Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4VisAttributes.hh
이 파일의 문서화 페이지로 가기
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 //
27 // $Id: G4VisAttributes.hh 110390 2018-05-22 08:28:07Z gcosmo $
28 //
29 //
30 // John Allison 23rd October 1996
31 
32 // Class Description:
33 // Visualization attributes are a set of information associated with the
34 // visualizable objects. This information is necessary only for
35 // visualization, and is not included in geometrical information such
36 // as shapes, position, and orientation.
37 // A typical example of a visualization attribute is "colour".
38 // For example, in visualizing a box, the Visualization Manager must know
39 // its colour. If an object to be visualized has not been assigned a set of
40 // visualization attributes, then a proper default set is used
41 // automatically. A set of visualization attributes is held by an
42 // instance of class G4VisAttributes defined in the graphics_reps
43 // category. The followings are commonly-used attributes:
44 // - visibility
45 // - visibility of daughters
46 // - force wireframe style, force solid style
47 // - force auxiliary edge visibility, force line segments pe circle
48 // - colour
49 // Class Description - End:
50 
51 
52 #ifndef __G4VISATTRIBUTES_HH__
53 #define __G4VISATTRIBUTES_HH__
54 
55 #include "globals.hh"
56 #include <vector>
57 #include <map>
58 
59 #include "graphics_reps_defs.hh"
60 
61 #include "G4Colour.hh"
62 #include "G4Color.hh"
63 
64 class G4AttValue;
65 class G4AttDef;
66 
68 
70 
71  friend std::ostream& operator << (std::ostream& os, const G4VisAttributes& a);
72 
73 public: // With description
74 
77 
78  G4VisAttributes ();
79  G4VisAttributes (G4bool visibility);
80  G4VisAttributes (const G4Colour& colour);
81  G4VisAttributes (G4bool visibility, const G4Colour& colour);
85 
86 #ifndef WIN32
87  // Deprecated 14 July 2016 JA
88  // Use GetInvisible() instead. E.g.:
89  // logical_volume->SetVisAttributes(G4VisAttributes::GetInvisible());
90  // or use one of the above constructors or SetVisibility and
91  // logical_volume->SetVisAttributes(my_vis_attributes);
92  static const G4VisAttributes Invisible;
93 #endif
94 
95  static const G4VisAttributes& GetInvisible();
96 
97  G4bool operator != (const G4VisAttributes& a) const;
98  G4bool operator == (const G4VisAttributes& a) const;
99 
100  void SetVisibility (G4bool = true);
101  void SetDaughtersInvisible (G4bool = true);
102  void SetColour (const G4Colour&);
103  void SetColor (const G4Color&);
104  void SetColour (G4double red, G4double green, G4double blue,
105  G4double alpha = 1.);
106  void SetColor (G4double red, G4double green, G4double blue,
107  G4double alpha = 1.);
108  void SetLineStyle (LineStyle);
109  void SetLineWidth (G4double);
110  void SetForceWireframe (G4bool = true);
111  void SetForceSolid (G4bool = true);
112  void SetForceAuxEdgeVisible (G4bool = true);
113  void SetForceLineSegmentsPerCircle (G4int nSegments);
114  // Allows choice of circle approximation. A circle of 360 degrees
115  // will be composed of nSegments line segments. If your solid has
116  // curves of D degrees that you need to divide into N segments,
117  // specify nSegments = N * 360 / D.
118  void SetStartTime (G4double);
119  void SetEndTime (G4double);
120  void SetAttValues (const std::vector<G4AttValue>*);
121  void SetAttDefs (const std::map<G4String,G4AttDef>*);
122 
123  G4bool IsVisible () const;
124  G4bool IsDaughtersInvisible () const;
125  const G4Colour& GetColour () const;
126  const G4Color& GetColor () const;
127  LineStyle GetLineStyle () const;
128  G4double GetLineWidth () const;
129  G4bool IsForceDrawingStyle () const;
131  G4bool IsForceAuxEdgeVisible () const;
135  G4double GetStartTime () const;
136  G4double GetEndTime () const;
138  // Returns an expendable copy of the G4AttValues...
139  const std::vector<G4AttValue>* CreateAttValues () const;
140  // Returns the orginal long life G4AttDefs...
141  const std::map<G4String,G4AttDef>* GetAttDefs () const;
142 
143  static constexpr G4int fMinLineSegmentsPerCircle = 3;
144  // Minumum number of sides per circle
145 
146  static constexpr G4double fVeryLongTime = 1.e100 * CLHEP::ns;
147  // About 1.e75 billion years!! Used as default for start and end time.
148 
149 private:
150 
151  G4bool fVisible; // Visibility flag
152  G4bool fDaughtersInvisible; // Make daughters invsibile.
155  G4double fLineWidth; // Units of "normal" device linewidth, e.g.,
156  // pixels for screen, 0.1 mm for paper.
157  G4bool fForceDrawingStyle; // To switch on forced drawing style.
158  ForcedDrawingStyle fForcedStyle; // Value of forced drawing style.
159  G4bool fForceAuxEdgeVisible; // To switch on a forced auxiliary edge mode.
160  G4bool fForcedAuxEdgeVisible; // Whether aux edges are visible or not.
161  G4int fForcedLineSegmentsPerCircle; // Forced lines segments per
162  // circle. <=0 means not forced.
163  G4double fStartTime, fEndTime; // Time range.
164  const std::vector<G4AttValue>* fAttValues; // For picking, etc.
165  const std::map<G4String,G4AttDef>* fAttDefs; // Corresponding definitions.
166 };
167 
168 #include "G4VisAttributes.icc"
169 
170 #endif
ForcedDrawingStyle fForcedStyle
const G4Color & GetColor() const
void SetForceAuxEdgeVisible(G4bool=true)
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
Definition: test07.cc:36
static constexpr G4double fVeryLongTime
void SetLineStyle(LineStyle)
G4double GetStartTime() const
ForcedDrawingStyle GetForcedDrawingStyle() const
static constexpr double ns
G4bool IsVisible() const
G4int fForcedLineSegmentsPerCircle
Definition: test07.cc:36
G4bool IsForceLineSegmentsPerCircle() const
G4bool fForcedAuxEdgeVisible
G4bool IsForceAuxEdgeVisible() const
static const G4VisAttributes & GetInvisible()
static G4int GetMinLineSegmentsPerCircle()
G4bool IsForcedAuxEdgeVisible() const
G4bool operator!=(const G4VisAttributes &a) const
void SetForceLineSegmentsPerCircle(G4int nSegments)
void SetAttValues(const std::vector< G4AttValue > *)
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
const std::vector< G4AttValue > * CreateAttValues() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
static constexpr G4int fMinLineSegmentsPerCircle
const std::map< G4String, G4AttDef > * fAttDefs
static const G4double alpha
G4double GetLineWidth() const
void SetColor(const G4Color &)
void SetAttDefs(const std::map< G4String, G4AttDef > *)
void SetStartTime(G4double)
G4bool operator==(const G4VisAttributes &a) const
G4VisAttributes & operator=(const G4VisAttributes &)
void SetForceSolid(G4bool=true)
void SetVisibility(G4bool=true)
int G4int
Definition: G4Types.hh:78
G4bool IsForceDrawingStyle() const
friend std::ostream & operator<<(std::ostream &os, const G4VisAttributes &a)
void SetDaughtersInvisible(G4bool=true)
void SetLineWidth(G4double)
void SetColour(const G4Colour &)
void SetForceWireframe(G4bool=true)
const std::vector< G4AttValue > * fAttValues
void SetEndTime(G4double)
G4double GetEndTime() const
static const G4VisAttributes Invisible
LineStyle GetLineStyle() const
G4int GetForcedLineSegmentsPerCircle() const
const G4Colour & GetColour() const
G4bool IsDaughtersInvisible() const