// @(#)root/gl:$Id: TGLSceneInfo.cxx 20882 2007-11-19 11:31:26Z rdm $
// Author:  Matevz Tadel, Feb 2007

/*************************************************************************
 * 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.             *
 *************************************************************************/

#include "TGLSceneInfo.h"
#include "TGLRnrCtx.h"
#include "TGLSceneBase.h"
#include "TGLViewerBase.h"

//______________________________________________________________________
// TGLSceneInfo
//
// Base class for extended scene context.
//
// Scenes can be shared among several viewers and each scene needs to
// cache some viewer/camera/clipping specific state => this is a
// storage class for this data.
//
// Sub-classes of TGLSceneBase can override the virtual
// CreateSceneInfo() method and in it instantiate a sub-class of
// TGLSceneInfo containing the needed information. See TGLScene and
// inner class SceneInfo; note that some casting is needed in actual
// methods as TGLRnrCtx holds the base-class pointer.
//

ClassImp(TGLSceneInfo)


//______________________________________________________________________
TGLSceneInfo::TGLSceneInfo(TGLViewerBase* view, TGLSceneBase* scene) :
   fViewer    (view),
   fScene     (scene),
   fActive    (kTRUE),

   fLOD   (TGLRnrCtx::kLODUndef),
   fStyle (TGLRnrCtx::kStyleUndef),
   fClip  (0),

   fLastLOD   (TGLRnrCtx::kLODUndef),
   fLastStyle (TGLRnrCtx::kStyleUndef),
   fLastClip  (0),
   fLastCamera(0),

   fSceneStamp (0),
   fClipStamp  (0),
   fCameraStamp(0),

   fViewCheck (kTRUE),
   fInFrustum (kTRUE),
   fInClip    (kTRUE),
   fClipMode  (kClipNone)
{
   // Default constructor.
}

//______________________________________________________________________
void TGLSceneInfo::SetActive(Bool_t a)
{
   // Set active state of the scene, mark viewer as changed.

   if (a != fActive)
   {
      fActive = a;
      fViewer->Changed();
   }
}

//______________________________________________________________________
void TGLSceneInfo::SetupTransformsAndBBox()
{
   // Combine information from scene, scene-info and camera (should be
   // optional) into transformation matrices.
   //
   // Transform scene bounding box using this transformation.

   // !!! Transforms not implemented yet, just copy the scene bounding
   // box.

   fTransformedBBox = fScene->BoundingBox();
}

Last update: Thu Jan 17 08:52:18 2008

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.