143 for (
Int_t i=0; i<3*
n; i++) {
166 for (
Int_t i=0; i<3*
n; i++) {
190 for (
Int_t i=0; i<
n;i++) {
218 for (
Int_t i=0; i<
n;i++) {
249 if (
fP)
delete []
fP;
292 const Int_t inaxis = 7;
301 if (px < puxmin - inaxis)
return dist;
302 if (py > puymin + inaxis)
return dist;
303 if (px > puxmax + inaxis)
return dist;
304 if (py < puymax - inaxis)
return dist;
307 if (!view)
return dist;
312 for (i=0;i<
Size()-1;i++) {
320 if (dsegment < dist) dist = dsegment;
383 pl3d->
SetPoint(0, xmin, ymin, zmin);
384 pl3d->
SetPoint(1, xmax, ymin, zmin);
385 pl3d->
SetPoint(2, xmax, ymax, zmin);
386 pl3d->
SetPoint(3, xmin, ymax, zmin);
392 pl3d->
SetPoint(0, xmax, ymin, zmin);
393 pl3d->
SetPoint(1, xmax, ymin, zmax);
394 pl3d->
SetPoint(2, xmax, ymax, zmax);
395 pl3d->
SetPoint(3, xmax, ymax, zmin);
401 pl3d->
SetPoint(0, xmax, ymin, zmax);
402 pl3d->
SetPoint(1, xmin, ymin, zmax);
403 pl3d->
SetPoint(2, xmin, ymax, zmax);
404 pl3d->
SetPoint(3, xmax, ymax, zmax);
410 pl3d->
SetPoint(0, xmin, ymin, zmax);
411 pl3d->
SetPoint(1, xmin, ymin, zmin);
412 pl3d->
SetPoint(2, xmin, ymax, zmin);
413 pl3d->
SetPoint(3, xmin, ymax, zmax);
428 for (
Int_t i=0; i<size;i++) { newpolyline->
fP[i] = p[i];}
442 if (
gPad->GetView())
gPad->GetView()->ExecuteRotateView(event, px, py);
451 std::cout <<
"PolyLine3D N=" <<
fN<<
" Option="<<option<<std::endl;
470 npoints += pl->
Size();
481 for (
Int_t i=0;i<np;i++) {
482 SetPoint(i,p[3*i],p[3*i+1],p[3*i+2]);
497 if (
Size() <= 0)
return;
515 if (!viewer3D)
return;
523 Int_t nbSegs = nbPnts-1;
524 if (!buffer.
SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, 0, 0)) {
532 for (i=0; i<3*buffer.
NbPnts(); i++) {
541 dlocal[0] = buffer.
fPnts[3*j];
542 dlocal[1] = buffer.
fPnts[3*j+1];
543 dlocal[2] = buffer.
fPnts[3*j+2];
545 buffer.
fPnts[3*j] = dmaster[0];
546 buffer.
fPnts[3*j+1] = dmaster[1];
547 buffer.
fPnts[3*j+2] = dmaster[2];
556 for (i = 0; i < buffer.
NbSegs(); i++) {
558 buffer.
fSegs[3*i+1] = i;
559 buffer.
fSegs[3*i+2] = i+1;
575 printf(
" TPolyLine3D N=%d, Option=%s\n",
fN,option);
580 printf(
" x[%d]=%g, y[%d]=%g, z[%d]=%g\n",i,
fP[3*i],i,
fP[3*i+1],i,
fP[3*i+2]);
595 out<<
" TPolyLine3D *";
598 out<<
"pline3D = new TPolyLine3D("<<
fN<<
","<<quote<<
fOption<<quote<<
");"<<std::endl;
603 for (
Int_t i=0;i<size;i++)
604 out<<
" pline3D->SetPoint("<<i<<
","<<
fP[3*i]<<
","<<
fP[3*i+1]<<
","<<
fP[3*i+2]<<
");"<<std::endl;
606 out<<
" pline3D->Draw();"<<std::endl;
628 if (!
fP || n >=
fN) {
634 memset(&savepoint[3*
fN],0,(newN-fN)*
sizeof(
Float_t));
661 if (
fP)
delete []
fP;
682 if (
fP)
delete []
fP;
687 fP[3*i+1] = p[3*i+1];
688 fP[3*i+2] = p[3*i+2];
711 if (
fP)
delete []
fP;
728 void TPolyLine3D::Streamer(
TBuffer &
b)
735 TObject::Streamer(b);
737 TAttLine::Streamer(b);
754 TObject::Streamer(b);
756 TAttLine::Streamer(b);
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
double dist(Rotation3D const &r1, Rotation3D const &r2)
virtual void ClassBegin(const TClass *, Version_t=-1)=0
TPolyLine3D()
3-D polyline default constructor.
static double p3(double t, double a, double b, double c, double d)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Float_t * fP
[3*fN] Array of 3-D coordinates (x,y,z)
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
virtual void SetPolyLine(Int_t n, Option_t *option="")
Re-initialize polyline with n points (0,0,0).
Use this attribute class when an object should have 3D capabilities.
Buffer base class used for serializing objects.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
void ClearSectionsValid()
Clear any sections marked valid.
void ToLower()
Change string to lower-case.
A 3-dimensional polyline.
virtual Int_t Merge(TCollection *list)
Merge polylines in the collection in this polyline.
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual void Modify()
Change current line attributes if necessary.
virtual Width_t GetLineWidth() const
Return the line width.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
if object in a list can be deleted
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void ClassMember(const char *, const char *=0, Int_t=-1, Int_t=-1)=0
static const double x2[5]
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void ls(Option_t *option="") const
List this 3-D polyline.
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
virtual void Copy(TObject &object) const
Copy this to obj.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual ~TPolyLine3D()
3-D polyline destructor.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a 3-D polyline.
static double p2(double t, double a, double b, double c)
virtual void Local2Master(Double_t *local, Double_t *master)
Convert one point from local system to master reference system.
Abstract 3D shapes viewer.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
void SetSectionsValid(UInt_t mask)
static void DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax)
Draw cube outline with 3d polylines.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Bool_t SectionsValid(UInt_t mask) const
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void Print(Option_t *option="") const
Dump this 3-D polyline with its attributes on stdout.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Collection abstract base class.
TPolyLine3D & operator=(const TPolyLine3D &polylin)
assignment operator
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Bool_t SetRawSizes(UInt_t reqPnts, UInt_t reqPntsCapacity, UInt_t reqSegs, UInt_t reqSegsCapacity, UInt_t reqPols, UInt_t reqPolsCapacity)
Set kRaw tessellation section of buffer with supplied sizes.
Generic 3D primitive description class.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
Int_t fN
Number of points.
static double p1(double t, double a, double b)
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual void WriteFastArray(const Bool_t *b, Int_t n)=0
virtual Color_t GetLineColor() const
Return the line color.
virtual void Draw(Option_t *option="")
Draw this 3-D polyline with its current attributes.
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
static const double x1[5]
Int_t fLastPoint
The index of the last filled point.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
virtual void Paint(Option_t *option="")
Paint a TPolyLine3D.
Int_t DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
Compute distance from point px,py to a line.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void Copy(TObject &polyline) const
Copy polyline to polyline obj.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Binding & operator=(OUT(*fun)(void))
Mother of all ROOT objects.
you should not use this method at all Int_t Int_t z
virtual void Add(TObject *obj)
virtual void ClassEnd(const TClass *)=0
Short_t Max(Short_t a, Short_t b)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream.
virtual void DrawPolyLine(Int_t n, Float_t *p, Option_t *option="")
Draw 3-D polyline with new coordinates.
R__EXTERN TGeometry * gGeometry
virtual Int_t Size() const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0