Geant4 Cross Reference |
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 // $Id: G4VTrajectoryModel.cc,v 1.3 2006/06/29 21:33:26 gunter Exp $ >> 27 // GEANT4 tag $Name: geant4-08-01-patch-01 $ 26 // 28 // 27 // Jane Tinslay May 2006 29 // Jane Tinslay May 2006 28 // 30 // 29 // See header for details 31 // See header for details 30 // 32 // 31 #include "G4VTrajectoryModel.hh" 33 #include "G4VTrajectoryModel.hh" 32 #include "G4VisTrajContext.hh" 34 #include "G4VisTrajContext.hh" 33 35 34 #include <assert.h> 36 #include <assert.h> 35 37 36 G4VTrajectoryModel::G4VTrajectoryModel(const G 38 G4VTrajectoryModel::G4VTrajectoryModel(const G4String& name, 37 G4VisTrajContext* context) 39 G4VisTrajContext* context) 38 :fName(name) 40 :fName(name) 39 ,fVerbose(false) 41 ,fVerbose(false) 40 ,fpContext(context) 42 ,fpContext(context) 41 { 43 { 42 // Create context object if none is provided 44 // Create context object if none is provided. Model will 43 // then use default G4VisTrajContext configu 45 // then use default G4VisTrajContext configuration 44 if (0 == fpContext) fpContext = new G4VisTra 46 if (0 == fpContext) fpContext = new G4VisTrajContext(); 45 } 47 } 46 48 47 G4VTrajectoryModel::~G4VTrajectoryModel() 49 G4VTrajectoryModel::~G4VTrajectoryModel() 48 { 50 { 49 delete fpContext; 51 delete fpContext; 50 } 52 } 51 53 52 const G4VisTrajContext& 54 const G4VisTrajContext& 53 G4VTrajectoryModel::GetContext() const 55 G4VTrajectoryModel::GetContext() const 54 { 56 { 55 // Expect context to exist 57 // Expect context to exist 56 assert (0 != fpContext); 58 assert (0 != fpContext); 57 return *fpContext; 59 return *fpContext; 58 } 60 } 59 61 60 G4String 62 G4String 61 G4VTrajectoryModel::Name() const 63 G4VTrajectoryModel::Name() const 62 { 64 { 63 return fName; 65 return fName; 64 } 66 } 65 67 66 void 68 void 67 G4VTrajectoryModel::SetVerbose(const G4bool& v 69 G4VTrajectoryModel::SetVerbose(const G4bool& verbose) 68 { 70 { 69 fVerbose = verbose; 71 fVerbose = verbose; 70 } 72 } 71 73 72 G4bool 74 G4bool 73 G4VTrajectoryModel::GetVerbose() const 75 G4VTrajectoryModel::GetVerbose() const 74 { 76 { 75 return fVerbose; 77 return fVerbose; 76 } 78 } 77 79