ROOT » GRAF3D » X3D » TViewerX3D

class TViewerX3D: public TVirtualViewer3D


C++ interface to the X3D viewer

Function Members (Methods)

voidTObject::AbstractMethod(const char* method) const
virtual voidAddCompositeOp(UInt_t)
virtual Int_tAddObject(const TBuffer3D& buffer, Bool_t* addChildren = 0)
virtual Int_tAddObject(UInt_t placedID, const TBuffer3D& buffer, Bool_t* addChildren = 0)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidBeginScene()
virtual voidTObject::Browse(TBrowser* b)
virtual Bool_tBuildingScene() const
virtual Bool_tTVirtualViewer3D::CanLoopOnPrimitives() const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual voidCloseComposite()
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTVirtualViewer3D::DrawViewer()
virtual voidTObject::Dump() constMENU
virtual voidEndScene()
virtual voidTObject::Error(const char* method, const char* msgfmt) const
Int_tExecCommand(Int_t px, Int_t py, char command)
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
voidGetPosition(Float_t& longitude, Float_t& latitude, Float_t& psi)
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
virtual voidTVirtualViewer3D::ObjectPaint(TObject*, Option_t* = "")
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
virtual Bool_tOpenComposite(const TBuffer3D&, Bool_t* = 0)
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TViewerX3D&operator=(const TViewerX3D&)
virtual voidTVirtualViewer3D::PadPaint(TVirtualPad*)
virtual voidTObject::Paint(Option_t* option = "")
voidPaintPolyMarker(const TBuffer3D& buffer) const
virtual voidTObject::Pop()
virtual Bool_tPreferLocalFrame() const
virtual voidTObject::Print(Option_t* option = "") const
virtual voidTVirtualViewer3D::PrintObjects()
Bool_tProcessFrameMessage(Long_t msg, Long_t parm1, Long_t parm2)
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTVirtualViewer3D::ResetCameras()
virtual voidTVirtualViewer3D::ResetCamerasAfterNextUpdate()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
virtual TObject*TVirtualViewer3D::SelectObject(Int_t, Int_t)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TViewerX3D(TVirtualPad* pad)
TViewerX3D(const TViewerX3D&)
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 voidTObject::UseCurrentStyle()
static TVirtualViewer3D*TVirtualViewer3D::Viewer3D(TVirtualPad* pad = 0, Option_t* type = "")
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidCreateViewer(const char* name)
Bool_tHandleContainerButton(Event_t* ev)

Data Members

static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
Bool_tfBuildingSceneRebuilding 3D scene
TGCanvas*fCanvascanvas widget
TGLayoutHints*fCanvasLayoutlayout for canvas widget
TX3DContainer*fContainercontainer containing X3D window
TGPopupMenu*fFileMenufile menu
UInt_tfHeightviewer height
TGPopupMenu*fHelpMenuhelp menu
TX3DFrame*fMainFramethe main GUI frame
TGLayoutHints*fMenuBarHelpLayoutlayout hint for help menu in menubar
TGLayoutHints*fMenuBarItemLayoutlayout hints for menu in menubar
TGLayoutHints*fMenuBarLayoutmenubar layout hints
TStringfOptionoption string to be passed to X3D
TVirtualPad*fPadpad we are attached to
TStringfTitleviewer title
UInt_tfWidthviewer width
Window_tfX3DWinX3D window
Int_tfXPosviewer X position
Int_tfYPosviewer Y position
static Bool_tfgCreatedTViewerX3D is a singleton
static TViewerX3D::EPasskDraw
static TViewerX3D::EPasskSize

Class Charts

Inheritance Chart:

Function documentation

TViewerX3D(TVirtualPad* pad)
 Create ROOT X3D viewer.
TViewerX3D(TVirtualPad* pad, Option_t* option, const char* title = "X3D Viewer", UInt_t width = 800, UInt_t height = 600)
 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)
 Create ROOT X3D viewer.
 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 = 0)
 The x3d viewer cannot rebuild a scene once created
Int_t AddObject(UInt_t placedID, const TBuffer3D& buffer, Bool_t* addChildren = 0)
 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

   TCanvas *c1 = new TCanvas("c1");
   TFile *f = new TFile("hsimple.root");
   TTree *ntuple = (TTree*)f->Get("ntuple");
   TViewerX3D *x3d = new TViewerX3D(c1,"");
   for (Int_t i=0;i<500;i++) {
      Int_t px = i%500;
      Int_t py = (2*i)%200;
      x3d->ExecCommand(px,py,0);  //rotate
      if (i%20 >10) x3d->ExecCommand(px,py,'j'); //zoom
      if (i%20 <10) x3d->ExecCommand(px,py,'k'); //unzoom

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 parm2)
 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.
TViewerX3D(TVirtualPad* pad)
void Iconify()
{ }
void Show()
{ fMainFrame->MapRaised(); }
Bool_t PreferLocalFrame() const
 TVirtualViewer3D interface
{ return kFALSE; }
Bool_t BuildingScene() const
{ return fBuildingScene; }
Bool_t OpenComposite(const TBuffer3D& , Bool_t* = 0)
 Composite shapes not supported on this viewer currently - ignore.
 Will result in a set of component shapes
{ return kTRUE; }
void CloseComposite()
void AddCompositeOp(UInt_t )