// @(#)root/base:$Id$
// Author: Olivier Couet 05/10/2004

/*************************************************************************
 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TVirtualViewer3D
#define ROOT_TVirtualViewer3D

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TVirtualViewer3D                                                     //
//                                                                      //
// Abstract 3D shapes viewer. The concrete implementations are:         //
//                                                                      //
// TViewerX3D   : X3d viewer                                            //
// TViewerOpenGL: OpenGL viewer                                         //
// TViewerPad3D : visualise the 3D scene in the current Pad             //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif

#ifndef ROOT_TObject
#include "TObject.h"
#endif

#ifndef ROOT_TAttFill
#include "TAttFill.h"
#endif

class TBuffer3D;
class TVirtualPad;
class TGLRect;

class TVirtualViewer3D : public TObject
{
public:
   virtual ~TVirtualViewer3D() {};

   // Viewers must always handle master (absolute) positions - and
   // buffer producers must be able to supply them. Some viewers may
   // prefer local frame & translation - and producers can optionally
   // supply them
   virtual Bool_t PreferLocalFrame() const = 0;

   // Viewers can implement their own loop over pad's primitive list.
   virtual Bool_t CanLoopOnPrimitives() const { return kFALSE; }
   // When they can, TPad::Paint() and TPad::PaintModified() simply
   // call the following function:
   virtual void   PadPaint(TVirtualPad*) {}
   virtual void   ObjectPaint(TObject*, Option_t* = "")  {}

   // Addition/removal of objects must occur between Begin/EndUpdate calls
   virtual void   BeginScene() = 0;
   virtual Bool_t BuildingScene() const = 0;
   virtual void   EndScene() = 0;

   // Simple object addition - buffer represents a unique single positioned object
   virtual Int_t  AddObject(const TBuffer3D & buffer, Bool_t * addChildren = 0) = 0;

   // Complex object addition - for adding physical objects which have common logical
   // shapes. In this case buffer describes template shape (aside from kCore).
   virtual Int_t  AddObject(UInt_t physicalID, const TBuffer3D & buffer, Bool_t * addChildren = 0) = 0;

   virtual Bool_t OpenComposite(const TBuffer3D & buffer, Bool_t * addChildren = 0) = 0;
   virtual void   CloseComposite() = 0;
   virtual void   AddCompositeOp(UInt_t operation) = 0;

   virtual TObject *SelectObject(Int_t, Int_t){return 0;}
   virtual void   DrawViewer(){}

   virtual void PrintObjects(){}
   virtual void ResetCameras(){}
   virtual void ResetCamerasAfterNextUpdate(){}

   static  TVirtualViewer3D *Viewer3D(TVirtualPad *pad = 0, Option_t *type = "");

   ClassDef(TVirtualViewer3D,0) // Abstract interface to 3D viewers
};

#endif
 TVirtualViewer3D.h:1
 TVirtualViewer3D.h:2
 TVirtualViewer3D.h:3
 TVirtualViewer3D.h:4
 TVirtualViewer3D.h:5
 TVirtualViewer3D.h:6
 TVirtualViewer3D.h:7
 TVirtualViewer3D.h:8
 TVirtualViewer3D.h:9
 TVirtualViewer3D.h:10
 TVirtualViewer3D.h:11
 TVirtualViewer3D.h:12
 TVirtualViewer3D.h:13
 TVirtualViewer3D.h:14
 TVirtualViewer3D.h:15
 TVirtualViewer3D.h:16
 TVirtualViewer3D.h:17
 TVirtualViewer3D.h:18
 TVirtualViewer3D.h:19
 TVirtualViewer3D.h:20
 TVirtualViewer3D.h:21
 TVirtualViewer3D.h:22
 TVirtualViewer3D.h:23
 TVirtualViewer3D.h:24
 TVirtualViewer3D.h:25
 TVirtualViewer3D.h:26
 TVirtualViewer3D.h:27
 TVirtualViewer3D.h:28
 TVirtualViewer3D.h:29
 TVirtualViewer3D.h:30
 TVirtualViewer3D.h:31
 TVirtualViewer3D.h:32
 TVirtualViewer3D.h:33
 TVirtualViewer3D.h:34
 TVirtualViewer3D.h:35
 TVirtualViewer3D.h:36
 TVirtualViewer3D.h:37
 TVirtualViewer3D.h:38
 TVirtualViewer3D.h:39
 TVirtualViewer3D.h:40
 TVirtualViewer3D.h:41
 TVirtualViewer3D.h:42
 TVirtualViewer3D.h:43
 TVirtualViewer3D.h:44
 TVirtualViewer3D.h:45
 TVirtualViewer3D.h:46
 TVirtualViewer3D.h:47
 TVirtualViewer3D.h:48
 TVirtualViewer3D.h:49
 TVirtualViewer3D.h:50
 TVirtualViewer3D.h:51
 TVirtualViewer3D.h:52
 TVirtualViewer3D.h:53
 TVirtualViewer3D.h:54
 TVirtualViewer3D.h:55
 TVirtualViewer3D.h:56
 TVirtualViewer3D.h:57
 TVirtualViewer3D.h:58
 TVirtualViewer3D.h:59
 TVirtualViewer3D.h:60
 TVirtualViewer3D.h:61
 TVirtualViewer3D.h:62
 TVirtualViewer3D.h:63
 TVirtualViewer3D.h:64
 TVirtualViewer3D.h:65
 TVirtualViewer3D.h:66
 TVirtualViewer3D.h:67
 TVirtualViewer3D.h:68
 TVirtualViewer3D.h:69
 TVirtualViewer3D.h:70
 TVirtualViewer3D.h:71
 TVirtualViewer3D.h:72
 TVirtualViewer3D.h:73
 TVirtualViewer3D.h:74
 TVirtualViewer3D.h:75
 TVirtualViewer3D.h:76
 TVirtualViewer3D.h:77
 TVirtualViewer3D.h:78
 TVirtualViewer3D.h:79
 TVirtualViewer3D.h:80
 TVirtualViewer3D.h:81
 TVirtualViewer3D.h:82
 TVirtualViewer3D.h:83
 TVirtualViewer3D.h:84
 TVirtualViewer3D.h:85
 TVirtualViewer3D.h:86
 TVirtualViewer3D.h:87
 TVirtualViewer3D.h:88
 TVirtualViewer3D.h:89