TGLSceneInfo.cxx

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TGLSceneInfo.cxx 29676 2009-08-04 16:18:07Z matevz $
00002 // Author:  Matevz Tadel, Feb 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #include "TGLSceneInfo.h"
00013 #include "TGLRnrCtx.h"
00014 #include "TGLSceneBase.h"
00015 #include "TGLViewerBase.h"
00016 
00017 //______________________________________________________________________
00018 // TGLSceneInfo
00019 //
00020 // Base class for extended scene context.
00021 //
00022 // Scenes can be shared among several viewers and each scene needs to
00023 // cache some viewer/camera/clipping specific state => this is a
00024 // storage class for this data.
00025 //
00026 // Sub-classes of TGLSceneBase can override the virtual
00027 // CreateSceneInfo() method and in it instantiate a sub-class of
00028 // TGLSceneInfo containing the needed information. See TGLScene and
00029 // inner class SceneInfo; note that some casting is needed in actual
00030 // methods as TGLRnrCtx holds the base-class pointer.
00031 //
00032 
00033 ClassImp(TGLSceneInfo)
00034 
00035 
00036 //______________________________________________________________________
00037 TGLSceneInfo::TGLSceneInfo(TGLViewerBase* view, TGLSceneBase* scene) :
00038    fViewer    (view),
00039    fScene     (scene),
00040    fActive    (kTRUE),
00041 
00042    fLOD     (TGLRnrCtx::kLODUndef),
00043    fStyle   (TGLRnrCtx::kStyleUndef),
00044    fWFLineW (0),
00045    fOLLineW (0),
00046    fClip    (0),
00047 
00048    fLastLOD   (TGLRnrCtx::kLODUndef),
00049    fLastStyle (TGLRnrCtx::kStyleUndef),
00050    fLastWFLineW (0),
00051    fLastOLLineW (0),
00052    fLastClip  (0),
00053    fLastCamera(0),
00054 
00055    fSceneStamp (0),
00056    fClipStamp  (0),
00057    fCameraStamp(0),
00058    fUpdateTimeouted(kFALSE),
00059 
00060    fViewCheck (kTRUE),
00061    fInFrustum (kTRUE),
00062    fInClip    (kTRUE),
00063    fClipMode  (kClipNone)
00064 {
00065    // Default constructor.
00066 }
00067 
00068 //______________________________________________________________________
00069 void TGLSceneInfo::SetActive(Bool_t a)
00070 {
00071    // Set active state of the scene, mark viewer as changed.
00072 
00073    if (a != fActive)
00074    {
00075       fActive = a;
00076       fViewer->Changed();
00077    }
00078 }
00079 
00080 //______________________________________________________________________
00081 void TGLSceneInfo::SetupTransformsAndBBox()
00082 {
00083    // Combine information from scene, scene-info and camera (should be
00084    // optional) into transformation matrices.
00085    //
00086    // Transform scene bounding box using this transformation.
00087 
00088    // !!! Transforms not implemented yet, just copy the scene bounding
00089    // box.
00090 
00091    fTransformedBBox = fScene->BoundingBox();
00092 }

Generated on Tue Jul 5 14:18:08 2011 for ROOT_528-00b_version by  doxygen 1.5.1