00001
00002
00003
00004
00005
00006
00007
00008
00009
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
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&);
00041
00042 protected:
00043 TString fTitle;
00044 TArrayI *fIntIds;
00045 Int_t fIntIdsPerPoint;
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);
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);
00100 };
00101
00102
00103
00104
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&);
00115 TEvePointSetArray& operator=(const TEvePointSetArray&);
00116
00117 protected:
00118 TEvePointSet **fBins;
00119 Int_t fDefPointSetCapacity;
00120 Int_t fNBins;
00121 Int_t fLastBin;
00122 Double_t fMin, fCurMin;
00123 Double_t fMax, fCurMax;
00124 Double_t fBinWidth;
00125 TString fQuantName;
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);
00163 };
00164
00165
00166
00167
00168
00169
00170 class TEvePointSetProjected : public TEvePointSet,
00171 public TEveProjected
00172 {
00173 private:
00174 TEvePointSetProjected(const TEvePointSetProjected&);
00175 TEvePointSetProjected& operator=(const TEvePointSetProjected&);
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);
00192 };
00193
00194 #endif