[834] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4VRML1FileViewer.cc,v 1.11 2006/06/29 21:25:59 gunter Exp $ |
---|
[944] | 28 | // GEANT4 tag $Name: $ |
---|
[834] | 29 | // |
---|
| 30 | // G4VRMLView.cc |
---|
| 31 | // Satoshi Tanaka & Yasuhide Sawada |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | //#define DEBUG_FR_VIEW |
---|
| 35 | |
---|
| 36 | #include "G4Scene.hh" |
---|
| 37 | #include "G4VRML1FileViewer.hh" |
---|
| 38 | #include "G4VRML1FileSceneHandler.hh" |
---|
| 39 | #include "G4VRML1File.hh" |
---|
| 40 | #include "G4ios.hh" |
---|
| 41 | |
---|
| 42 | G4VRML1FileViewer::G4VRML1FileViewer(G4VRML1FileSceneHandler& sceneHandler, |
---|
| 43 | const G4String& name) : |
---|
| 44 | G4VViewer(sceneHandler, |
---|
| 45 | sceneHandler.IncrementViewCount(), |
---|
| 46 | name), |
---|
| 47 | fSceneHandler(sceneHandler) |
---|
| 48 | {} |
---|
| 49 | |
---|
| 50 | G4VRML1FileViewer::~G4VRML1FileViewer() |
---|
| 51 | {} |
---|
| 52 | |
---|
| 53 | void G4VRML1FileViewer::SetView() |
---|
| 54 | { |
---|
| 55 | #if defined DEBUG_FR_VIEW |
---|
| 56 | G4cerr << "***** G4VRML1FileViewer::SetView(): No effects" << G4endl; |
---|
| 57 | #endif |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | void G4VRML1FileViewer::DrawView() |
---|
| 61 | { |
---|
| 62 | #if defined DEBUG_FR_VIEW |
---|
| 63 | G4cerr << "***** G4VRML1FileViewer::DrawView()" << G4endl; |
---|
| 64 | #endif |
---|
| 65 | |
---|
| 66 | fSceneHandler.VRMLBeginModeling(); |
---|
| 67 | |
---|
| 68 | // Here is a minimal DrawView() function. |
---|
| 69 | NeedKernelVisit(); |
---|
| 70 | ProcessView(); |
---|
| 71 | FinishView(); |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | void G4VRML1FileViewer::ClearView(void) |
---|
| 75 | { |
---|
| 76 | //#if defined DEBUG_FR_VIEW |
---|
| 77 | G4cerr << "***** G4VRML1File1View::ClearView()" << G4endl; |
---|
| 78 | //#endif |
---|
| 79 | if(fSceneHandler.fFlagDestOpen) { |
---|
| 80 | fSceneHandler.fDest.close(); |
---|
| 81 | // Re-open with same filename... |
---|
| 82 | fSceneHandler.fDest.open(fSceneHandler.fVRMLFileName); |
---|
| 83 | fSceneHandler.fDest << "#VRML V1.0 ascii" << "\n"; |
---|
| 84 | fSceneHandler.fDest << "# Generated by VRML 1.0 driver of GEANT4\n" << "\n"; |
---|
| 85 | } |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | void G4VRML1FileViewer::ShowView(void) |
---|
| 89 | { |
---|
| 90 | #if defined DEBUG_FR_VIEW |
---|
| 91 | G4cerr << "***** G4VRML1FileViewer::ShowView()" << G4endl; |
---|
| 92 | #endif |
---|
| 93 | fSceneHandler.VRMLEndModeling(); |
---|
| 94 | } |
---|
| 95 | |
---|
| 96 | void G4VRML1FileViewer::FinishView(void) |
---|
| 97 | { |
---|
| 98 | #if defined DEBUG_FR_VIEW |
---|
| 99 | G4cerr << "***** G4VRML1FileViewer::FinishView(): No effects" << G4endl; |
---|
| 100 | #endif |
---|
| 101 | } |
---|