// @(#)root/eve:$Id$
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007

/*************************************************************************
 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TEveLine
#define ROOT_TEveLine

#include "TEvePointSet.h"
#include "TEveVector.h"

#include "TAttLine.h"

//------------------------------------------------------------------------------
// TEveLine
//------------------------------------------------------------------------------

class TEveLine : public TEvePointSet,
                 public TAttLine
{
   friend class TEveLineEditor;
   friend class TEveLineGL;

private:
   TEveLine(const TEveLine&);            // Not implemented
   TEveLine& operator=(const TEveLine&); // Not implemented

protected:
   Bool_t  fRnrLine;
   Bool_t  fRnrPoints;
   Bool_t  fSmooth;

   static Bool_t fgDefaultSmooth;

public:
   TEveLine(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ);
   TEveLine(const char* name, Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ);
   virtual ~TEveLine() {}

   virtual void SetMarkerColor(Color_t col);

   virtual void SetLineColor(Color_t col)   { SetMainColor(col); }
   virtual void SetLineStyle(Style_t lstyle);
   virtual void SetLineWidth(Width_t lwidth);

   Bool_t GetRnrLine() const     { return fRnrLine;   }
   Bool_t GetRnrPoints() const   { return fRnrPoints; }
   Bool_t GetSmooth() const      { return fSmooth;    }
   void   SetRnrLine(Bool_t r);
   void   SetRnrPoints(Bool_t r);
   void   SetSmooth(Bool_t r);

   void    ReduceSegmentLengths(Float_t max);
   Float_t CalculateLineLength() const;

   TEveVector GetLineStart() const;
   TEveVector GetLineEnd()   const;

   virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE);

   virtual void CopyVizParams(const TEveElement* el);
   virtual void WriteVizParams(std::ostream& out, const TString& var);

   virtual TClass* ProjectedClass(const TEveProjection* p) const;

   static Bool_t GetDefaultSmooth();
   static void   SetDefaultSmooth(Bool_t r);

   ClassDef(TEveLine, 0); // An arbitrary polyline with fixed line and marker attributes.
};


//------------------------------------------------------------------------------
// TEveLineProjected
//------------------------------------------------------------------------------

class TEveLineProjected : public TEveLine,
                          public TEveProjected
{
private:
   TEveLineProjected(const TEveLineProjected&);            // Not implemented
   TEveLineProjected& operator=(const TEveLineProjected&); // Not implemented

protected:
   virtual void SetDepthLocal(Float_t d);

public:
   TEveLineProjected();
   virtual ~TEveLineProjected() {}

   virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
   virtual void UpdateProjection();
   virtual TEveElement* GetProjectedAsElement() { return this; }

   ClassDef(TEveLineProjected, 0); // Projected replica of a TEveLine.
};

#endif
 TEveLine.h:1
 TEveLine.h:2
 TEveLine.h:3
 TEveLine.h:4
 TEveLine.h:5
 TEveLine.h:6
 TEveLine.h:7
 TEveLine.h:8
 TEveLine.h:9
 TEveLine.h:10
 TEveLine.h:11
 TEveLine.h:12
 TEveLine.h:13
 TEveLine.h:14
 TEveLine.h:15
 TEveLine.h:16
 TEveLine.h:17
 TEveLine.h:18
 TEveLine.h:19
 TEveLine.h:20
 TEveLine.h:21
 TEveLine.h:22
 TEveLine.h:23
 TEveLine.h:24
 TEveLine.h:25
 TEveLine.h:26
 TEveLine.h:27
 TEveLine.h:28
 TEveLine.h:29
 TEveLine.h:30
 TEveLine.h:31
 TEveLine.h:32
 TEveLine.h:33
 TEveLine.h:34
 TEveLine.h:35
 TEveLine.h:36
 TEveLine.h:37
 TEveLine.h:38
 TEveLine.h:39
 TEveLine.h:40
 TEveLine.h:41
 TEveLine.h:42
 TEveLine.h:43
 TEveLine.h:44
 TEveLine.h:45
 TEveLine.h:46
 TEveLine.h:47
 TEveLine.h:48
 TEveLine.h:49
 TEveLine.h:50
 TEveLine.h:51
 TEveLine.h:52
 TEveLine.h:53
 TEveLine.h:54
 TEveLine.h:55
 TEveLine.h:56
 TEveLine.h:57
 TEveLine.h:58
 TEveLine.h:59
 TEveLine.h:60
 TEveLine.h:61
 TEveLine.h:62
 TEveLine.h:63
 TEveLine.h:64
 TEveLine.h:65
 TEveLine.h:66
 TEveLine.h:67
 TEveLine.h:68
 TEveLine.h:69
 TEveLine.h:70
 TEveLine.h:71
 TEveLine.h:72
 TEveLine.h:73
 TEveLine.h:74
 TEveLine.h:75
 TEveLine.h:76
 TEveLine.h:77
 TEveLine.h:78
 TEveLine.h:79
 TEveLine.h:80
 TEveLine.h:81
 TEveLine.h:82
 TEveLine.h:83
 TEveLine.h:84
 TEveLine.h:85
 TEveLine.h:86
 TEveLine.h:87
 TEveLine.h:88
 TEveLine.h:89
 TEveLine.h:90
 TEveLine.h:91
 TEveLine.h:92
 TEveLine.h:93
 TEveLine.h:94
 TEveLine.h:95
 TEveLine.h:96
 TEveLine.h:97
 TEveLine.h:98
 TEveLine.h:99
 TEveLine.h:100
 TEveLine.h:101
 TEveLine.h:102
 TEveLine.h:103
 TEveLine.h:104