00001
00002
00003 #include "VisGeant4/VisG4Volumes/interface/VisG4VolumeTwig.h"
00004 #include "VisGeant4/VisG4Volumes/interface/VisG4Navigator.h"
00005 #include "VisGeant4/VisG4Volumes/interface/VisG4VolumePicker.h"
00006 #include "VisGeant4/VisG4Volumes/interface/VisG4MaterialFilter.h"
00007 #include "VisGeant4/VisG4Volumes/interface/VisG4MaterialCacheFilter.h"
00008 #include "VisGeant4/VisG4Volumes/interface/VisG4MaterialMiscFilter.h"
00009 #include "VisGeant4/VisG4Volumes/interface/VisG4MaterialDensityFilter.h"
00010 #include "VisGeant4/VisG4Volumes/interface/VisG4MaterialFalseColorFilter.h"
00011 #include "VisGeant4/VisG4Volumes/interface/VisG4Filter.h"
00012 #include "VisGeant4/VisG4Volumes/interface/VisG4FilterCache.h"
00013 #include "VisGeant4/VisG4Volumes/interface/VisG4MaterialNameFilter.h"
00014 #include "VisGeant4/VisG4Volumes/interface/xtypeinfo.h"
00015 #include "VisGeant4/VisG4Core/interface/VisG4Path.h"
00016 #include "VisGeant4/VisG4Core/interface/VisG4VisSceneHandler.h"
00017 #include "Iguana/GLModels/interface/IgCommon3DReps.h"
00018 #include "Iguana/GLModels/interface/Ig3DModel.h"
00019 #include "Iguana/GLModels/interface/Ig3DRep.h"
00020 #include "Iguana/GLModels/interface/IgRPhiModel.h"
00021 #include "Iguana/GLModels/interface/IgRPhiRep.h"
00022 #include "Iguana/GLModels/interface/IgRZModel.h"
00023 #include "Iguana/GLModels/interface/IgRZRep.h"
00024 #include "Iguana/GLModels/interface/xtypeinfo.h"
00025 #include "Iguana/Models/interface/IgTextModel.h"
00026 #include "Iguana/Models/interface/IgSimpleTextRep.h"
00027 #include "Iguana/Models/interface/xtypeinfo.h"
00028 #include "Iguana/Framework/interface/IgRepContext.h"
00029 #include "Iguana/Framework/interface/IgRepSet.h"
00030 #include "Iguana/Framework/interface/IgBrowserMethods.h"
00031 #include "Iguana/Framework/interface/xtypeinfo.h"
00032 #include <classlib/utils/DebugAids.h>
00033 #include <classlib/utils/Log.h>
00034
00035 #include <Inventor/nodes/SoMaterial.h>
00036
00037 #include <G4ModelingParameters.hh>
00038 #include <G4VPhysicalVolume.hh>
00039 #include <G4LogicalVolume.hh>
00040 #include <G4VisAttributes.hh>
00041 #include <G4Material.hh>
00042 #include <G4VSensitiveDetector.hh>
00043 #include <G4VSolid.hh>
00044 #include <G4Box.hh>
00045 #include <G4Cons.hh>
00046 #include <G4Polycone.hh>
00047 #include <G4Polyhedra.hh>
00048 #include <G4Torus.hh>
00049 #include <G4Trap.hh>
00050 #include <G4Trd.hh>
00051 #include <G4Tubs.hh>
00052
00053 #include <sstream>
00054
00055
00056
00057
00058
00059
00060 extern lat::logflag LFG4vis;
00061
00062
00063
00064
00065
00066
00067
00068 VisG4VolumeTwig::VisG4VolumeTwig (IgTwig *parent,
00069 G4VPhysicalVolume *volume,
00070 bool traverse ,
00071 bool visible ,
00072 bool open ,
00073 bool logic )
00074 : IgCompoundTwig (parent),
00075 m_volume (volume)
00076 {
00077 ASSERT (parent);
00078 ASSERT (m_volume);
00079
00080 selfTraverse (traverse);
00081 selfVisible (visible);
00082 cascade (open);
00083 logical (logic);
00084 if (m_materialFilter == 0)
00085 {
00086 m_materialFilter = new VisG4MaterialCacheFilter (true);
00087 VisG4MaterialFilter *currentFilter = m_materialFilter;
00088
00089 VisG4MaterialFilter *tmpFilter;
00090
00091 if (! getenv ("DISABLE_LUT_FILTER"))
00092 {
00093 tmpFilter = new VisG4MaterialLUTFilter (true);
00094 currentFilter->appendFilter (tmpFilter);
00095 currentFilter = tmpFilter;
00096 }
00097
00098 if (getenv ("ENABLE_DENSITY_FILTER"))
00099 {
00100 tmpFilter = new VisG4MaterialDensityFilter (true);
00101 currentFilter->appendFilter (tmpFilter);
00102 currentFilter = tmpFilter;
00103 }
00104
00105 if (getenv ("ENABLE_FALSE_COLOR_FILTER"))
00106 {
00107 tmpFilter = new VisG4MaterialFalseColorFilter (true);
00108 currentFilter->appendFilter (tmpFilter);
00109 currentFilter = tmpFilter;
00110 }
00111 }
00112 }
00113
00114 VisG4MaterialFilter *VisG4VolumeTwig::m_materialFilter = 0;
00115 VisG4Filter *VisG4VolumeTwig::m_visualizationFilter = 0;
00116
00117 std::string
00118 VisG4VolumeTwig::name (void) const
00119 { return m_volume->GetLogicalVolume ()->GetName (); }
00120
00121 void
00122 VisG4VolumeTwig::name (const std::string &)
00123 { ASSERT (false); }
00124
00125 bool
00126 VisG4VolumeTwig::expand (void)
00127 {
00128 if (IgCompoundTwig::expand ())
00129 return true;
00130
00131 VisG4Navigator::build (1, m_volume, this);
00132 return false;
00133 }
00134
00135 #if 0
00136 VisG4Path
00137 VisG4VolumeTwig::path (void) const
00138 {
00139 if (const IgTwig *p = parent ())
00140 return VisG4Path (p->path (), p->indexOf (this), 0);
00141 else
00142 return VisG4Path ();
00143 }
00144 #endif
00145
00146 VisG4VolumeTwig *
00147 VisG4VolumeTwig::select (const VisG4Path &path, bool autoexpand )
00148 {
00149 if (path.empty ())
00150 return this;
00151
00152 VisG4VolumeTwig *c = select (path.prefix (), autoexpand);
00153
00154 if (! c->children () && autoexpand)
00155 c->expand ();
00156
00157 unsigned n = path.daughter ();
00158 if (n < c->children ())
00159 {
00160 IgTwig *sub = c->child (n);
00161 VisG4VolumeTwig *subvol = static_cast<VisG4VolumeTwig *> (sub);
00162 ASSERT (dynamic_cast<VisG4VolumeTwig *> (sub));
00163 return subvol;
00164 }
00165 else
00166 return 0;
00167 }
00168
00169 G4VPhysicalVolume *
00170 VisG4VolumeTwig::volume (void) const
00171 { return m_volume; }
00172
00173 bool
00174 VisG4VolumeTwig::selfTraverse (void) const
00175 { return flag (TRAVERSE); }
00176
00177 void
00178 VisG4VolumeTwig::selfTraverse (bool value)
00179 { flag (TRAVERSE, value); }
00180
00181 bool
00182 VisG4VolumeTwig::selfVisible (void) const
00183 { return flag (VISIBLE); }
00184
00185 void
00186 VisG4VolumeTwig::selfVisible (bool value)
00187 { flag (VISIBLE, value); }
00188
00189 bool
00190 VisG4VolumeTwig::cascade (void) const
00191 { return flag (CASCADE); }
00192
00193 void
00194 VisG4VolumeTwig::cascade (bool value)
00195 { flag (CASCADE, value); }
00196
00197
00198 bool
00199 VisG4VolumeTwig::logical (void) const
00200 { return flag (LOGICAL); }
00201
00202 void
00203 VisG4VolumeTwig::logical (bool value)
00204 {
00205 if (flag (LOGICAL) != value)
00206 {
00207
00208 destroy ();
00209 flag (LOGICAL, value);
00210 flag (EXPANDED, false);
00211 }
00212 }
00213
00215 unsigned
00216 VisG4VolumeTwig::physicalChildren (void)
00217 {
00218 if (! logical ())
00219 return children ();
00220 else if (flag (EXPANDED))
00221 return m_volume->GetLogicalVolume ()->GetNoDaughters ();
00222 else
00223 return 0;
00224 }
00225
00226 IgTwig *
00227 VisG4VolumeTwig::physicalChild (unsigned index)
00228 { return child (logical () ? VisG4Navigator::findLogical (m_volume, index)
00229 : index); }
00230
00232 unsigned
00233 VisG4VolumeTwig::paths (void)
00234 {
00235 if (m_paths.empty ())
00236 {
00237
00238 if (VisG4VolumeTwig *p = dynamic_cast<VisG4VolumeTwig *> (parent ()))
00239 {
00240
00241 G4VPhysicalVolume *pvol = p->volume ();
00242 int nreps = 1;
00243
00244 if (m_volume->IsReplicated ())
00245 {
00246 EAxis axis;
00247 G4double width, offset;
00248 G4bool consuming;
00249 m_volume->GetReplicationData (axis, nreps, width,
00250 offset, consuming);
00251 }
00252
00253 if (p->logical ())
00254
00255
00256
00257 for (unsigned i = 0; i < p->paths (); ++i)
00258 {
00259 VisG4Path prefix = p->path (i);
00260 G4LogicalVolume *mother = pvol->GetLogicalVolume ();
00261 G4LogicalVolume *me = m_volume->GetLogicalVolume ();
00262
00263 for (int i = 0; i < mother->GetNoDaughters (); ++i)
00264 if (mother->GetDaughter (i)->GetLogicalVolume () == me)
00265 for (int j = 0; j < nreps; ++j)
00266 m_paths.push_back (VisG4Path (prefix, i, j));
00267 }
00268
00269 else
00270
00271
00272 for (unsigned i = 0, me = p->indexOf(this); i < p->paths();++i)
00273 for (int j = 0; j < nreps; ++j)
00274 m_paths.push_back (VisG4Path (p->path (i), me, j));
00275 }
00276 else
00277 m_paths.push_back (VisG4Path ());
00278 }
00279
00280
00281 return m_paths.size ();
00282 }
00283
00284 VisG4Path
00285 VisG4VolumeTwig::path (unsigned index)
00286 {
00287 ASSERT (m_paths.size () > index);
00288 return m_paths [index];
00289 }
00290
00294 void
00295 drawSolidParts (VisG4VisSceneHandler *handler, G4VSolid *solid, int depth = 0)
00296 {
00297 G4VSolid *b0, *b1;
00298
00299 if ((b0 = solid->GetConstituentSolid (0)))
00300 {
00301 VERIFY (b1 = solid->GetConstituentSolid (1));
00302 drawSolidParts (handler, b0, depth+1);
00303 drawSolidParts (handler, b1, depth+1);
00304 }
00305
00306 if (depth > 0)
00307 solid->DescribeYourselfTo (*handler);
00308 }
00309
00310 void
00311 drawVolumeTwig (VisG4VolumeTwig *twig, Ig3DRep *rep)
00312 {
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325 rep->clear ();
00326
00327
00328 VisG4VolumeTwig *root = twig;
00329 while (VisG4VolumeTwig *x = dynamic_cast<VisG4VolumeTwig *> (root->parent()))
00330 root = x;
00331
00332 VisG4VisSceneHandler *handler = VisG4VisSceneHandler::instance ();
00333 G4VPhysicalVolume *volume = root->volume ();
00334
00335 ASSERT (handler);
00336 ASSERT (volume);
00337 ASSERT (root);
00338
00339
00340
00341
00342
00343
00344 handler->defineBounds (volume->GetLogicalVolume ()
00345 ->GetSolid ()->GetExtent ());
00346
00347 for (unsigned i = 0; i < twig->paths (); ++i)
00348 {
00349 bool replica = false;
00350 G4VPhysicalVolume *pv = volume;
00351 G4LogicalVolume *lv = 0;
00352 G4VSolid *solid = 0;
00353 G4Transform3D pos;
00354
00355 VisG4VolumePicker::apply (twig->path (i), pv, lv, solid, pos, replica);
00356
00357 ASSERT (solid);
00358 ASSERT (pv);
00359 ASSERT (lv);
00360
00361
00362 VisSoMaterialDetails details;
00363 details << VisG4MaterialDetails (lv->GetMaterial ());
00364 details << VisG4PVDetails (pv);
00365 details << VisG4PathDetails (twig->fullName ());
00366
00367
00368 if (VisG4VolumeTwig::m_visualizationFilter
00369 && ! VisG4VolumeTwig::m_visualizationFilter->compute (details))
00370 continue;
00371
00372 SoSeparator *sep = new SoSeparator;
00373 rep->node ()->addChild (sep);
00374
00375
00376 handler->beginObject (sep, replica ? 0 : pv);
00377
00378
00379 handler->addTransform (pos);
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391 handler->addStyle (lv->GetVisAttributes ());
00392
00393
00394 handler->addMaterial (VisG4VolumeTwig::m_materialFilter->getSoMaterial (details, 0));
00395
00396
00397 solid->DescribeYourselfTo (*handler);
00398
00399
00400 handler->endObject ();
00401 }
00402 }
00403
00404 void
00405 drawVolumeTwig (VisG4VolumeTwig *twig, IgRPhiRep *rep)
00406 {
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419 rep->clear ();
00420
00421
00422 VisG4VolumeTwig *root = twig;
00423 while (VisG4VolumeTwig *x = dynamic_cast<VisG4VolumeTwig *> (root->parent()))
00424 root = x;
00425
00426 VisG4VisSceneHandler *handler = VisG4VisSceneHandler::instance ();
00427 G4VPhysicalVolume *volume = root->volume ();
00428
00429 ASSERT (handler);
00430 ASSERT (volume);
00431 ASSERT (root);
00432
00433
00434
00435
00436
00437
00438 handler->defineBounds (volume->GetLogicalVolume ()
00439 ->GetSolid ()->GetExtent ());
00440
00441 for (unsigned i = 0; i < twig->paths (); ++i)
00442 {
00443 bool replica = false;
00444 G4VPhysicalVolume *pv = volume;
00445 G4LogicalVolume *lv = 0;
00446 G4VSolid *solid = 0;
00447 G4Transform3D pos;
00448
00449 VisG4VolumePicker::apply (twig->path (i), pv, lv, solid, pos, replica);
00450
00451 ASSERT (solid);
00452 ASSERT (pv);
00453 ASSERT (lv);
00454
00455
00456 VisSoMaterialDetails details;
00457 details << VisG4MaterialDetails (lv->GetMaterial ());
00458 details << VisG4PVDetails (pv);
00459 details << VisG4PathDetails (twig->fullName ());
00460
00461
00462 if (VisG4VolumeTwig::m_visualizationFilter
00463 && ! VisG4VolumeTwig::m_visualizationFilter->compute (details))
00464 continue;
00465
00466 SoSeparator *sep = new SoSeparator;
00467 rep->node ()->addChild (sep);
00468
00469
00470 handler->beginObject (sep, replica ? 0 : pv);
00471
00472
00473 handler->addTransform (pos);
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485 handler->addStyle (lv->GetVisAttributes ());
00486
00487
00488 handler->addMaterial (VisG4VolumeTwig::m_materialFilter->getSoMaterial (details, 0));
00489
00490
00491 solid->DescribeYourselfTo (*handler);
00492
00493
00494 handler->endObject ();
00495 }
00496 }
00497
00498 void
00499 drawVolumeTwig (VisG4VolumeTwig *twig, IgRZRep *rep)
00500 {
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513 rep->clear ();
00514
00515
00516 VisG4VolumeTwig *root = twig;
00517 while (VisG4VolumeTwig *x = dynamic_cast<VisG4VolumeTwig *> (root->parent()))
00518 root = x;
00519
00520 VisG4VisSceneHandler *handler = VisG4VisSceneHandler::instance ();
00521 G4VPhysicalVolume *volume = root->volume ();
00522
00523 ASSERT (handler);
00524 ASSERT (volume);
00525 ASSERT (root);
00526
00527
00528
00529
00530
00531
00532 handler->defineBounds (volume->GetLogicalVolume ()
00533 ->GetSolid ()->GetExtent ());
00534
00535 for (unsigned i = 0; i < twig->paths (); ++i)
00536 {
00537 bool replica = false;
00538 G4VPhysicalVolume *pv = volume;
00539 G4LogicalVolume *lv = 0;
00540 G4VSolid *solid = 0;
00541 G4Transform3D pos;
00542
00543 VisG4VolumePicker::apply (twig->path (i), pv, lv, solid, pos, replica);
00544
00545 ASSERT (solid);
00546 ASSERT (pv);
00547 ASSERT (lv);
00548
00549
00550 VisSoMaterialDetails details;
00551 details << VisG4MaterialDetails (lv->GetMaterial ());
00552 details << VisG4PVDetails (pv);
00553 details << VisG4PathDetails (twig->fullName ());
00554
00555
00556 if (VisG4VolumeTwig::m_visualizationFilter
00557 && ! VisG4VolumeTwig::m_visualizationFilter->compute (details))
00558 continue;
00559
00560 SoSeparator *sep = new SoSeparator;
00561 rep->node ()->addChild (sep);
00562
00563
00564 handler->beginObject (sep, replica ? 0 : pv);
00565
00566
00567 handler->addTransform (pos);
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579 handler->addStyle (lv->GetVisAttributes ());
00580
00581
00582 handler->addMaterial (VisG4VolumeTwig::m_materialFilter->getSoMaterial (details, 0));
00583
00584
00585 solid->DescribeYourselfTo (*handler);
00586
00587
00588 handler->endObject ();
00589 }
00590 }
00591
00592 MMM_DEFUN_FUNC(void,IgBrowserMethods::,doUpdate,
00593 (VisG4VolumeTwig *twig, Ig3DRep *rep, unsigned mask))
00594 {
00595
00596 mmm_doUpdate ((IgTwig *) twig, rep, mask);
00597
00598
00599
00600
00601
00602 if (twig->visible () &&
00603 (((mask & IgTwig::FLAGS_MASK)
00604 && rep->node ()->getNumChildren () == 0)
00605 || (mask & IgTwig::SELF_MASK)))
00606 drawVolumeTwig (twig, rep);
00607 }
00608
00609 MMM_DEFUN_FUNC(void,IgBrowserMethods::,doUpdate,
00610 (VisG4VolumeTwig *twig, IgRPhiRep *rep, unsigned mask))
00611 {
00612
00613 mmm_doUpdate ((IgTwig *) twig, rep, mask);
00614
00615
00616
00617
00618
00619 if (twig->visible () &&
00620 (((mask & IgTwig::FLAGS_MASK)
00621 && rep->node ()->getNumChildren () == 0)
00622 || (mask & IgTwig::SELF_MASK)))
00623 drawVolumeTwig (twig, rep);
00624 }
00625
00626 MMM_DEFUN_FUNC(void,IgBrowserMethods::,doUpdate,
00627 (VisG4VolumeTwig *twig, IgRZRep *rep, unsigned mask))
00628 {
00629
00630 mmm_doUpdate ((IgTwig *) twig, rep, mask);
00631
00632
00633
00634
00635
00636 if (twig->visible () &&
00637 (((mask & IgTwig::FLAGS_MASK)
00638 && rep->node ()->getNumChildren () == 0)
00639 || (mask & IgTwig::SELF_MASK)))
00640 drawVolumeTwig (twig, rep);
00641 }
00642
00643 MMM_DEFUN_FUNC(void,IgBrowserMethods::,doUpdate,
00644 (VisG4VolumeTwig *twig, IgTextRep *rep, unsigned))
00645 {
00646
00647
00648 G4LogicalVolume *lv = twig->volume ()->GetLogicalVolume ();
00649 G4VSolid *solid = lv->GetSolid ();
00650 G4Material *material = lv->GetMaterial ();
00651 G4RotationMatrix *r = twig->volume ()->GetRotation ();
00652 G4ThreeVector t = twig->volume ()->GetTranslation ();
00653
00654 std::ostringstream text;
00655
00656 text << "<table width='100%'><tr><td>Name</td><td>"
00657 << lv->GetName ()
00658 << "</td><tr><td>Copy #</td><td>"
00659 << twig->volume ()->GetCopyNo ()
00660 << "</td><tr><td>Replicated</td><td>"
00661 << (twig->volume ()->IsReplicated () ? "Yes" : "No")
00662
00663
00664 << "</td><tr><td>Position</td><td>"
00665 << "(" << t.x () << ", " << t.y () << ", " << t.z () << ")"
00666 << "</td><tr><td>Rotation</td><td>";
00667
00668 if (r)
00669 r->print (text);
00670 else
00671 text << "(None)";
00672
00673 text << "</td><tr><td>Material</td><td>"
00674 << (material ? material->GetName () : G4String ("(None)"))
00675 << "</td></tr><tr><td>Density</td><td>"
00676 << (material ? material->GetDensity () / g*cm*cm*cm : 0.)
00677 << "</td></tr><tr><td>Sensitive</td><td>"
00678 << (lv->GetSensitiveDetector ()
00679 ? lv->GetSensitiveDetector ()->GetFullPathName ()
00680 : G4String ("(not sensitive)"))
00681 << "</td></tr><tr><td>Solid Type</td><td>"
00682 << solid->GetEntityType ()
00683 << "</td></tr><tr><td>Solid Name</td><td>"
00684 << solid->GetName ()
00685 << "</td></tr><tr><td>Solid Parameters</td><td> </td></tr>";
00686
00687
00688
00689 if (G4Box *box = dynamic_cast<G4Box *> (solid))
00690 text << "<tr><td> x/2</td><td>"
00691 << box->GetXHalfLength () << "</td></tr>"
00692 << "<tr><td> y/2</td><td>"
00693 << box->GetYHalfLength () << "</td></tr>"
00694 << "<tr><td> z/2</td><td>"
00695 << box->GetZHalfLength () << "</td></tr>";
00696 else if (G4Cons *cons = dynamic_cast<G4Cons *> (solid))
00697 text << "<tr><td> z/2</td><td>"
00698 << cons->GetZHalfLength () << "</td></tr>"
00699 << "<tr><td> rInZ-</td><td>"
00700 << cons->GetInnerRadiusMinusZ () << "</td></tr>"
00701 << "<tr><td> rInZ+</td><td>"
00702 << cons->GetInnerRadiusPlusZ () << "</td></tr>"
00703 << "<tr><td> rOutZ-</td><td>"
00704 << cons->GetOuterRadiusMinusZ () << "</td></tr>"
00705 << "<tr><td> rOutZ+</td><td>"
00706 << cons->GetOuterRadiusPlusZ () << "</td></tr>"
00707 << "<tr><td> startPhi</td><td>"
00708 << cons->GetStartPhiAngle () << "</td></tr>"
00709 << "<tr><td> deltaPhi</td><td>"
00710 << cons->GetDeltaPhiAngle () << "</td></tr>";
00711 else if (G4Polycone *pcon = dynamic_cast<G4Polycone *> (solid))
00712 {
00713 int nr = pcon->GetNumRZCorner();
00714 text << "<tr><td> startPhi</td><td>"
00715 << pcon->GetStartPhi () << "</td></tr>"
00716 << "<tr><td> endPhi</td><td>"
00717 << pcon->GetEndPhi () << "</td></tr>"
00718 << "<tr><td> nrRZ</td><td>"
00719 << nr << "</td></tr>";
00720
00721 for (int i = 0; i < nr; ++i)
00722 text << "<tr><td> z" << i << "</td><td>"
00723 << pcon->GetCorner (i).z << "</td></tr>"
00724 << "<tr><td> r" << i << "</td><td>"
00725 << pcon->GetCorner (i).r << "</td></tr>";
00726 }
00727 else if (G4Polyhedra *phed = dynamic_cast<G4Polyhedra *> (solid))
00728 {
00729 int nr = phed->GetNumRZCorner();
00730 text << "<tr><td> startPhi</td><td>"
00731 << phed->GetStartPhi () << "</td></tr>"
00732 << "<tr><td> endPhi</td><td>"
00733 << phed->GetEndPhi () << "</td></tr>"
00734 << "<tr><td> sides</td><td>"
00735 << phed->GetNumSide () << "</td></tr>"
00736 << "<tr><td> nrRZ</td><td>"
00737 << nr << "</td></tr>";
00738
00739 for (int i = 0; i < nr; ++i)
00740 text << "<tr><td> z" << i << "</td><td>"
00741 << phed->GetCorner (i).z << "</td></tr>"
00742 << "<tr><td> r" << i << "</td><td>"
00743 << phed->GetCorner (i).r << "</td></tr>";
00744 }
00745 else if (G4Torus *torus = dynamic_cast<G4Torus *> (solid))
00746 text << "<tr><td> R min</td><td>"
00747 << torus->GetRmin () << "</td></tr>"
00748 << "<tr><td> R max</td><td>"
00749 << torus->GetRmax () << "</td></tr>"
00750 << "<tr><td> R tor</td><td>"
00751 << torus->GetRtor () << "</td></tr>"
00752 << "<tr><td> start Phi (radians)</td><td>"
00753 << torus->GetSPhi () << "</td></tr>"
00754 << "<tr><td> Delta angle of the segment (radians)</td><td>"
00755 << torus->GetDPhi () << "</td></tr>";
00756 else if (G4Trap *trap = dynamic_cast<G4Trap *> (solid))
00757 text << "<tr><td> z/2</td><td>"
00758 << trap->GetZHalfLength () << "</td></tr>"
00759 << "<tr><td> x1/2</td><td>"
00760 << trap->GetXHalfLength1 () << "</td></tr>"
00761 << "<tr><td> x2/2</td><td>"
00762 << trap->GetXHalfLength2 () << "</td></tr>"
00763 << "<tr><td> y1/2</td><td>"
00764 << trap->GetYHalfLength1 () << "</td></tr>"
00765 << "<tr><td> tanAlpha_1</td><td>"
00766 << trap->GetTanAlpha1 () << "</td></tr>"
00767 << "<tr><td> x3/2</td><td>"
00768 << trap->GetXHalfLength3 () << "</td></tr>"
00769 << "<tr><td> x4/2</td><td>"
00770 << trap->GetXHalfLength4 () << "</td></tr>"
00771 << "<tr><td> y2/2</td><td>"
00772 << trap->GetYHalfLength2 () << "</td></tr>"
00773 << "<tr><td> tanAlpha_2</td><td>"
00774 << trap->GetTanAlpha2 () << "</td></tr>";
00775 else if (G4Trd *trd = dynamic_cast<G4Trd *> (solid))
00776 text << "<tr><td> z/2</td><td>"
00777 << trd->GetZHalfLength () << "</td></tr>"
00778
00779 << "<tr><td> x1/2</td><td>"
00780 << trd->GetXHalfLength1 () << "</td></tr>"
00781 << "<tr><td> x2/2</td><td>"
00782 << trd->GetXHalfLength2 () << "</td></tr>"
00783 << "<tr><td> y1/2</td><td>"
00784 << trd->GetYHalfLength1 () << "</td></tr>"
00785 << "<tr><td> y2/2</td><td>"
00786 << trd->GetYHalfLength2 () << "</td></tr>";
00787 else if (G4Tubs *tubs = dynamic_cast<G4Tubs *> (solid))
00788 text << "<tr><td> z/2</td><td>"
00789 << tubs->GetZHalfLength () << "</td></tr>"
00790 << "<tr><td> rIn</td><td>"
00791 << tubs->GetInnerRadius () << "</td></tr>"
00792 << "<tr><td> rOut</td><td>"
00793 << tubs->GetOuterRadius () << "</td></tr>"
00794 << "<tr><td> startPhi</td><td>"
00795 << tubs->GetStartPhiAngle () << "</td></tr>"
00796 << "<tr><td> deltaPhi</td><td>"
00797 << tubs->GetDeltaPhiAngle () << "</td></tr>";
00798 else
00799 text << "<tr><td> (not known)</td><td> </td></tr>";
00800
00801 text << "</table>";
00802
00803 rep->setText (text.str ());
00804 }