G4Visible Class Reference

#include <G4Visible.hh>

Inheritance diagram for G4Visible:

G4NURBS G4Polyhedron G4Polyline G4VMarker G4NURBSbox G4NURBScylinder G4NURBShexahedron G4NURBStube G4NURBStubesector G4PolyhedronArbitrary G4PolyhedronBox G4PolyhedronCone G4PolyhedronCons G4PolyhedronEllipsoid G4PolyhedronEllipticalCone G4PolyhedronHype G4PolyhedronPara G4PolyhedronParaboloid G4PolyhedronPcon G4PolyhedronPgon G4PolyhedronSphere G4PolyhedronTorus G4PolyhedronTrap G4PolyhedronTrd1 G4PolyhedronTrd2 G4PolyhedronTube G4PolyhedronTubs G4Circle G4Polymarker G4Scale G4Square G4Text

Public Member Functions

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

Protected Attributes

const G4VisAttributesfpVisAttributes
G4bool fAllocatedVisAttributes

Friends

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

Detailed Description

Definition at line 48 of file G4Visible.hh.


Constructor & Destructor Documentation

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 }


Member Function Documentation

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 }

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

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 }

G4Visible & G4Visible::operator= ( const G4Visible  ) 

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 }


Friends And Related Function Documentation

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 }


Field Documentation

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().


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:47 2013 for Geant4 by  doxygen 1.4.7