ROOT  6.06/09
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 #ifndef ROOT_Rtypes
28 #include "Rtypes.h"
29 #endif
30 
31 #ifndef ROOT_TObject
32 #include "TObject.h"
33 #endif
34 
35 #ifndef ROOT_TAttFill
36 #include "TAttFill.h"
37 #endif
38 
39 class TBuffer3D;
40 class TVirtualPad;
41 class TGLRect;
42 
43 class TVirtualViewer3D : public TObject
44 {
45 public:
46  virtual ~TVirtualViewer3D() {};
47 
48  // Viewers must always handle master (absolute) positions - and
49  // buffer producers must be able to supply them. Some viewers may
50  // prefer local frame & translation - and producers can optionally
51  // supply them
52  virtual Bool_t PreferLocalFrame() const = 0;
53 
54  // Viewers can implement their own loop over pad's primitive list.
55  virtual Bool_t CanLoopOnPrimitives() const { return kFALSE; }
56  // When they can, TPad::Paint() and TPad::PaintModified() simply
57  // call the following function:
58  virtual void PadPaint(TVirtualPad*) {}
59  virtual void ObjectPaint(TObject*, Option_t* = "") {}
60 
61  // Addition/removal of objects must occur between Begin/EndUpdate calls
62  virtual void BeginScene() = 0;
63  virtual Bool_t BuildingScene() const = 0;
64  virtual void EndScene() = 0;
65 
66  // Simple object addition - buffer represents a unique single positioned object
67  virtual Int_t AddObject(const TBuffer3D & buffer, Bool_t * addChildren = 0) = 0;
68 
69  // Complex object addition - for adding physical objects which have common logical
70  // shapes. In this case buffer describes template shape (aside from kCore).
71  virtual Int_t AddObject(UInt_t physicalID, const TBuffer3D & buffer, Bool_t * addChildren = 0) = 0;
72 
73  virtual Bool_t OpenComposite(const TBuffer3D & buffer, Bool_t * addChildren = 0) = 0;
74  virtual void CloseComposite() = 0;
75  virtual void AddCompositeOp(UInt_t operation) = 0;
76 
77  virtual TObject *SelectObject(Int_t, Int_t){return 0;}
78  virtual void DrawViewer(){}
79 
80  virtual void PrintObjects(){}
81  virtual void ResetCameras(){}
82  virtual void ResetCamerasAfterNextUpdate(){}
83 
84  static TVirtualViewer3D *Viewer3D(TVirtualPad *pad = 0, Option_t *type = "");
85 
86  ClassDef(TVirtualViewer3D,0) // Abstract interface to 3D viewers
87 };
88 
89 #endif
virtual void CloseComposite()=0
virtual void DrawViewer()
virtual TObject * SelectObject(Int_t, Int_t)
const char Option_t
Definition: RtypesCore.h:62
virtual Bool_t OpenComposite(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual ~TVirtualViewer3D()
Viewport (pixel base) 2D rectangle class.
Definition: TGLUtil.h:426
Abstract 3D shapes viewer.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:59
virtual void ResetCameras()
virtual void ObjectPaint(TObject *, Option_t *="")
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual Bool_t BuildingScene() const =0
Generic 3D primitive description class.
Definition: TBuffer3D.h:19
virtual void BeginScene()=0
virtual void ResetCamerasAfterNextUpdate()
virtual Bool_t PreferLocalFrame() const =0
int type
Definition: TGX11.cxx:120
virtual void AddCompositeOp(UInt_t operation)=0
Mother of all ROOT objects.
Definition: TObject.h:58
static TVirtualViewer3D * Viewer3D(TVirtualPad *pad=0, Option_t *type="")
virtual void PadPaint(TVirtualPad *)
virtual void PrintObjects()
virtual void EndScene()=0
virtual Bool_t CanLoopOnPrimitives() const