Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TVirtualViewer3D.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/base:$Id$
0002 // Author: Olivier Couet 05/10/2004
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TVirtualViewer3D
0013 #define ROOT_TVirtualViewer3D
0014 
0015 //////////////////////////////////////////////////////////////////////////
0016 //                                                                      //
0017 // TVirtualViewer3D                                                     //
0018 //                                                                      //
0019 // Abstract 3D shapes viewer. The concrete implementations are:         //
0020 //                                                                      //
0021 // TViewerX3D   : X3d viewer                                            //
0022 // TViewerOpenGL: OpenGL viewer                                         //
0023 // TViewerPad3D : visualise the 3D scene in the current Pad             //
0024 //                                                                      //
0025 //////////////////////////////////////////////////////////////////////////
0026 
0027 #include "TObject.h"
0028 
0029 class TBuffer3D;
0030 class TVirtualPad;
0031 class TGLRect;
0032 
0033 class TVirtualViewer3D : public TObject
0034 {
0035 public:
0036    virtual ~TVirtualViewer3D();
0037 
0038    // Viewers must always handle master (absolute) positions - and
0039    // buffer producers must be able to supply them. Some viewers may
0040    // prefer local frame & translation - and producers can optionally
0041    // supply them
0042    virtual Bool_t PreferLocalFrame() const = 0;
0043 
0044    // Viewers can implement their own loop over pad's primitive list.
0045    virtual Bool_t CanLoopOnPrimitives() const { return kFALSE; }
0046    // When they can, TPad::Paint() and TPad::PaintModified() simply
0047    // call the following function:
0048    virtual void   PadPaint(TVirtualPad*) {}
0049    virtual void   ObjectPaint(TObject*, Option_t* = "")  {}
0050 
0051    // Addition/removal of objects must occur between Begin/EndUpdate calls
0052    virtual void   BeginScene() = 0;
0053    virtual Bool_t BuildingScene() const = 0;
0054    virtual void   EndScene() = 0;
0055 
0056    // Simple object addition - buffer represents a unique single positioned object
0057    virtual Int_t  AddObject(const TBuffer3D &buffer, Bool_t *addChildren = nullptr) = 0;
0058 
0059    // Complex object addition - for adding physical objects which have common logical
0060    // shapes. In this case buffer describes template shape (aside from kCore).
0061    virtual Int_t  AddObject(UInt_t physicalID, const TBuffer3D &buffer, Bool_t *addChildren = nullptr) = 0;
0062 
0063    virtual Bool_t OpenComposite(const TBuffer3D &buffer, Bool_t *addChildren = nullptr) = 0;
0064    virtual void   CloseComposite() = 0;
0065    virtual void   AddCompositeOp(UInt_t operation) = 0;
0066 
0067    virtual TObject *SelectObject(Int_t, Int_t) { return nullptr; }
0068    virtual void   DrawViewer(){}
0069 
0070    virtual void PrintObjects(){}
0071    virtual void ResetCameras(){}
0072    virtual void ResetCamerasAfterNextUpdate(){}
0073 
0074    static  TVirtualViewer3D *Viewer3D(TVirtualPad *pad = nullptr, Option_t *type = "");
0075 
0076    ClassDefOverride(TVirtualViewer3D,0) // Abstract interface to 3D viewers
0077 };
0078 
0079 #endif