Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveCompound.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel 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 #ifndef ROOT_TEveCompound
13 #define ROOT_TEveCompound
14 
15 #include "TEveElement.h"
16 #include "TEveProjectionBases.h"
17 
18 
19 //==============================================================================
20 // TEveCompound
21 //==============================================================================
22 
23 class TEveCompound : public TEveElementList
24 {
25 private:
26  TEveCompound(const TEveCompound&); // Not implemented
27  TEveCompound& operator=(const TEveCompound&); // Not implemented
28 
29 protected:
30  Short_t fCompoundOpen; // If more than zero, tag new children as compound members.
31 
32 public:
33  TEveCompound(const char* n="TEveCompound", const char* t="",
34  Bool_t doColor=kTRUE, Bool_t doTransparency=kFALSE);
35  virtual ~TEveCompound() {}
36 
37  void OpenCompound() { ++fCompoundOpen; }
38  void CloseCompound() { --fCompoundOpen; }
39  Bool_t IsCompoundOpen() const { return fCompoundOpen > 0; }
40 
41  virtual void SetMainColor(Color_t color);
42  virtual void SetMainTransparency(Char_t t);
43 
44  virtual void AddElement(TEveElement* el);
45  virtual void RemoveElementLocal(TEveElement* el);
46  virtual void RemoveElementsLocal();
47 
48  virtual void FillImpliedSelectedSet(Set_t& impSelSet);
49 
50  virtual TClass* ProjectedClass(const TEveProjection* p) const;
51 
52  ClassDef(TEveCompound, 0); // Container for managing compounds of TEveElements.
53 };
54 
55 
56 //==============================================================================
57 // TEveCompoundProjected
58 //==============================================================================
59 
60 class TEveCompoundProjected : public TEveCompound,
61  public TEveProjected
62 {
63 private:
64  TEveCompoundProjected(const TEveCompoundProjected&); // Not implemented
65  TEveCompoundProjected& operator=(const TEveCompoundProjected&); // Not implemented
66 
67 public:
68  TEveCompoundProjected();
69  virtual ~TEveCompoundProjected() {}
70 
71  virtual void SetMainColor(Color_t color);
72 
73  virtual void UpdateProjection() {}
74  virtual TEveElement* GetProjectedAsElement() { return this; }
75 
76  ClassDef(TEveCompoundProjected, 0); // Projected TEveCompund container.
77 };
78 
79 #endif