Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TEvePointSet.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/eve:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TEvePointSet
0013 #define ROOT_TEvePointSet
0014 
0015 #include "TEveElement.h"
0016 #include "TEveProjectionBases.h"
0017 #include "TEveTreeTools.h"
0018 
0019 #include "TArrayI.h"
0020 #include "TPointSet3D.h"
0021 #include "TQObject.h"
0022 
0023 class TTree;
0024 class TF3;
0025 class TGListTreeItem;
0026 
0027 /******************************************************************************/
0028 // TEvePointSet
0029 /******************************************************************************/
0030 
0031 class TEvePointSet : public TEveElement,
0032                      public TPointSet3D,
0033                      public TEvePointSelectorConsumer,
0034                      public TEveProjectable,
0035                      public TQObject
0036 {
0037    friend class TEvePointSetArray;
0038 
0039 private:
0040    TEvePointSet& operator=(const TEvePointSet&); // Not implemented
0041 
0042 protected:
0043    TString  fTitle;           // Title/tooltip of the TEvePointSet.
0044    TArrayI *fIntIds;          // Optional array of integer ideices.
0045    Int_t    fIntIdsPerPoint;  // Number of integer indices assigned to each point.
0046 
0047    void AssertIntIdsSize();
0048 
0049 public:
0050    TEvePointSet(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ);
0051    TEvePointSet(const char* name, Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ);
0052    TEvePointSet(const TEvePointSet& e);
0053    ~TEvePointSet() override;
0054 
0055    TObject* GetObject(const TEveException&) const override
0056    { const TObject* obj = this; return const_cast<TObject*>(obj); }
0057 
0058    TEvePointSet* CloneElement() const override { return new TEvePointSet(*this); }
0059 
0060    virtual void ClonePoints(const TEvePointSet& e);
0061 
0062    void  Reset(Int_t n_points=0, Int_t n_int_ids=0);
0063    Int_t GrowFor(Int_t n_points);
0064 
0065    const char* GetTitle()         const override { return fTitle; }
0066    const char* GetElementName()   const override { return TPointSet3D::GetName(); }
0067    const char* GetElementTitle()  const override { return fTitle; }
0068    void  SetElementName (const char* n) override { fName  = n; NameTitleChanged(); }
0069    virtual void  SetTitle(const char* t)        { fTitle = t; NameTitleChanged(); }
0070    void  SetElementTitle(const char* t) override { fTitle = t; NameTitleChanged(); }
0071    void  SetElementNameTitle(const char* n, const char* t) override
0072    { fName = n; fTitle = t; NameTitleChanged(); }
0073 
0074    Int_t  GetIntIdsPerPoint() const { return fIntIdsPerPoint; }
0075    Int_t* GetPointIntIds(Int_t p) const;
0076    Int_t  GetPointIntId(Int_t p, Int_t i) const;
0077 
0078    void   SetPointIntIds(Int_t* ids);
0079    void   SetPointIntIds(Int_t n, Int_t* ids);
0080 
0081    void SetMarkerColor(Color_t col) override { SetMainColor(col); }
0082    void SetMarkerStyle(Style_t mstyle=1) override;
0083    void SetMarkerSize(Size_t msize=1) override;
0084 
0085    void Paint(Option_t* option="") override;
0086 
0087    void InitFill(Int_t subIdNum) override;
0088    void TakeAction(TEvePointSelector*) override;
0089 
0090    void PointSelected(Int_t id) override; // *SIGNAL*
0091 
0092    const TGPicture* GetListTreeIcon(Bool_t open=kFALSE) override;
0093 
0094    void CopyVizParams(const TEveElement* el) override;
0095    void WriteVizParams(std::ostream& out, const TString& var) override;
0096 
0097    TClass* ProjectedClass(const TEveProjection* p) const override;
0098 
0099    ClassDefOverride(TEvePointSet, 0); // Set of 3D points with same marker attributes; optionally each point can be assigned an external TRef or a number of integer indices.
0100 };
0101 
0102 
0103 /******************************************************************************/
0104 // TEvePointSetArray
0105 /******************************************************************************/
0106 
0107 class TEvePointSetArray : public TEveElement,
0108                           public TNamed,
0109                           public TAttMarker,
0110                           public TEvePointSelectorConsumer
0111 {
0112    friend class TEvePointSetArrayEditor;
0113 
0114    TEvePointSetArray(const TEvePointSetArray&);            // Not implemented
0115    TEvePointSetArray& operator=(const TEvePointSetArray&); // Not implemented
0116 
0117 protected:
0118    TEvePointSet **fBins;               //  Pointers to subjugated TEvePointSet's.
0119    Int_t        fDefPointSetCapacity;  //  Default capacity of subjugated TEvePointSet's.
0120    Int_t        fNBins;                //  Number of subjugated TEvePointSet's.
0121    Int_t        fLastBin;              //! Index of the last filled TEvePointSet.
0122    Double_t     fMin, fCurMin;         //  Overall and current minimum value of the separating quantity.
0123    Double_t     fMax, fCurMax;         //  Overall and current maximum value of the separating quantity.
0124    Double_t     fBinWidth;             //  Separating quantity bin-width.
0125    TString      fQuantName;            //  Name of the separating quantity.
0126 
0127 public:
0128    TEvePointSetArray(const char* name="TEvePointSetArray", const char* title="");
0129    ~TEvePointSetArray() override;
0130 
0131    void RemoveElementLocal(TEveElement* el) override;
0132    void RemoveElementsLocal() override;
0133 
0134    void SetMarkerColor(Color_t tcolor=1) override;
0135    void SetMarkerStyle(Style_t mstyle=1) override;
0136    void SetMarkerSize(Size_t msize=1) override;
0137 
0138    void TakeAction(TEvePointSelector*) override;
0139 
0140    virtual Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const;
0141 
0142    void   InitBins(const char* quant_name, Int_t nbins, Double_t min, Double_t max);
0143    Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant);
0144    void   SetPointId(TObject* id);
0145    void   CloseBins();
0146 
0147    void   SetOwnIds(Bool_t o);
0148 
0149    Int_t  GetDefPointSetCapacity() const  { return fDefPointSetCapacity; }
0150    void   SetDefPointSetCapacity(Int_t c) { fDefPointSetCapacity = c; }
0151 
0152    Int_t         GetNBins()        const { return fNBins; }
0153    TEvePointSet* GetBin(Int_t bin) const { return fBins[bin]; }
0154 
0155    Double_t GetMin()    const { return fMin; }
0156    Double_t GetCurMin() const { return fCurMin; }
0157    Double_t GetMax()    const { return fMax; }
0158    Double_t GetCurMax() const { return fCurMax; }
0159 
0160    void SetRange(Double_t min, Double_t max);
0161 
0162    ClassDefOverride(TEvePointSetArray, 0); // 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.
0163 };
0164 
0165 
0166 /******************************************************************************/
0167 // TEvePointSetProjected
0168 /******************************************************************************/
0169 
0170 class TEvePointSetProjected : public TEvePointSet,
0171                               public TEveProjected
0172 {
0173 private:
0174    TEvePointSetProjected(const TEvePointSetProjected&);            // Not implemented
0175    TEvePointSetProjected& operator=(const TEvePointSetProjected&); // Not implemented
0176 
0177 protected:
0178    void SetDepthLocal(Float_t d) override;
0179 
0180 public:
0181    TEvePointSetProjected();
0182    ~TEvePointSetProjected() override {}
0183 
0184    void SetProjection(TEveProjectionManager* proj, TEveProjectable* model) override;
0185    void UpdateProjection() override;
0186    TEveElement* GetProjectedAsElement() override { return this; }
0187 
0188    void PointSelected(Int_t id) override;
0189 
0190 
0191    ClassDefOverride(TEvePointSetProjected, 0); // Projected copy of a TEvePointSet.
0192 };
0193 
0194 #endif