ROOT logo
ROOT » GRAF2D » GRAF » TPolyLine

class TPolyLine: public TObject, public TAttLine, public TAttFill

  a PolyLine is defined by an array on N points in a 2-D space.

 One can draw the contour of the polyline or/and its fill area.
   Double_t x[5] = {.2,.7,.6,.25,.2};
   Double_t y[5] = {.5,.1,.9,.7,.5};
   TPolyLine *pline = new TPolyLine(5,x,y);

Function Members (Methods)

TPolyLine(const TPolyLine& polyline)
TPolyLine(Int_t n, Option_t* option = "")
TPolyLine(Int_t n, Float_t* x, Float_t* y, Option_t* option = "")
TPolyLine(Int_t n, Double_t* x, Double_t* y, Option_t* option = "")
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
static TClass*TAttFill::Class()
static TClass*TAttLine::Class()
static TClass*TObject::Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidCopy(TObject& polyline) const
voidTAttFill::Copy(TAttFill& attfill) const
voidTAttLine::Copy(TAttLine& attline) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
Int_tTAttLine::DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
virtual Int_tDistancetoPrimitive(Int_t px, Int_t py)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidDraw(Option_t* option = "")
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidDrawPolyLine(Int_t n, Double_t* x, Double_t* y, Option_t* option = "")
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Color_tTAttFill::GetFillColor() const
virtual Style_tTAttFill::GetFillStyle() const
virtual const char*TObject::GetIconName() const
virtual Int_tGetLastPoint() const
virtual Color_tTAttLine::GetLineColor() const
virtual Style_tTAttLine::GetLineStyle() const
virtual Width_tTAttLine::GetLineWidth() const
Int_tGetN() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*GetOption() const
virtual Option_t*TObject::GetOption() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Double_t*GetX() const
Double_t*GetY() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual TClass*TAttFill::IsA() const
virtual TClass*TAttLine::IsA() const
virtual TClass*TObject::IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
virtual Bool_tTAttFill::IsTransparent() const
Bool_tTObject::IsZombie() const
virtual voidls(Option_t* option = "") const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Int_tMerge(TCollection* list)
virtual voidTAttFill::Modify()
virtual voidTAttLine::Modify()
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TAttFill&TAttFill::operator=(const TAttFill&)
TAttLine&TAttLine::operator=(const TAttLine&)
TObject&TObject::operator=(const TObject& rhs)
virtual voidPaint(Option_t* option = "")
virtual voidPaintPolyLine(Int_t n, Double_t* x, Double_t* y, Option_t* option = "")
virtual voidPaintPolyLineNDC(Int_t n, Double_t* x, Double_t* y, Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidTAttFill::ResetAttFill(Option_t* option = "")
virtual voidTAttLine::ResetAttLine(Option_t* option = "")
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTAttFill::SaveFillAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1001)
virtual voidTAttLine::SaveLineAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1, Int_t widdef = 1)
virtual voidSavePrimitive(ostream& out, Option_t* option = "")
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTAttFill::SetFillAttributes()MENU
virtual voidTAttFill::SetFillColor(Color_t fcolor)
virtual voidTAttFill::SetFillStyle(Style_t fstyle)
virtual voidTAttLine::SetLineAttributes()MENU
virtual voidTAttLine::SetLineColor(Color_t lcolor)
virtual voidTAttLine::SetLineStyle(Style_t lstyle)
virtual voidTAttLine::SetLineWidth(Width_t lwidth)
virtual voidSetNDC(Bool_t isNDC = kTRUE)
virtual Int_tSetNextPoint(Double_t x, Double_t y)MENU
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidSetOption(Option_t* option = "")
virtual voidSetPoint(Int_t point, Double_t x, Double_t y)MENU
virtual voidSetPolyLine(Int_t n)
virtual voidSetPolyLine(Int_t n, Float_t* x, Float_t* y, Option_t* option = "")
virtual voidSetPolyLine(Int_t n, Double_t* x, Double_t* y3, Option_t* option = "")
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidTAttFill::ShowMembers(TMemberInspector& insp, char* parent)
virtual voidTAttLine::ShowMembers(TMemberInspector& insp, char* parent)
virtual voidTObject::ShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tSize() const
virtual voidStreamer(TBuffer& b)
virtual voidTAttFill::Streamer(TBuffer& b)
virtual voidTAttLine::Streamer(TBuffer& b)
virtual voidTObject::Streamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
voidTAttFill::StreamerNVirtual(TBuffer& b)
voidTAttLine::StreamerNVirtual(TBuffer& b)
voidTObject::StreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
TPolyLine&operator=(const TPolyLine&)

Data Members

Color_tTAttFill::fFillColorfill area color
Style_tTAttFill::fFillStylefill area style
Int_tfLastPointThe index of the last filled point
Color_tTAttLine::fLineColorline color
Style_tTAttLine::fLineStyleline style
Width_tTAttLine::fLineWidthline width
Int_tfNNumber of points
Double_t*fX[fN] Array of X coordinates
Double_t*fY[fN] Array of Y coordinates

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

 PolyLine default constructor.
TPolyLine(Int_t n, Option_t* option = "")
 PolyLine normal constructor without initialisation.
TPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option)
 PolyLine normal constructor.
TPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option)
 PolyLine normal constructor.
TPolyLine& operator=(const TPolyLine& )
assignment operator
 PolyLine default destructor.
TPolyLine(const TPolyLine& polyline)
 PolyLine copy constructor.
void Copy(TObject& polyline) const
 Copy this polyline to polyline.
Int_t DistancetoPrimitive(Int_t px, Int_t py)
 Compute distance from point px,py to a polyline.

  Compute the closest distance of approach from point px,py to each segment
  of the polyline.
  Returns when the distance found is below DistanceMaximum.
  The distance is computed in pixels units.
void Draw(Option_t* option = "")
 Draw this polyline with its current attributes.
void DrawPolyLine(Int_t n, Double_t* x, Double_t* y, Option_t* option = "")
 Draw this polyline with new coordinates.
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
 Execute action corresponding to one event.

  This member function is called when a polyline is clicked with the locator

  If Left button clicked on one of the line end points, this point
     follows the cursor until button is released.

  if Middle button clicked, the line is moved parallel to itself
     until the button is released.
void ls(Option_t* option = "") const
 List this polyline with its attributes.
Int_t Merge(TCollection* list)
 Merge polylines in the collection in this polyline
void Paint(Option_t* option = "")
 Paint this polyline with its current attributes.
void PaintPolyLine(Int_t n, Double_t* x, Double_t* y, Option_t* option = "")
 Draw this polyline with new coordinates.

  if option = 'f' or 'F' the fill area is drawn
  default is to draw the lines only
void PaintPolyLineNDC(Int_t n, Double_t* x, Double_t* y, Option_t* option = "")
 Draw this polyline with new coordinates in NDC.
void Print(Option_t* option = "") const
 Dump this polyline with its attributes.
void SavePrimitive(ostream& out, Option_t* option = "")
 Save primitive as a C++ statement(s) on output stream out
void SetNDC(Bool_t isNDC = kTRUE)
 Set NDC mode on if isNDC = kTRUE, off otherwise
Int_t SetNextPoint(Double_t x, Double_t y)
 Set point following LastPoint to x, y.
 Returns index of the point (new last point).
void SetPoint(Int_t point, Double_t x, Double_t y)
 set point number n
 if n is greater than the current size, the arrays are automatically
void SetPolyLine(Int_t n)
 if n <= 0 the current arrays of points are deleted.
void SetPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option)
 Set new values for this polyline.

 if n <= 0 the current arrays of points are deleted.
void SetPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option)
 Set new values for this polyline.

 if n <= 0 the current arrays of points are deleted.
void Streamer(TBuffer& b)
 Stream a class object.
Int_t GetLastPoint() const
{ return fLastPoint;}
Int_t GetN() const
{return fN;}
Double_t * GetX() const
{return fX;}
Double_t * GetY() const
{return fY;}
Option_t * GetOption() const
{return fOption.Data();}
void SetOption(Option_t* option = "")
{fOption = option;}
Int_t Size() const
{return fLastPoint+1;}