Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4VMarker.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: G4VMarker.hh 66376 2012-12-18 09:42:59Z gcosmo $
28 //
29 //
30 // G4VMarker - base class for markers - circles, squares, etc.
31 // John Allison 17/11/96.
32 
33 // Class Description:
34 // G4VMarkers are 2-dimensional G4VVisPrims with the special
35 // properties (a) of always facing the camera and (b) of having the
36 // possibility of a size defined in screen units (pixels) or paper
37 // units (points - there are 72 points per inch). The convention is
38 // that if a world size is not specified, then the marker will be
39 // drawn to the given screen size or paper size independent of the
40 // viewing transformation in effect.
41 //
42 // "Size" means "overall size", e.g., diameter of circle, side of
43 // square, height of text (but diameter and radius access functions
44 // are defined to avoid ambiguity).
45 //
46 // So the user who constructs the marker decides whether it should be
47 // drawn to a given size in world coordinates by setting the world
48 // size. Alternatively, the user can set the screen size (internally,
49 // the world size is set to zero) and the marker is drawn to its
50 // screen size. Finally, the user may decide not to set any size; in
51 // that case, it is drawn according to the sizes specified in the
52 // default marker specified in G4ViewParameters.
53 //
54 // Also in G4ViewParameters is a "global marker scale" which is a
55 // factor by which all marker sizes are multiplied before drawing.
56 //
57 // Thus the graphics system driver scene handler code might look like:
58 //
59 // void G4XXXGraphicsSceneHandler::AddPrimitive (const G4Circle& circle) {
60 // G4bool hidden = !(fpView -> GetViewParameters().IsMarkerNotHidden());
61 // const G4Colour& colour = GetColour (circle);
62 // // Base class GetColour.
63 // G4VMarker::FillStyle style = circle.GetFillStyle();
64 // const G4Point3D& centre = circle.GetPosition();
65 // MarkerSizeType sizeType;
66 // G4double size = GetMarkerSize (circle, sizeType);
67 // switch (sizeType) {
68 // default:
69 // case screen:
70 // // Draw in screen coordinates.
71 // // ...
72 // break;
73 // case world:
74 // // Draw in world coordinates.
75 // // ...
76 // break;
77 // }
78 // }
79 // Class Description - End:
80 
81 
82 #ifndef G4VMARKER_HH
83 #define G4VMARKER_HH
84 
85 #include "globals.hh"
86 #include "G4Visible.hh"
87 #include "G4Point3D.hh"
88 #include "G4Colour.hh"
89 #include "G4Color.hh"
90 
91 class G4VMarker: public G4Visible {
92 
93  friend std::ostream& operator << (std::ostream& os, const G4VMarker&);
94 
95 public: // With description
96 
99 
101  // Constructors...
102  G4VMarker ();
103  G4VMarker (const G4VMarker&);
104  G4VMarker (const G4Point3D& position);
105 
107  // Destructor...
108  virtual ~G4VMarker ();
109 
111  // Assignment...
113 
115  // Logical...
116  G4bool operator != (const G4VMarker&) const;
117 
119  // Get functions...
120  G4Point3D GetPosition () const;
121  SizeType GetSizeType () const;
122  G4double GetWorldSize () const;
123  G4double GetWorldDiameter () const;
124  G4double GetWorldRadius () const;
125  G4double GetScreenSize () const;
126  G4double GetScreenDiameter () const;
127  G4double GetScreenRadius () const;
128  FillStyle GetFillStyle () const;
129 
131  // Set functions...
132  void SetPosition (const G4Point3D&);
133  void SetSize (SizeType, G4double);
134  void SetDiameter (SizeType, G4double);
135  void SetRadius (SizeType, G4double);
136  void SetWorldSize (G4double);
137  void SetWorldDiameter (G4double);
138  void SetWorldRadius (G4double);
139  void SetScreenSize (G4double);
141  void SetScreenRadius (G4double);
142  void SetFillStyle (FillStyle);
143 
144  // Access functions to the string for user customizable information
145  virtual const G4String& GetInfo() const;
146  virtual void SetInfo( const G4String& info );
147 
148 private:
150  G4double fWorldSize; // Default 0. means use screen size.
151  G4double fScreenSize; // Default 0. means use global default.
153 
154  // String for user customizable information
156 
157 };
158 
159 #include "G4VMarker.icc"
160 
161 #endif
void SetPosition(const G4Point3D &)
const XML_Char XML_Encoding * info
Definition: expat.h:530
G4double fScreenSize
Definition: G4VMarker.hh:151
G4double GetWorldRadius() const
G4bool operator!=(const G4VMarker &) const
Definition: G4VMarker.cc:76
G4double GetScreenRadius() const
G4Point3D fPosition
Definition: G4VMarker.hh:149
G4double GetScreenSize() const
FillStyle fFillStyle
Definition: G4VMarker.hh:152
void SetWorldSize(G4double)
void SetDiameter(SizeType, G4double)
void SetWorldDiameter(G4double)
G4double fWorldSize
Definition: G4VMarker.hh:150
void SetScreenSize(G4double)
void SetRadius(SizeType, G4double)
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
void SetScreenRadius(G4double)
G4double GetScreenDiameter() const
G4double GetWorldDiameter() const
friend std::ostream & operator<<(std::ostream &os, const G4VMarker &)
Definition: G4VMarker.cc:89
virtual const G4String & GetInfo() const
void SetWorldRadius(G4double)
G4double GetWorldSize() const
void SetSize(SizeType, G4double)
Definition: G4VMarker.cc:119
G4String fInfo
Definition: G4VMarker.hh:155
FillStyle GetFillStyle() const
SizeType GetSizeType() const
Definition: G4VMarker.cc:112
G4Point3D GetPosition() const
void SetScreenDiameter(G4double)
virtual void SetInfo(const G4String &info)
virtual ~G4VMarker()
Definition: G4VMarker.cc:63
void SetFillStyle(FillStyle)
G4VMarker & operator=(const G4VMarker &)
Definition: G4VMarker.cc:65