00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "G4VisManager.hh"
00035
00036 void G4VRML2SCENEHANDLER::AddSolid(const G4Trd& trd)
00037 {
00038 #if defined DEBUG_SCENE_FUNC
00039 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00040 G4cout << "***** AddSolid trd" << "\n" ;
00041 #endif
00042 VRMLBeginModeling () ;
00043 G4VSceneHandler::AddSolid(trd);
00044 }
00045
00046 void G4VRML2SCENEHANDLER::AddSolid(const G4Trap& trap)
00047 {
00048 #if defined DEBUG_SCENE_FUNC
00049 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00050 G4cout << "***** AddSolid trap" << "\n" ;
00051 #endif
00052 VRMLBeginModeling () ;
00053 G4VSceneHandler::AddSolid(trap);
00054 }
00055
00056 void G4VRML2SCENEHANDLER::AddSolid(const G4Para& para)
00057 {
00058 #if defined DEBUG_SCENE_FUNC
00059 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00060 G4cout << "***** AddSolid para" << "\n" ;
00061 #endif
00062 VRMLBeginModeling () ;
00063 G4VSceneHandler::AddSolid(para);
00064 }
00065
00066 void G4VRML2SCENEHANDLER::AddSolid(const G4Torus& torus )
00067 {
00068 #if defined DEBUG_SCENE_FUNC
00069 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00070 G4cout << "***** AddSolid torus" << "\n" ;
00071 #endif
00072 VRMLBeginModeling () ;
00073 G4VSceneHandler::AddSolid(torus);
00074 }
00075
00076
00077 void G4VRML2SCENEHANDLER::AddSolid(const G4VSolid& vsolid)
00078 {
00079 #if defined DEBUG_SCENE_FUNC
00080 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00081 G4cout << "***** AddSolid vsolid" << "\n" ;
00082 #endif
00083 VRMLBeginModeling () ;
00084 G4VSceneHandler::AddSolid(vsolid);
00085 }
00086
00087 void G4VRML2SCENEHANDLER::AddSolid(const G4Tubs& tubs)
00088 {
00089 #if defined DEBUG_SCENE_FUNC
00090 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00091 G4cout << "***** AddSolid tubs" << "\n" ;
00092 #endif
00093 VRMLBeginModeling () ;
00094 G4VSceneHandler::AddSolid(tubs) ;
00095
00096 }
00097
00098
00099 void G4VRML2SCENEHANDLER::AddSolid(const G4Cons& cons)
00100 {
00101 #if defined DEBUG_SCENE_FUNC
00102 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00103 G4cout << "***** AddSolid cons" << "\n" ;
00104 #endif
00105 VRMLBeginModeling () ;
00106 G4VSceneHandler::AddSolid(cons) ;
00107 }
00108
00109 void G4VRML2SCENEHANDLER::AddSolid(const G4Box& box)
00110 {
00111 #if defined DEBUG_SCENE_FUNC
00112 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00113 G4cout << "***** AddSolid box" << "\n" ;
00114 #endif
00115 VRMLBeginModeling () ;
00116 G4VSceneHandler::AddSolid(box) ;
00117 }
00118
00119
00120 void G4VRML2SCENEHANDLER::AddSolid(const G4Sphere& sphere)
00121 {
00122 #if defined DEBUG_SCENE_FUNC
00123 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00124 G4cout << "***** AddSolid sphere" << "\n" ;
00125 #endif
00126 VRMLBeginModeling () ;
00127 G4VSceneHandler::AddSolid(sphere) ;
00128 }
00129
00130 void G4VRML2SCENEHANDLER::AddPrimitive(const G4Polyline& polyline)
00131 {
00132 #if defined DEBUG_SCENE_FUNC
00133 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00134 G4cout << "***** AddPrimitive polyline" << "\n" ;
00135 #endif
00136
00137 if (fProcessing2D) {
00138 static G4bool warned = false;
00139 if (!warned) {
00140 warned = true;
00141 G4Exception
00142 ("G4VRML2SCENEHANDLER::AddPrimitive (const G4Polyline&)",
00143 "VRML-2001", JustWarning,
00144 "2D polylines not implemented. Ignored.");
00145 }
00146 return;
00147 }
00148
00149 VRMLBeginModeling () ;
00150
00151
00152
00153 fDest << "#---------- POLYLINE" << "\n";
00154 fDest << "Shape {" << "\n";
00155
00156 SendLineColor ( polyline.GetVisAttributes() );
00157
00158 fDest << "\t" << "geometry IndexedLineSet {" << "\n";
00159
00160 fDest << "\t\t" << "coord Coordinate {" << "\n";
00161 fDest << "\t\t\t" << "point [" << "\n";
00162 G4int e, i;
00163 for (i = 0, e = polyline.size(); e; i++, e--) {
00164
00165 G4Point3D point = polyline[i];
00166 point.transform( fObjectTransformation );
00167
00168 fDest << "\t\t\t\t";
00169 fDest << point.x() << " ";
00170 fDest << point.y() << " ";
00171 fDest << point.z() << "," << "\n";
00172
00173 }
00174
00175 fDest << "\t\t\t" << "]" << "\n";
00176 fDest << "\t\t" << "}" << "\n";
00177
00178 fDest << "\t\t" << "coordIndex [";
00179 for (i = 0, e = polyline.size(); e; i++, e--) {
00180 if (i % 10 == 0)
00181 fDest << "\n" << "\t\t\t";
00182 fDest << i << ", ";
00183 }
00184 fDest << "-1" << "\n";
00185 fDest << "\t\t" << "]" << "\n";
00186 fDest << "\t" << "}" << "\n";
00187
00188 fDest << "}" << "\n";
00189 }
00190
00191
00192 void G4VRML2SCENEHANDLER::AddPrimitive(const G4Polyhedron& polyhedron)
00193 {
00194 #if defined DEBUG_SCENE_FUNC
00195 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00196 G4cout << "***** AddPrimitive(G4Polyhedron)" << "\n";
00197 #endif
00198
00199 if (polyhedron.GetNoFacets() == 0) return;
00200
00201 if (fProcessing2D) {
00202 static G4bool warned = false;
00203 if (!warned) {
00204 warned = true;
00205 G4Exception
00206 ("G4VRML2SCENEHANDLER::AddPrimitive (const G4Polyhedron&)",
00207 "VRML-2002", JustWarning,
00208 "2D polyhedra not implemented. Ignored.");
00209 }
00210 return;
00211 }
00212
00213 VRMLBeginModeling () ;
00214
00215
00216 if ( GetPVTransparency() > 0.99 ) { return ; }
00217
00218
00219 const G4VModel* pv_model = GetModel();
00220 G4String pv_name = "No model";
00221 if (pv_model) pv_name = pv_model->GetCurrentTag() ;
00222
00223
00224
00225 fDest << "#---------- SOLID: " << pv_name << "\n";
00226
00227 if ( IsPVPickable() ) {
00228
00229 fDest << "Anchor {" << "\n";
00230 fDest << " description " << "\"" << pv_name << "\"" << "\n";
00231 fDest << " url \"\" " << "\n";
00232 fDest << " children [" << "\n";
00233 }
00234
00235 fDest << "\t"; fDest << "Shape {" << "\n";
00236
00237 SendMaterialNode();
00238
00239 fDest << "\t\t" << "geometry IndexedFaceSet {" << "\n";
00240
00241 fDest << "\t\t\t" << "coord Coordinate {" << "\n";
00242 fDest << "\t\t\t\t" << "point [" << "\n";
00243 G4int i, j;
00244 for (i = 1, j = polyhedron.GetNoVertices(); j; j--, i++) {
00245 G4Point3D point = polyhedron.GetVertex(i);
00246
00247 point.transform( fObjectTransformation );
00248
00249 fDest << "\t\t\t\t\t";
00250 fDest << point.x() << " ";
00251 fDest << point.y() << " ";
00252 fDest << point.z() << "," << "\n";
00253 }
00254 fDest << "\t\t\t\t" << "]" << "\n";
00255 fDest << "\t\t\t" << "}" << "\n";
00256
00257 fDest << "\t\t\t" << "coordIndex [" << "\n";
00258
00259
00260 G4int f;
00261 for (f = polyhedron.GetNoFacets(); f; f--) {
00262
00263
00264 G4bool notLastEdge;
00265 G4int index = -1, edgeFlag = 1;
00266 fDest << "\t\t\t\t";
00267 do {
00268 notLastEdge = polyhedron.GetNextVertexIndex(index, edgeFlag);
00269 fDest << index - 1 << ", ";
00270 } while (notLastEdge);
00271 fDest << "-1," << "\n";
00272 }
00273 fDest << "\t\t\t" << "]" << "\n";
00274
00275 fDest << "\t\t\t" << "solid FALSE" << "\n";
00276
00277 fDest << "\t\t" << "}" << "\n";
00278 fDest << "\t" << "}" << "\n";
00279
00280 if ( IsPVPickable() ) {
00281 fDest << " ]" << "\n";
00282 fDest << "}" << "\n";
00283 }
00284
00285 }
00286
00287
00288 void G4VRML2SCENEHANDLER::AddPrimitive(const G4NURBS&)
00289 {
00290 #if defined DEBUG_SCENE_FUNC
00291 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00292 G4cout << "***** AddPrimitive nurbs" << "\n" ;
00293 #endif
00294 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00295 G4cout << "G4VRML2File::AddPrimitive(G4NURBS&): not implemented. " << "\n" ;
00296
00297 VRMLBeginModeling () ;
00298 }
00299
00300 void G4VRML2SCENEHANDLER::AddPrimitive( const G4Text& )
00301 {
00302 #if defined DEBUG_SCENE_FUNC
00303 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00304 G4cout << "***** AddPrimitive text" << "\n" ;
00305 #endif
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00321 G4cout <<
00322 "***** void G4VRML2SCENEHANDLER::AddPrimitive( const G4Text& text )"
00323 " not implemented yet."
00324 << "\n";
00325
00326 VRMLBeginModeling () ;
00327
00328 }
00329
00330 void G4VRML2SCENEHANDLER::AddPrimitive( const G4Circle& circle )
00331 {
00332 #if defined DEBUG_SCENE_FUNC
00333 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00334 G4cout << "***** AddPrimitive circle" << "\n" ;
00335 #endif
00336
00337 if (fProcessing2D) {
00338 static G4bool warned = false;
00339 if (!warned) {
00340 warned = true;
00341 G4Exception
00342 ("G4VRML2SCENEHANDLER::AddPrimitive (const G4Circle&)",
00343 "VRML-2004", JustWarning,
00344 "2D circles not implemented. Ignored.");
00345 }
00346 return;
00347 }
00348
00349 VRMLBeginModeling () ;
00350
00351
00352
00353 const char* info = circle.GetInfo() ;
00354
00355
00356 G4double X, Y, Z ; GetMarkerWorldPosition( circle, &X, &Y, &Z ) ;
00357 G4double radius = GetMarkerHalfSize ( circle );
00358
00359
00360 fDest << "#---------- 3D MARKER (Circle)" << "\n";
00361 fDest << "Anchor {" << "\n";
00362
00363 if( circle.GetInfo().isNull() ) {
00364 fDest << " description " << "\"(" << X << " " ;
00365 fDest << Y << " " ;
00366 fDest << Z << ")\"" << "\n";
00367 } else {
00368 fDest << " description " << "\"" << info << "\"" << "\n";
00369 }
00370
00371
00372 fDest << " url \"\" " << "\n";
00373
00374 fDest << " children [" << "\n";
00375
00376 fDest << " Transform {" << "\n";
00377
00378 fDest << " translation ";
00379 fDest << X << " " << Y << " " << Z << "\n";
00380
00381 fDest << " children [" << "\n";
00382
00383 fDest << "\t" << "Shape {" << "\n";
00384
00385 SendMarkerColor( circle );
00386
00387
00388 fDest << "\t\t" << "geometry Sphere {" << "\n";
00389 fDest << "\t\t\t" << "radius " << radius << "\n";
00390 fDest << "\t\t" << "}" << "\n";
00391
00392 fDest << "\t" << "}" << "\n";
00393
00394 fDest << " ]" << "\n";
00395 fDest << " }" << "\n";
00396
00397 fDest << " ]" << "\n";
00398 fDest << "}" << "\n";
00399
00400 }
00401
00402 void G4VRML2SCENEHANDLER::AddPrimitive(const G4Square& square)
00403 {
00404 #if defined DEBUG_SCENE_FUNC
00405 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00406 G4cout << "***** AddPrimitive square" << "\n" ;
00407 #endif
00408
00409 if (fProcessing2D) {
00410 static G4bool warned = false;
00411 if (!warned) {
00412 warned = true;
00413 G4Exception
00414 ("G4VRML2SCENEHANDLER::AddPrimitive (const G4Square&)",
00415 "VRML-2005", JustWarning,
00416 "2D squares not implemented. Ignored.");
00417 }
00418 return;
00419 }
00420
00421 VRMLBeginModeling () ;
00422
00423
00424
00425 const char* info = square.GetInfo() ;
00426
00427
00428 G4double X, Y, Z ; GetMarkerWorldPosition ( square, &X, &Y, &Z ) ;
00429 G4double radius = GetMarkerHalfSize ( square );
00430 G4double diameter = 2.0 * radius ;
00431
00432
00433 fDest << "#---------- 3D MARKER (Square)" << "\n";
00434 fDest << "Anchor {" << "\n";
00435
00436 if( square.GetInfo().isNull() ) {
00437 fDest << " description " << "\"(" << X << " " ;
00438 fDest << Y << " " ;
00439 fDest << Z << ")\"" << "\n";
00440 } else {
00441 fDest << " description " << "\"" << info << "\"" << "\n";
00442 }
00443
00444 fDest << " url \"\" " << "\n";
00445
00446 fDest << " children [" << "\n";
00447
00448 fDest << " Transform {" << "\n";
00449
00450 fDest << " translation ";
00451 fDest << X << " " << Y << " " << Z << "\n";
00452
00453 fDest << " children [" << "\n";
00454
00455 fDest << "\t" << "Shape {" << "\n";
00456
00457 SendMarkerColor( square );
00458
00459
00460 fDest << "\t\t" << "geometry Box {" << "\n";
00461 fDest << "\t\t\t" << "size " << diameter << " " ;
00462 fDest << diameter << " " ;
00463 fDest << diameter << "\n" ;
00464 fDest << "\t\t" << "}" << "\n";
00465
00466 fDest << "\t" << "}" << "\n";
00467
00468 fDest << " ]" << "\n";
00469 fDest << " }" << "\n";
00470
00471 fDest << " ]" << "\n";
00472 fDest << "}" << "\n";
00473
00474 }
00475
00476 void G4VRML2SCENEHANDLER::BeginModeling()
00477 {
00478 #if defined DEBUG_SCENE_FUNC
00479 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00480 G4cout << "***** BeginModeling" << "\n" ;
00481 #endif
00482 G4VSceneHandler::BeginModeling();
00483
00484 }
00485
00486 void G4VRML2SCENEHANDLER::EndModeling()
00487 {
00488 #if defined DEBUG_SCENE_FUNC
00489 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00490 G4cout << "***** EndModeling " << "\n" ;
00491 #endif
00492 G4VSceneHandler::EndModeling();
00493 }
00494
00495 void G4VRML2SCENEHANDLER::BeginPrimitives(const G4Transform3D& objectTransformation)
00496 {
00497 G4VSceneHandler::BeginPrimitives (objectTransformation);
00498 #if defined DEBUG_SCENE_FUNC
00499 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00500 G4cout << "***** BeginPrimitives " << "\n" ;
00501 #endif
00502 VRMLBeginModeling();
00503 }
00504
00505 void G4VRML2SCENEHANDLER::EndPrimitives()
00506 {
00507 #if defined DEBUG_SCENE_FUNC
00508 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00509 G4cout << "***** EndPrimitives " << "\n" ;
00510 #endif
00511 G4VSceneHandler::EndPrimitives();
00512 }
00513
00514 void G4VRML2SCENEHANDLER::SendMaterialNode( const G4VisAttributes* pVA )
00515 {
00516
00517 G4bool flagWF = false ;
00518 G4double TRANSPARENCY = GetPVTransparency() ;
00519
00520
00521 const G4ViewParameters& cur_view_param = fpViewer -> GetViewParameters ();
00522 if (pVA->IsForceDrawingStyle() &&
00523 (pVA->GetForcedDrawingStyle() == G4VisAttributes::wireframe))
00524 {
00525
00526 flagWF = true ;
00527
00528 } else if ( cur_view_param.GetDrawingStyle() == G4ViewParameters::wireframe )
00529 {
00530
00531 flagWF = true ;
00532 }
00533
00534
00535 if (!pVA) {
00536
00537
00538 fDest << "\t\t" ;
00539 fDest << "appearance Appearance { material Material {} }";
00540 fDest << "\n";
00541
00542 } else {
00543
00544 const G4Color& color = pVA->GetColor();
00545
00546 fDest << "\t\t" << "appearance Appearance {" << "\n";
00547 fDest << "\t\t\t" << "material Material {" << "\n";
00548
00549
00550 fDest << "\t\t\t\t" << "diffuseColor ";
00551 fDest << color.GetRed() << " " ;
00552 fDest << color.GetGreen() << " " ;
00553 fDest << color.GetBlue() << "\n";
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563 if ( flagWF )
00564 {
00565 fDest << "\t\t\t\t" << "transparency " << TRANSPARENCY << "\n";
00566 }
00567
00568 fDest << "\t\t\t" << "}" << "\n";
00569 fDest << "\t\t" << "}" << "\n";
00570 }
00571
00572 }
00573
00574
00575 void G4VRML2SCENEHANDLER::SendMaterialNode()
00576 {
00577 SendMaterialNode
00578 ( fpViewer->GetApplicableVisAttributes (fpVisAttribs) );
00579 }
00580
00581
00582 void G4VRML2SCENEHANDLER::VRMLBeginModeling()
00583 {
00584 if (!IS_CONNECTED ) {
00585 #if defined DEBUG_SCENE_FUNC
00586 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00587 G4cout << "***** VRMLBeginModeling (started)" << "\n" ;
00588 #endif
00589 this->connectPort();
00590 fDest << "#VRML V2.0 utf8" << "\n";
00591 fDest << "# Generated by VRML 2.0 driver of GEANT4\n" << "\n";
00592 }
00593 }
00594
00595 void G4VRML2SCENEHANDLER::VRMLEndModeling()
00596 {
00597 if ( IS_CONNECTED ) {
00598 #if defined DEBUG_SCENE_FUNC
00599 if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00600 G4cout << "***** VRMLEndModeling (started)" << "\n" ;
00601 #endif
00602 fDest << "#End of file." << "\n";
00603 this->closePort();
00604 }
00605 }
00606
00607 void G4VRML2SCENEHANDLER::SendMarkerColor ( const G4VMarker& mark )
00608 {
00609 const G4Color& color = GetColor( mark );
00610
00611 fDest << "\t\t" << "appearance Appearance {" << "\n";
00612 fDest << "\t\t\t" << "material Material {" << "\n";
00613 fDest << "\t\t\t\t" << "diffuseColor ";
00614 fDest << color.GetRed() << " " ;
00615 fDest << color.GetGreen() << " " ;
00616 fDest << color.GetBlue() << "\n";
00617 fDest << "\t\t\t\t" << "emissiveColor ";
00618 fDest << color.GetRed() << " " ;
00619 fDest << color.GetGreen() << " " ;
00620 fDest << color.GetBlue() << "\n";
00621 fDest << "\t\t\t" << "}" << "\n";
00622 fDest << "\t\t" << "}" << "\n";
00623
00624 }
00625
00626 void
00627 G4VRML2SCENEHANDLER::SendMarkerWorldPosition ( const G4VMarker& mark )
00628 {
00629 G4Point3D point = mark.GetPosition();
00630
00631 point.transform( fObjectTransformation );
00632
00633 fDest << " translation ";
00634 fDest << point.x() << " " << point.y() << " " << point.z() << "\n";
00635
00636 }
00637
00638 void G4VRML2SCENEHANDLER::GetMarkerWorldPosition ( const G4VMarker& mark ,
00639 double* pX ,
00640 double* pY ,
00641 double* pZ )
00642 {
00643 G4Point3D point = mark.GetPosition();
00644
00645 point.transform( fObjectTransformation );
00646
00647 *pX = point.x() ;
00648 *pY = point.y() ;
00649 *pZ = point.z() ;
00650 }
00651
00652 G4double G4VRML2SCENEHANDLER::GetMarkerHalfSize ( const G4VMarker& mark )
00653 {
00654
00655 G4double size = 1.0 ;
00656
00657
00658 const double HALF_SCREEN_SIZE_2D = 300.0 ;
00659 double zoom_factor = fpViewer->GetViewParameters().GetZoomFactor() ;
00660 if ( zoom_factor <= 0.0 ) { zoom_factor = 1.0 ; }
00661 double extent_radius_3d = GetScene()->GetExtent().GetExtentRadius() ;
00662 if ( extent_radius_3d <= 0.0 ) { extent_radius_3d = 1.0 ; }
00663
00664
00665 if ( mark.GetWorldSize() > 0.0 ) {
00666
00667
00668 size = 0.5 * mark.GetWorldSize() ;
00669
00670 } else if ( mark.GetScreenSize() > 0.0 ) {
00671
00672
00673 double mark_radius_2d = 0.5 * mark.GetScreenSize() ;
00674
00675
00676 size \
00677 = extent_radius_3d * ( mark_radius_2d / HALF_SCREEN_SIZE_2D );
00678 size *= zoom_factor ;
00679
00680 } else {
00681
00682 double mark_radius_2d \
00683 = fpViewer->GetViewParameters().GetDefaultMarker().GetScreenSize();
00684 mark_radius_2d *= 0.1 ;
00685
00686
00687 size \
00688 = extent_radius_3d * ( mark_radius_2d / HALF_SCREEN_SIZE_2D );
00689 size *= zoom_factor ;
00690 }
00691
00692
00693 size *= fpViewer->GetViewParameters().GetGlobalMarkerScale();
00694
00695
00696 return size ;
00697
00698 }
00699
00700 void G4VRML2SCENEHANDLER::SendLineColor ( const G4VisAttributes* pVA )
00701 {
00702 const G4Color& color = pVA->GetColor();
00703
00704
00705 fDest << "\t" << "appearance Appearance {" << "\n";
00706 fDest << "\t\t" << "material Material {" << "\n";
00707 fDest << "\t\t\t" << "diffuseColor ";
00708 fDest << color.GetRed() << " " ;
00709 fDest << color.GetGreen() << " " ;
00710 fDest << color.GetBlue() << "\n";
00711 fDest << "\t\t\t" << "emissiveColor ";
00712 fDest << color.GetRed() << " " ;
00713 fDest << color.GetGreen() << " " ;
00714 fDest << color.GetBlue() << "\n";
00715 fDest << "\t\t" << "}" << "\n";
00716 fDest << "\t" << "}" << "\n";
00717 }
00718
00719 G4double G4VRML2SCENEHANDLER::SetPVTransparency ()
00720 {
00721
00722 G4double TRANSPARENCY = 0.7 ;
00723
00724 if( getenv( "G4VRML_TRANSPARENCY" ) != NULL ) {
00725
00726
00727 sscanf( getenv("G4VRML_TRANSPARENCY"), "%lg", &TRANSPARENCY ) ;
00728
00729
00730 TRANSPARENCY = std::fabs ( TRANSPARENCY ) ;
00731 if ( TRANSPARENCY > 1.0 ) { TRANSPARENCY = 1.0 ; }
00732 }
00733
00734 fPVTransparency = TRANSPARENCY ;
00735
00736 return fPVTransparency ;
00737 }
00738
00739
00740 void G4VRML2SCENEHANDLER::ClearTransientStore()
00741 {
00742
00743
00744
00745 if (fpViewer) {
00746 fpViewer -> SetView ();
00747 fpViewer -> ClearView ();
00748 fpViewer -> DrawView ();
00749 }
00750 }
00751
00752
00753