Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends
G4VisAttributes Class Reference

#include <G4VisAttributes.hh>

Public Types

enum  LineStyle { unbroken, dashed, dotted }
 
enum  ForcedDrawingStyle { wireframe, solid }
 

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 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

Enumerator
wireframe 
solid 

Definition at line 72 of file G4VisAttributes.hh.

Enumerator
unbroken 
dashed 
dotted 

Definition at line 71 of file G4VisAttributes.hh.

Constructor & Destructor Documentation

G4VisAttributes::G4VisAttributes ( )

Definition at line 58 of file G4VisAttributes.cc.

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

Definition at line 37 of file G4VisAttributes.cc.

37  :
38 fVisible (va.fVisible),
39 fDaughtersInvisible (va.fDaughtersInvisible),
40 fColour (va.fColour),
41 fLineStyle (va.fLineStyle),
42 fLineWidth (va.fLineWidth),
43 fForceDrawingStyle (va.fForceDrawingStyle),
44 fForcedStyle (va.fForcedStyle),
45 fForceAuxEdgeVisible (va.fForceAuxEdgeVisible),
46 fForcedLineSegmentsPerCircle (va.fForcedLineSegmentsPerCircle),
47 fStartTime (va.fStartTime),
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.
52 fAttValues (va.fAttValues),
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 {}
G4VisAttributes::G4VisAttributes ( G4bool  visibility)

Definition at line 74 of file G4VisAttributes.cc.

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

Definition at line 90 of file G4VisAttributes.cc.

90  :
91 fVisible (true),
92 fDaughtersInvisible (false),
93 fColour (colour),
94 fLineStyle (unbroken),
95 fLineWidth (1.),
96 fForceDrawingStyle (false),
97 fForcedStyle (wireframe),
98 fForceAuxEdgeVisible (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 ( G4bool  visibility,
const G4Colour colour 
)

Definition at line 106 of file G4VisAttributes.cc.

107  :
108 fVisible (visibility),
109 fDaughtersInvisible (false),
110 fColour (colour),
111 fLineStyle (unbroken),
112 fLineWidth (1.),
113 fForceDrawingStyle (false),
114 fForcedStyle (wireframe),
115 fForceAuxEdgeVisible (false),
116 fForcedLineSegmentsPerCircle (0), // <=0 means not forced.
117 fStartTime (-DBL_MAX),
118 fEndTime (DBL_MAX),
119 fAttValues (0),
120 fAttDefs (0)
121 {}
#define DBL_MAX
Definition: templates.hh:83
G4VisAttributes::~G4VisAttributes ( )

Definition at line 123 of file G4VisAttributes.cc.

124 {
125 }

Member Function Documentation

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

Definition at line 153 of file G4VisAttributes.cc.

Referenced by G4VSceneHandler::LoadAtts(), and G4XXXStoredSceneHandler::PreAddSolid().

153  {
154  // Create an expendable copy on the heap...
155  return new std::vector<G4AttValue>(*fAttValues);
156 }
const std::map<G4String,G4AttDef>* G4VisAttributes::GetAttDefs ( ) const
const G4Color& G4VisAttributes::GetColor ( ) const
const G4Colour& G4VisAttributes::GetColour ( ) const
G4double G4VisAttributes::GetEndTime ( ) const
ForcedDrawingStyle G4VisAttributes::GetForcedDrawingStyle ( ) const
G4int G4VisAttributes::GetForcedLineSegmentsPerCircle ( ) const
static const G4VisAttributes& G4VisAttributes::GetInvisible ( )
static
LineStyle G4VisAttributes::GetLineStyle ( ) const
G4double G4VisAttributes::GetLineWidth ( ) const
G4double G4VisAttributes::GetStartTime ( ) const
G4bool G4VisAttributes::IsDaughtersInvisible ( ) const
G4bool G4VisAttributes::IsForceAuxEdgeVisible ( ) const
G4bool G4VisAttributes::IsForceDrawingStyle ( ) const
G4bool G4VisAttributes::IsForceLineSegmentsPerCircle ( ) const
G4bool G4VisAttributes::IsVisible ( ) const
G4bool G4VisAttributes::operator!= ( const G4VisAttributes a) const

Definition at line 229 of file G4VisAttributes.cc.

Referenced by operator==().

229  {
230 
231  if (
232  (fVisible != a.fVisible) ||
233  (fDaughtersInvisible != a.fDaughtersInvisible) ||
234  (fColour != a.fColour) ||
235  (fLineStyle != a.fLineStyle) ||
236  (fLineWidth != a.fLineWidth) ||
237  (fForceDrawingStyle != a.fForceDrawingStyle) ||
238  (fForceAuxEdgeVisible!= a.fForceAuxEdgeVisible)||
239  (fForcedLineSegmentsPerCircle != a.fForcedLineSegmentsPerCircle) ||
240  (fStartTime != a.fStartTime) ||
241  (fEndTime != a.fEndTime) ||
242  (fAttValues != a.fAttValues) ||
243  (fAttDefs != a.fAttDefs)
244  )
245  return true;
246 
247  if (fForceDrawingStyle) {
248  if (fForcedStyle != a.fForcedStyle) return true;
249  }
250 
251  return false;
252 }
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;
131  fDaughtersInvisible = rhs.fDaughtersInvisible;
132  fColour = rhs.fColour;
133  fLineStyle = rhs.fLineStyle;
134  fLineWidth = rhs.fLineWidth;
135  fForceDrawingStyle = rhs.fForceDrawingStyle;
136  fForcedStyle = rhs.fForcedStyle;
137  fForceAuxEdgeVisible = rhs.fForceAuxEdgeVisible;
138  fForcedLineSegmentsPerCircle = rhs.fForcedLineSegmentsPerCircle;
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 }
G4bool G4VisAttributes::operator== ( const G4VisAttributes a) const

Definition at line 254 of file G4VisAttributes.cc.

References operator!=().

254  {
255  return !(G4VisAttributes::operator != (a));
256 }
G4bool operator!=(const G4VisAttributes &a) const
void G4VisAttributes::SetAttDefs ( const std::map< G4String, G4AttDef > *  )

Referenced by export_G4VisAttributes().

void G4VisAttributes::SetAttValues ( const std::vector< G4AttValue > *  )

Referenced by export_G4VisAttributes().

void G4VisAttributes::SetColor ( const G4Color )
void G4VisAttributes::SetColor ( G4double  red,
G4double  green,
G4double  blue,
G4double  alpha = 1. 
)
void G4VisAttributes::SetColour ( const G4Colour )
void G4VisAttributes::SetColour ( G4double  red,
G4double  green,
G4double  blue,
G4double  alpha = 1. 
)
void G4VisAttributes::SetDaughtersInvisible ( G4bool  )
void G4VisAttributes::SetEndTime ( G4double  )
void G4VisAttributes::SetForceAuxEdgeVisible ( G4bool  )
void G4VisAttributes::SetForceLineSegmentsPerCircle ( G4int  nSegments)

Definition at line 158 of file G4VisAttributes.cc.

References G4cout, and G4endl.

Referenced by G4PhysicalVolumeModel::DescribeAndDescend(), and G4VisCommandsTouchableSet::SetNewValue().

158  {
159  const G4int nSegmentsMin = 12;
160  if (nSegments > 0 && nSegments < nSegmentsMin) {
161  nSegments = nSegmentsMin;
162  G4cout <<
163  "G4VisAttributes::SetForcedLineSegmentsPerCircle: attempt to set the"
164  "\nnumber of line segements per circle < " << nSegmentsMin
165  << "; forced to " << nSegments << G4endl;
166  }
167  fForcedLineSegmentsPerCircle = nSegments;
168 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4VisAttributes::SetForceSolid ( G4bool  )

Referenced by G4MIRDLiver::Construct(), B03DetectorConstruction::Construct(), G4MIRDLeftLeg::Construct(), G4MIRDLeftLegBone::Construct(), G4MIRDRightClavicle::Construct(), G4MIRDRightKidney::Construct(), G4MIRDRightLeg::Construct(), G4MIRDRightLegBone::Construct(), G4MIRDLeftOvary::Construct(), G4MIRDRightScapula::Construct(), G4MIRDLeftAdrenal::Construct(), G4MIRDLeftTeste::Construct(), G4MIRDSkull::Construct(), G4MIRDSmallIntestine::Construct(), G4MIRDLeftScapula::Construct(), G4MIRDThyroid::Construct(), G4MIRDLowerLargeIntestine::Construct(), G4MIRDUpperLargeIntestine::Construct(), G4MIRDLeftClavicle::Construct(), G4MIRDMaleGenitalia::Construct(), G4MIRDPelvis::Construct(), G4MIRDLeftKidney::Construct(), G4MIRDRightAdrenal::Construct(), G4MIRDRightLung::Construct(), G4MIRDRightOvary::Construct(), G4MIRDLeftLung::Construct(), G4MIRDRightTeste::Construct(), G4MIRDBrain::Construct(), G4MIRDSpleen::Construct(), G4MIRDStomach::Construct(), G4MIRDThymus::Construct(), G4MIRDHeart::Construct(), G4MIRDTrunk::Construct(), G4MIRDRightBreast::Construct(), G4MIRDMiddleLowerSpine::Construct(), G4MIRDUpperSpine::Construct(), G4MIRDUterus::Construct(), G4MIRDPancreas::Construct(), G4MIRDRibCage::Construct(), G4MIRDLeftBreast::Construct(), B02DetectorConstruction::Construct(), G4MIRDHead::Construct(), G4MIRDRightArmBone::Construct(), G4MIRDUrinaryBladder::Construct(), G4MIRDLeftArmBone::Construct(), B01DetectorConstruction::Construct(), DMXDetectorConstruction::Construct(), CML2PhaseSpaces::createPlane(), G4PhysicalVolumeModel::DescribeAndDescend(), G4ScoringCylinder::Draw(), G4ScoringBox::Draw(), ExN04CalorimeterHit::Draw(), RE01CalorimeterHit::Draw(), RE05CalorimeterHit::Draw(), ExGflashHit::Draw(), Par01CalorimeterHit::Draw(), LXePMTHit::Draw(), G4ScoringCylinder::DrawColumn(), G4ScoringBox::DrawColumn(), export_G4VisAttributes(), G4ArrowModel::G4ArrowModel(), G4VisCommandsTouchableSet::SetNewValue(), and G4VisCommandSceneAddLogo::SetNewValue().

void G4VisAttributes::SetForceWireframe ( G4bool  )
void G4VisAttributes::SetLineStyle ( LineStyle  )
void G4VisAttributes::SetLineWidth ( G4double  )
void G4VisAttributes::SetStartTime ( G4double  )
void G4VisAttributes::SetVisibility ( G4bool  )

Friends And Related Function Documentation

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

Definition at line 170 of file G4VisAttributes.cc.

170  {
171 
172  os << "G4VisAttributes: ";
173  if (&a){
174  if (!a.fVisible) os << "in";
175  os << "visible, daughters ";
176  if (a.fDaughtersInvisible) os << "in";
177  os << "visible, colour: " << a.fColour;
178  os << "\n linestyle: ";
179  switch (a.fLineStyle) {
181  os << "solid"; break;
183  os << "dashed"; break;
184  case G4VisAttributes::dotted: os << "dotted"; break;
185  default: os << "unrecognised"; break;
186  }
187  os << ", line width: " << a.fLineWidth;
188  os << "\n drawing style: ";
189  if (a.fForceDrawingStyle) {
190  os << "forced to: ";
191  switch (a.fForcedStyle) {
193  os << "wireframe"; break;
195  os << "solid"; break;
196  default: os << "unrecognised"; break;
197  }
198  }
199  else {
200  os << "not forced";
201  }
202  os << ", auxiliary edge visibility: ";
203  if (!a.fForceAuxEdgeVisible) {
204  os << "not ";
205  }
206  os << "forced";
207  os << "\n line segments per circle: ";
208  if (a.fForcedLineSegmentsPerCircle > 0) {
209  os << "forced to " << a.fForcedLineSegmentsPerCircle;
210  } else {
211  os << "not forced.";
212  }
213  os << "\n time range: (" << a.fStartTime << ',' << a.fEndTime << ')';
214  os << "\n G4AttValue pointer is ";
215  if (a.fAttValues) {
216  os << "non-";
217  }
218  os << "zero";
219  os << ", G4AttDef pointer is ";
220  if (a.fAttDefs) {
221  os << "non-";
222  }
223  os << "zero";
224  }
225  else os << " zero G4VisAttributes pointer";
226  return os;
227 }

Field Documentation

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

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