Geant4  10.02.p03
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 (const G4VisAttributes &)
 
 G4VisAttributes (G4bool visibility)
 
 G4VisAttributes (const G4Colour &colour)
 
 G4VisAttributes (G4bool visibility, const G4Colour &colour)
 
 ~G4VisAttributes ()
 
G4VisAttributesoperator= (const G4VisAttributes &)
 
G4bool operator!= (const G4VisAttributes &a) const
 
G4bool operator== (const G4VisAttributes &a) const
 
void SetVisibility (G4bool)
 
void SetDaughtersInvisible (G4bool)
 
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)
 
void SetForceSolid (G4bool)
 
void SetForceAuxEdgeVisible (G4bool)
 
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 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)
 

Private Attributes

G4bool fVisible
 
G4bool fDaughtersInvisible
 
G4Colour fColour
 
LineStyle fLineStyle
 
G4double fLineWidth
 
G4bool fForceDrawingStyle
 
ForcedDrawingStyle fForcedStyle
 
G4bool fForceAuxEdgeVisible
 
G4int fForcedLineSegmentsPerCircle
 
G4double fStartTime
 
G4double fEndTime
 
const std::vector< G4AttValue > * fAttValues
 
const std::map< G4String, G4AttDef > * fAttDefs
 

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

anonymous enum
Enumerator
fMinLineSegmentsPerCircle 

Definition at line 73 of file G4VisAttributes.hh.

◆ ForcedDrawingStyle

◆ LineStyle

Constructor & Destructor Documentation

◆ G4VisAttributes() [1/5]

G4VisAttributes::G4VisAttributes ( )

Definition at line 58 of file G4VisAttributes.cc.

58  :
59 fVisible (true),
60 fDaughtersInvisible (false),
61 fColour (G4Colour ()),
63 fLineWidth (1.),
64 fForceDrawingStyle (false),
66 fForceAuxEdgeVisible (false),
67 fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
70 fAttValues (0),
71 fAttDefs (0)
72 {}
const std::map< G4String, G4AttDef > * fAttDefs
ForcedDrawingStyle fForcedStyle
const std::vector< G4AttValue > * fAttValues
G4int fForcedLineSegmentsPerCircle
#define DBL_MAX
Definition: templates.hh:83
Here is the caller graph for this function:

◆ G4VisAttributes() [2/5]

G4VisAttributes::G4VisAttributes ( const G4VisAttributes va)

Definition at line 37 of file G4VisAttributes.cc.

37  :
38 fVisible (va.fVisible),
40 fColour (va.fColour),
48 fEndTime (va.fEndTime),
49 // AttValues are created afresh for each object (using the
50 // CreateAttValues message), but deletion is the responsibility of
51 // the creator. So just copy pointer.
53 // AttDefs, if any, belong to the object from which they were obtained
54 // (with a GetAttDefs message), so just copy pointer.
55 fAttDefs (va.fAttDefs)
56 {}
const std::map< G4String, G4AttDef > * fAttDefs
ForcedDrawingStyle fForcedStyle
const std::vector< G4AttValue > * fAttValues
G4int fForcedLineSegmentsPerCircle

◆ G4VisAttributes() [3/5]

G4VisAttributes::G4VisAttributes ( G4bool  visibility)

Definition at line 74 of file G4VisAttributes.cc.

74  :
75 fVisible (visibility),
76 fDaughtersInvisible (false),
77 fColour (G4Colour ()),
79 fLineWidth (1.),
80 fForceDrawingStyle (false),
82 fForceAuxEdgeVisible (false),
83 fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
86 fAttValues (0),
87 fAttDefs (0)
88 {}
const std::map< G4String, G4AttDef > * fAttDefs
ForcedDrawingStyle fForcedStyle
const std::vector< G4AttValue > * fAttValues
G4int fForcedLineSegmentsPerCircle
#define DBL_MAX
Definition: templates.hh:83

◆ G4VisAttributes() [4/5]

G4VisAttributes::G4VisAttributes ( const G4Colour colour)

Definition at line 90 of file G4VisAttributes.cc.

90  :
91 fVisible (true),
92 fDaughtersInvisible (false),
93 fColour (colour),
95 fLineWidth (1.),
96 fForceDrawingStyle (false),
98 fForceAuxEdgeVisible (false),
99 fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
101 fEndTime (DBL_MAX),
102 fAttValues (0),
103 fAttDefs (0)
104 {}
const std::map< G4String, G4AttDef > * fAttDefs
ForcedDrawingStyle fForcedStyle
const std::vector< G4AttValue > * fAttValues
G4int fForcedLineSegmentsPerCircle
#define DBL_MAX
Definition: templates.hh:83

◆ G4VisAttributes() [5/5]

G4VisAttributes::G4VisAttributes ( G4bool  visibility,
const G4Colour colour 
)

Definition at line 106 of file G4VisAttributes.cc.

107  :
108 fVisible (visibility),
109 fDaughtersInvisible (false),
110 fColour (colour),
112 fLineWidth (1.),
113 fForceDrawingStyle (false),
115 fForceAuxEdgeVisible (false),
116 fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
118 fEndTime (DBL_MAX),
119 fAttValues (0),
120 fAttDefs (0)
121 {}
const std::map< G4String, G4AttDef > * fAttDefs
ForcedDrawingStyle fForcedStyle
const std::vector< G4AttValue > * fAttValues
G4int fForcedLineSegmentsPerCircle
#define DBL_MAX
Definition: templates.hh:83

◆ ~G4VisAttributes()

G4VisAttributes::~G4VisAttributes ( )

Definition at line 123 of file G4VisAttributes.cc.

124 {
125 }

Member Function Documentation

◆ CreateAttValues()

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

Definition at line 159 of file G4VisAttributes.cc.

159  {
160  // Create an expendable copy on the heap...
161  return new std::vector<G4AttValue>(*fAttValues);
162 }
Here is the caller graph for this function:

◆ GetAttDefs()

const std::map<G4String,G4AttDef>* G4VisAttributes::GetAttDefs ( ) const
Here is the caller graph for this function:

◆ GetColor()

const G4Color& G4VisAttributes::GetColor ( ) const
Here is the caller graph for this function:

◆ GetColour()

const G4Colour& G4VisAttributes::GetColour ( ) const
Here is the caller graph for this function:

◆ GetEndTime()

G4double G4VisAttributes::GetEndTime ( ) const

◆ GetForcedDrawingStyle()

ForcedDrawingStyle G4VisAttributes::GetForcedDrawingStyle ( ) const
Here is the caller graph for this function:

◆ GetForcedLineSegmentsPerCircle()

G4int G4VisAttributes::GetForcedLineSegmentsPerCircle ( ) const
Here is the caller graph for this function:

◆ GetInvisible()

const G4VisAttributes & G4VisAttributes::GetInvisible ( )
static

Definition at line 154 of file G4VisAttributes.cc.

154  {
155  static const G4VisAttributes invisible = G4VisAttributes(false);
156  return invisible;
157 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLineStyle()

LineStyle G4VisAttributes::GetLineStyle ( ) const
Here is the caller graph for this function:

◆ GetLineWidth()

G4double G4VisAttributes::GetLineWidth ( ) const
Here is the caller graph for this function:

◆ GetMinLineSegmentsPerCircle()

static G4int G4VisAttributes::GetMinLineSegmentsPerCircle ( )
inlinestatic

Definition at line 131 of file G4VisAttributes.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStartTime()

G4double G4VisAttributes::GetStartTime ( ) const

◆ IsDaughtersInvisible()

G4bool G4VisAttributes::IsDaughtersInvisible ( ) const
Here is the caller graph for this function:

◆ IsForceAuxEdgeVisible()

G4bool G4VisAttributes::IsForceAuxEdgeVisible ( ) const
Here is the caller graph for this function:

◆ IsForceDrawingStyle()

G4bool G4VisAttributes::IsForceDrawingStyle ( ) const
Here is the caller graph for this function:

◆ IsForceLineSegmentsPerCircle()

G4bool G4VisAttributes::IsForceLineSegmentsPerCircle ( ) const
Here is the caller graph for this function:

◆ IsVisible()

G4bool G4VisAttributes::IsVisible ( ) const
Here is the caller graph for this function:

◆ operator!=()

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

Definition at line 233 of file G4VisAttributes.cc.

233  {
234 
235  if (
236  (fVisible != a.fVisible) ||
238  (fColour != a.fColour) ||
239  (fLineStyle != a.fLineStyle) ||
240  (fLineWidth != a.fLineWidth) ||
244  (fStartTime != a.fStartTime) ||
245  (fEndTime != a.fEndTime) ||
246  (fAttValues != a.fAttValues) ||
247  (fAttDefs != a.fAttDefs)
248  )
249  return true;
250 
251  if (fForceDrawingStyle) {
252  if (fForcedStyle != a.fForcedStyle) return true;
253  }
254 
255  return false;
256 }
const std::map< G4String, G4AttDef > * fAttDefs
ForcedDrawingStyle fForcedStyle
const std::vector< G4AttValue > * fAttValues
G4int fForcedLineSegmentsPerCircle
Here is the caller graph for this function:

◆ operator=()

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

Definition at line 127 of file G4VisAttributes.cc.

128 {
129  if (&rhs == this) return *this;
130  fVisible = rhs.fVisible;
132  fColour = rhs.fColour;
133  fLineStyle = rhs.fLineStyle;
134  fLineWidth = rhs.fLineWidth;
139  fStartTime = rhs.fStartTime;
140  fEndTime = rhs.fEndTime;
141  // AttValues are created afresh for each object (using the
142  // CreateAttValues message), but deletion is the responsibility of
143  // the creator. So just copy pointer.
144  fAttValues = rhs.fAttValues;
145  // AttDefs, if any, belong to the object from which they were obtained
146  // (with a GetAttDefs message), so just copy pointer.
147  fAttDefs = rhs.fAttDefs;
148  return *this;
149 }
const std::map< G4String, G4AttDef > * fAttDefs
ForcedDrawingStyle fForcedStyle
const std::vector< G4AttValue > * fAttValues
G4int fForcedLineSegmentsPerCircle
Here is the call graph for this function:

◆ operator==()

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

Definition at line 258 of file G4VisAttributes.cc.

258  {
259  return !(G4VisAttributes::operator != (a));
260 }
G4bool operator!=(const G4VisAttributes &a) const
Here is the call graph for this function:

◆ SetAttDefs()

void G4VisAttributes::SetAttDefs ( const std::map< G4String, G4AttDef > *  )
Here is the caller graph for this function:

◆ SetAttValues()

void G4VisAttributes::SetAttValues ( const std::vector< G4AttValue > *  )
Here is the caller graph for this function:

◆ SetColor() [1/2]

void G4VisAttributes::SetColor ( const G4Color )
Here is the caller graph for this function:

◆ SetColor() [2/2]

void G4VisAttributes::SetColor ( G4double  red,
G4double  green,
G4double  blue,
G4double  alpha = 1. 
)

◆ SetColour() [1/2]

void G4VisAttributes::SetColour ( const G4Colour )
Here is the caller graph for this function:

◆ SetColour() [2/2]

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

◆ SetDaughtersInvisible()

void G4VisAttributes::SetDaughtersInvisible ( G4bool  )
Here is the caller graph for this function:

◆ SetEndTime()

void G4VisAttributes::SetEndTime ( G4double  )
Here is the caller graph for this function:

◆ SetForceAuxEdgeVisible()

void G4VisAttributes::SetForceAuxEdgeVisible ( G4bool  )
Here is the caller graph for this function:

◆ SetForceLineSegmentsPerCircle()

void G4VisAttributes::SetForceLineSegmentsPerCircle ( G4int  nSegments)

Definition at line 164 of file G4VisAttributes.cc.

164  {
165  const G4int nSegmentsMin = fMinLineSegmentsPerCircle;
166  if (nSegments > 0 && nSegments < nSegmentsMin) {
167  nSegments = nSegmentsMin;
168  G4cout <<
169  "G4VisAttributes::SetForcedLineSegmentsPerCircle: attempt to set the"
170  "\nnumber of line segements per circle < " << nSegmentsMin
171  << "; forced to " << nSegments << G4endl;
172  }
173  fForcedLineSegmentsPerCircle = nSegments;
174 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4int fForcedLineSegmentsPerCircle
Here is the caller graph for this function:

◆ SetForceSolid()

void G4VisAttributes::SetForceSolid ( G4bool  )

◆ SetForceWireframe()

void G4VisAttributes::SetForceWireframe ( G4bool  )
Here is the caller graph for this function:

◆ SetLineStyle()

void G4VisAttributes::SetLineStyle ( LineStyle  )
Here is the caller graph for this function:

◆ SetLineWidth()

void G4VisAttributes::SetLineWidth ( G4double  )
Here is the caller graph for this function:

◆ SetStartTime()

void G4VisAttributes::SetStartTime ( G4double  )
Here is the caller graph for this function:

◆ SetVisibility()

void G4VisAttributes::SetVisibility ( G4bool  )

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 176 of file G4VisAttributes.cc.

177 {
178  os << "G4VisAttributes: ";
179  if (!a.fVisible) os << "in";
180  os << "visible, daughters ";
181  if (a.fDaughtersInvisible) os << "in";
182  os << "visible, colour: " << a.fColour;
183  os << "\n linestyle: ";
184  switch (a.fLineStyle) {
186  os << "solid"; break;
188  os << "dashed"; break;
189  case G4VisAttributes::dotted: os << "dotted"; break;
190  default: os << "unrecognised"; break;
191  }
192  os << ", line width: " << a.fLineWidth;
193  os << ", min line segments per circle: " << a.GetMinLineSegmentsPerCircle();
194  os << "\n drawing style: ";
195  if (a.fForceDrawingStyle) {
196  os << "forced to: ";
197  switch (a.fForcedStyle) {
199  os << "wireframe"; break;
201  os << "solid"; break;
202  default: os << "unrecognised"; break;
203  }
204  }
205  else {
206  os << "not forced";
207  }
208  os << ", auxiliary edge visibility: ";
209  if (!a.fForceAuxEdgeVisible) {
210  os << "not ";
211  }
212  os << "forced";
213  os << "\n line segments per circle: ";
214  if (a.fForcedLineSegmentsPerCircle > 0) {
215  os << "forced to " << a.fForcedLineSegmentsPerCircle;
216  } else {
217  os << "not forced.";
218  }
219  os << "\n time range: (" << a.fStartTime << ',' << a.fEndTime << ')';
220  os << "\n G4AttValue pointer is ";
221  if (a.fAttValues) {
222  os << "non-";
223  }
224  os << "zero";
225  os << ", G4AttDef pointer is ";
226  if (a.fAttDefs) {
227  os << "non-";
228  }
229  os << "zero";
230  return os;
231 }
const std::map< G4String, G4AttDef > * fAttDefs
ForcedDrawingStyle fForcedStyle
static G4int GetMinLineSegmentsPerCircle()
const std::vector< G4AttValue > * fAttValues
G4int fForcedLineSegmentsPerCircle

Member Data Documentation

◆ fAttDefs

const std::map<G4String,G4AttDef>* G4VisAttributes::fAttDefs
private

Definition at line 154 of file G4VisAttributes.hh.

◆ fAttValues

const std::vector<G4AttValue>* G4VisAttributes::fAttValues
private

Definition at line 153 of file G4VisAttributes.hh.

◆ fColour

G4Colour G4VisAttributes::fColour
private

Definition at line 143 of file G4VisAttributes.hh.

◆ fDaughtersInvisible

G4bool G4VisAttributes::fDaughtersInvisible
private

Definition at line 142 of file G4VisAttributes.hh.

◆ fEndTime

G4double G4VisAttributes::fEndTime
private

Definition at line 152 of file G4VisAttributes.hh.

◆ fForceAuxEdgeVisible

G4bool G4VisAttributes::fForceAuxEdgeVisible
private

Definition at line 149 of file G4VisAttributes.hh.

◆ fForcedLineSegmentsPerCircle

G4int G4VisAttributes::fForcedLineSegmentsPerCircle
private

Definition at line 150 of file G4VisAttributes.hh.

◆ fForceDrawingStyle

G4bool G4VisAttributes::fForceDrawingStyle
private

Definition at line 147 of file G4VisAttributes.hh.

◆ fForcedStyle

ForcedDrawingStyle G4VisAttributes::fForcedStyle
private

Definition at line 148 of file G4VisAttributes.hh.

◆ fLineStyle

LineStyle G4VisAttributes::fLineStyle
private

Definition at line 144 of file G4VisAttributes.hh.

◆ fLineWidth

G4double G4VisAttributes::fLineWidth
private

Definition at line 145 of file G4VisAttributes.hh.

◆ fStartTime

G4double G4VisAttributes::fStartTime
private

Definition at line 152 of file G4VisAttributes.hh.

◆ fVisible

G4bool G4VisAttributes::fVisible
private

Definition at line 141 of file G4VisAttributes.hh.

◆ Invisible

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: