34#ifdef G4VIS_BUILD_VRML_DRIVER
49G4VRML2Viewer::G4VRML2Viewer(G4VRML2SceneHandler& sceneHandler,
const G4String& name) :
51 sceneHandler.IncrementViewCount(),
53 fSceneHandler(sceneHandler),
54 fDest(sceneHandler.fDest)
56 fViewHalfAngle = 0.5 * 0.785398 ;
57 fsin_VHA = std::sin ( fViewHalfAngle ) ;
60G4VRML2Viewer::~G4VRML2Viewer()
63void G4VRML2Viewer::SetView()
65#if defined DEBUG_FR_VIEW
67 G4cout <<
"***** G4VRML2Viewer::SetView(): No effects" <<
G4endl;
76void G4VRML2Viewer::DrawView()
78#if defined DEBUG_FR_VIEW
82 fSceneHandler.VRMLBeginModeling() ;
93void G4VRML2Viewer::ClearView(
void)
95#if defined DEBUG_FR_VIEW
97 G4cout <<
"***** G4VRML2Viewer::ClearView(): No effects" <<
G4endl;
101void G4VRML2Viewer::ShowView(
void)
103#if defined DEBUG_FR_VIEW
107 fSceneHandler.VRMLEndModeling();
110void G4VRML2Viewer::FinishView(
void)
112#if defined DEBUG_FR_VIEW
114 G4cout <<
"***** G4VRML2Viewer::FinishView(): No effects" <<
G4endl;
118void G4VRML2Viewer::SendViewParameters ()
124#if defined DEBUG_FR_VIEW
126 G4cout <<
"***** G4VRML2Viewer::SendViewParameters()\n";
129 if ( fsin_VHA < 1.0e-6 ) { return ; }
132 G4double extent_radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
133 G4double camera_distance = extent_radius / fsin_VHA ;
137 = fSceneHandler.GetScene()->GetStandardTargetPoint()
138 + fVP.GetCurrentTargetPoint();
139 G4double E_z = target_point.
z() + camera_distance;
144 fDest <<
"#---------- CAMERA" <<
"\n";
145 fDest <<
"Viewpoint {" <<
"\n";
146 fDest <<
"\t" <<
"position " ;
147 fDest << E.x() <<
" " ;
148 fDest << E.y() <<
" " ;
149 fDest << E.z() <<
"\n" ;
150 fDest <<
"}" <<
"\n";
G4GLOB_DLL std::ostream G4cout
static Verbosity GetVerbosity()
const char * name(G4int ptype)