TGraphEdge.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TGraphEdge.h 30204 2009-09-16 14:55:06Z couet $
00002 // Author: Olivier Couet 13/07/09
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, 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_TGraphEdge
00013 #define ROOT_TGraphEdge
00014 
00015 #ifndef ROOT_TObject
00016 #include "TObject.h"
00017 #endif
00018 
00019 #ifndef ROOT_TAttLine
00020 #include "TAttLine.h"
00021 #endif
00022 
00023 struct Agraph_t;
00024 struct Agedge_t;
00025 class  TGraphNode;
00026 
00027 //////////////////////////////////////////////////////////////////////////
00028 //                                                                      //
00029 // TGraphEdge                                                           //
00030 //                                                                      //
00031 // Interface to the graphviz package.                                   //
00032 //                                                                      //
00033 //////////////////////////////////////////////////////////////////////////
00034 
00035 
00036 class TGraphEdge: public TObject, public TAttLine {
00037 
00038 protected:
00039 
00040    TGraphNode *fNode1;  // First node
00041    TGraphNode *fNode2;  // Second node
00042    Agedge_t   *fGVEdge; // Graphviz edge
00043    Double_t   *fX;      // X edge points (GV)
00044    Double_t   *fY;      // X edge points (GV)
00045    Int_t      *fN;      // number of edge points (GV)
00046                         // fN[0] = number of splines
00047                         // fN[1...n] = number of points in each spline
00048    Double_t    fArrX;   // Arrow X position
00049    Double_t    fArrY;   // Arrow Y position
00050 
00051 public:
00052 
00053    TGraphEdge();
00054    TGraphEdge(TGraphNode *n1, TGraphNode *n2);
00055    virtual ~TGraphEdge();
00056 
00057    void           CreateGVEdge(Agraph_t *gv);
00058    virtual Int_t  DistancetoPrimitive(Int_t px, Int_t py);
00059    virtual void   ExecuteEvent(Int_t event, Int_t px, Int_t py);
00060    void           SetGVEdge(Agedge_t *gve) {fGVEdge = gve;}
00061    Agedge_t      *GetGVEdge() {return fGVEdge;}
00062    TGraphNode    *GetNode1() {return fNode1;}
00063    TGraphNode    *GetNode2() {return fNode2;}
00064    void           Layout();            
00065    virtual void   Paint(Option_t *option="");
00066    virtual void   SavePrimitive(ostream &, Option_t *);
00067    void           SaveAttributes(ostream &, const char*);                  
00068 
00069 
00070    ClassDef(TGraphEdge,1)  //Graph edge class
00071 };
00072 
00073 #endif

Generated on Tue Jul 5 14:14:28 2011 for ROOT_528-00b_version by  doxygen 1.5.1