File indexing completed on 2026-10-02 09:05:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef G4VInteractiveSession_H
0029 #define G4VInteractiveSession_H 1
0030
0031 #include "G4VInteractorManager.hh"
0032
0033 #include <map>
0034
0035 class G4UImessenger;
0036 class G4SceneTreeItem;
0037
0038
0039
0040
0041
0042
0043
0044
0045 class G4VInteractiveSession
0046 {
0047 public:
0048 struct OutputStyle
0049 {
0050 G4bool fixed, bold, highlight;
0051 };
0052
0053 G4VInteractiveSession();
0054 virtual ~G4VInteractiveSession();
0055 virtual void AddMenu(const char*, const char*);
0056 virtual void AddButton(const char*, const char*, const char*);
0057 virtual void AddIcon(const char*, const char*, const char*, const char*);
0058 virtual void DefaultIcons(bool);
0059 virtual void SetOutputStyle(const char*, const char*);
0060 virtual void NativeMenu(bool);
0061 virtual void ClearMenu();
0062 virtual void UpdateSceneTree(const G4SceneTreeItem&);
0063 void AddInteractor(G4String, G4Interactor);
0064 G4Interactor GetInteractor(const G4String&);
0065 const std::map<G4String, OutputStyle>& GetOutputStyles() const;
0066
0067 virtual void UpdateDrawingStyle(G4int style);
0068 virtual void UpdateProjectionStyle(G4int style);
0069 virtual void UpdateTransparencySlider(G4double depth, G4int option);
0070
0071 protected:
0072 void SetStyleUtility(const G4String& destination, const G4String& style);
0073
0074 std::map<G4String,OutputStyle> fOutputStyles {
0075 {"cout",{true,false,true}},
0076 {"cerr",{true,true,true}},
0077 {"warn",{true,false,true}},
0078 {"error",{true,true,true}},
0079 {"debug",{true,false,true}}};
0080
0081
0082 private:
0083 G4UImessenger* messenger;
0084 using G4interactor_map = std::map<G4String, G4Interactor, std::less<G4String>>;
0085 G4interactor_map interactors;
0086 };
0087
0088 #endif