Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Visible Class Reference

#include <G4Visible.hh>

+ Inheritance diagram for G4Visible:

Public Member Functions

 G4Visible ()
 
 G4Visible (const G4Visible &)
 
 G4Visible (G4Visible &&)
 
 G4Visible (const G4VisAttributes *)
 
virtual ~G4Visible ()
 
G4Visibleoperator= (const G4Visible &)
 
G4Visibleoperator= (G4Visible &&)
 
G4bool operator!= (const G4Visible &right) const
 
const G4VisAttributesGetVisAttributes () const
 
void SetVisAttributes (const G4VisAttributes *)
 
void SetVisAttributes (const G4VisAttributes &)
 
virtual const G4StringGetInfo () const
 
virtual void SetInfo (const G4String &info)
 

Protected Attributes

G4String fInfo
 
const G4VisAttributesfpVisAttributes
 
G4bool fAllocatedVisAttributes
 

Friends

std::ostream & operator<< (std::ostream &os, const G4Visible &v)
 

Detailed Description

Definition at line 47 of file G4Visible.hh.

Constructor & Destructor Documentation

◆ G4Visible() [1/4]

G4Visible::G4Visible ( )

Definition at line 36 of file G4Visible.cc.

36 :
37 fpVisAttributes (nullptr),
39{}
const G4VisAttributes * fpVisAttributes
Definition: G4Visible.hh:87
G4bool fAllocatedVisAttributes
Definition: G4Visible.hh:88

◆ G4Visible() [2/4]

G4Visible::G4Visible ( const G4Visible visible)

◆ G4Visible() [3/4]

G4Visible::G4Visible ( G4Visible &&  visible)

Definition at line 48 of file G4Visible.cc.

48 {
51 visible.fpVisAttributes = nullptr;
52 visible.fAllocatedVisAttributes = false;
53}

◆ G4Visible() [4/4]

G4Visible::G4Visible ( const G4VisAttributes pVA)

Definition at line 55 of file G4Visible.cc.

55 :
56 fpVisAttributes (pVA),
58{}

◆ ~G4Visible()

G4Visible::~G4Visible ( )
virtual

Definition at line 60 of file G4Visible.cc.

60 {
62}

Member Function Documentation

◆ GetInfo()

virtual const G4String & G4Visible::GetInfo ( ) const
virtual

◆ GetVisAttributes()

◆ operator!=()

G4bool G4Visible::operator!= ( const G4Visible right) const

Definition at line 105 of file G4Visible.cc.

105 {
106 if (fInfo != right.fInfo) return false;
107 if ((fpVisAttributes != nullptr) && (right.fpVisAttributes != nullptr))
108 return *fpVisAttributes != *right.fpVisAttributes;
109 if ((fpVisAttributes == nullptr) && (right.fpVisAttributes == nullptr)) return false;
110 return true;
111}
G4String fInfo
Definition: G4Visible.hh:86

◆ operator=() [1/2]

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

Definition at line 64 of file G4Visible.cc.

64 {
65 if (&rhs == this) return *this;
66 fInfo = rhs.fInfo;
69 delete fpVisAttributes;
71 }
73 return *this;
74}

◆ operator=() [2/2]

G4Visible & G4Visible::operator= ( G4Visible &&  rhs)

Definition at line 76 of file G4Visible.cc.

76 {
77 if (&rhs == this) return *this;
78 fInfo = rhs.fInfo;
82 rhs.fpVisAttributes = nullptr;
83 rhs.fAllocatedVisAttributes = false;
84 return *this;
85}

◆ SetInfo()

virtual void G4Visible::SetInfo ( const G4String info)
virtual

◆ SetVisAttributes() [1/2]

void G4Visible::SetVisAttributes ( const G4VisAttributes VA)

Definition at line 87 of file G4Visible.cc.

87 {
88 // Allocate G4VisAttributes on the heap in case the user specifies a
89 // short-lived VA for a long-lived G4Visible. Flag so that it can
90 // be deleted in the destructor.
91 // First delete any G4VisAttributes already on the heap...
95}

◆ SetVisAttributes() [2/2]

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const G4Visible v 
)
friend

Definition at line 113 of file G4Visible.cc.

113 {
114 os << "G4Visible: ";
115 if (!v.fInfo.empty()) os << "User information: " << v.fInfo;
116 os << '\n';
117 if (v.fpVisAttributes != nullptr) return os << *(v.fpVisAttributes);
118 return os << "No Visualization Attributes";
119}

Member Data Documentation

◆ fAllocatedVisAttributes

G4bool G4Visible::fAllocatedVisAttributes
protected

Definition at line 88 of file G4Visible.hh.

Referenced by G4Visible(), operator=(), SetVisAttributes(), and ~G4Visible().

◆ fInfo

G4String G4Visible::fInfo
protected

Definition at line 86 of file G4Visible.hh.

Referenced by operator!=(), and operator=().

◆ fpVisAttributes

const G4VisAttributes* G4Visible::fpVisAttributes
protected

Definition at line 87 of file G4Visible.hh.

Referenced by G4Visible(), operator!=(), operator=(), SetVisAttributes(), and ~G4Visible().


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