00001 // @(#)root/eve:$Id: TEveLine.h 35074 2010-08-30 15:18:02Z 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_TEveLine 00013 #define ROOT_TEveLine 00014 00015 #include "TEvePointSet.h" 00016 #include "TEveVector.h" 00017 00018 #include "TAttLine.h" 00019 00020 //------------------------------------------------------------------------------ 00021 // TEveLine 00022 //------------------------------------------------------------------------------ 00023 00024 class TEveLine : public TEvePointSet, 00025 public TAttLine 00026 { 00027 friend class TEveLineEditor; 00028 friend class TEveLineGL; 00029 00030 private: 00031 TEveLine(const TEveLine&); // Not implemented 00032 TEveLine& operator=(const TEveLine&); // Not implemented 00033 00034 protected: 00035 Bool_t fRnrLine; 00036 Bool_t fRnrPoints; 00037 Bool_t fSmooth; 00038 00039 static Bool_t fgDefaultSmooth; 00040 00041 public: 00042 TEveLine(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ); 00043 TEveLine(const char* name, Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ); 00044 virtual ~TEveLine() {} 00045 00046 virtual void SetMarkerColor(Color_t col); 00047 00048 virtual void SetLineColor(Color_t col) { SetMainColor(col); } 00049 virtual void SetLineStyle(Style_t lstyle); 00050 virtual void SetLineWidth(Width_t lwidth); 00051 00052 Bool_t GetRnrLine() const { return fRnrLine; } 00053 Bool_t GetRnrPoints() const { return fRnrPoints; } 00054 Bool_t GetSmooth() const { return fSmooth; } 00055 void SetRnrLine(Bool_t r); 00056 void SetRnrPoints(Bool_t r); 00057 void SetSmooth(Bool_t r); 00058 00059 void ReduceSegmentLengths(Float_t max); 00060 00061 TEveVector GetLineStart() const; 00062 TEveVector GetLineEnd() const; 00063 00064 virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE); 00065 00066 virtual void CopyVizParams(const TEveElement* el); 00067 virtual void WriteVizParams(ostream& out, const TString& var); 00068 00069 virtual TClass* ProjectedClass(const TEveProjection* p) const; 00070 00071 static Bool_t GetDefaultSmooth(); 00072 static void SetDefaultSmooth(Bool_t r); 00073 00074 ClassDef(TEveLine, 0); // An arbitrary polyline with fixed line and marker attributes. 00075 }; 00076 00077 00078 //------------------------------------------------------------------------------ 00079 // TEveLineProjected 00080 //------------------------------------------------------------------------------ 00081 00082 class TEveLineProjected : public TEveLine, 00083 public TEveProjected 00084 { 00085 private: 00086 TEveLineProjected(const TEveLineProjected&); // Not implemented 00087 TEveLineProjected& operator=(const TEveLineProjected&); // Not implemented 00088 00089 protected: 00090 virtual void SetDepthLocal(Float_t d); 00091 00092 public: 00093 TEveLineProjected(); 00094 virtual ~TEveLineProjected() {} 00095 00096 virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model); 00097 virtual void UpdateProjection(); 00098 virtual TEveElement* GetProjectedAsElement() { return this; } 00099 00100 ClassDef(TEveLineProjected, 0); // Projected replica of a TEveLine. 00101 }; 00102 00103 #endif