File indexing completed on 2026-09-08 09:26:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TViewerX3D
0013 #define ROOT_TViewerX3D
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TX3DFrame.h"
0025 #include "TVirtualViewer3D.h"
0026
0027 class TVirtualPad;
0028 class TGCanvas;
0029 class TGMenuBar;
0030 class TGPopupMenu;
0031 class TGLayoutHints;
0032 class TX3DContainer;
0033
0034 class TViewerX3D : public TVirtualViewer3D
0035 {
0036
0037 friend class TX3DContainer;
0038
0039 private:
0040 TX3DFrame *fMainFrame;
0041 TString fOption;
0042 TString fTitle;
0043 Window_t fX3DWin;
0044 TGCanvas *fCanvas;
0045 TX3DContainer *fContainer;
0046 TGMenuBar *fMenuBar;
0047 TGPopupMenu *fFileMenu;
0048 TGPopupMenu *fHelpMenu;
0049 TGLayoutHints *fMenuBarLayout;
0050 TGLayoutHints *fMenuBarItemLayout;
0051 TGLayoutHints *fMenuBarHelpLayout;
0052 TGLayoutHints *fCanvasLayout;
0053 UInt_t fWidth;
0054 UInt_t fHeight;
0055 Int_t fXPos;
0056 Int_t fYPos;
0057 TVirtualPad *fPad;
0058 Bool_t fBuildingScene;
0059 enum EPass {
0060
0061 #if defined(__clang__) && __clang_major__ < 20
0062 #pragma clang diagnostic push
0063 #pragma clang diagnostic ignored "-Wshadow"
0064 #endif
0065 kSize,
0066 #if defined(__clang__) && __clang_major__ < 20
0067 #pragma clang diagnostic pop
0068 #endif
0069 kDraw };
0070 EPass fPass;
0071
0072 void CreateViewer(const char *name);
0073 void InitX3DWindow();
0074 void DeleteX3DWindow();
0075
0076 Bool_t HandleContainerButton(Event_t *ev);
0077
0078 static Bool_t fgCreated;
0079
0080 public:
0081 TViewerX3D(TVirtualPad *pad);
0082 TViewerX3D(TVirtualPad *pad, Option_t *option, const char *title="X3D Viewer",
0083 UInt_t width = 800, UInt_t height = 600);
0084 TViewerX3D(TVirtualPad *pad, Option_t *option, const char *title,
0085 Int_t x, Int_t y, UInt_t width, UInt_t height);
0086 ~TViewerX3D() override;
0087
0088 Int_t ExecCommand(Int_t px, Int_t py, char command);
0089 void GetPosition(Float_t &longitude, Float_t &latitude, Float_t &psi);
0090 void Iconify() { }
0091 void Show() { fMainFrame->MapRaised(); }
0092 void Close();
0093 void Update();
0094
0095 void PaintPolyMarker(const TBuffer3D & buffer) const;
0096
0097
0098 Bool_t PreferLocalFrame() const override { return kFALSE; }
0099 void BeginScene() override;
0100 Bool_t BuildingScene() const override { return fBuildingScene; }
0101 void EndScene() override;
0102 Int_t AddObject(const TBuffer3D & buffer, Bool_t * addChildren = nullptr) override;
0103 Int_t AddObject(UInt_t placedID, const TBuffer3D & buffer, Bool_t * addChildren = nullptr) override;
0104
0105
0106
0107 Bool_t OpenComposite(const TBuffer3D & , Bool_t * = nullptr) override { return kTRUE; }
0108 void CloseComposite() override {};
0109 void AddCompositeOp(UInt_t ) override {};
0110
0111 Bool_t ProcessFrameMessage(Long_t msg, Long_t parm1, Long_t parm2);
0112
0113 ClassDefOverride(TViewerX3D,0)
0114 };
0115
0116 #endif