Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/visualization/modeling/src/G4ModelingParameters.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /visualization/modeling/src/G4ModelingParameters.cc (Version 11.3.0) and /visualization/modeling/src/G4ModelingParameters.cc (Version 11.0.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27 //                                                 27 //
 28 //                                                 28 // 
 29 // John Allison  31st December 1997.               29 // John Allison  31st December 1997.
 30 // Parameters associated with the modeling of      30 // Parameters associated with the modeling of GEANT4 objects.
 31                                                    31 
 32 #include "G4ModelingParameters.hh"                 32 #include "G4ModelingParameters.hh"
 33                                                    33 
 34 #include "G4ios.hh"                                34 #include "G4ios.hh"
 35 #include "G4VisAttributes.hh"                      35 #include "G4VisAttributes.hh"
 36 #include "G4ExceptionSeverity.hh"                  36 #include "G4ExceptionSeverity.hh"
 37 #include "G4SystemOfUnits.hh"                      37 #include "G4SystemOfUnits.hh"
 38 #include "G4VSolid.hh"                             38 #include "G4VSolid.hh"
 39 #include "G4DisplacedSolid.hh"                     39 #include "G4DisplacedSolid.hh"
 40 #include "G4VPhysicalVolume.hh"                    40 #include "G4VPhysicalVolume.hh"
 41 #include "G4PhysicalVolumeModel.hh"                41 #include "G4PhysicalVolumeModel.hh"
 42 #include "G4UnitsTable.hh"                         42 #include "G4UnitsTable.hh"
 43                                                    43 
 44 #define G4warn G4cout                          << 
 45                                                << 
 46 G4ModelingParameters::G4ModelingParameters ():     44 G4ModelingParameters::G4ModelingParameters ():
 47   fWarning               (true),                   45   fWarning               (true),
 48   fpDefaultVisAttributes (0),                      46   fpDefaultVisAttributes (0),
 49   fDrawingStyle          (wf),                     47   fDrawingStyle          (wf),
 50   fNumberOfCloudPoints   (10000),                  48   fNumberOfCloudPoints   (10000),
 51   fCulling               (false),                  49   fCulling               (false),
 52   fCullInvisible         (false),                  50   fCullInvisible         (false),
 53   fDensityCulling        (false),                  51   fDensityCulling        (false),
 54   fVisibleDensity        (0.01 * g / cm3),         52   fVisibleDensity        (0.01 * g / cm3),
 55   fCullCovered           (false),                  53   fCullCovered           (false),
 56   fCBDAlgorithmNumber    (0),                      54   fCBDAlgorithmNumber    (0),
 57   fExplodeFactor         (1.),                     55   fExplodeFactor         (1.),
 58   fNoOfSides             (24),                     56   fNoOfSides             (24),
 59   fpSectionSolid         (0),                      57   fpSectionSolid         (0),
 60   fCutawayMode           (cutawayUnion),       << 
 61   fpCutawaySolid         (0),                      58   fpCutawaySolid         (0),
 62   fpEvent                (0),                      59   fpEvent                (0),
 63   fSpecialMeshRendering  (false)                   60   fSpecialMeshRendering  (false)
 64 {}                                                 61 {}
 65                                                    62 
 66 G4ModelingParameters::G4ModelingParameters         63 G4ModelingParameters::G4ModelingParameters
 67 (const G4VisAttributes* pDefaultVisAttributes,     64 (const G4VisAttributes* pDefaultVisAttributes,
 68  G4ModelingParameters::DrawingStyle drawingSty     65  G4ModelingParameters::DrawingStyle drawingStyle,
 69  G4bool isCulling,                                 66  G4bool isCulling,
 70  G4bool isCullingInvisible,                        67  G4bool isCullingInvisible,
 71  G4bool isDensityCulling,                          68  G4bool isDensityCulling,
 72  G4double visibleDensity,                          69  G4double visibleDensity,
 73  G4bool isCullingCovered,                          70  G4bool isCullingCovered,
 74  G4int noOfSides                                   71  G4int noOfSides
 75  ):                                                72  ):
 76   fWarning        (true),                          73   fWarning        (true),
 77   fpDefaultVisAttributes (pDefaultVisAttribute     74   fpDefaultVisAttributes (pDefaultVisAttributes),
 78   fDrawingStyle   (drawingStyle),                  75   fDrawingStyle   (drawingStyle),
 79   fNumberOfCloudPoints (10000),                    76   fNumberOfCloudPoints (10000),
 80   fCulling        (isCulling),                     77   fCulling        (isCulling),
 81   fCullInvisible  (isCullingInvisible),            78   fCullInvisible  (isCullingInvisible),
 82   fDensityCulling (isDensityCulling),              79   fDensityCulling (isDensityCulling),
 83   fVisibleDensity (visibleDensity),                80   fVisibleDensity (visibleDensity),
 84   fCullCovered    (isCullingCovered),              81   fCullCovered    (isCullingCovered),
 85   fCBDAlgorithmNumber (0),                         82   fCBDAlgorithmNumber (0),
 86   fExplodeFactor  (1.),                            83   fExplodeFactor  (1.),
 87   fNoOfSides      (noOfSides),                     84   fNoOfSides      (noOfSides),
 88   fpSectionSolid  (0),                             85   fpSectionSolid  (0),
 89   fCutawayMode    (cutawayUnion),              << 
 90   fpCutawaySolid  (0),                             86   fpCutawaySolid  (0),
 91   fpEvent         (0),                             87   fpEvent         (0),
 92   fSpecialMeshRendering (false)                    88   fSpecialMeshRendering (false)
 93 {}                                                 89 {}
 94                                                    90 
 95 G4ModelingParameters::~G4ModelingParameters ()     91 G4ModelingParameters::~G4ModelingParameters ()
 96 {                                                  92 {
 97   delete fpSectionSolid;                           93   delete fpSectionSolid;
 98   delete fpCutawaySolid;                           94   delete fpCutawaySolid;
 99 }                                                  95 }
100                                                    96 
101 //G4ModelingParameters::VisAttributesModifier:     97 //G4ModelingParameters::VisAttributesModifier::VisAttributesModifier
102 //(const G4VisAttributes& visAtts,                 98 //(const G4VisAttributes& visAtts,
103 // G4ModelingParameters::VisAttributesSignifie     99 // G4ModelingParameters::VisAttributesSignifier signifier,
104 // const std::vector<G4PhysicalVolumeModel::G4    100 // const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& path):
105 //fVisAtts(visAtts), fSignifier(signifier)        101 //fVisAtts(visAtts), fSignifier(signifier)
106 //{                                               102 //{
107 //  typedef G4PhysicalVolumeModel::G4PhysicalV    103 //  typedef G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID;
108 //  typedef std::vector<PVNodeID> PVPath;         104 //  typedef std::vector<PVNodeID> PVPath;
109 //  typedef PVPath::const_iterator PVPathConst    105 //  typedef PVPath::const_iterator PVPathConstIterator;
110 //  PVPathConstIterator i;                        106 //  PVPathConstIterator i;
111 //  for (i = path.begin();                        107 //  for (i = path.begin();
112 //       i != path.end();                         108 //       i != path.end();
113 //       ++i) {                                   109 //       ++i) {
114 //    fPVNameCopyNoPath.push_back                 110 //    fPVNameCopyNoPath.push_back
115 //    (PVNameCopyNo                               111 //    (PVNameCopyNo
116 //     (i->GetPhysicalVolume()->GetName(),        112 //     (i->GetPhysicalVolume()->GetName(),
117 //      i->GetCopyNo()));                         113 //      i->GetCopyNo()));
118 //  }                                             114 //  }
119 //}                                               115 //}
120                                                   116 
121 void G4ModelingParameters::SetVisibleDensity (    117 void G4ModelingParameters::SetVisibleDensity (G4double visibleDensity) {
122   const G4double reasonableMaximum = 10.0 * g     118   const G4double reasonableMaximum = 10.0 * g / cm3;
123   if (visibleDensity < 0 && fWarning) {           119   if (visibleDensity < 0 && fWarning) {
124     G4warn << "G4ModelingParameters::SetVisibl << 120     G4cout << "G4ModelingParameters::SetVisibleDensity: attempt to set negative "
125       "density - ignored." << G4endl;             121       "density - ignored." << G4endl;
126   }                                               122   }
127   else {                                          123   else {
128     if (fVisibleDensity > reasonableMaximum &&    124     if (fVisibleDensity > reasonableMaximum && fWarning) {
129       G4warn << "G4ModelingParameters::SetVisi << 125       G4cout << "G4ModelingParameters::SetVisibleDensity: density > "
130      << reasonableMaximum                         126      << reasonableMaximum
131      << " g / cm3 - did you mean this?"           127      << " g / cm3 - did you mean this?"
132      << G4endl;                                   128      << G4endl;
133     }                                             129     }
134     fVisibleDensity = visibleDensity;             130     fVisibleDensity = visibleDensity;
135   }                                               131   }
136 }                                                 132 }
137                                                   133 
138 G4int G4ModelingParameters::SetNoOfSides (G4in    134 G4int G4ModelingParameters::SetNoOfSides (G4int nSides) {
139   const G4int  nSidesMin = fpDefaultVisAttribu    135   const G4int  nSidesMin = fpDefaultVisAttributes->GetMinLineSegmentsPerCircle();
140   if (nSides < nSidesMin) {                       136   if (nSides < nSidesMin) {
141     nSides = nSidesMin;                           137     nSides = nSidesMin;
142     if (fWarning)                                 138     if (fWarning)
143       G4warn << "G4ModelingParameters::SetNoOf << 139       G4cout << "G4ModelingParameters::SetNoOfSides: attempt to set the"
144   "\nnumber of sides per circle < " << nSidesM    140   "\nnumber of sides per circle < " << nSidesMin
145        << "; forced to" << nSides << G4endl;      141        << "; forced to" << nSides << G4endl;
146   }                                               142   }
147   fNoOfSides = nSides;                            143   fNoOfSides = nSides;
148   return fNoOfSides;                              144   return fNoOfSides;
149 }                                                 145 }
150                                                   146 
151 void G4ModelingParameters::SetSectionSolid        147 void G4ModelingParameters::SetSectionSolid
152 (G4DisplacedSolid* pSectionSolid) {               148 (G4DisplacedSolid* pSectionSolid) {
153   delete fpSectionSolid;                          149   delete fpSectionSolid;
154   fpSectionSolid = pSectionSolid;                 150   fpSectionSolid = pSectionSolid;
155 }                                                 151 }
156                                                   152 
157 void G4ModelingParameters::SetCutawaySolid        153 void G4ModelingParameters::SetCutawaySolid
158 (G4DisplacedSolid* pCutawaySolid) {               154 (G4DisplacedSolid* pCutawaySolid) {
159   delete fpCutawaySolid;                          155   delete fpCutawaySolid;
160   fpCutawaySolid = pCutawaySolid;                 156   fpCutawaySolid = pCutawaySolid;
161 }                                                 157 }
162                                                   158 
163 std::ostream& operator << (std::ostream& os, c    159 std::ostream& operator << (std::ostream& os, const G4ModelingParameters& mp)
164 {                                                 160 {
165   os << "Modeling parameters (warning ";          161   os << "Modeling parameters (warning ";
166   if (mp.fWarning) os << "true";                  162   if (mp.fWarning) os << "true";
167   else os << "false";                             163   else os << "false";
168   os << "):";                                     164   os << "):";
169                                                   165 
170   const G4VisAttributes* va = mp.fpDefaultVisA    166   const G4VisAttributes* va = mp.fpDefaultVisAttributes;
171   os << "\n  Default vis. attributes: ";          167   os << "\n  Default vis. attributes: ";
172   if (va) os << *va;                              168   if (va) os << *va;
173   else os << "none";                              169   else os << "none";
174                                                   170 
175   os << "\n  Current requested drawing style:     171   os << "\n  Current requested drawing style: ";
176   switch (mp.fDrawingStyle) {                     172   switch (mp.fDrawingStyle) {
177     case G4ModelingParameters::wf:                173     case G4ModelingParameters::wf:
178       os << "wireframe"; break;                   174       os << "wireframe"; break;
179     case G4ModelingParameters::hlr:               175     case G4ModelingParameters::hlr:
180       os << "hidden line removal (hlr)"; break    176       os << "hidden line removal (hlr)"; break;
181     case G4ModelingParameters::hsr:               177     case G4ModelingParameters::hsr:
182       os << "surface (hsr)"; break;               178       os << "surface (hsr)"; break;
183     case G4ModelingParameters::hlhsr:             179     case G4ModelingParameters::hlhsr:
184       os << "surface and edges (hlhsr)"; break    180       os << "surface and edges (hlhsr)"; break;
185     case G4ModelingParameters::cloud:             181     case G4ModelingParameters::cloud:
186       os << "cloud"; break;                       182       os << "cloud"; break;
187     default: os << "unrecognised"; break;         183     default: os << "unrecognised"; break;
188   }                                               184   }
189                                                   185 
190   os << "\n  Number of cloud points: " << mp.f    186   os << "\n  Number of cloud points: " << mp.fNumberOfCloudPoints;
191                                                   187 
192   os << "\n  Culling: ";                          188   os << "\n  Culling: ";
193   if (mp.fCulling) os << "on";                    189   if (mp.fCulling) os << "on";
194   else            os << "off";                    190   else            os << "off";
195                                                   191 
196   os << "\n  Culling invisible objects: ";        192   os << "\n  Culling invisible objects: ";
197   if (mp.fCullInvisible) os << "on";              193   if (mp.fCullInvisible) os << "on";
198   else                  os << "off";              194   else                  os << "off";
199                                                   195 
200   os << "\n  Density culling: ";                  196   os << "\n  Density culling: ";
201   if (mp.fDensityCulling) {                       197   if (mp.fDensityCulling) {
202     os << "on - invisible if density less than    198     os << "on - invisible if density less than "
203        << mp.fVisibleDensity / (1. * g / cm3)     199        << mp.fVisibleDensity / (1. * g / cm3) << " g cm^-3";
204   }                                               200   }
205   else os << "off";                               201   else os << "off";
206                                                   202 
207   os << "\n  Culling daughters covered by opaq    203   os << "\n  Culling daughters covered by opaque mothers: ";
208   if (mp.fCullCovered) os << "on";                204   if (mp.fCullCovered) os << "on";
209   else                os << "off";                205   else                os << "off";
210                                                   206 
211   os << "\n  Colour by density: ";                207   os << "\n  Colour by density: ";
212   if (mp.fCBDAlgorithmNumber <= 0) {              208   if (mp.fCBDAlgorithmNumber <= 0) {
213     os << "inactive";                             209     os << "inactive";
214   } else {                                        210   } else {
215     os << "Algorithm " << mp.fCBDAlgorithmNumb    211     os << "Algorithm " << mp.fCBDAlgorithmNumber << ", Parameters:";
216     for (auto p: mp.fCBDParameters) {             212     for (auto p: mp.fCBDParameters) {
217       os << ' ' << G4BestUnit(p,"Volumic Mass"    213       os << ' ' << G4BestUnit(p,"Volumic Mass");
218     }                                             214     }
219   }                                               215   }
220                                                   216 
221   os << "\n  Explode factor: " << mp.fExplodeF    217   os << "\n  Explode factor: " << mp.fExplodeFactor
222      << " about centre: " << mp.fExplodeCentre    218      << " about centre: " << mp.fExplodeCentre;
223                                                   219 
224   os << "\n  No. of sides used in circle polyg    220   os << "\n  No. of sides used in circle polygon approximation: "
225      << mp.fNoOfSides;                            221      << mp.fNoOfSides;
226                                                   222 
227   os << "\n  Section (DCUT) shape (G4Displaced    223   os << "\n  Section (DCUT) shape (G4DisplacedSolid) pointer: ";
228   if (!mp.fpSectionSolid) os << "non-";           224   if (!mp.fpSectionSolid) os << "non-";
229   os << "null";                                   225   os << "null";
230                                                   226 
231   os << "\n  Cutaway mode: ";                  << 
232   if (mp.GetCutawayMode() == G4ModelingParamet << 
233   else if (mp.GetCutawayMode() == G4ModelingPa << 
234                                                << 
235   os << "\n  Cutaway (DCUT) shape (G4Displaced    227   os << "\n  Cutaway (DCUT) shape (G4DisplacedSolid) pointer: ";
236   if (!mp.fpCutawaySolid) os << "non-";           228   if (!mp.fpCutawaySolid) os << "non-";
237   os << "null";                                   229   os << "null";
238                                                   230 
239   os << "\n  Event pointer: " << mp.fpEvent;      231   os << "\n  Event pointer: " << mp.fpEvent;
240                                                   232 
241   os << "\n  Vis attributes modifiers: ";         233   os << "\n  Vis attributes modifiers: ";
242   const std::vector<G4ModelingParameters::VisA    234   const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
243   mp.fVisAttributesModifiers;                     235   mp.fVisAttributesModifiers;
244   if (vams.empty()) {                             236   if (vams.empty()) {
245     os << "None";                                 237     os << "None";
246   } else {                                        238   } else {
247     os << vams;                                   239     os << vams;
248   }                                               240   }
249                                                   241 
250   os << "\n  Special Mesh Rendering: ";           242   os << "\n  Special Mesh Rendering: ";
251   if (mp.fSpecialMeshRendering) {                 243   if (mp.fSpecialMeshRendering) {
252     os << "on: ";                                 244     os << "on: ";
253     if (mp.fSpecialMeshVolumes.empty()) {         245     if (mp.fSpecialMeshVolumes.empty()) {
254       os << "all meshes";                         246       os << "all meshes";
255     } else {                                      247     } else {
256       os << "selected meshes";                    248       os << "selected meshes";
257       for (const auto& vol: mp.fSpecialMeshVol    249       for (const auto& vol: mp.fSpecialMeshVolumes) {
258   os << "\n    " << vol.GetName() << ':' << vo    250   os << "\n    " << vol.GetName() << ':' << vol.GetCopyNo();
259       }                                           251       }
260     }                                             252     }
261   } else os << "off";                             253   } else os << "off";
262                                                   254 
263   return os;                                      255   return os;
264 }                                                 256 }
265                                                   257 
266 G4bool G4ModelingParameters::operator !=          258 G4bool G4ModelingParameters::operator !=
267 (const G4ModelingParameters& mp) const {          259 (const G4ModelingParameters& mp) const {
268                                                   260 
269   if (                                            261   if (
270       (fWarning                != mp.fWarning)    262       (fWarning                != mp.fWarning)                ||
271       (*fpDefaultVisAttributes != *mp.fpDefaul    263       (*fpDefaultVisAttributes != *mp.fpDefaultVisAttributes) ||
272       (fDrawingStyle           != mp.fDrawingS    264       (fDrawingStyle           != mp.fDrawingStyle)           ||
273       (fNumberOfCloudPoints    != mp.fNumberOf    265       (fNumberOfCloudPoints    != mp.fNumberOfCloudPoints)    ||
274       (fCulling                != mp.fCulling)    266       (fCulling                != mp.fCulling)                ||
275       (fCullInvisible          != mp.fCullInvi    267       (fCullInvisible          != mp.fCullInvisible)          ||
276       (fDensityCulling         != mp.fDensityC    268       (fDensityCulling         != mp.fDensityCulling)         ||
277       (fCullCovered            != mp.fCullCove    269       (fCullCovered            != mp.fCullCovered)            ||
278       (fCBDAlgorithmNumber     != mp.fCBDAlgor    270       (fCBDAlgorithmNumber     != mp.fCBDAlgorithmNumber)     ||
279       (fExplodeFactor          != mp.fExplodeF    271       (fExplodeFactor          != mp.fExplodeFactor)          ||
280       (fExplodeCentre          != mp.fExplodeC    272       (fExplodeCentre          != mp.fExplodeCentre)          ||
281       (fNoOfSides              != mp.fNoOfSide    273       (fNoOfSides              != mp.fNoOfSides)              ||
282       (fpSectionSolid          != mp.fpSection    274       (fpSectionSolid          != mp.fpSectionSolid)          ||
283       (fCutawayMode            != mp.fCutawayM << 
284       (fpCutawaySolid          != mp.fpCutaway    275       (fpCutawaySolid          != mp.fpCutawaySolid)          ||
285       (fpEvent                 != mp.fpEvent)     276       (fpEvent                 != mp.fpEvent)                 ||
286       (fSpecialMeshRendering   != mp.fSpecialM    277       (fSpecialMeshRendering   != mp.fSpecialMeshRendering)
287       )                                           278       )
288     return true;                                  279     return true;
289                                                   280 
290   if (fDensityCulling &&                          281   if (fDensityCulling &&
291       (fVisibleDensity != mp.fVisibleDensity))    282       (fVisibleDensity != mp.fVisibleDensity)) return true;
292                                                   283 
293   if (fCBDAlgorithmNumber > 0) {                  284   if (fCBDAlgorithmNumber > 0) {
294     if (fCBDParameters.size() != mp.fCBDParame    285     if (fCBDParameters.size() != mp.fCBDParameters.size()) return true;
295     else if (fCBDParameters != mp.fCBDParamete    286     else if (fCBDParameters != mp.fCBDParameters) return true;
296   }                                               287   }
297                                                   288 
298   if (fVisAttributesModifiers != mp.fVisAttrib    289   if (fVisAttributesModifiers != mp.fVisAttributesModifiers)
299     return true;                                  290     return true;
300                                                   291 
301   if (fSpecialMeshRendering) {                    292   if (fSpecialMeshRendering) {
302     if (fSpecialMeshVolumes != mp.fSpecialMesh    293     if (fSpecialMeshVolumes != mp.fSpecialMeshVolumes)
303       return true;;                               294       return true;;
304   }                                               295   }
305                                                   296 
306   return false;                                   297   return false;
307 }                                                 298 }
308                                                   299 
309 G4bool G4ModelingParameters::VisAttributesModi    300 G4bool G4ModelingParameters::VisAttributesModifier::operator!=
310 (const G4ModelingParameters::VisAttributesModi    301 (const G4ModelingParameters::VisAttributesModifier& rhs) const
311 {                                                 302 {
312   if (fSignifier != rhs.fSignifier) return tru    303   if (fSignifier != rhs.fSignifier) return true;
313   if (fPVNameCopyNoPath != rhs.fPVNameCopyNoPa    304   if (fPVNameCopyNoPath != rhs.fPVNameCopyNoPath) return true;
314   switch (fSignifier) {                           305   switch (fSignifier) {
315     case G4ModelingParameters::VASVisibility:     306     case G4ModelingParameters::VASVisibility:
316       if (fVisAtts.IsVisible() != rhs.fVisAtts    307       if (fVisAtts.IsVisible() != rhs.fVisAtts.IsVisible())
317         return true;                              308         return true;
318       break;                                      309       break;
319     case G4ModelingParameters::VASDaughtersInv    310     case G4ModelingParameters::VASDaughtersInvisible:
320       if (fVisAtts.IsDaughtersInvisible() !=      311       if (fVisAtts.IsDaughtersInvisible() !=
321           rhs.fVisAtts.IsDaughtersInvisible())    312           rhs.fVisAtts.IsDaughtersInvisible())
322         return true;                              313         return true;
323       break;                                      314       break;
324     case G4ModelingParameters::VASColour:         315     case G4ModelingParameters::VASColour:
325       if (fVisAtts.GetColour() != rhs.fVisAtts    316       if (fVisAtts.GetColour() != rhs.fVisAtts.GetColour())
326         return true;                              317         return true;
327       break;                                      318       break;
328     case G4ModelingParameters::VASLineStyle:      319     case G4ModelingParameters::VASLineStyle:
329       if (fVisAtts.GetLineStyle() != rhs.fVisA    320       if (fVisAtts.GetLineStyle() != rhs.fVisAtts.GetLineStyle())
330         return true;                              321         return true;
331       break;                                      322       break;
332     case G4ModelingParameters::VASLineWidth:      323     case G4ModelingParameters::VASLineWidth:
333       if (fVisAtts.GetLineWidth() != rhs.fVisA    324       if (fVisAtts.GetLineWidth() != rhs.fVisAtts.GetLineWidth())
334         return true;                              325         return true;
335       break;                                      326       break;
336     case G4ModelingParameters::VASForceWirefra    327     case G4ModelingParameters::VASForceWireframe:
337     case G4ModelingParameters::VASForceSolid:     328     case G4ModelingParameters::VASForceSolid:
338     case G4ModelingParameters::VASForceCloud:     329     case G4ModelingParameters::VASForceCloud:
339       if (fVisAtts.GetForcedDrawingStyle() !=     330       if (fVisAtts.GetForcedDrawingStyle() !=
340           rhs.fVisAtts.GetForcedDrawingStyle()    331           rhs.fVisAtts.GetForcedDrawingStyle())
341         return true;                              332         return true;
342       break;                                      333       break;
343     case G4ModelingParameters::VASForceNumberO    334     case G4ModelingParameters::VASForceNumberOfCloudPoints:
344       if (fVisAtts.GetForcedNumberOfCloudPoint    335       if (fVisAtts.GetForcedNumberOfCloudPoints() !=
345           rhs.fVisAtts.GetForcedNumberOfCloudP    336           rhs.fVisAtts.GetForcedNumberOfCloudPoints())
346         return true;                              337         return true;
347       break;                                      338       break;
348     case G4ModelingParameters::VASForceAuxEdge    339     case G4ModelingParameters::VASForceAuxEdgeVisible:
349       if (fVisAtts.IsForceAuxEdgeVisible() !=     340       if (fVisAtts.IsForceAuxEdgeVisible() !=
350           rhs.fVisAtts.IsForceAuxEdgeVisible()    341           rhs.fVisAtts.IsForceAuxEdgeVisible() ||
351           fVisAtts.IsForcedAuxEdgeVisible() !=    342           fVisAtts.IsForcedAuxEdgeVisible() !=
352           rhs.fVisAtts.IsForcedAuxEdgeVisible(    343           rhs.fVisAtts.IsForcedAuxEdgeVisible())
353         return true;                              344         return true;
354       break;                                      345       break;
355     case G4ModelingParameters::VASForceLineSeg    346     case G4ModelingParameters::VASForceLineSegmentsPerCircle:
356       if (fVisAtts.GetForcedLineSegmentsPerCir    347       if (fVisAtts.GetForcedLineSegmentsPerCircle() !=
357           rhs.fVisAtts.GetForcedLineSegmentsPe    348           rhs.fVisAtts.GetForcedLineSegmentsPerCircle())
358         return true;                              349         return true;
359       break;                                      350       break;
360   }                                               351   }
361   return false;                                   352   return false;
362 }                                                 353 }
363                                                   354 
364 G4bool G4ModelingParameters::PVNameCopyNo::ope    355 G4bool G4ModelingParameters::PVNameCopyNo::operator!=
365 (const G4ModelingParameters::PVNameCopyNo& rhs    356 (const G4ModelingParameters::PVNameCopyNo& rhs) const
366 {                                                 357 {
367   if (fName != rhs.fName) return true;            358   if (fName != rhs.fName) return true;
368   if (fCopyNo != rhs.fCopyNo) return true;        359   if (fCopyNo != rhs.fCopyNo) return true;
369   return false;                                   360   return false;
370 }                                                 361 }
371                                                   362 
372 std::ostream& operator <<                         363 std::ostream& operator <<
373 (std::ostream& os, const G4ModelingParameters:    364 (std::ostream& os, const G4ModelingParameters::PVNameCopyNoPath& path)
374 {                                                 365 {
375   os << "Touchable path: ";                       366   os << "Touchable path: ";
376   if (path.empty()) {                             367   if (path.empty()) {
377     os << "empty";                                368     os << "empty";
378   } else {                                        369   } else {
379     os << "physical-volume-name:copy-number pa    370     os << "physical-volume-name:copy-number pairs:\n  ";
380     G4ModelingParameters::PVNameCopyNoPathCons    371     G4ModelingParameters::PVNameCopyNoPathConstIterator i;
381     for (i = path.begin(); i != path.end(); ++    372     for (i = path.begin(); i != path.end(); ++i) {
382       if (i != path.begin()) {                    373       if (i != path.begin()) {
383         os << ',';                                374         os << ',';
384       }                                           375       }
385       os << i->GetName() << ':' << i->GetCopyN    376       os << i->GetName() << ':' << i->GetCopyNo();
386     }                                             377     }
387   }                                               378   }
388   return os;                                      379   return os;
389 }                                                 380 }
390                                                   381 
391 const G4String& G4ModelingParameters::PVPointe    382 const G4String& G4ModelingParameters::PVPointerCopyNo::GetName() const
392 {                                                 383 {
393   return fpPV->GetName();                         384   return fpPV->GetName();
394 }                                                 385 }
395                                                   386 
396 G4bool G4ModelingParameters::PVPointerCopyNo::    387 G4bool G4ModelingParameters::PVPointerCopyNo::operator!=
397 (const G4ModelingParameters::PVPointerCopyNo&     388 (const G4ModelingParameters::PVPointerCopyNo& rhs) const
398 {                                                 389 {
399   if (fpPV != rhs.fpPV) return true;              390   if (fpPV != rhs.fpPV) return true;
400   if (fCopyNo != rhs.fCopyNo) return true;        391   if (fCopyNo != rhs.fCopyNo) return true;
401   return false;                                   392   return false;
402 }                                                 393 }
403                                                   394 
404 std::ostream& operator <<                         395 std::ostream& operator <<
405 (std::ostream& os, const G4ModelingParameters:    396 (std::ostream& os, const G4ModelingParameters::PVPointerCopyNoPath& path)
406 {                                                 397 {
407   os << "Touchable path: physical-volume-point    398   os << "Touchable path: physical-volume-pointer:copy-number pairs:\n  ";
408   G4ModelingParameters::PVPointerCopyNoPathCon    399   G4ModelingParameters::PVPointerCopyNoPathConstIterator i;
409   for (i = path.begin(); i != path.end(); ++i)    400   for (i = path.begin(); i != path.end(); ++i) {
410     if (i != path.begin()) {                      401     if (i != path.begin()) {
411       os << ',';                                  402       os << ',';
412     }                                             403     }
413     os << '(' << (void*)(i->GetPVPointer()) <<    404     os << '(' << (void*)(i->GetPVPointer()) << ')' << i->GetName() << ':' << i->GetCopyNo();
414   }                                               405   }
415   return os;                                      406   return os;
416 }                                                 407 }
417                                                   408 
418 std::ostream& operator <<                         409 std::ostream& operator <<
419 (std::ostream& os,                                410 (std::ostream& os,
420  const std::vector<G4ModelingParameters::VisAt    411  const std::vector<G4ModelingParameters::VisAttributesModifier>& vams)
421 {                                                 412 {
422   std::vector<G4ModelingParameters::VisAttribu    413   std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator
423   iModifier;                                      414   iModifier;
424   for (iModifier = vams.begin();                  415   for (iModifier = vams.begin();
425        iModifier != vams.end();                   416        iModifier != vams.end();
426        ++iModifier) {                             417        ++iModifier) {
427     const G4ModelingParameters::PVNameCopyNoPa    418     const G4ModelingParameters::PVNameCopyNoPath& vamPath =
428     iModifier->GetPVNameCopyNoPath();             419     iModifier->GetPVNameCopyNoPath();
429     os << '\n' << vamPath;                        420     os << '\n' << vamPath;
430     const G4VisAttributes& vamVisAtts = iModif    421     const G4VisAttributes& vamVisAtts = iModifier->GetVisAttributes();
431     const G4Colour& c = vamVisAtts.GetColour()    422     const G4Colour& c = vamVisAtts.GetColour();
432     switch (iModifier->GetVisAttributesSignifi    423     switch (iModifier->GetVisAttributesSignifier()) {
433       case G4ModelingParameters::VASVisibility    424       case G4ModelingParameters::VASVisibility:
434         os << " visibility ";                     425         os << " visibility ";
435         if (vamVisAtts.IsVisible()) {             426         if (vamVisAtts.IsVisible()) {
436           os << "true";                           427           os << "true";
437         } else {                                  428         } else {
438           os << "false";                          429           os << "false";
439         }                                         430         }
440         break;                                    431         break;
441       case G4ModelingParameters::VASDaughtersI    432       case G4ModelingParameters::VASDaughtersInvisible:
442         os << " daughtersInvisible ";             433         os << " daughtersInvisible ";
443         if (vamVisAtts.IsDaughtersInvisible())    434         if (vamVisAtts.IsDaughtersInvisible()) {
444           os << "true";                           435           os << "true";
445         } else {                                  436         } else {
446           os << "false";                          437           os << "false";
447         }                                         438         }
448         break;                                    439         break;
449       case G4ModelingParameters::VASColour:       440       case G4ModelingParameters::VASColour:
450         os << " colour " << c;                    441         os << " colour " << c;
451         break;                                    442         break;
452       case G4ModelingParameters::VASLineStyle:    443       case G4ModelingParameters::VASLineStyle:
453         os << " lineStyle ";                      444         os << " lineStyle ";
454         switch (vamVisAtts.GetLineStyle()) {      445         switch (vamVisAtts.GetLineStyle()) {
455           case G4VisAttributes::unbroken:         446           case G4VisAttributes::unbroken:
456             os << "unbroken";                     447             os << "unbroken";
457             break;                                448             break;
458           case G4VisAttributes::dashed:           449           case G4VisAttributes::dashed:
459             os << "dashed";                       450             os << "dashed";
460             break;                                451             break;
461           case G4VisAttributes::dotted:           452           case G4VisAttributes::dotted:
462             os << "dotted";                       453             os << "dotted";
463         }                                         454         }
464         break;                                    455         break;
465       case G4ModelingParameters::VASLineWidth:    456       case G4ModelingParameters::VASLineWidth:
466         os << " lineWidth "                       457         os << " lineWidth "
467         << vamVisAtts.GetLineWidth();             458         << vamVisAtts.GetLineWidth();
468         break;                                    459         break;
469       case G4ModelingParameters::VASForceWiref    460       case G4ModelingParameters::VASForceWireframe:
470         if (vamVisAtts.GetForcedDrawingStyle()    461         if (vamVisAtts.GetForcedDrawingStyle() == G4VisAttributes::wireframe) {
471           os << " forceWireframe ";               462           os << " forceWireframe ";
472           if (vamVisAtts.IsForceDrawingStyle()    463           if (vamVisAtts.IsForceDrawingStyle()) {
473             os << "true";                         464             os << "true";
474           } else {                                465           } else {
475             os << "false";                        466             os << "false";
476           }                                       467           }
477         }                                         468         }
478         break;                                    469         break;
479       case G4ModelingParameters::VASForceSolid    470       case G4ModelingParameters::VASForceSolid:
480         if (vamVisAtts.GetForcedDrawingStyle()    471         if (vamVisAtts.GetForcedDrawingStyle() == G4VisAttributes::solid) {
481           os << " forceSolid ";                   472           os << " forceSolid ";
482           if (vamVisAtts.IsForceDrawingStyle()    473           if (vamVisAtts.IsForceDrawingStyle()) {
483             os << "true";                         474             os << "true";
484           } else {                                475           } else {
485             os << "false";                        476             os << "false";
486           }                                       477           }
487         }                                         478         }
488         break;                                    479         break;
489       case G4ModelingParameters::VASForceCloud    480       case G4ModelingParameters::VASForceCloud:
490         if (vamVisAtts.GetForcedDrawingStyle()    481         if (vamVisAtts.GetForcedDrawingStyle() == G4VisAttributes::cloud) {
491           os << " forceCloud ";                   482           os << " forceCloud ";
492           if (vamVisAtts.IsForceDrawingStyle()    483           if (vamVisAtts.IsForceDrawingStyle()) {
493             os << "true";                         484             os << "true";
494           } else {                                485           } else {
495             os << "false";                        486             os << "false";
496           }                                       487           }
497         }                                         488         }
498         break;                                    489         break;
499       case G4ModelingParameters::VASForceNumbe    490       case G4ModelingParameters::VASForceNumberOfCloudPoints:
500         os << " numberOfCloudPoints "             491         os << " numberOfCloudPoints "
501         << vamVisAtts.GetForcedNumberOfCloudPo    492         << vamVisAtts.GetForcedNumberOfCloudPoints();
502         break;                                    493         break;
503       case G4ModelingParameters::VASForceAuxEd    494       case G4ModelingParameters::VASForceAuxEdgeVisible:
504         os << " forceAuxEdgeVisible: ";           495         os << " forceAuxEdgeVisible: ";
505         if (!vamVisAtts.IsForceDrawingStyle())    496         if (!vamVisAtts.IsForceDrawingStyle()) {
506           os << "not ";                           497           os << "not ";
507         }                                         498         }
508         os << " forced";                          499         os << " forced";
509         if (vamVisAtts.IsForceAuxEdgeVisible()    500         if (vamVisAtts.IsForceAuxEdgeVisible()) {
510           os << ": ";                             501           os << ": ";
511           if (vamVisAtts.IsForcedAuxEdgeVisibl    502           if (vamVisAtts.IsForcedAuxEdgeVisible()) {
512             os << "true";                         503             os << "true";
513           } else {                                504           } else {
514             os << "false";                        505             os << "false";
515           }                                       506           }
516         }                                         507         }
517         break;                                    508         break;
518       case G4ModelingParameters::VASForceLineS    509       case G4ModelingParameters::VASForceLineSegmentsPerCircle:
519         os << " lineSegmentsPerCircle "           510         os << " lineSegmentsPerCircle "
520         << vamVisAtts.GetForcedLineSegmentsPer    511         << vamVisAtts.GetForcedLineSegmentsPerCircle();
521         break;                                    512         break;
522     }                                             513     }
523   }                                               514   }
524                                                   515 
525   return os;                                      516   return os;
526 }                                                 517 }
527                                                   518 
528                                                   519