TEvePointSet.h

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEvePointSet.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_TEvePointSet
00013 #define ROOT_TEvePointSet
00014 
00015 #include "TEveElement.h"
00016 #include "TEveProjectionBases.h"
00017 #include "TEveTreeTools.h"
00018 
00019 #include "TArrayI.h"
00020 #include "TPointSet3D.h"
00021 #include "TQObject.h"
00022 
00023 class TTree;
00024 class TF3;
00025 class TGListTreeItem;
00026 
00027 /******************************************************************************/
00028 // TEvePointSet
00029 /******************************************************************************/
00030 
00031 class TEvePointSet : public TEveElement,
00032                      public TPointSet3D,
00033                      public TEvePointSelectorConsumer,
00034                      public TEveProjectable,
00035                      public TQObject
00036 {
00037    friend class TEvePointSetArray;
00038 
00039 private:
00040    TEvePointSet& operator=(const TEvePointSet&); // Not implemented
00041 
00042 protected:
00043    TString  fTitle;           // Title/tooltip of the TEvePointSet.
00044    TArrayI *fIntIds;          // Optional array of integer ideices.
00045    Int_t    fIntIdsPerPoint;  // Number of integer indices assigned to each point.
00046 
00047    void AssertIntIdsSize();
00048 
00049 public:
00050    TEvePointSet(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ);
00051    TEvePointSet(const char* name, Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ);
00052    TEvePointSet(const TEvePointSet& e);
00053    virtual ~TEvePointSet();
00054 
00055    virtual TObject* GetObject(const TEveException&) const
00056    { const TObject* obj = this; return const_cast<TObject*>(obj); }
00057 
00058    virtual TEvePointSet* CloneElement() const { return new TEvePointSet(*this); }
00059 
00060    virtual void ClonePoints(const TEvePointSet& e);
00061 
00062    void  Reset(Int_t n_points=0, Int_t n_int_ids=0);
00063    Int_t GrowFor(Int_t n_points);
00064 
00065    virtual const char* GetTitle()         const { return fTitle; }
00066    virtual const char* GetElementName()   const { return TPointSet3D::GetName(); }
00067    virtual const char* GetElementTitle()  const { return fTitle; }
00068    virtual void  SetElementName (const char* n) { fName  = n; NameTitleChanged(); }
00069    virtual void  SetTitle(const char* t)        { fTitle = t; NameTitleChanged(); }
00070    virtual void  SetElementTitle(const char* t) { fTitle = t; NameTitleChanged(); }
00071    virtual void  SetElementNameTitle(const char* n, const char* t)
00072    { fName = n; fTitle = t; NameTitleChanged(); }
00073 
00074    Int_t  GetIntIdsPerPoint() const { return fIntIdsPerPoint; }
00075    Int_t* GetPointIntIds(Int_t p) const;
00076    Int_t  GetPointIntId(Int_t p, Int_t i) const;
00077 
00078    void   SetPointIntIds(Int_t* ids);
00079    void   SetPointIntIds(Int_t n, Int_t* ids);
00080 
00081    virtual void SetMarkerColor(Color_t col) { SetMainColor(col); }
00082    virtual void SetMarkerStyle(Style_t mstyle=1);
00083    virtual void SetMarkerSize(Size_t msize=1);
00084 
00085    virtual void Paint(Option_t* option="");
00086 
00087    virtual void InitFill(Int_t subIdNum);
00088    virtual void TakeAction(TEvePointSelector*);
00089 
00090    virtual void PointSelected(Int_t id); // *SIGNAL*
00091 
00092    virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE);
00093 
00094    virtual void CopyVizParams(const TEveElement* el);
00095    virtual void WriteVizParams(ostream& out, const TString& var);
00096 
00097    virtual TClass* ProjectedClass(const TEveProjection* p) const;
00098 
00099    ClassDef(TEvePointSet, 1); // Set of 3D points with same marker attributes; optionally each point can be assigned an external TRef or a number of integer indices.
00100 };
00101 
00102 
00103 /******************************************************************************/
00104 // TEvePointSetArray
00105 /******************************************************************************/
00106 
00107 class TEvePointSetArray : public TEveElement,
00108                           public TNamed,
00109                           public TAttMarker,
00110                           public TEvePointSelectorConsumer
00111 {
00112    friend class TEvePointSetArrayEditor;
00113 
00114    TEvePointSetArray(const TEvePointSetArray&);            // Not implemented
00115    TEvePointSetArray& operator=(const TEvePointSetArray&); // Not implemented
00116 
00117 protected:
00118    TEvePointSet **fBins;               //  Pointers to subjugated TEvePointSet's.
00119    Int_t        fDefPointSetCapacity;  //  Default capacity of subjugated TEvePointSet's.
00120    Int_t        fNBins;                //  Number of subjugated TEvePointSet's.
00121    Int_t        fLastBin;              //! Index of the last filled TEvePointSet.
00122    Double_t     fMin, fCurMin;         //  Overall and current minimum value of the separating quantity.
00123    Double_t     fMax, fCurMax;         //  Overall and current maximum value of the separating quantity.
00124    Double_t     fBinWidth;             //  Separating quantity bin-width.
00125    TString      fQuantName;            //  Name of the separating quantity.
00126 
00127 public:
00128    TEvePointSetArray(const char* name="TEvePointSetArray", const char* title="");
00129    virtual ~TEvePointSetArray();
00130 
00131    virtual void RemoveElementLocal(TEveElement* el);
00132    virtual void RemoveElementsLocal();
00133 
00134    virtual void SetMarkerColor(Color_t tcolor=1);
00135    virtual void SetMarkerStyle(Style_t mstyle=1);
00136    virtual void SetMarkerSize(Size_t msize=1);
00137 
00138    virtual void TakeAction(TEvePointSelector*);
00139 
00140    virtual Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const;
00141 
00142    void   InitBins(const char* quant_name, Int_t nbins, Double_t min, Double_t max);
00143    Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant);
00144    void   SetPointId(TObject* id);
00145    void   CloseBins();
00146 
00147    void   SetOwnIds(Bool_t o);
00148 
00149    Int_t  GetDefPointSetCapacity() const  { return fDefPointSetCapacity; }
00150    void   SetDefPointSetCapacity(Int_t c) { fDefPointSetCapacity = c; }
00151 
00152    Int_t         GetNBins()        const { return fNBins; }
00153    TEvePointSet* GetBin(Int_t bin) const { return fBins[bin]; }
00154 
00155    Double_t GetMin()    const { return fMin; }
00156    Double_t GetCurMin() const { return fCurMin; }
00157    Double_t GetMax()    const { return fMax; }
00158    Double_t GetCurMax() const { return fCurMax; }
00159 
00160    void SetRange(Double_t min, Double_t max);
00161 
00162    ClassDef(TEvePointSetArray, 1); // Array of TEvePointSet's filled via a common point-source; range of displayed TEvePointSet's can be controlled, based on a separating quantity provided on fill-time by a user.
00163 };
00164 
00165 
00166 /******************************************************************************/
00167 // TEvePointSetProjected
00168 /******************************************************************************/
00169 
00170 class TEvePointSetProjected : public TEvePointSet,
00171                               public TEveProjected
00172 {
00173 private:
00174    TEvePointSetProjected(const TEvePointSetProjected&);            // Not implemented
00175    TEvePointSetProjected& operator=(const TEvePointSetProjected&); // Not implemented
00176 
00177 protected:
00178    virtual void SetDepthLocal(Float_t d);
00179 
00180 public:
00181    TEvePointSetProjected();
00182    virtual ~TEvePointSetProjected() {}
00183 
00184    virtual void SetProjection(TEveProjectionManager* proj, TEveProjectable* model);
00185    virtual void UpdateProjection();
00186    virtual TEveElement* GetProjectedAsElement() { return this; }
00187 
00188    virtual void PointSelected(Int_t id);
00189 
00190 
00191    ClassDef(TEvePointSetProjected, 1); // Projected copy of a TEvePointSet.
00192 };
00193 
00194 #endif

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