TEveProjectionBases.h

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveProjectionBases.h 36373 2010-10-19 17:43:35Z matevz $
00002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, 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 #ifndef ROOT_TEveProjectionBases
00013 #define ROOT_TEveProjectionBases
00014 
00015 #include "Rtypes.h"
00016 #include <list>
00017 #include <set>
00018 
00019 class TEveElement;
00020 class TEveProjection;
00021 class TEveProjected;
00022 class TEveProjectionManager;
00023 
00024 class TClass;
00025 
00026 ////////////////////////////////////////////////////////////////
00027 //                                                            //
00028 // TEveProjectable                                            //
00029 //                                                            //
00030 // Abstract base class for non-linear projectable objects.    //
00031 //                                                            //
00032 ////////////////////////////////////////////////////////////////
00033 
00034 class TEveProjectable
00035 {
00036 private:
00037    TEveProjectable(const TEveProjectable&);            // Not implemented
00038    TEveProjectable& operator=(const TEveProjectable&); // Not implemented
00039 
00040 public:
00041    typedef std::list<TEveProjected*>            ProjList_t;
00042    typedef std::list<TEveProjected*>::iterator  ProjList_i;
00043 
00044 protected:
00045    ProjList_t       fProjectedList; // references to projected instances.
00046 
00047 public:
00048    TEveProjectable();
00049    virtual ~TEveProjectable();
00050 
00051    virtual TClass* ProjectedClass(const TEveProjection* p) const = 0;
00052 
00053    virtual Bool_t HasProjecteds() const { return ! fProjectedList.empty(); }
00054 
00055    ProjList_i   BeginProjecteds()       { return  fProjectedList.begin(); }
00056    ProjList_i   EndProjecteds()         { return  fProjectedList.end();   }
00057 
00058    virtual void AddProjected(TEveProjected* p)    { fProjectedList.push_back(p); }
00059    virtual void RemoveProjected(TEveProjected* p) { fProjectedList.remove(p);   }
00060 
00061    virtual void AnnihilateProjecteds();
00062    virtual void ClearProjectedList();
00063 
00064    virtual void AddProjectedsToSet(std::set<TEveElement*>& set);
00065 
00066    virtual void PropagateVizParams(TEveElement* el=0);
00067    virtual void PropagateRenderState(Bool_t rnr_self, Bool_t rnr_children);
00068    virtual void PropagateMainColor(Color_t color, Color_t old_color);
00069    virtual void PropagateMainTransparency(Char_t t, Char_t old_t);
00070 
00071    ClassDef(TEveProjectable, 0); // Abstract base class for classes that can be transformed with non-linear projections.
00072 };
00073 
00074 
00075 ////////////////////////////////////////////////////////////////
00076 //                                                            //
00077 // TEveProjected                                              //
00078 //                                                            //
00079 // Abstract base class for non-linear projected objects.      //
00080 //                                                            //
00081 ////////////////////////////////////////////////////////////////
00082 
00083 class TEveProjected
00084 {
00085 private:
00086    TEveProjected(const TEveProjected&);            // Not implemented
00087    TEveProjected& operator=(const TEveProjected&); // Not implemented
00088 
00089 protected:
00090    TEveProjectionManager *fManager;       // manager
00091    TEveProjectable       *fProjectable;   // link to original object
00092    Float_t                fDepth;         // z coordinate
00093 
00094    void         SetDepthCommon(Float_t d, TEveElement* el, Float_t* bbox);
00095    virtual void SetDepthLocal(Float_t d);
00096 
00097 public:
00098    TEveProjected();
00099    virtual ~TEveProjected();
00100 
00101    TEveProjectionManager* GetManager()     const { return fManager; }
00102    TEveProjectable*       GetProjectable() const { return fProjectable; }
00103    Float_t                GetDepth()       const { return fDepth; }
00104 
00105    virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
00106    virtual void UnRefProjectable(TEveProjectable* assumed_parent, bool notifyParent = true);
00107 
00108    virtual void UpdateProjection() = 0;   
00109    virtual TEveElement* GetProjectedAsElement();
00110 
00111    virtual void SetDepth(Float_t d);
00112 
00113    ClassDef(TEveProjected, 0); // Abstract base class for classes that hold results of a non-linear projection transformation.
00114 };
00115 
00116 #endif

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