Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveSceneInfo.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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 #include "TEveSceneInfo.h"
13 #include "TEveScene.h"
14 #include "TEveManager.h"
15 
16 #include "TGLSceneInfo.h"
17 
18 /** \class TEveSceneInfo
19 \ingroup TEve
20 TEveUtil representation of TGLSceneInfo.
21 */
22 
23 ClassImp(TEveSceneInfo);
24 
25 ////////////////////////////////////////////////////////////////////////////////
26 /// Constructor.
27 
28 TEveSceneInfo::TEveSceneInfo(TEveViewer* viewer, TEveScene* scene, TGLSceneInfo* sinfo) :
29  TEveElement (),
30  TNamed (Form("SI - %s", scene->GetName()),
31  Form("TEveSceneInfo of scene '%s'", scene->GetName())),
32  fViewer (viewer),
33  fScene (scene),
34  fGLSceneInfo (sinfo)
35 {
36 }
37 
38 ////////////////////////////////////////////////////////////////////////////////
39 /// Return the TGLSceneBase represented by this SceneInfo object.
40 
41 TGLSceneBase* TEveSceneInfo::GetGLScene() const
42 {
43  return fGLSceneInfo->GetScene();
44 }
45 
46 ////////////////////////////////////////////////////////////////////////////////
47 /// Override from TEveElement.
48 /// Process visibility changes and forward them to fGLScene.
49 
50 void TEveSceneInfo::AddStamp(UChar_t bits)
51 {
52  TEveElement::AddStamp(bits);
53  if (bits & kCBVisibility)
54  {
55  fGLSceneInfo->SetActive(fRnrSelf);
56  }
57 }
58 
59 ////////////////////////////////////////////////////////////////////////////////
60 /// Virtual from TEveElement.
61 /// TEveSceneInfo does not accept children.
62 
63 Bool_t TEveSceneInfo::AcceptElement(TEveElement* /*el*/)
64 {
65  static const TEveException eH("TEveSceneInfo::AcceptElement ");
66 
67  gEve->SetStatusLine(eH + "this class does not accept children.");
68  return kFALSE;
69 }
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// Virtual from TEveElement.
73 /// TEveSceneInfo does not accept children.
74 
75 Bool_t TEveSceneInfo::HandleElementPaste(TEveElement* /*el*/)
76 {
77  static const TEveException eH("TEveSceneInfo::HandleElementPaste ");
78 
79  gEve->SetStatusLine(eH + "this class does not accept children.");
80  return kFALSE;
81 }