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 = nullptr) = 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 = nullptr) = 0;
62
63 virtual Bool_t OpenComposite(const TBuffer3D &buffer, Bool_t *addChildren = nullptr) = 0;
64 virtual void CloseComposite() = 0;
65 virtual void AddCompositeOp(UInt_t operation) = 0;
66
67 virtual TObject *SelectObject(Int_t, Int_t) { return nullptr; }
68 virtual void DrawViewer(){}
69
70 virtual void PrintObjects(){}
71 virtual void ResetCameras(){}
73
74 static TVirtualViewer3D *Viewer3D(TVirtualPad *pad = nullptr, Option_t *type = "");
75
76 ClassDefOverride(TVirtualViewer3D,0) // Abstract interface to 3D viewers
77};
78
79#endif
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
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:41
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
Abstract 3D shapes viewer.
virtual void DrawViewer()
virtual Int_t AddObject(UInt_t physicalID, const TBuffer3D &buffer, Bool_t *addChildren=nullptr)=0
virtual Bool_t PreferLocalFrame() const =0
virtual void CloseComposite()=0
virtual void ObjectPaint(TObject *, Option_t *="")
virtual void ResetCamerasAfterNextUpdate()
virtual Bool_t BuildingScene() const =0
virtual void EndScene()=0
virtual void ResetCameras()
static TVirtualViewer3D * Viewer3D(TVirtualPad *pad=nullptr, Option_t *type="")
Create a Viewer 3D of specified type.
virtual void PadPaint(TVirtualPad *)
virtual void PrintObjects()
virtual void BeginScene()=0
virtual Bool_t CanLoopOnPrimitives() const
virtual void AddCompositeOp(UInt_t operation)=0
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=nullptr)=0
virtual Bool_t OpenComposite(const TBuffer3D &buffer, Bool_t *addChildren=nullptr)=0
virtual TObject * SelectObject(Int_t, Int_t)