132 for (
Int_t i=0; i<3*
n; i++) {
151 for (
Int_t i=0; i<3*
n; i++) {
171 for (
Int_t i=0; i<
n;i++) {
195 for (
Int_t i=0; i<
n;i++) {
210 pl.TPolyLine3D::Copy(*
this);
219 if (
fP)
delete []
fP;
227 polyline.TPolyLine3D::Copy(*
this);
261 const Int_t inaxis = 7;
270 if (px < puxmin - inaxis)
return dist;
271 if (py > puymin + inaxis)
return dist;
272 if (px > puxmax + inaxis)
return dist;
273 if (py < puymax - inaxis)
return dist;
275 TView *view =
gPad->GetView();
276 if (!view)
return dist;
281 for (i=0;i<
Size()-1;i++) {
289 if (dsegment < dist)
dist = dsegment;
331 TView *view =
gPad->GetView();
397 for (
Int_t i=0; i<
size;i++) { newpolyline->
fP[i] = p[i];}
411 if (
gPad->GetView())
gPad->GetView()->ExecuteRotateView(event, px, py);
420 std::cout <<
"PolyLine3D N=" <<
fN<<
" Option="<<option<<std::endl;
436 Error(
"Add",
"Attempt to add object of class: %s to a %s",pl->
ClassName(),this->ClassName());
439 npoints += pl->
Size();
450 for (
Int_t i=0;i<np;i++) {
451 SetPoint(i,p[3*i],p[3*i+1],p[3*i+2]);
466 if (
Size() <= 0)
return;
473 buffer.ClearSectionsValid();
478 buffer.fTransparency = 0;
479 buffer.fLocalFrame =
kFALSE;
483 TVirtualViewer3D * viewer3D =
gPad->GetViewer3D();
484 if (!viewer3D)
return;
492 Int_t nbSegs = nbPnts-1;
493 if (!buffer.SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, 0, 0)) {
501 for (i=0; i<3*buffer.NbPnts(); i++) {
509 for (
UInt_t j=0; j<buffer.NbPnts(); j++) {
510 dlocal[0] = buffer.fPnts[3*j];
511 dlocal[1] = buffer.fPnts[3*j+1];
512 dlocal[2] = buffer.fPnts[3*j+2];
513 gGeometry->Local2Master(&dlocal[0],&dmaster[0]);
514 buffer.fPnts[3*j] = dmaster[0];
515 buffer.fPnts[3*j+1] = dmaster[1];
516 buffer.fPnts[3*j+2] = dmaster[2];
525 for (i = 0; i < buffer.NbSegs(); i++) {
526 buffer.fSegs[3*i ] =
c;
527 buffer.fSegs[3*i+1] = i;
528 buffer.fSegs[3*i+2] = i+1;
544 printf(
" TPolyLine3D N=%d, Option=%s\n",
fN,option);
545 TString opt = option;
549 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]);
561 std::vector<Double_t> arr(
Size() * 3);
565 arrarg.
Append(
".data(), ");
569 out,
Class(),
"pline3D",
596 if (!
fP ||
n >=
fN) {
602 memset(&savepoint[3*
fN],0,(newN-
fN)*
sizeof(
Float_t));
629 if (
fP)
delete []
fP;
650 if (
fP)
delete []
fP;
655 fP[3*i+1] = p[3*i+1];
656 fP[3*i+2] = p[3*i+2];
679 if (
fP)
delete []
fP;
700 b.ReadVersion(&R__s, &R__c);
702 b.ClassMember(
"TObject");
704 b.ClassMember(
"TAttLine");
706 b.ClassMember(
"fN",
"Int_t");
710 b.ClassMember(
"fP",
"Float_t", 3 *
fN);
711 b.ReadFastArray(
fP, 3 *
fN);
713 b.ClassMember(
"fOption",
"TString");
721 b.ClassMember(
"TObject");
723 b.ClassMember(
"TAttLine");
725 b.ClassMember(
"fN",
"Int_t");
729 b.ClassMember(
"fP",
"Float_t", 3 *
size);
730 b.WriteFastArray(
fP, 3 *
size);
732 b.ClassMember(
"fOption",
"TString");
735 b.SetByteCount(R__c,
kTRUE);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
externTGeometry * gGeometry
Use this attribute class when an object should have 3D capabilities.
virtual void Streamer(TBuffer &)
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 SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
void Copy(TAttLine &attline) const
Int_t DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
Buffer base class used for serializing objects.
Collection abstract base class.
TObject * After(const TObject *obj) const override
Returns the object after object obj.
void Add(TObject *obj) override
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Mother of all ROOT objects.
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
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.
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
static TString SavePrimitiveVector(std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
Save array in the output stream "out" as vector.
@ kCanDelete
if object in a list can be deleted
virtual Int_t Merge(TCollection *list)
TPolyLine3D & operator=(const TPolyLine3D &polylin)
void Paint(Option_t *option="") override
This method must be overridden if a class wants to paint itself.
Int_t fLastPoint
The index of the last filled point.
Int_t fN
Number of points.
virtual void DrawPolyLine(Int_t n, Float_t *p, Option_t *option="")
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to an event at (px,py).
virtual Int_t Size() const
void ls(Option_t *option="") const override
The ls function lists the contents of a class on stdout.
void Draw(Option_t *option="") override
Default Draw method for all objects.
void Copy(TObject &polyline) const override
Copy this to obj.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
void Streamer(TBuffer &) override
Stream an object of class TObject.
void Print(Option_t *option="") const override
This method must be overridden when a class wants to print itself.
static void DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax)
virtual void SetPolyLine(Int_t n, Option_t *option="")
TClass * IsA() const override
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
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.
const char * Data() const
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=nullptr)=0
double dist(Rotation3D const &r1, Rotation3D const &r2)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.