| 3043 | } |
| 3044 | |
| 3045 | void G4VisCommandSceneAddUserAction::AddVisAction |
| 3046 | (const G4String& name, |
| 3047 | G4VUserVisAction* visAction, |
| 3048 | G4Scene* pScene, |
| 3049 | G4VisCommandSceneAddUserAction::ActionType type, |
| 3050 | G4VisManager::Verbosity verbosity) |
| 3051 | { |
| 3052 | G4bool warn = verbosity >= G4VisManager::warnings; |
| 3053 | |
| 3054 | const std::map<G4VUserVisAction*,G4VisExtent>& visExtentMap = |
| 3055 | fpVisManager->GetUserVisActionExtents(); |
| 3056 | G4VisExtent extent; |
| 3057 | std::map<G4VUserVisAction*,G4VisExtent>::const_iterator i = |
| 3058 | visExtentMap.find(visAction); |
| 3059 | if (i != visExtentMap.end()) extent = i->second; |
| 3060 | if (warn) { |
| 3061 | if (extent.GetExtentRadius() <= 0.) { |
| 3062 | G4warn |
| 3063 | << "WARNING: User Vis Action \"" << name << "\" extent is null." |
| 3064 | << G4endl; |
| 3065 | } |
| 3066 | } |
| 3067 | |
| 3068 | G4VModel* model = new G4CallbackModel<G4VUserVisAction>(visAction); |
| 3069 | model->SetType("User Vis Action"); |
| 3070 | model->SetGlobalTag(name); |
| 3071 | model->SetGlobalDescription(name); |
| 3072 | model->SetExtent(extent); |
| 3073 | G4bool successful = false;; |
| 3074 | switch (type) { |
| 3075 | case runDuration: |
| 3076 | successful = pScene -> AddRunDurationModel (model, warn); |
| 3077 | break; |
| 3078 | case endOfEvent: |
| 3079 | successful = pScene -> AddEndOfEventModel (model, warn); |
| 3080 | break; |
| 3081 | case endOfRun: |
| 3082 | successful = pScene -> AddEndOfRunModel (model, warn); |
| 3083 | break; |
| 3084 | } |
| 3085 | if (successful) { |
| 3086 | if (verbosity >= G4VisManager::confirmations) { |
| 3087 | const G4String& currentSceneName = pScene -> GetName (); |
| 3088 | G4cout << "User Vis Action added to scene \"" |
| 3089 | << currentSceneName << "\""; |
| 3090 | if (verbosity >= G4VisManager::parameters) { |
| 3091 | G4cout << "\n with extent " << extent; |
| 3092 | } |
| 3093 | G4cout << G4endl; |
| 3094 | } |
| 3095 | } |
| 3096 | else G4VisCommandsSceneAddUnsuccessful(verbosity); |
| 3097 | } |
| 3098 | |
| 3099 | ////////////// /vis/scene/add/volume /////////////////////////////////////// |
| 3100 |
nothing calls this directly
no test coverage detected