G4ModelingParameters Class Reference

#include <G4ModelingParameters.hh>


Public Types

typedef std::vector< PVNameCopyNoPVNameCopyNoPath
typedef PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
 wf
 hlr
 hsr
 hlhsr
 VASVisibility
 VASDaughtersInvisible
 VASColour
 VASLineStyle
 VASLineWidth
 VASForceWireframe
 VASForceSolid
 VASForceAuxEdgeVisible
 VASForceLineSegmentsPerCircle
enum  DrawingStyle { wf, hlr, hsr, hlhsr }
enum  VisAttributesSignifier {
  VASVisibility, VASDaughtersInvisible, VASColour, VASLineStyle,
  VASLineWidth, VASForceWireframe, VASForceSolid, VASForceAuxEdgeVisible,
  VASForceLineSegmentsPerCircle
}

Public Member Functions

 G4ModelingParameters ()
 G4ModelingParameters (const G4VisAttributes *pDefaultVisAttributes, DrawingStyle drawingStyle, G4bool isCulling, G4bool isCullingInvisible, G4bool isDensityCulling, G4double visibleDensity, G4bool isCullingCovered, G4int noOfSides)
 ~G4ModelingParameters ()
G4bool operator!= (const G4ModelingParameters &) const
G4bool IsWarning () const
const G4VisAttributesGetDefaultVisAttributes () const
DrawingStyle GetDrawingStyle () const
G4bool IsCulling () const
G4bool IsCullingInvisible () const
G4bool IsDensityCulling () const
G4double GetVisibleDensity () const
G4bool IsCullingCovered () const
G4bool IsExplode () const
G4double GetExplodeFactor () const
const G4Point3DGetExplodeCentre () const
G4int GetNoOfSides () const
G4VSolidGetSectionSolid () const
G4VSolidGetCutawaySolid () const
const G4EventGetEvent () const
const std::vector< VisAttributesModifier > & GetVisAttributesModifiers () const
void SetWarning (G4bool)
void SetDefaultVisAttributes (const G4VisAttributes *pDefaultVisAttributes)
void SetDrawingStyle (DrawingStyle)
void SetCulling (G4bool)
void SetCullingInvisible (G4bool)
void SetDensityCulling (G4bool)
void SetVisibleDensity (G4double)
void SetCullingCovered (G4bool)
void SetExplodeFactor (G4double explodeFactor)
void SetExplodeCentre (const G4Point3D &explodeCentre)
G4int SetNoOfSides (G4int)
void SetSectionSolid (G4VSolid *pSectionSolid)
void SetCutawaySolid (G4VSolid *pCutawaySolid)
void SetEvent (const G4Event *pEvent)
void SetVisAttributesModifiers (const std::vector< VisAttributesModifier >)

Static Public Member Functions

static G4bool PVNameCopyNoPathNotEqual (const PVNameCopyNoPath &, const PVNameCopyNoPath &)
static G4bool VAMSNotEqual (const std::vector< VisAttributesModifier > &, const std::vector< VisAttributesModifier > &)

Friends

std::ostream & operator<< (std::ostream &os, const G4ModelingParameters &)
std::ostream & operator<< (std::ostream &os, const PVNameCopyNoPath &)
std::ostream & operator<< (std::ostream &os, const std::vector< VisAttributesModifier > &)

Data Structures

class  PVNameCopyNo
class  VisAttributesModifier


Detailed Description

Definition at line 52 of file G4ModelingParameters.hh.


Member Typedef Documentation

typedef std::vector<PVNameCopyNo> G4ModelingParameters::PVNameCopyNoPath

Definition at line 87 of file G4ModelingParameters.hh.

typedef PVNameCopyNoPath::const_iterator G4ModelingParameters::PVNameCopyNoPathConstIterator

Definition at line 88 of file G4ModelingParameters.hh.


Member Enumeration Documentation

enum G4ModelingParameters::DrawingStyle

Enumerator:
wf 
hlr 
hsr 
hlhsr 

Definition at line 57 of file G4ModelingParameters.hh.

00057                     {
00058     wf,         // Draw edges    - no hidden line removal (wireframe).
00059     hlr,        // Draw edges    - hidden lines removed.
00060     hsr,        // Draw surfaces - hidden surfaces removed.
00061     hlhsr       // Draw surfaces and edges - hidden removed.
00062   };

enum G4ModelingParameters::VisAttributesSignifier

Enumerator:
VASVisibility 
VASDaughtersInvisible 
VASColour 
VASLineStyle 
VASLineWidth 
VASForceWireframe 
VASForceSolid 
VASForceAuxEdgeVisible 
VASForceLineSegmentsPerCircle 

Definition at line 66 of file G4ModelingParameters.hh.


Constructor & Destructor Documentation

G4ModelingParameters::G4ModelingParameters (  ) 

Definition at line 43 of file G4ModelingParameters.cc.

00043                                            :
00044   fWarning               (true),
00045   fpDefaultVisAttributes (0),
00046   fDrawingStyle          (wf),
00047   fCulling               (false),
00048   fCullInvisible         (false),
00049   fDensityCulling        (false),
00050   fVisibleDensity        (0.01 * g / cm3),
00051   fCullCovered           (false),
00052   fExplodeFactor         (1.),
00053   fNoOfSides             (24),
00054   fpSectionSolid         (0),
00055   fpCutawaySolid         (0),
00056   fpEvent                (0)
00057 {}

G4ModelingParameters::G4ModelingParameters ( const G4VisAttributes pDefaultVisAttributes,
DrawingStyle  drawingStyle,
G4bool  isCulling,
G4bool  isCullingInvisible,
G4bool  isDensityCulling,
G4double  visibleDensity,
G4bool  isCullingCovered,
G4int  noOfSides 
)

Definition at line 60 of file G4ModelingParameters.cc.

00068   :
00069   fWarning        (true),
00070   fpDefaultVisAttributes (pDefaultVisAttributes),
00071   fDrawingStyle   (drawingStyle),
00072   fCulling        (isCulling),
00073   fCullInvisible  (isCullingInvisible),
00074   fDensityCulling (isDensityCulling),
00075   fVisibleDensity (visibleDensity),
00076   fCullCovered    (isCullingCovered),
00077   fExplodeFactor  (1.),
00078   fNoOfSides      (noOfSides),
00079   fpSectionSolid  (0),
00080   fpCutawaySolid  (0),
00081   fpEvent         (0)
00082 {}

G4ModelingParameters::~G4ModelingParameters (  ) 

Definition at line 84 of file G4ModelingParameters.cc.

00085 {
00086   delete fpSectionSolid;
00087   delete fpCutawaySolid;
00088 }


Member Function Documentation

G4VSolid * G4ModelingParameters::GetCutawaySolid (  )  const [inline]

Definition at line 86 of file G4ModelingParameters.icc.

00087 {return fpCutawaySolid;}

const G4VisAttributes * G4ModelingParameters::GetDefaultVisAttributes (  )  const [inline]

Definition at line 38 of file G4ModelingParameters.icc.

Referenced by G4PhysicalVolumeModel::Validate().

00038                                                      {
00039   return fpDefaultVisAttributes;
00040 }

G4ModelingParameters::DrawingStyle G4ModelingParameters::GetDrawingStyle (  )  const [inline]

Definition at line 43 of file G4ModelingParameters.icc.

00043                                              {
00044   return fDrawingStyle;
00045 }

const G4Event * G4ModelingParameters::GetEvent (  )  const [inline]

Definition at line 89 of file G4ModelingParameters.icc.

Referenced by G4TrajectoriesModel::DescribeYourselfTo(), G4HitsModel::DescribeYourselfTo(), and G4DigiModel::DescribeYourselfTo().

00090 {return fpEvent;}

const G4Point3D & G4ModelingParameters::GetExplodeCentre (  )  const [inline]

Definition at line 75 of file G4ModelingParameters.icc.

00075                                                                       {
00076   return fExplodeCentre;
00077 }

G4double G4ModelingParameters::GetExplodeFactor (  )  const [inline]

Definition at line 71 of file G4ModelingParameters.icc.

00071                                                               {
00072   return fExplodeFactor;
00073 }

G4int G4ModelingParameters::GetNoOfSides (  )  const [inline]

Definition at line 79 of file G4ModelingParameters.icc.

00079                                                        {
00080   return fNoOfSides;
00081 }

G4VSolid * G4ModelingParameters::GetSectionSolid (  )  const [inline]

Definition at line 83 of file G4ModelingParameters.icc.

00084 {return fpSectionSolid;}

const std::vector< G4ModelingParameters::VisAttributesModifier > & G4ModelingParameters::GetVisAttributesModifiers (  )  const [inline]

Definition at line 93 of file G4ModelingParameters.icc.

00093                                                       {
00094   return fVisAttributesModifiers;
00095 }

G4double G4ModelingParameters::GetVisibleDensity (  )  const [inline]

Definition at line 59 of file G4ModelingParameters.icc.

00059                                                                {
00060   return fVisibleDensity;
00061 }

G4bool G4ModelingParameters::IsCulling (  )  const [inline]

Definition at line 47 of file G4ModelingParameters.icc.

00047                                                      {
00048   return fCulling;
00049 }

G4bool G4ModelingParameters::IsCullingCovered (  )  const [inline]

Definition at line 63 of file G4ModelingParameters.icc.

00063                                                             {
00064   return fCullCovered;
00065 }

G4bool G4ModelingParameters::IsCullingInvisible (  )  const [inline]

Definition at line 51 of file G4ModelingParameters.icc.

00051                                                               {
00052   return fCullInvisible;
00053 }

G4bool G4ModelingParameters::IsDensityCulling (  )  const [inline]

Definition at line 55 of file G4ModelingParameters.icc.

00055                                                             {
00056   return fDensityCulling;
00057 }

G4bool G4ModelingParameters::IsExplode (  )  const [inline]

Definition at line 67 of file G4ModelingParameters.icc.

00067                                                      {
00068   return fExplodeFactor > 1.;
00069 }

G4bool G4ModelingParameters::IsWarning (  )  const [inline]

Definition at line 33 of file G4ModelingParameters.icc.

00033                                                      {
00034   return fWarning;
00035 }

G4bool G4ModelingParameters::operator!= ( const G4ModelingParameters  )  const

Definition at line 225 of file G4ModelingParameters.cc.

00225                                        {
00226 
00227   if (
00228       (fWarning                != mp.fWarning)                ||
00229       (*fpDefaultVisAttributes != *mp.fpDefaultVisAttributes) ||
00230       (fCulling                != mp.fCulling)                ||
00231       (fCullInvisible          != mp.fCullInvisible)          ||
00232       (fDensityCulling         != mp.fDensityCulling)         ||
00233       (fCullCovered            != mp.fCullCovered)            ||
00234       (fExplodeFactor          != mp.fExplodeFactor)          ||
00235       (fExplodeCentre          != mp.fExplodeCentre)          ||
00236       (fNoOfSides              != mp.fNoOfSides)              ||
00237       (fpSectionSolid          != mp.fpSectionSolid)     ||
00238       (fpCutawaySolid          != mp.fpCutawaySolid)     ||
00239       (fpEvent                 != mp.fpEvent)
00240       )
00241     return true;
00242 
00243   if (fDensityCulling &&
00244       (fVisibleDensity != mp.fVisibleDensity)) return true;
00245 
00246   if (VAMSNotEqual(fVisAttributesModifiers, mp.fVisAttributesModifiers))
00247     return true;
00248 
00249   return false;
00250 }

G4bool G4ModelingParameters::PVNameCopyNoPathNotEqual ( const PVNameCopyNoPath ,
const PVNameCopyNoPath  
) [static]

Definition at line 253 of file G4ModelingParameters.cc.

00255 {
00256   if (path1.size() != path2.size()) return true;
00257   if (path1.empty()) return false;
00258   PVNameCopyNoPathConstIterator i1, i2;
00259   for (i1 = path1.begin(), i2 = path2.begin();
00260        i1 != path1.end();
00261        ++i1, ++i2) {
00262     if (i1->GetName() != i2->GetName()) return true;
00263     if (i1->GetCopyNo() != i2->GetCopyNo()) return true;
00264   }
00265   return false;
00266 }

void G4ModelingParameters::SetCulling ( G4bool   )  [inline]

Definition at line 112 of file G4ModelingParameters.icc.

Referenced by G4LogicalVolumeModel::DescribeYourselfTo().

00112                                                           {
00113   fCulling = value;
00114 }

void G4ModelingParameters::SetCullingCovered ( G4bool   )  [inline]

Definition at line 124 of file G4ModelingParameters.icc.

00124                                                                  {
00125   fCullCovered = value;
00126 }

void G4ModelingParameters::SetCullingInvisible ( G4bool   )  [inline]

Definition at line 116 of file G4ModelingParameters.icc.

00116                                                                    {
00117   fCullInvisible = value;
00118 }

void G4ModelingParameters::SetCutawaySolid ( G4VSolid pCutawaySolid  ) 

Definition at line 147 of file G4ModelingParameters.cc.

Referenced by G4VSceneHandler::CreateModelingParameters().

00147                           {
00148   delete fpCutawaySolid;
00149   fpCutawaySolid = pCutawaySolid;
00150 }

void G4ModelingParameters::SetDefaultVisAttributes ( const G4VisAttributes pDefaultVisAttributes  )  [inline]

Definition at line 102 of file G4ModelingParameters.icc.

Referenced by G4PhysicalVolumeModel::Validate().

00102                                                {
00103   fpDefaultVisAttributes = pDefaultVisAttributes;
00104 }

void G4ModelingParameters::SetDensityCulling ( G4bool   )  [inline]

Definition at line 120 of file G4ModelingParameters.icc.

00120                                                                  {
00121   fDensityCulling = value;
00122 }

void G4ModelingParameters::SetDrawingStyle ( DrawingStyle   )  [inline]

Definition at line 108 of file G4ModelingParameters.icc.

00108                                          {
00109   fDrawingStyle = style;
00110 }

void G4ModelingParameters::SetEvent ( const G4Event pEvent  )  [inline]

Definition at line 137 of file G4ModelingParameters.icc.

Referenced by G4VSceneHandler::DrawEndOfRunModels(), and G4VSceneHandler::DrawEvent().

00137                                                                 {
00138   fpEvent = pEvent;
00139 }

void G4ModelingParameters::SetExplodeCentre ( const G4Point3D explodeCentre  )  [inline]

Definition at line 133 of file G4ModelingParameters.icc.

Referenced by G4VSceneHandler::CreateModelingParameters().

00133                                  {
00134   fExplodeCentre = explodeCentre;
00135 }

void G4ModelingParameters::SetExplodeFactor ( G4double  explodeFactor  )  [inline]

Definition at line 128 of file G4ModelingParameters.icc.

Referenced by G4VSceneHandler::CreateModelingParameters().

00128                                                                           {
00129   fExplodeFactor = explodeFactor;
00130 }

G4int G4ModelingParameters::SetNoOfSides ( G4int   ) 

Definition at line 127 of file G4ModelingParameters.cc.

References G4cout, and G4endl.

00127                                                       {
00128   const G4int  nSidesMin = 12;
00129   if (nSides < nSidesMin) {
00130     nSides = nSidesMin;
00131     if (fWarning)
00132       G4cout << "G4ModelingParameters::SetNoOfSides: attempt to set the"
00133         "\nnumber of sides per circle < " << nSidesMin
00134              << "; forced to" << nSides << G4endl;
00135   }
00136   fNoOfSides = nSides;
00137   return fNoOfSides;
00138 }

void G4ModelingParameters::SetSectionSolid ( G4VSolid pSectionSolid  ) 

Definition at line 141 of file G4ModelingParameters.cc.

Referenced by G4VSceneHandler::CreateModelingParameters().

00141                           {
00142   delete fpSectionSolid;
00143   fpSectionSolid = pSectionSolid;
00144 }

void G4ModelingParameters::SetVisAttributesModifiers ( const std::vector< VisAttributesModifier  ) 

Referenced by G4VSceneHandler::CreateModelingParameters().

void G4ModelingParameters::SetVisibleDensity ( G4double   ) 

Definition at line 110 of file G4ModelingParameters.cc.

References G4cout, and G4endl.

00110                                                                      {
00111   const G4double reasonableMaximum = 10.0 * g / cm3;
00112   if (visibleDensity < 0 && fWarning) {
00113     G4cout << "G4ModelingParameters::SetVisibleDensity: attempt to set negative "
00114       "density - ignored." << G4endl;
00115   }
00116   else {
00117     if (fVisibleDensity > reasonableMaximum && fWarning) {
00118       G4cout << "G4ModelingParameters::SetVisibleDensity: density > "
00119            << reasonableMaximum
00120            << " g / cm3 - did you mean this?"
00121            << G4endl;
00122     }
00123     fVisibleDensity = visibleDensity;
00124   }
00125 }

void G4ModelingParameters::SetWarning ( G4bool   )  [inline]

Definition at line 97 of file G4ModelingParameters.icc.

Referenced by G4VSceneHandler::CreateModelingParameters().

00097                                                           {
00098   fWarning = value;
00099 }

static G4bool G4ModelingParameters::VAMSNotEqual ( const std::vector< VisAttributesModifier > &  ,
const std::vector< VisAttributesModifier > &   
) [static]

Referenced by G4ViewParameters::operator!=().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const std::vector< VisAttributesModifier > &  vams 
) [friend]

Definition at line 349 of file G4ModelingParameters.cc.

00351 {
00352   std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator
00353     iModifier;
00354   for (iModifier = vams.begin();
00355        iModifier != vams.end();
00356        ++iModifier) {
00357     const G4ModelingParameters::PVNameCopyNoPath& vamPath =
00358       iModifier->GetPVNameCopyNoPath();
00359     os << '\n' << vamPath;
00360     const G4VisAttributes& vamVisAtts = iModifier->GetVisAttributes();
00361     const G4Colour& c = vamVisAtts.GetColour();
00362     switch (iModifier->GetVisAttributesSignifier()) {
00363       case G4ModelingParameters::VASVisibility:
00364         os << " visibility ";
00365         if (vamVisAtts.IsVisible()) {
00366           os << "true";
00367         } else {
00368           os << "false";
00369         }
00370         break;
00371       case G4ModelingParameters::VASDaughtersInvisible:
00372         os << " daughtersInvisible ";
00373         if (vamVisAtts.IsDaughtersInvisible()) {
00374           os << "true";
00375         } else {
00376           os << "false";
00377         }
00378         break;
00379       case G4ModelingParameters::VASColour:
00380         os << " colour " << c;
00381         break;
00382       case G4ModelingParameters::VASLineStyle:
00383         os << " lineStyle ";
00384         switch (vamVisAtts.GetLineStyle()) {
00385           case G4VisAttributes::unbroken:
00386             os << "unbroken";
00387             break;
00388           case G4VisAttributes::dashed:
00389             os << "dashed";
00390             break;
00391           case G4VisAttributes::dotted:
00392             os << "dotted";
00393         }
00394         break;
00395       case G4ModelingParameters::VASLineWidth:
00396         os << " lineWidth "
00397         << vamVisAtts.GetLineWidth();
00398         break;
00399       case G4ModelingParameters::VASForceWireframe:
00400         if (vamVisAtts.GetForcedDrawingStyle() == G4VisAttributes::wireframe) {
00401           os << " forceWireframe ";
00402           if (vamVisAtts.IsForceDrawingStyle()) {
00403             os << "true";
00404           } else {
00405             os << "false";
00406           }
00407         }
00408         break;
00409       case G4ModelingParameters::VASForceSolid:
00410         if (vamVisAtts.GetForcedDrawingStyle() == G4VisAttributes::solid) {
00411           os << " forceSolid ";
00412           if (vamVisAtts.IsForceDrawingStyle()) {
00413             os << "true";
00414           } else {
00415             os << "false";
00416           }
00417         }
00418         break;
00419       case G4ModelingParameters::VASForceAuxEdgeVisible:
00420         os << " forceAuxEdgeVisible ";
00421         if (vamVisAtts.IsForceAuxEdgeVisible()) {
00422           os << "true";
00423         } else {
00424           os << "false";
00425         }
00426         break;
00427       case G4ModelingParameters::VASForceLineSegmentsPerCircle:
00428         os << " lineSegmentsPerCircle "
00429         << vamVisAtts.GetForcedLineSegmentsPerCircle();
00430         break;
00431     }
00432   }
00433 
00434   return os;
00435 }

std::ostream& operator<< ( std::ostream &  os,
const PVNameCopyNoPath path 
) [friend]

Definition at line 335 of file G4ModelingParameters.cc.

00336 {
00337 //  os << "Touchable path: physical-volume-name:copy-number pairs:\n  ";
00338   G4ModelingParameters::PVNameCopyNoPathConstIterator i;
00339   for (i = path.begin(); i != path.end(); ++i) {
00340     if (i != path.begin()) {
00341       os << ", ";
00342     }
00343     os << i->GetName() << ':' << i->GetCopyNo();
00344   }
00345   return os;
00346 }

std::ostream& operator<< ( std::ostream &  os,
const G4ModelingParameters mp 
) [friend]

Definition at line 152 of file G4ModelingParameters.cc.

00153 {
00154   os << "Modeling parameters (warning ";
00155   if (mp.fWarning) os << "true";
00156   else os << "false";
00157   os << "):";
00158 
00159   const G4VisAttributes* va = mp.fpDefaultVisAttributes;
00160   os << "\n  Default vis. attributes: ";
00161   if (va) os << *va;
00162   else os << "none";
00163 
00164   os << "\n  Current requested drawing style: ";
00165   switch (mp.fDrawingStyle) {
00166   case G4ModelingParameters::wf:
00167     os << "wireframe"; break;
00168   case G4ModelingParameters::hlr:
00169     os << "hidden line removal (hlr)"; break;
00170   case G4ModelingParameters::hsr:
00171     os << "surface (hsr)"; break;
00172   case G4ModelingParameters::hlhsr:
00173     os << "surface and edges (hlhsr)"; break;
00174   default: os << "unrecognised"; break;
00175   }
00176 
00177   os << "\n  Culling: ";
00178   if (mp.fCulling) os << "on";
00179   else            os << "off";
00180 
00181   os << "\n  Culling invisible objects: ";
00182   if (mp.fCullInvisible) os << "on";
00183   else                  os << "off";
00184 
00185   os << "\n  Density culling: ";
00186   if (mp.fDensityCulling) {
00187     os << "on - invisible if density less than "
00188        << mp.fVisibleDensity / (1. * g / cm3) << " g cm^-3";
00189   }
00190   else os << "off";
00191 
00192   os << "\n  Culling daughters covered by opaque mothers: ";
00193   if (mp.fCullCovered) os << "on";
00194   else                os << "off";
00195 
00196   os << "\n  Explode factor: " << mp.fExplodeFactor
00197      << " about centre: " << mp.fExplodeCentre;
00198 
00199   os << "\n  No. of sides used in circle polygon approximation: "
00200      << mp.fNoOfSides;
00201 
00202   os << "\n  Section (DCUT) shape (G4VSolid) pointer: ";
00203   if (!mp.fpSectionSolid) os << "non-";
00204   os << "null";
00205 
00206   os << "\n  Cutaway (DCUT) shape (G4VSolid) pointer: ";
00207   if (!mp.fpCutawaySolid) os << "non-";
00208   os << "null";
00209 
00210   os << "\n  Event pointer: " << mp.fpEvent;
00211 
00212   os << "\n  Vis attributes modifiers: ";
00213   const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
00214     mp.fVisAttributesModifiers;
00215   if (vams.empty()) {
00216     os << "None";
00217   } else {
00218     os << vams;
00219   }
00220   
00221   return os;
00222 }


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