// @(#)root/g3d:$Id$
// Author: Nenad Buncic   17/08/95

/*************************************************************************
 * Copyright (C) 1995-2000, 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_TPolyLine3D
#define ROOT_TPolyLine3D


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TPolyLine3D                                                          //
//                                                                      //
// A 3-D polyline.                                                      //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TList
#include "TList.h"
#endif
#ifndef ROOT_TTString
#include "TString.h"
#endif
#ifndef ROOT_TAttLine
#include "TAttLine.h"
#endif
#ifndef ROOT_TAtt3D
#include "TAtt3D.h"
#endif


class TPolyLine3D : public TObject, public TAttLine, public TAtt3D
{
protected:
   Int_t        fN;            //Number of points
   Float_t     *fP;            //[3*fN] Array of 3-D coordinates  (x,y,z)
   TString      fOption;       //options
   Int_t        fLastPoint;    //The index of the last filled point

public:
   TPolyLine3D();
   TPolyLine3D(Int_t n, Option_t *option="");
   TPolyLine3D(Int_t n, Float_t *p, Option_t *option="");
   TPolyLine3D(Int_t n, Double_t *p, Option_t *option="");
   TPolyLine3D(Int_t n, Float_t *x, Float_t *y, Float_t *z, Option_t *option="");
   TPolyLine3D(Int_t n, Double_t *x, Double_t *y, Double_t *z, Option_t *option="");
   TPolyLine3D(const TPolyLine3D &polylin);
   TPolyLine3D& operator=(const TPolyLine3D &polylin);
   virtual ~TPolyLine3D();

   virtual void      Copy(TObject &polyline) const;
   virtual Int_t     DistancetoPrimitive(Int_t px, Int_t py);
   virtual void      Draw(Option_t *option="");
   virtual void      DrawPolyLine(Int_t n, Float_t *p, Option_t *option="");
   virtual void      ExecuteEvent(Int_t event, Int_t px, Int_t py);
   Int_t             GetLastPoint() const {return fLastPoint;}
   Int_t             GetN() const {return fN;}
   Float_t          *GetP() const {return fP;}
   Option_t         *GetOption() const {return fOption.Data();}
   virtual void      ls(Option_t *option="") const;
   virtual Int_t     Merge(TCollection *list);
   virtual void      Paint(Option_t *option="");
   virtual void      Print(Option_t *option="") const;
   virtual void      SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual Int_t     SetNextPoint(Double_t x, Double_t y, Double_t z); // *MENU*
   virtual void      SetOption(Option_t *option="") {fOption = option;}
   virtual void      SetPoint(Int_t point, Double_t x, Double_t y, Double_t z); // *MENU*
   virtual void      SetPolyLine(Int_t n, Option_t *option="");
   virtual void      SetPolyLine(Int_t n, Float_t *p, Option_t *option="");
   virtual void      SetPolyLine(Int_t n, Double_t *p, Option_t *option="");
   virtual Int_t     Size() const { return fLastPoint+1;}

   static  void      DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax);

   ClassDef(TPolyLine3D,1)  //A 3-D polyline
};

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