144 for (
Int_t i=0; i<3*
n; i++) {
167 for (
Int_t i=0; i<3*
n; i++) {
191 for (
Int_t i=0; i<
n;i++) {
219 for (
Int_t i=0; i<
n;i++) {
235 TAttLine::operator=(pl);
236 TAtt3D::operator=(pl);
250 if (
fP)
delete []
fP;
293 const Int_t inaxis = 7;
302 if (px < puxmin - inaxis)
return dist;
303 if (py > puymin + inaxis)
return dist;
304 if (px > puxmax + inaxis)
return dist;
305 if (py < puymax - inaxis)
return dist;
308 if (!view)
return dist;
313 for (i=0;i<
Size()-1;i++) {
321 if (dsegment < dist) dist = dsegment;
429 for (
Int_t i=0; i<size;i++) { newpolyline->
fP[i] = p[i];}
443 if (
gPad->GetView())
gPad->GetView()->ExecuteRotateView(event, px, py);
452 std::cout <<
"PolyLine3D N=" <<
fN<<
" Option="<<option<<std::endl;
468 Error(
"Add",
"Attempt to add object of class: %s to a %s",pl->
ClassName(),this->ClassName());
471 npoints += pl->
Size();
482 for (
Int_t i=0;i<np;i++) {
483 SetPoint(i,p[3*i],p[3*i+1],p[3*i+2]);
498 if (
Size() <= 0)
return;
516 if (!viewer3D)
return;
524 Int_t nbSegs = nbPnts-1;
525 if (!buffer.
SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, 0, 0)) {
533 for (i=0; i<3*buffer.
NbPnts(); i++) {
542 dlocal[0] = buffer.
fPnts[3*j];
543 dlocal[1] = buffer.
fPnts[3*j+1];
544 dlocal[2] = buffer.
fPnts[3*j+2];
546 buffer.
fPnts[3*j] = dmaster[0];
547 buffer.
fPnts[3*j+1] = dmaster[1];
548 buffer.
fPnts[3*j+2] = dmaster[2];
557 for (i = 0; i < buffer.
NbSegs(); i++) {
559 buffer.
fSegs[3*i+1] = i;
560 buffer.
fSegs[3*i+2] = i+1;
576 printf(
" TPolyLine3D N=%d, Option=%s\n",
fN,option);
581 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]);
593 if (
gROOT->ClassSaved(TPolyLine3D::Class())) {
596 out<<
" TPolyLine3D *";
599 out<<
"pline3D = new TPolyLine3D("<<
fN<<
","<<quote<<
fOption<<quote<<
");"<<std::endl;
604 for (
Int_t i=0;i<size;i++)
605 out<<
" pline3D->SetPoint("<<i<<
","<<
fP[3*i]<<
","<<
fP[3*i+1]<<
","<<
fP[3*i+2]<<
");"<<std::endl;
607 out<<
" pline3D->Draw();"<<std::endl;
629 if (!
fP ||
n >=
fN) {
635 memset(&savepoint[3*
fN],0,(newN-
fN)*
sizeof(
Float_t));
662 if (
fP)
delete []
fP;
683 if (
fP)
delete []
fP;
688 fP[3*i+1] = p[3*i+1];
689 fP[3*i+2] = p[3*i+2];
712 if (
fP)
delete []
fP;
729void TPolyLine3D::Streamer(
TBuffer &
b)
733 b.ReadVersion(&R__s, &R__c);
734 b.ClassBegin(TPolyLine3D::IsA());
735 b.ClassMember(
"TObject");
736 TObject::Streamer(
b);
737 b.ClassMember(
"TAttLine");
738 TAttLine::Streamer(
b);
739 b.ClassMember(
"fN",
"Int_t");
743 b.ClassMember(
"fP",
"Float_t", 3 *
fN);
744 b.ReadFastArray(
fP, 3 *
fN);
746 b.ClassMember(
"fOption",
"TString");
749 b.ClassEnd(TPolyLine3D::IsA());
750 b.CheckByteCount(R__s, R__c, TPolyLine3D::IsA());
752 R__c =
b.WriteVersion(TPolyLine3D::IsA(),
kTRUE);
753 b.ClassBegin(TPolyLine3D::IsA());
754 b.ClassMember(
"TObject");
755 TObject::Streamer(
b);
756 b.ClassMember(
"TAttLine");
757 TAttLine::Streamer(
b);
758 b.ClassMember(
"fN",
"Int_t");
762 b.ClassMember(
"fP",
"Float_t", 3 * size);
763 b.WriteFastArray(
fP, 3 * size);
765 b.ClassMember(
"fOption",
"TString");
767 b.ClassEnd(TPolyLine3D::IsA());
768 b.SetByteCount(R__c,
kTRUE);
static const double x2[5]
static const double x1[5]
R__EXTERN TGeometry * gGeometry
Use this attribute class when an object should have 3D capabilities.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void Modify()
Change current line attributes if necessary.
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
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.
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.
Generic 3D primitive description class.
Bool_t SectionsValid(UInt_t mask) const
void ClearSectionsValid()
Clear any sections marked valid.
void SetSectionsValid(UInt_t mask)
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.
Buffer base class used for serializing objects.
Collection abstract base class.
virtual void Local2Master(Double_t *local, Double_t *master)
Convert one point from local system to master reference system.
virtual void Add(TObject *obj)
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Mother of all ROOT objects.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Copy(TObject &object) const
Copy this to obj.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
@ kCanDelete
if object in a list can be deleted
A 3-dimensional polyline.
TPolyLine3D & operator=(const TPolyLine3D &polylin)
assignment operator
TPolyLine3D()
3-D polyline default constructor.
static void DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax)
Draw cube outline with 3d polylines.
virtual void Print(Option_t *option="") const
Dump this 3-D polyline with its attributes on stdout.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream.
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
virtual ~TPolyLine3D()
3-D polyline destructor.
virtual Int_t Merge(TCollection *list)
Merge polylines in the collection in this polyline.
virtual void ls(Option_t *option="") const
List this 3-D polyline.
Int_t fLastPoint
The index of the last filled point.
Int_t fN
Number of points.
virtual void Draw(Option_t *option="")
Draw this 3-D polyline with its current attributes.
virtual void Paint(Option_t *option="")
Paint a TPolyLine3D.
virtual void Copy(TObject &polyline) const
Copy polyline to polyline obj.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual Int_t Size() const
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a 3-D polyline.
virtual void SetPolyLine(Int_t n, Option_t *option="")
Re-initialize polyline with n points (0,0,0).
virtual void DrawPolyLine(Int_t n, Float_t *p, Option_t *option="")
Draw 3-D polyline with new coordinates.
Float_t * fP
[3*fN] Array of 3-D coordinates (x,y,z)
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
void ToLower()
Change string to lower-case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
Abstract 3D shapes viewer.
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
Short_t Max(Short_t a, Short_t b)