Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
29class TBuffer3D;
30class TVirtualPad;
31class TGLRect;
32
34{
35public:
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(){}
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
const Bool_t kFALSE
Definition RtypesCore.h:92
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
int type
Definition TGX11.cxx:121
Generic 3D primitive description class.
Definition TBuffer3D.h:18
Viewport (pixel base) 2D rectangle class.
Definition TGLUtil.h:422
Mother of all ROOT objects.
Definition TObject.h:37
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
Abstract 3D shapes viewer.
virtual void DrawViewer()
virtual Bool_t PreferLocalFrame() const =0
static TVirtualViewer3D * Viewer3D(TVirtualPad *pad=0, Option_t *type="")
Create a Viewer 3D of specified type.
virtual void CloseComposite()=0
virtual Int_t AddObject(UInt_t physicalID, const TBuffer3D &buffer, Bool_t *addChildren=0)=0
virtual void ObjectPaint(TObject *, Option_t *="")
virtual void ResetCamerasAfterNextUpdate()
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
virtual Bool_t OpenComposite(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
virtual Bool_t BuildingScene() const =0
virtual void EndScene()=0
virtual void ResetCameras()
virtual void PadPaint(TVirtualPad *)
virtual void PrintObjects()
virtual void BeginScene()=0
virtual Bool_t CanLoopOnPrimitives() const
virtual void AddCompositeOp(UInt_t operation)=0
virtual TObject * SelectObject(Int_t, Int_t)