ROOT logo
// @(#)root/table:$Id: TPolyLineShape.h 20882 2007-11-19 11:31:26Z rdm $
// Author:

/*************************************************************************
 * 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_TPolyLineShape
#define ROOT_TPolyLineShape

#ifndef ROOT_TShape
#include "TShape.h"
#endif
#ifndef ROOT_TAttMarker
#include "TAttMarker.h"
#endif

class TPoints3DABC;
class TVirtualPad;

enum EShapeTypes { kNULL=0, kSphere, kBrik};

class TPolyLineShape : public TShape, public TAttMarker {
 protected:
   Bool_t        fPointFlag;   // Flag whether we should paint "points" (option "P")
   Bool_t        fLineFlag;    // Flag whether we should connect the points with "line" (option "L")
   EShapeTypes   fShapeType;   // shape of the segment connections
   TShape       *fShape;       // shape for draw each segment of the polylins
   TShape       *fConnection;  // shape to represent the each "end" of the polyline
   TPoints3DABC   *fPoints;    // PolyLine itself
   Float_t       fWidthFactor; // factor to calculate the the tube diameters
   Bool_t        fHasDrawn;    // flag to avoid multiply plots
   Bool_t        fSmooth;      // Make smooth connections
   Size3D       *fSizeX3D;     //! the X3D buffer sizes


protected:
   virtual void  Create();
   virtual Size3D *CreateX3DSize(Bool_t marker=kFALSE);
   virtual void  SetConnection(TShape *connection){ fConnection = connection;}
   virtual Int_t PointDistancetoPrimitive(Int_t px, Int_t py);

public:
   TPolyLineShape();
   TPolyLineShape(TPoints3DABC *points,Option_t* option="P");
   virtual ~TPolyLineShape();
   virtual Int_t        DistancetoPrimitive(Int_t px, Int_t py);
   virtual void         Draw(Option_t *opt="");
   virtual void         ExecuteEvent(Int_t event, Int_t px, Int_t py);
   virtual TShape      *GetConnection() const { return fConnection;}
   virtual Color_t      GetColorAttribute() const;
   virtual const char  *GetName()  const;
   virtual char        *GetObjectInfo(Int_t px, Int_t py) const;
   virtual Size_t       GetSizeAttribute()  const;
   virtual Style_t      GetStyleAttribute() const;
   virtual const char  *GetTitle() const;
   virtual TPoints3DABC *GetMarker() const { return fPoints;}
   virtual TPoints3DABC *GetPoints() const { return fPoints;}
   virtual TShape      *GetShape() const { return fShape;}
   virtual Bool_t       GetSmooth() const { return fSmooth;}
   virtual Float_t      GetWidthFactor() const { return fWidthFactor;}
   virtual void         PaintNode(Float_t *start,Float_t *end,Option_t *option);
   virtual void         Paint(Option_t *opt);
   virtual void         Paint3d(Option_t *opt);
   virtual void         PaintX3DLine(Option_t *opt="");
   virtual void         PaintX3DMarker(Option_t *opt="");
   static Double_t     *Gyrot(Double_t *dirc, Double_t cosang,Double_t sinang, Double_t trans[3][3]);
   virtual void         PaintPoints(Int_t n, Float_t *p=0, Option_t *opt="");
   virtual void         PaintPolyMarker(Int_t n, Float_t *p=0, Marker_t m=0, Option_t *opt="");
   static Float_t       Product(Float_t *v1, Float_t *v2,Int_t ndim=3);
   static Double_t      Product(Double_t *v1, Double_t *v2,Int_t ndim=3);
   virtual Color_t      SetColorAttribute(Color_t color);
   virtual Size_t       SetSizeAttribute(Size_t size);
   virtual Int_t        SetConnection(EShapeTypes connection=kBrik);
   virtual void         SetShape(TShape *shape);
   virtual void         SetSmooth(Bool_t smooth=kTRUE){ fSmooth=smooth;}
   virtual Style_t      SetStyleAttribute(Style_t style);
   virtual void         SetWidthFactor(Float_t fact=1.0){fWidthFactor = fact;} //*MENU
   virtual Int_t        Size() const;
   virtual void         Sizeof3D() const;
   ClassDef(TPolyLineShape,0) // The base class to define an abstract 3D shape of STAR "event" geometry
};


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