Geant4  10.02.p01
DetectorMessenger.cc
Go to the documentation of this file.
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 // This example is provided by the Geant4-DNA collaboration
27 // Any report or published results obtained using the Geant4-DNA software
28 // shall cite the following Geant4-DNA collaboration publication:
29 // Med. Phys. 37 (2010) 4692-4708
30 // Delage et al. PDB4DNA: implementation of DNA geometry from the Protein Data
31 // Bank (PDB) description for Geant4-DNA Monte-Carlo
32 // simulations (submitted to Comput. Phys. Commun.)
33 // The Geant4-DNA web site is available at http://geant4-dna.org
34 //
35 // $Id$
36 //
39 
40 #include "DetectorMessenger.hh"
41 #include "DetectorConstruction.hh"
42 
43 #include "G4UIdirectory.hh"
44 #include "G4UIcmdWithAString.hh"
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48 
50 : G4UImessenger(),
51  fpDetectorConstruction(Det)
52 {
53  fpDirectory = new G4UIdirectory("/PDB4DNA/");
54  fpDirectory->SetGuidance("UI commands of this example");
55 
56  fpDetDirectory = new G4UIdirectory("/PDB4DNA/det/");
57  fpDetDirectory->SetGuidance("Detector construction control");
58 
59  fpLoadPdbCmd = new G4UIcmdWithAString("/PDB4DNA/det/loadPDB",this);
60  fpLoadPdbCmd->SetGuidance("Load PDB file");
61  fpLoadPdbCmd->SetParameterName("filename",false);
63 
64  fpDrawAtoms = new G4UIcmdWithoutParameter("/PDB4DNA/det/drawAtoms",this);
65  fpDrawAtoms->SetGuidance("Draw atoms");
67 
69  "/PDB4DNA/det/drawNucleotides",
70  this);
71  fpDrawNucleotides->SetGuidance("Draw nucleotides with bounding sphere");
73 
75  "/PDB4DNA/det/drawResidues",
76  this);
77  fpDrawResidues->SetGuidance("Draw residues inside nucleotides with sphere "
78  "linked by cylinders");
80 
82  "/PDB4DNA/det/buildBoundingV",
83  this);
84  fpBuildBoundingV->SetGuidance("Build molecule bounding volume");
86 
88  "/PDB4DNA/det/drawAtomsWithBounding",
89  this);
90  fpDrawAtomsWithBounding->SetGuidance("Draw atoms with bounding volume");
92 
94  "/PDB4DNA/det/drawNucleotidesWithBounding",
95  this);
97  "Draw nucleotides with bounding sphere and bounding volume");
99  G4State_Idle);
100 
102  "/PDB4DNA/det/drawResiduesWithBounding",
103  this);
104  fpDrawResiduesWithBounding->SetGuidance("Draw residues inside nucleotides"
105  " with sphere linked by cylinders and with bounding volume");
108 }
109 
110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
111 
113 {
114  delete fpLoadPdbCmd;
115  delete fpDrawAtoms;
116  delete fpDrawNucleotides;
117  delete fpDrawResidues;
118  delete fpBuildBoundingV;
122 
123  delete fpDetDirectory;
124  delete fpDirectory;
125 }
126 
127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
128 
130 {
131  if( command == fpLoadPdbCmd )
132  {
134  }
135  if( command == fpDrawAtoms )
136  {
138  }
139  if( command == fpDrawNucleotides )
140  {
142  }
143  if( command == fpDrawResidues )
144  {
146  }
147  if( command == fpBuildBoundingV )
148  {
150  }
151  if( command == fpDrawAtomsWithBounding )
152  {
154  }
155  if( command == fpDrawNucleotidesWithBounding )
156  {
158  }
159  if( command == fpDrawResiduesWithBounding )
160  {
162  }
163 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetNewValue(G4UIcommand *, G4String)
G4UIdirectory * fpDetDirectory
DetectorConstruction * fpDetectorConstruction
G4UIcmdWithoutParameter * fpDrawNucleotides
G4UIcmdWithoutParameter * fpDrawAtoms
G4UIcmdWithoutParameter * fpDrawResidues
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4UIcmdWithoutParameter * fpBuildBoundingV
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
G4UIcmdWithAString * fpLoadPdbCmd
G4UIcmdWithoutParameter * fpDrawResiduesWithBounding
G4UIcmdWithoutParameter * fpDrawNucleotidesWithBounding
void LoadPDBfile(G4String fileName)
DetectorMessenger(DetectorConstruction *)
Detector construction class to demonstrate various ways of placement.
G4UIdirectory * fpDirectory
G4UIcmdWithoutParameter * fpDrawAtomsWithBounding