#ifndef ROOT_TViewerX3D
#define ROOT_TViewerX3D
#ifndef ROOT_TX3DFrame
#include "TX3DFrame.h"
#endif
#ifndef ROOT_TVirtualViewer3D
#include "TVirtualViewer3D.h"
#endif
class TVirtualPad;
class TGCanvas;
class TGMenuBar;
class TGPopupMenu;
class TGLayoutHints;
class TX3DContainer;
class TViewerX3D : public TVirtualViewer3D
{
friend class TX3DContainer;
private:
TX3DFrame *fMainFrame;
TString fOption;
TString fTitle;
Window_t fX3DWin;
TGCanvas *fCanvas;
TX3DContainer *fContainer;
TGMenuBar *fMenuBar;
TGPopupMenu *fFileMenu;
TGPopupMenu *fHelpMenu;
TGLayoutHints *fMenuBarLayout;
TGLayoutHints *fMenuBarItemLayout;
TGLayoutHints *fMenuBarHelpLayout;
TGLayoutHints *fCanvasLayout;
UInt_t fWidth;
UInt_t fHeight;
Int_t fXPos;
Int_t fYPos;
TVirtualPad *fPad;
Bool_t fBuildingScene;
enum EPass { kSize, kDraw };
EPass fPass;
void CreateViewer(const char *name);
void InitX3DWindow();
void DeleteX3DWindow();
Bool_t HandleContainerButton(Event_t *ev);
static Bool_t fgCreated;
public:
TViewerX3D(TVirtualPad *pad);
TViewerX3D(TVirtualPad *pad, Option_t *option, const char *title="X3D Viewer",
UInt_t width = 800, UInt_t height = 600);
TViewerX3D(TVirtualPad *pad, Option_t *option, const char *title,
Int_t x, Int_t y, UInt_t width, UInt_t height);
virtual ~TViewerX3D();
Int_t ExecCommand(Int_t px, Int_t py, char command);
void GetPosition(Float_t &longitude, Float_t &latitude, Float_t &psi);
void Iconify() { }
void Show() { fMainFrame->MapRaised(); }
void Close();
void Update();
void PaintPolyMarker(const TBuffer3D & buffer) const;
virtual Bool_t PreferLocalFrame() const { return kFALSE; }
virtual void BeginScene();
virtual Bool_t BuildingScene() const { return fBuildingScene; }
virtual void EndScene();
virtual Int_t AddObject(const TBuffer3D & buffer, Bool_t * addChildren = 0);
virtual Int_t AddObject(UInt_t placedID, const TBuffer3D & buffer, Bool_t * addChildren = 0);
virtual Bool_t OpenComposite(const TBuffer3D & , Bool_t * =0) { return kTRUE; }
virtual void CloseComposite() {};
virtual void AddCompositeOp(UInt_t ) {};
Bool_t ProcessFrameMessage(Long_t msg, Long_t parm1, Long_t parm2);
ClassDef(TViewerX3D,0)
};
#endif