#include "TViewerX3D.h"

TViewerX3D


class description - source file - inheritance tree (.pdf)

class TViewerX3D : public TVirtualViewer3D

Inheritance Chart:
TObject
<-
TVirtualViewer3D
<-
TViewerX3D
    private:
void CreateViewer(const char* name) void DeleteX3DWindow() Bool_t HandleContainerButton(Event_t* ev) void InitX3DWindow() 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) TViewerX3D(const TViewerX3D&) virtual ~TViewerX3D() virtual void AddCompositeOp(UInt_t) 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 void BeginScene() virtual Bool_t BuildingScene() const static TClass* Class() void Close() virtual void CloseComposite() virtual void EndScene() Int_t ExecCommand(Int_t px, Int_t py, char command) void GetPosition(Float_t& longitude, Float_t& latitude, Float_t& psi) void Iconify() virtual TClass* IsA() const virtual Bool_t OpenComposite(const TBuffer3D&, Bool_t* = 0) TViewerX3D& operator=(const TViewerX3D&) void PaintPolyMarker(const TBuffer3D& buffer) const virtual Bool_t PreferLocalFrame() const Bool_t ProcessFrameMessage(Long_t msg, Long_t parm1, Long_t parm2) void Show() virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) void Update()

Data Members

    private:
TX3DFrame* fMainFrame the main GUI frame TString fOption option string to be passed to X3D TString fTitle viewer title Window_t fX3DWin X3D window TGCanvas* fCanvas canvas widget TX3DContainer* fContainer container containing X3D window TGMenuBar* fMenuBar menubar TGPopupMenu* fFileMenu file menu TGPopupMenu* fHelpMenu help menu TGLayoutHints* fMenuBarLayout menubar layout hints TGLayoutHints* fMenuBarItemLayout layout hints for menu in menubar TGLayoutHints* fMenuBarHelpLayout layout hint for help menu in menubar TGLayoutHints* fCanvasLayout layout for canvas widget UInt_t fWidth viewer width UInt_t fHeight viewer height Int_t fXPos viewer X position Int_t fYPos viewer Y position TVirtualPad* fPad pad we are attached to Bool_t fBuildingScene Rebuilding 3D scene TViewerX3D::EPass fPass static Bool_t fgCreated TViewerX3D is a singleton public:
static const TViewerX3D::EPass kSize static const TViewerX3D::EPass kDraw

Class Description

                                                                      
 TViewerX3D                                                           
                                                                      
 C++ interface to the X3D viewer                                      
                                                                      


TViewerX3D(TVirtualPad *pad) : TVirtualViewer3D(), fCanvas(0), fContainer(0), fMenuBar(0), fFileMenu(0), fHelpMenu(0), fMenuBarLayout(0), fMenuBarItemLayout(0), fMenuBarHelpLayout(0), fCanvasLayout(0), fPad(pad), fBuildingScene(kFALSE), fPass(kSize)
 Create ROOT X3D viewer.

TViewerX3D(TVirtualPad *pad, Option_t *option, const char *title, UInt_t width, UInt_t height) : TVirtualViewer3D(), fCanvas(0), fContainer(0), fMenuBar(0), fFileMenu(0), fHelpMenu(0), fMenuBarLayout(0), fMenuBarItemLayout(0), fMenuBarHelpLayout(0), fCanvasLayout(0), fPad(pad), fBuildingScene(kFALSE), fPass(kSize)
 Create ROOT X3D viewer.

TViewerX3D(TVirtualPad *pad, Option_t *option, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height) : TVirtualViewer3D(), fCanvas(0), fContainer(0), fMenuBar(0), fFileMenu(0), fHelpMenu(0), fMenuBarLayout(0), fMenuBarItemLayout(0), fMenuBarHelpLayout(0), fCanvasLayout(0), fPad(pad), fBuildingScene(kFALSE), fPass(kSize)
 Create ROOT X3D viewer.

~TViewerX3D()
 Delete ROOT X3D viewer.

void Close()
 Close X3D Viewer

void CreateViewer(const char *name)
 Create the actual canvas.

void InitX3DWindow()
 Setup geometry and initialize X3D.

void BeginScene()
 The x3d viewer cannot rebuild a scene once created

void EndScene()
 The x3d viewer cannot rebuild a scene once created

Int_t AddObject(const TBuffer3D & buffer, Bool_t * addChildren)
 The x3d viewer cannot rebuild a scene once created

Int_t AddObject(UInt_t /* placedID */, const TBuffer3D & buffer, Bool_t * addChildren)
 We don't support placed IDs - discard

void PaintPolyMarker(const TBuffer3D & buffer) const
 Paint 3D PolyMarker

Int_t ExecCommand(Int_t px, Int_t py, char command)
 This function may be called from a script to animate an X3D picture
 px, py  mouse position
command = 0       --- move to px,py
        = w       --- wireframe mode
        = e       --- hidden line mode
        = r       --- hidden surface mode
        = u       --- move object down
        = i       --- move object up
        = o       --- toggle controls style
        = s       --- toggle stereo display
        = d       --- toggle blue stereo view
        = f       --- toggle double buffer
        = h       --- move object right
        = j       --- move object forward
        = k       --- move object backward
        = l       --- move object left
        = x a     --- rotate about x
        = y b     --- rotate about y
        = z c     --- rotate about z
        = 1 2 3   --- autorotate about x
        = 4 5 6   --- autorotate about y
        = 7 8 9   --- autorotate about z
        = [ ] { } --- adjust focus
 Example:

void GetPosition(Float_t &longitude, Float_t &latitude, Float_t &psi)
 Get position

void DeleteX3DWindow()
 Close X3D window.

void Update()
 Update X3D viewer.

Bool_t ProcessFrameMessage(Long_t msg, Long_t parm1, Long_t)
 Handle menu and other command generated by the user.

Bool_t HandleContainerButton(Event_t * /*ev */ )
 After button release get current position and update associated pad.



Inline Functions


               void Iconify()
               void Show()
             Bool_t PreferLocalFrame() const
             Bool_t BuildingScene() const
             Bool_t OpenComposite(const TBuffer3D&, Bool_t* = 0)
               void CloseComposite()
               void AddCompositeOp(UInt_t)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)
         TViewerX3D TViewerX3D(const TViewerX3D&)
        TViewerX3D& operator=(const TViewerX3D&)


Author: Rene Brun 05/09/99
Last update: root/x3d:$Name: $:$Id: TViewerX3D.cxx,v 1.18 2005/11/11 16:12:18 couet Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.