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