#include <G4Visible.hh>
Inheritance diagram for G4Visible:
Public Member Functions | |
G4Visible () | |
G4Visible (const G4Visible &) | |
G4Visible (const G4VisAttributes *) | |
virtual | ~G4Visible () |
G4Visible & | operator= (const G4Visible &) |
G4bool | operator!= (const G4Visible &right) const |
const G4VisAttributes * | GetVisAttributes () const |
void | SetVisAttributes (const G4VisAttributes *) |
void | SetVisAttributes (const G4VisAttributes &) |
Protected Attributes | |
const G4VisAttributes * | fpVisAttributes |
G4bool | fAllocatedVisAttributes |
Friends | |
std::ostream & | operator<< (std::ostream &os, const G4Visible &v) |
Definition at line 48 of file G4Visible.hh.
G4Visible::G4Visible | ( | ) |
Definition at line 37 of file G4Visible.cc.
00037 : 00038 fpVisAttributes (0), 00039 fAllocatedVisAttributes (false) 00040 {}
G4Visible::G4Visible | ( | const G4Visible & | ) |
Definition at line 42 of file G4Visible.cc.
References fAllocatedVisAttributes, and fpVisAttributes.
00042 { 00043 fAllocatedVisAttributes = visible.fAllocatedVisAttributes; 00044 if (fAllocatedVisAttributes) 00045 fpVisAttributes = new G4VisAttributes(*visible.fpVisAttributes); 00046 else fpVisAttributes = visible.fpVisAttributes; 00047 }
G4Visible::G4Visible | ( | const G4VisAttributes * | ) |
Definition at line 49 of file G4Visible.cc.
00049 : 00050 fpVisAttributes (pVA), 00051 fAllocatedVisAttributes (false) 00052 {}
G4Visible::~G4Visible | ( | ) | [virtual] |
Definition at line 54 of file G4Visible.cc.
References fAllocatedVisAttributes, and fpVisAttributes.
00054 { 00055 if (fAllocatedVisAttributes) delete fpVisAttributes; 00056 }
const G4VisAttributes * G4Visible::GetVisAttributes | ( | ) | const [inline] |
Definition at line 32 of file G4Visible.icc.
References fpVisAttributes.
Referenced by G4XXXSceneHandler::AddPrimitive(), G4VSceneHandler::AddPrimitive(), G4GMocrenFileSceneHandler::AddPrimitive(), G4VSceneHandler::GetColour(), G4VSceneHandler::GetTextColour(), and G4VSceneHandler::LoadAtts().
00032 { 00033 return fpVisAttributes; 00034 }
Definition at line 87 of file G4Visible.cc.
References fpVisAttributes.
00087 { 00088 if (fpVisAttributes && right.fpVisAttributes) 00089 return *fpVisAttributes != *right.fpVisAttributes; 00090 else if (!fpVisAttributes && !right.fpVisAttributes) return false; 00091 else return true; 00092 }
Definition at line 58 of file G4Visible.cc.
References fAllocatedVisAttributes, and fpVisAttributes.
Referenced by G4VMarker::operator=().
00058 { 00059 if (&rhs == this) return *this; 00060 fAllocatedVisAttributes = rhs.fAllocatedVisAttributes; 00061 if (fAllocatedVisAttributes) { 00062 delete fpVisAttributes; 00063 fpVisAttributes = new G4VisAttributes(*rhs.fpVisAttributes); 00064 } 00065 else fpVisAttributes = rhs.fpVisAttributes; 00066 return *this; 00067 }
void G4Visible::SetVisAttributes | ( | const G4VisAttributes & | ) |
Definition at line 69 of file G4Visible.cc.
References fAllocatedVisAttributes, and fpVisAttributes.
00069 { 00070 // Allocate G4VisAttributes on the heap in case the user specifies a 00071 // short-lived VA for a long-lived G4Visible. Flag so that it can 00072 // be deleted in the destructor. 00073 // First delete any G4VisAttributes already on the heap... 00074 if (fAllocatedVisAttributes) delete fpVisAttributes; 00075 fpVisAttributes = new G4VisAttributes(VA); 00076 fAllocatedVisAttributes = true; 00077 }
void G4Visible::SetVisAttributes | ( | const G4VisAttributes * | ) |
Definition at line 80 of file G4Visible.cc.
References fAllocatedVisAttributes, and fpVisAttributes.
Referenced by G4VSceneHandler::AddPrimitive(), G4PhysicalVolumeModel::DescribeSolid(), G4VScoreColorMap::DrawColorChartBar(), G4ScoreLogColorMap::DrawColorChartBar(), G4VScoreColorMap::DrawColorChartText(), G4ScoreLogColorMap::DrawColorChartText(), G4AxesModel::G4AxesModel(), G4VisCommandSceneAddText2D::SetNewValue(), G4VisCommandSceneAddText::SetNewValue(), and G4VisCommandSceneAddScale::SetNewValue().
00080 { 00081 // First delete any G4VisAttributes already on the heap... 00082 if (fAllocatedVisAttributes) delete fpVisAttributes; 00083 fpVisAttributes = pVA; 00084 fAllocatedVisAttributes = false; 00085 }
std::ostream& operator<< | ( | std::ostream & | os, | |
const G4Visible & | v | |||
) | [friend] |
Definition at line 94 of file G4Visible.cc.
00094 { 00095 if (v.fpVisAttributes) return os << *(v.fpVisAttributes); 00096 else return os << "No Visualization Attributes"; 00097 }
G4bool G4Visible::fAllocatedVisAttributes [protected] |
Definition at line 82 of file G4Visible.hh.
Referenced by G4Visible(), operator=(), SetVisAttributes(), and ~G4Visible().
const G4VisAttributes* G4Visible::fpVisAttributes [protected] |
Definition at line 81 of file G4Visible.hh.
Referenced by G4Visible(), GetVisAttributes(), operator!=(), operator<<(), operator=(), SetVisAttributes(), and ~G4Visible().