Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VisAttributes Class Reference

#include <G4VisAttributes.hh>

Collaboration diagram for G4VisAttributes:

Public Types

enum  LineStyle { unbroken, dashed, dotted }
 
enum  ForcedDrawingStyle { wireframe, solid }
 
enum  { fMinLineSegmentsPerCircle = 3 }
 

Public Member Functions

 G4VisAttributes ()
 
 G4VisAttributes (G4bool visibility)
 
 G4VisAttributes (const G4Colour &colour)
 
 G4VisAttributes (G4bool visibility, const G4Colour &colour)
 
 G4VisAttributes (const G4VisAttributes &)
 
 ~G4VisAttributes ()
 
G4VisAttributesoperator= (const G4VisAttributes &)
 
G4bool operator!= (const G4VisAttributes &a) const
 
G4bool operator== (const G4VisAttributes &a) const
 
void SetVisibility (G4bool=true)
 
void SetDaughtersInvisible (G4bool=true)
 
void SetColour (const G4Colour &)
 
void SetColor (const G4Color &)
 
void SetColour (G4double red, G4double green, G4double blue, G4double alpha=1.)
 
void SetColor (G4double red, G4double green, G4double blue, G4double alpha=1.)
 
void SetLineStyle (LineStyle)
 
void SetLineWidth (G4double)
 
void SetForceWireframe (G4bool=true)
 
void SetForceSolid (G4bool=true)
 
void SetForceAuxEdgeVisible (G4bool=true)
 
void SetForceLineSegmentsPerCircle (G4int nSegments)
 
void SetStartTime (G4double)
 
void SetEndTime (G4double)
 
void SetAttValues (const std::vector< G4AttValue > *)
 
void SetAttDefs (const std::map< G4String, G4AttDef > *)
 
G4bool IsVisible () const
 
G4bool IsDaughtersInvisible () const
 
const G4ColourGetColour () const
 
const G4ColorGetColor () const
 
LineStyle GetLineStyle () const
 
G4double GetLineWidth () const
 
G4bool IsForceDrawingStyle () const
 
ForcedDrawingStyle GetForcedDrawingStyle () const
 
G4bool IsForceAuxEdgeVisible () const
 
G4bool IsForcedAuxEdgeVisible () const
 
G4bool IsForceLineSegmentsPerCircle () const
 
G4int GetForcedLineSegmentsPerCircle () const
 
G4double GetStartTime () const
 
G4double GetEndTime () const
 
const std::vector< G4AttValue > * CreateAttValues () const
 
const std::map< G4String,
G4AttDef > * 
GetAttDefs () const
 

Static Public Member Functions

static const G4VisAttributesGetInvisible ()
 
static G4int GetMinLineSegmentsPerCircle ()
 

Static Public Attributes

static const G4VisAttributes Invisible = G4VisAttributes (false)
 

Friends

std::ostream & operator<< (std::ostream &os, const G4VisAttributes &a)
 

Detailed Description

Definition at line 65 of file G4VisAttributes.hh.

Member Enumeration Documentation

anonymous enum
Enumerator
fMinLineSegmentsPerCircle 

Definition at line 73 of file G4VisAttributes.hh.

Constructor & Destructor Documentation

G4VisAttributes::G4VisAttributes ( )

Definition at line 37 of file G4VisAttributes.cc.

37  :
38 fVisible (true),
39 fDaughtersInvisible (false),
40 fColour (G4Colour ()),
41 fLineStyle (unbroken),
42 fLineWidth (1.),
43 fForceDrawingStyle (false),
44 fForcedStyle (wireframe),
45 fForceAuxEdgeVisible (false),
46 fForcedAuxEdgeVisible(false),
47 fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
48 fStartTime (-DBL_MAX),
49 fEndTime (DBL_MAX),
50 fAttValues (0),
51 fAttDefs (0)
52 {}
#define DBL_MAX
Definition: templates.hh:83

Here is the caller graph for this function:

G4VisAttributes::G4VisAttributes ( G4bool  visibility)

Definition at line 54 of file G4VisAttributes.cc.

54  :
55 fVisible (visibility),
56 fDaughtersInvisible (false),
57 fColour (G4Colour ()),
58 fLineStyle (unbroken),
59 fLineWidth (1.),
60 fForceDrawingStyle (false),
61 fForcedStyle (wireframe),
62 fForceAuxEdgeVisible (false),
63 fForcedAuxEdgeVisible(false),
64 fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
65 fStartTime (-DBL_MAX),
66 fEndTime (DBL_MAX),
67 fAttValues (0),
68 fAttDefs (0)
69 {}
#define DBL_MAX
Definition: templates.hh:83
G4VisAttributes::G4VisAttributes ( const G4Colour colour)

Definition at line 71 of file G4VisAttributes.cc.

71  :
72 fVisible (true),
73 fDaughtersInvisible (false),
74 fColour (colour),
75 fLineStyle (unbroken),
76 fLineWidth (1.),
77 fForceDrawingStyle (false),
78 fForcedStyle (wireframe),
79 fForceAuxEdgeVisible (false),
80 fForcedAuxEdgeVisible(false),
81 fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
82 fStartTime (-DBL_MAX),
83 fEndTime (DBL_MAX),
84 fAttValues (0),
85 fAttDefs (0)
86 {}
#define DBL_MAX
Definition: templates.hh:83
G4VisAttributes::G4VisAttributes ( G4bool  visibility,
const G4Colour colour 
)

Definition at line 88 of file G4VisAttributes.cc.

89  :
90 fVisible (visibility),
91 fDaughtersInvisible (false),
92 fColour (colour),
93 fLineStyle (unbroken),
94 fLineWidth (1.),
95 fForceDrawingStyle (false),
96 fForcedStyle (wireframe),
97 fForceAuxEdgeVisible (false),
98 fForcedAuxEdgeVisible(false),
99 fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
100 fStartTime (-DBL_MAX),
101 fEndTime (DBL_MAX),
102 fAttValues (0),
103 fAttDefs (0)
104 {}
#define DBL_MAX
Definition: templates.hh:83
G4VisAttributes::G4VisAttributes ( const G4VisAttributes va)

Definition at line 106 of file G4VisAttributes.cc.

106  :
107 fVisible (va.fVisible),
108 fDaughtersInvisible (va.fDaughtersInvisible),
109 fColour (va.fColour),
110 fLineStyle (va.fLineStyle),
111 fLineWidth (va.fLineWidth),
112 fForceDrawingStyle (va.fForceDrawingStyle),
113 fForcedStyle (va.fForcedStyle),
114 fForceAuxEdgeVisible (va.fForceAuxEdgeVisible),
115 fForcedAuxEdgeVisible(va.fForcedAuxEdgeVisible),
116 fForcedLineSegmentsPerCircle (va.fForcedLineSegmentsPerCircle),
117 fStartTime (va.fStartTime),
118 fEndTime (va.fEndTime),
119 // AttValues are created afresh for each object (using the
120 // CreateAttValues message), but deletion is the responsibility of
121 // the creator. So just copy pointer.
122 fAttValues (va.fAttValues),
123 // AttDefs, if any, belong to the object from which they were obtained
124 // (with a GetAttDefs message), so just copy pointer.
125 fAttDefs (va.fAttDefs)
126 {}
G4VisAttributes::~G4VisAttributes ( )

Definition at line 128 of file G4VisAttributes.cc.

129 {}

Member Function Documentation

const std::vector< G4AttValue > * G4VisAttributes::CreateAttValues ( ) const

Definition at line 198 of file G4VisAttributes.cc.

198  {
199  // Create an expendable copy on the heap...
200  return new std::vector<G4AttValue>(*fAttValues);
201 }

Here is the caller graph for this function:

const std::map<G4String,G4AttDef>* G4VisAttributes::GetAttDefs ( ) const

Here is the caller graph for this function:

const G4Color& G4VisAttributes::GetColor ( ) const

Here is the caller graph for this function:

const G4Colour& G4VisAttributes::GetColour ( ) const

Here is the caller graph for this function:

G4double G4VisAttributes::GetEndTime ( ) const
G4VisAttributes::ForcedDrawingStyle G4VisAttributes::GetForcedDrawingStyle ( ) const

Definition at line 188 of file G4VisAttributes.cc.

188  {
189  if (fForceDrawingStyle) return fForcedStyle;
190  else return G4VisAttributes::wireframe;
191 }

Here is the caller graph for this function:

G4int G4VisAttributes::GetForcedLineSegmentsPerCircle ( ) const

Here is the caller graph for this function:

const G4VisAttributes & G4VisAttributes::GetInvisible ( )
static

Definition at line 159 of file G4VisAttributes.cc.

159  {
160  static const G4VisAttributes invisible = G4VisAttributes(false);
161  return invisible;
162 }

Here is the call graph for this function:

Here is the caller graph for this function:

LineStyle G4VisAttributes::GetLineStyle ( ) const

Here is the caller graph for this function:

G4double G4VisAttributes::GetLineWidth ( ) const

Here is the caller graph for this function:

static G4int G4VisAttributes::GetMinLineSegmentsPerCircle ( )
static

Here is the caller graph for this function:

G4double G4VisAttributes::GetStartTime ( ) const
G4bool G4VisAttributes::IsDaughtersInvisible ( ) const

Here is the caller graph for this function:

G4bool G4VisAttributes::IsForceAuxEdgeVisible ( ) const

Here is the caller graph for this function:

G4bool G4VisAttributes::IsForcedAuxEdgeVisible ( ) const

Definition at line 193 of file G4VisAttributes.cc.

193  {
194  if (fForceAuxEdgeVisible) return fForcedAuxEdgeVisible;
195  else return false;
196 }

Here is the caller graph for this function:

G4bool G4VisAttributes::IsForceDrawingStyle ( ) const

Here is the caller graph for this function:

G4bool G4VisAttributes::IsForceLineSegmentsPerCircle ( ) const

Here is the caller graph for this function:

G4bool G4VisAttributes::IsVisible ( ) const

Here is the caller graph for this function:

G4bool G4VisAttributes::operator!= ( const G4VisAttributes a) const

Definition at line 277 of file G4VisAttributes.cc.

277  {
278 
279  if (
280  (fVisible != a.fVisible) ||
281  (fDaughtersInvisible != a.fDaughtersInvisible) ||
282  (fColour != a.fColour) ||
283  (fLineStyle != a.fLineStyle) ||
284  (fLineWidth != a.fLineWidth) ||
285  (fForceDrawingStyle != a.fForceDrawingStyle) ||
286  (fForceAuxEdgeVisible!= a.fForceAuxEdgeVisible) ||
287  (fForcedLineSegmentsPerCircle != a.fForcedLineSegmentsPerCircle) ||
288  (fStartTime != a.fStartTime) ||
289  (fEndTime != a.fEndTime) ||
290  (fAttValues != a.fAttValues) ||
291  (fAttDefs != a.fAttDefs)
292  )
293  return true;
294 
295  if (fForceDrawingStyle) {
296  if (fForcedStyle != a.fForcedStyle) return true;
297  }
298 
299  if (fForceAuxEdgeVisible) {
300  if (fForcedAuxEdgeVisible != a.fForcedAuxEdgeVisible) return true;
301  }
302 
303  return false;
304 }

Here is the caller graph for this function:

G4VisAttributes & G4VisAttributes::operator= ( const G4VisAttributes rhs)

Definition at line 131 of file G4VisAttributes.cc.

132 {
133  if (&rhs == this) return *this;
134  fVisible = rhs.fVisible;
135  fDaughtersInvisible = rhs.fDaughtersInvisible;
136  fColour = rhs.fColour;
137  fLineStyle = rhs.fLineStyle;
138  fLineWidth = rhs.fLineWidth;
139  fForceDrawingStyle = rhs.fForceDrawingStyle;
140  fForcedStyle = rhs.fForcedStyle;
141  fForceAuxEdgeVisible = rhs.fForceAuxEdgeVisible;
142  fForcedAuxEdgeVisible = rhs.fForcedAuxEdgeVisible;
143  fForcedLineSegmentsPerCircle = rhs.fForcedLineSegmentsPerCircle;
144  fStartTime = rhs.fStartTime;
145  fEndTime = rhs.fEndTime;
146  // AttValues are created afresh for each object (using the
147  // CreateAttValues message), but deletion is the responsibility of
148  // the creator. So just copy pointer.
149  fAttValues = rhs.fAttValues;
150  // AttDefs, if any, belong to the object from which they were obtained
151  // (with a GetAttDefs message), so just copy pointer.
152  fAttDefs = rhs.fAttDefs;
153  return *this;
154 }
G4bool G4VisAttributes::operator== ( const G4VisAttributes a) const

Definition at line 306 of file G4VisAttributes.cc.

306  {
307  return !(G4VisAttributes::operator != (a));
308 }
G4bool operator!=(const G4VisAttributes &a) const

Here is the call graph for this function:

void G4VisAttributes::SetAttDefs ( const std::map< G4String, G4AttDef > *  )
void G4VisAttributes::SetAttValues ( const std::vector< G4AttValue > *  )
void G4VisAttributes::SetColor ( const G4Color )
void G4VisAttributes::SetColor ( G4double  red,
G4double  green,
G4double  blue,
G4double  alpha = 1. 
)
void G4VisAttributes::SetColour ( const G4Colour )

Here is the caller graph for this function:

void G4VisAttributes::SetColour ( G4double  red,
G4double  green,
G4double  blue,
G4double  alpha = 1. 
)
void G4VisAttributes::SetDaughtersInvisible ( G4bool  = true)

Here is the caller graph for this function:

void G4VisAttributes::SetEndTime ( G4double  )
void G4VisAttributes::SetForceAuxEdgeVisible ( G4bool  visibility = true)

Definition at line 182 of file G4VisAttributes.cc.

182  {
183  fForceAuxEdgeVisible = true;
184  fForcedAuxEdgeVisible = visibility;
185 }

Here is the caller graph for this function:

void G4VisAttributes::SetForceLineSegmentsPerCircle ( G4int  nSegments)

Definition at line 203 of file G4VisAttributes.cc.

203  {
204  const G4int nSegmentsMin = fMinLineSegmentsPerCircle;
205  if (nSegments > 0 && nSegments < nSegmentsMin) {
206  nSegments = nSegmentsMin;
207  G4cout <<
208  "G4VisAttributes::SetForcedLineSegmentsPerCircle: attempt to set the"
209  "\nnumber of line segements per circle < " << nSegmentsMin
210  << "; forced to " << nSegments << G4endl;
211  }
212  fForcedLineSegmentsPerCircle = nSegments;
213 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void G4VisAttributes::SetForceSolid ( G4bool  force = true)

Definition at line 173 of file G4VisAttributes.cc.

173  {
174  if (force) {
175  fForceDrawingStyle = true;
176  fForcedStyle = G4VisAttributes::solid;
177  } else {
178  fForceDrawingStyle = false;
179  }
180 }

Here is the caller graph for this function:

void G4VisAttributes::SetForceWireframe ( G4bool  force = true)

Definition at line 164 of file G4VisAttributes.cc.

164  {
165  if (force) {
166  fForceDrawingStyle = true;
167  fForcedStyle = G4VisAttributes::wireframe;
168  } else {
169  fForceDrawingStyle = false;
170  }
171 }

Here is the caller graph for this function:

void G4VisAttributes::SetLineStyle ( LineStyle  )

Here is the caller graph for this function:

void G4VisAttributes::SetLineWidth ( G4double  )

Here is the caller graph for this function:

void G4VisAttributes::SetStartTime ( G4double  )
void G4VisAttributes::SetVisibility ( G4bool  = true)

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const G4VisAttributes a 
)
friend

Definition at line 215 of file G4VisAttributes.cc.

216 {
217  os << "G4VisAttributes: ";
218  if (!a.fVisible) os << "in";
219  os << "visible, daughters ";
220  if (a.fDaughtersInvisible) os << "in";
221  os << "visible, colour: " << a.fColour;
222  os << "\n linestyle: ";
223  switch (a.fLineStyle) {
225  os << "solid"; break;
227  os << "dashed"; break;
228  case G4VisAttributes::dotted: os << "dotted"; break;
229  default: os << "unrecognised"; break;
230  }
231  os << ", line width: " << a.fLineWidth;
232  os << ", min line segments per circle: " << a.GetMinLineSegmentsPerCircle();
233  os << "\n drawing style: ";
234  if (a.fForceDrawingStyle) {
235  os << "forced to ";
236  switch (a.fForcedStyle) {
238  os << "wireframe"; break;
240  os << "solid"; break;
241  default: os << "unrecognised"; break;
242  }
243  }
244  else {
245  os << "not forced";
246  }
247  os << ", auxiliary edge visibility: ";
248  if (a.fForceAuxEdgeVisible) {
249  os << "forced to ";
250  if (!a.fForcedAuxEdgeVisible) {
251  os << "not ";
252  }
253  os << "visible";
254  } else {
255  os << "not forced";
256  }
257  os << "\n line segments per circle: ";
258  if (a.fForcedLineSegmentsPerCircle > 0) {
259  os << "forced to " << a.fForcedLineSegmentsPerCircle;
260  } else {
261  os << "not forced.";
262  }
263  os << "\n time range: (" << a.fStartTime << ',' << a.fEndTime << ')';
264  os << "\n G4AttValue pointer is ";
265  if (a.fAttValues) {
266  os << "non-";
267  }
268  os << "zero";
269  os << ", G4AttDef pointer is ";
270  if (a.fAttDefs) {
271  os << "non-";
272  }
273  os << "zero";
274  return os;
275 }
static G4int GetMinLineSegmentsPerCircle()

Member Data Documentation

const G4VisAttributes G4VisAttributes::Invisible = G4VisAttributes (false)
static

Definition at line 88 of file G4VisAttributes.hh.


The documentation for this class was generated from the following files: