Logo ROOT  
Reference Guide
TVirtualViewer3D.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Olivier Couet 05/10/2004
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TVirtualViewer3D
13 #define ROOT_TVirtualViewer3D
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TVirtualViewer3D //
18 // //
19 // Abstract 3D shapes viewer. The concrete implementations are: //
20 // //
21 // TViewerX3D : X3d viewer //
22 // TViewerOpenGL: OpenGL viewer //
23 // TViewerPad3D : visualise the 3D scene in the current Pad //
24 // //
25 //////////////////////////////////////////////////////////////////////////
26 
27 #include "TObject.h"
28 
29 class TBuffer3D;
30 class TVirtualPad;
31 class TGLRect;
32 
33 class TVirtualViewer3D : public TObject
34 {
35 public:
36  virtual ~TVirtualViewer3D();
37 
38  // Viewers must always handle master (absolute) positions - and
39  // buffer producers must be able to supply them. Some viewers may
40  // prefer local frame & translation - and producers can optionally
41  // supply them
42  virtual Bool_t PreferLocalFrame() const = 0;
43 
44  // Viewers can implement their own loop over pad's primitive list.
45  virtual Bool_t CanLoopOnPrimitives() const { return kFALSE; }
46  // When they can, TPad::Paint() and TPad::PaintModified() simply
47  // call the following function:
48  virtual void PadPaint(TVirtualPad*) {}
49  virtual void ObjectPaint(TObject*, Option_t* = "") {}
50 
51  // Addition/removal of objects must occur between Begin/EndUpdate calls
52  virtual void BeginScene() = 0;
53  virtual Bool_t BuildingScene() const = 0;
54  virtual void EndScene() = 0;
55 
56  // Simple object addition - buffer represents a unique single positioned object
57  virtual Int_t AddObject(const TBuffer3D & buffer, Bool_t * addChildren = 0) = 0;
58 
59  // Complex object addition - for adding physical objects which have common logical
60  // shapes. In this case buffer describes template shape (aside from kCore).
61  virtual Int_t AddObject(UInt_t physicalID, const TBuffer3D & buffer, Bool_t * addChildren = 0) = 0;
62 
63  virtual Bool_t OpenComposite(const TBuffer3D & buffer, Bool_t * addChildren = 0) = 0;
64  virtual void CloseComposite() = 0;
65  virtual void AddCompositeOp(UInt_t operation) = 0;
66 
67  virtual TObject *SelectObject(Int_t, Int_t){return 0;}
68  virtual void DrawViewer(){}
69 
70  virtual void PrintObjects(){}
71  virtual void ResetCameras(){}
72  virtual void ResetCamerasAfterNextUpdate(){}
73 
74  static TVirtualViewer3D *Viewer3D(TVirtualPad *pad = 0, Option_t *type = "");
75 
76  ClassDef(TVirtualViewer3D,0) // Abstract interface to 3D viewers
77 };
78 
79 #endif
TVirtualViewer3D::OpenComposite
virtual Bool_t OpenComposite(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
TVirtualViewer3D::CloseComposite
virtual void CloseComposite()=0
TVirtualViewer3D::ResetCamerasAfterNextUpdate
virtual void ResetCamerasAfterNextUpdate()
Definition: TVirtualViewer3D.h:72
TVirtualViewer3D::AddCompositeOp
virtual void AddCompositeOp(UInt_t operation)=0
TVirtualViewer3D::PadPaint
virtual void PadPaint(TVirtualPad *)
Definition: TVirtualViewer3D.h:48
TVirtualViewer3D::EndScene
virtual void EndScene()=0
Int_t
int Int_t
Definition: RtypesCore.h:45
TVirtualViewer3D::BeginScene
virtual void BeginScene()=0
TVirtualViewer3D::ResetCameras
virtual void ResetCameras()
Definition: TVirtualViewer3D.h:71
TVirtualViewer3D::Viewer3D
static TVirtualViewer3D * Viewer3D(TVirtualPad *pad=0, Option_t *type="")
Create a Viewer 3D of specified type.
Definition: TVirtualViewer3D.cxx:281
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
bool
TVirtualViewer3D::DrawViewer
virtual void DrawViewer()
Definition: TVirtualViewer3D.h:68
TVirtualViewer3D::PreferLocalFrame
virtual Bool_t PreferLocalFrame() const =0
TBuffer3D
Definition: TBuffer3D.h:17
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TVirtualViewer3D::PrintObjects
virtual void PrintObjects()
Definition: TVirtualViewer3D.h:70
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TVirtualViewer3D::ObjectPaint
virtual void ObjectPaint(TObject *, Option_t *="")
Definition: TVirtualViewer3D.h:49
TGLRect
Definition: TGLUtil.h:421
TVirtualViewer3D::~TVirtualViewer3D
virtual ~TVirtualViewer3D()
Definition: TVirtualViewer3D.cxx:276
TVirtualPad
Definition: TVirtualPad.h:50
TObject.h
TVirtualViewer3D::SelectObject
virtual TObject * SelectObject(Int_t, Int_t)
Definition: TVirtualViewer3D.h:67
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TVirtualViewer3D
Definition: TVirtualViewer3D.h:33
TVirtualViewer3D::AddObject
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
TVirtualViewer3D::CanLoopOnPrimitives
virtual Bool_t CanLoopOnPrimitives() const
Definition: TVirtualViewer3D.h:45
TVirtualViewer3D::BuildingScene
virtual Bool_t BuildingScene() const =0
type
int type
Definition: TGX11.cxx:121
int