TPolyLine3D


class description - source file - inheritance tree

class TPolyLine3D : public TObject, public TAttLine, public TAtt3D


    public:
TPolyLine3D TPolyLine3D() TPolyLine3D TPolyLine3D(Int_t n, Option_t* option) TPolyLine3D TPolyLine3D(Int_t n, Float_t* p, Option_t* option) TPolyLine3D TPolyLine3D(Int_t n, Double_t* p, Option_t* option) TPolyLine3D TPolyLine3D(Int_t n, Float_t* x, Float_t* y, Float_t* z, Option_t* option) TPolyLine3D TPolyLine3D(Int_t n, Double_t* x, Double_t* y, Double_t* z, Option_t* option) TPolyLine3D TPolyLine3D(const TPolyLine3D& polylin) virtual void ~TPolyLine3D() static TClass* Class() virtual void Copy(TObject& polyline) virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) virtual void Draw(Option_t* option) static void DrawOutlineCube(TList* outline, Double_t* rmin, Double_t* rmax) 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 Int_t GetN() const virtual Option_t* GetOption() const Float_t* GetP() const virtual TClass* IsA() const virtual void ls(Option_t* option) const virtual void Paint(Option_t* option) virtual void PaintPolyLine(Int_t n, Float_t* p, Option_t* option) virtual void PaintPolyLine(Int_t n, Double_t* p, Option_t* option) virtual void Print(Option_t* option) const virtual void SavePrimitive(ofstream& out, Option_t* option) virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z) virtual void SetOption(Option_t* option) virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z) 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 void ShowMembers(TMemberInspector& insp, char* parent) virtual Int_t Size() const virtual void Sizeof3D() const virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

private:
protected:
Int_t fN Number of points Float_t* fP [3*fN] Array of 3-D coordinates (x,y,z) TString fOption options UInt_t fGLList !The list number for OpenGL view Int_t fLastPoint The index of the last filled point


See also

THelix

Class Description

 PolyLine3D is a 3-dimensional polyline. It has 4 different constructors.

   First one, without any parameters TPolyLine3D(), we call 'default
 constructor' and it's used in a case that just an initialisation is
 needed (i.e. pointer declaration).

       Example:
                 TPolyLine3D *pl1 = new TPolyLine3D;


   Second one is 'normal constructor' with, usually, one parameter
 n (number of points), and it just allocates a space for the points.

       Example:
                 TPolyLine3D pl1(150);


   Third one allocates a space for the points, and also makes
 initialisation from the given array.

       Example:
                 TPolyLine3D pl1(150, pointerToAnArray);


   Fourth one is, almost, similar to the constructor above, except
 initialisation is provided with three independent arrays (array of
 x coordinates, y coordinates and z coordinates).

       Example:
                 TPolyLine3D pl1(150, xArray, yArray, zArray);

 Example:
   void pl3() {
      TCanvas *c1 = new TCanvas("c1");
      TView *view = new TView(1);
      view->SetRange(0,0,0,2,2,2);
      const Int_t n = 100;
      TPolyLine3D *l = new TPolyLine3D(n);
      for (Int_t i=0;i<n;i++) {
         Double_t x = 2*gRandom->Rndm();
         Double_t y = 2*gRandom->Rndm();
         Double_t z = 2*gRandom->Rndm();
         l->SetPoint(i,x,y,z);
      }
      l->Draw();
   }

TPolyLine3D()
*-*-*-*-*-*-*-*-*-*-*-*-*3-D PolyLine default constructor*-*-*-*-*-*-*-*-*-*-*
*-*                      ================================

TPolyLine3D(Int_t n, Option_t *option)
*-*-*-*-*-*3-D PolyLine normal constructor without initialisation*-*-*-*-*-*-*
*-*        ======================================================
*-*  If n < 0 the default size (2 points) is set
*-*

TPolyLine3D(Int_t n, Float_t *p, Option_t *option)
*-*-*-*-*-*-*-*-*-*-*-*-*3-D PolyLine normal constructor*-*-*-*-*-*-*-*-*-*-*-*
*-*                      ===============================
*-*  If n < 0 the default size (2 points) is set
*-*

TPolyLine3D(Int_t n, Double_t *p, Option_t *option)
*-*-*-*-*-*-*-*-*-*-*-*-*3-D PolyLine normal constructor*-*-*-*-*-*-*-*-*-*-*-*
*-*                      ===============================
*-*  If n < 0 the default size (2 points) is set
*-*

TPolyLine3D(Int_t n, Float_t *x, Float_t *y, Float_t *z, Option_t *option)
*-*-*-*-*-*-*-*-*-*-*-*-*3-D PolyLine normal constructor*-*-*-*-*-*-*-*-*-*-*-*
*-*                      ===============================
*-*  If n < 0 the default size (2 points) is set
*-*

TPolyLine3D(Int_t n, Double_t *x, Double_t *y, Double_t *z, Option_t *option)
*-*-*-*-*-*-*-*-*-*-*-*-*3-D PolyLine normal constructor*-*-*-*-*-*-*-*-*-*-*-*
*-*                      ===============================
*-*  If n < 0 the default size (2 points) is set
*-*

~TPolyLine3D()
*-*-*-*-*-*-*-*-*-*-*-*-*3-D PolyLine default destructor*-*-*-*-*-*-*-*-*-*-*-*
*-*                      ===============================

TPolyLine3D(const TPolyLine3D &polyline)

void Copy(TObject &obj)
*-*-*-*-*-*-*-*-*-*-*-*-*Copy this polyline to polyline*-*-*-*-*-*-*-*-*-*-*-*
*-*                      ==============================

Int_t DistancetoPrimitive(Int_t px, Int_t py)
*-*-*-*-*-*-*-*Compute distance from point px,py to a 3-D 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 3-D polyline with its current attributes*-*-*-*-*-*-*
*-*            ==================================================

void DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax)
*-*-*-*-*-*-*-*Draw cube outline with 3d polylines*-*-*-*-*-*-*
*-*            ===================================
*-*                                                                    *
*-*      x = fRmin[0]        X = fRmax[0]                              *
*-*      y = fRmin[1]        Y = fRmax[1]                              *
*-*      z = fRmin[2]        Z = fRmax[2]                              *
*-*                                                                    *
*-*                                                                    *
*-*            (x,Y,Z) +---------+ (X,Y,Z)                             *
*-*                   /         /|                                     *
*-*                  /         / |                                     *
*-*                 /         /  |                                     *
*-*        (x,y,Z) +---------+   |                                     *
*-*                |         |   + (X,Y,z)                             *
*-*                |         |  /                                      *
*-*                |         | /                                       *
*-*                |         |/                                        *
*-*                +---------+                                         *
*-*             (x,y,z)   (X,y,z)                                      *
*-*                                                                    *
*-*                                                                    *
*-*                                                                    *
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**

void DrawPolyLine(Int_t n, Float_t *p, Option_t *option)
*-*-*-*-*-*-*-*-*Draw this 3-D polyline with new coordinates*-*-*-*-*-*-*-*-*-*
*-*              ============================================

void ExecuteEvent(Int_t event, Int_t px, Int_t py)
*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*-*-*-*-*-*-*
*-*                =========================================

void ls(Option_t *option) const
*-*-*-*-*-*-*-*-*-*List this 3-D polyline with its attributes*-*-*-*-*-*-*
*-*                ==========================================

void Paint(Option_t *option)
*-*-*-*-*-*-*-*-*Paint this 3-D polyline with its current attributes*-*-*-*-*
*-*              ===================================================
*-*
*-* Option could be 'x3d', and it means that output
*-* will be performed by X3D package.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void PaintPolyLine(Int_t n, Float_t *p, Option_t *)
*-*-*-*-*-*-*-*-*Draw this 3-D polyline with new coordinates*-*-*-*-*-*-*-*-*-*
*-*              ===========================================

void PaintPolyLine(Int_t n, Double_t *p, Option_t *)
*-*-*-*-*-*-*-*-*Draw this 3-D polyline with new coordinates*-*-*-*-*-*-*-*-*-*
*-*              ===========================================

void Print(Option_t *option) const
*-*-*-*-*-*-*-*-*-*Dump this 3-D polyline with its attributes*-*-*-*-*-*-*-*-*
*-*                ==========================================

void SavePrimitive(ofstream &out, Option_t *)
 Save primitive as a C++ statement(s) on output stream out

Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
 Set point following LastPoint

void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
*-*-*-*-*-*-*-*-*-*Initialize one point of the 3-D polyline*-*-*-*-*-*-*-*-*-*
*-*                ========================================
*-*  if n is more then the current TPolyLine3D size (n > fN) - re-allocate this
*-*

void SetPolyLine(Int_t n, Option_t *option)
*-*-*-*-*-*-*-*-*-*-*Set new values for this 3-D polyline*-*-*-*-*-*-*-*-*-*-*
*-*                  ====================================

void SetPolyLine(Int_t n, Float_t *p, Option_t *option)
*-*-*-*-*-*-*-*-*-*-*Set new values for this 3-D polyline*-*-*-*-*-*-*-*-*-*-*
*-*                  ====================================

void SetPolyLine(Int_t n, Double_t *p, Option_t *option)
*-*-*-*-*-*-*-*-*-*-*Set new values for this 3-D polyline*-*-*-*-*-*-*-*-*-*-*
*-*                  ====================================

void Sizeof3D() const
*-*-*-*-*-*Return total X3D size of this shape with its attributes*-*-*-*-*-*-*
*-*        =======================================================

void Streamer(TBuffer &b)
*-*-*-*-*-*-*-*-*Stream a class object*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*              =========================================



Inline Functions


              Int_t GetLastPoint() const
              Int_t GetN() const
           Float_t* GetP() const
          Option_t* GetOption() const
               void SetOption(Option_t* option)
              Int_t Size() const
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void StreamerNVirtual(TBuffer& b)


Author: Nenad Buncic 17/08/95
Last update: root/g3d:$Name: $:$Id: TPolyLine3D.cxx,v 1.6 2001/06/05 10:27:52 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.