107 Printf(
"Error Referenced shape does not exist: %s",shapename);
114 fParent->GetListOfNodes()->Add(
this);
156 if(!shape) {
Printf(
"Illegal referenced shape");
return;}
160 fParent->GetListOfNodes()->Add(
this);
196 TAttLine::operator=(no);
197 TAttFill::operator=(no);
198 TAtt3D::operator=(no);
262 const Int_t big = 9999;
263 const Int_t inaxis = 7;
264 const Int_t maxdist = 5;
272 if (px < puxmin - inaxis)
return big;
273 if (
py > puymin + inaxis)
return big;
274 if (px > puxmax + inaxis)
return big;
275 if (
py < puymax - inaxis)
return big;
278 if (!view)
return big;
289 dist =
fShape->DistancetoPrimitive(px,
py);
290 if (dist < maxdist) {
291 gPad->SetSelected(
this);
307 while ((obj = next())) {
310 if (dnode <= 0)
break;
311 if (dnode < dist) dist = dnode;
329 gROOT->MakeDefCanvas();
380 TNode *node, *nodefound;
381 if (!
fNodes)
return nullptr;
387 if (nodefound)
return nodefound;
399 const char *snull =
"";
400 if (!
gPad)
return (
char*)snull;
403 return const_cast<char*
>(info.
Data());
453 x = bomb*translation[0]
456 + local[2]*matrix[6];
458 y = bomb*translation[1]
461 + local[2]*matrix[7];
463 z = bomb*translation[2]
466 + local[2]*matrix[8];
468 master[0] =
x; master[1] =
y; master[2] = z;
487 x = bomb*translation[0]
490 + local[2]*matrix[6];
492 y = bomb*translation[1]
495 + local[2]*matrix[7];
497 z = bomb*translation[2]
500 + local[2]*matrix[8];
502 master[0] =
x; master[1] =
y; master[2] = z;
517 if (opt.
Contains(
"1")) maxlevel = 1;
518 if (opt.
Contains(
"2")) maxlevel = 2;
519 if (opt.
Contains(
"3")) maxlevel = 3;
520 if (opt.
Contains(
"4")) maxlevel = 4;
521 if (opt.
Contains(
"5")) maxlevel = 5;
528 const char *shapename, *matrixname;
530 else shapename =
"????";
537 std::cout<<
" NumPoints="<<
gSize3D.numPoints;
538 std::cout<<
" NumSegs ="<<
gSize3D.numSegs;
539 std::cout<<
" NumPolys ="<<
gSize3D.numPolys;
541 std::cout<<
" X="<<
fX<<
" Y="<<
fY<<
" Z="<<
fZ;
542 if (nsons) std::cout<<
" Sons="<<nsons;
544 else matrixname =
"Identity";
545 if(strcmp(matrixname,
"Identity")) std::cout<<
" Rot="<<matrixname;
547 std::cout<<std::endl;
575 Double_t xms = master[0] - bomb*translation[0];
576 Double_t yms = master[1] - bomb*translation[1];
577 Double_t zms = master[2] - bomb*translation[2];
579 x = xms*matrix[0] + yms*matrix[1] + zms*matrix[2];
580 y = xms*matrix[3] + yms*matrix[4] + zms*matrix[5];
581 z = xms*matrix[6] + yms*matrix[7] + zms*matrix[8];
583 local[0] =
x; local[1] =
y; local[2] = z;
602 Double_t xms = master[0] - bomb*translation[0];
603 Double_t yms = master[1] - bomb*translation[1];
604 Double_t zms = master[2] - bomb*translation[2];
606 x = xms*matrix[0] + yms*matrix[1] + zms*matrix[2];
607 y = xms*matrix[3] + yms*matrix[4] + zms*matrix[5];
608 z = xms*matrix[6] + yms*matrix[7] + zms*matrix[8];
610 local[0] =
x; local[1] =
y; local[2] = z;
658 Int_t reqSections = viewer3D->
AddObject(buffer, &viewerWantsSons);
661 fShape->GetBuffer3D(reqSections);
662 viewer3D->
AddObject(buffer, &viewerWantsSons);
669 if(!nsons || !viewerWantsSons)
return;
675 while ((obj = next())) {
727 printf(
"Error: Cannot set parent node to be a child node:%s\n",
GetName());
728 printf(
" Operation not performed!\n");
735 else gGeometry->GetListOfNodes()->Remove(
this);
741 fParent->GetListOfNodes()->Add(
this);
743 else gGeometry->GetListOfNodes()->Add(
this);
766 }
else if (vis == -3 ) {
771 }
else if (vis == -2) {
775 }
else if (vis == -1) {
779 }
else if (vis == 0) {
782 }
else if (vis == 1) {
785 }
else if (vis == 2) {
789 }
else if (vis == 3) {
809 while ((obj = next())) {
892 dxnew[0] = dx[0] +
x*rmat[0] +
y*rmat[3] + z*rmat[6];
893 dxnew[1] = dx[1] +
x*rmat[1] +
y*rmat[4] + z*rmat[7];
894 dxnew[2] = dx[2] +
x*rmat[2] +
y*rmat[5] + z*rmat[8];
896 rmatnew[0] = rmat[0]*matrix[0] + rmat[3]*matrix[1] + rmat[6]*matrix[2];
897 rmatnew[1] = rmat[1]*matrix[0] + rmat[4]*matrix[1] + rmat[7]*matrix[2];
898 rmatnew[2] = rmat[2]*matrix[0] + rmat[5]*matrix[1] + rmat[8]*matrix[2];
899 rmatnew[3] = rmat[0]*matrix[3] + rmat[3]*matrix[4] + rmat[6]*matrix[5];
900 rmatnew[4] = rmat[1]*matrix[3] + rmat[4]*matrix[4] + rmat[7]*matrix[5];
901 rmatnew[5] = rmat[2]*matrix[3] + rmat[5]*matrix[4] + rmat[8]*matrix[5];
902 rmatnew[6] = rmat[0]*matrix[6] + rmat[3]*matrix[7] + rmat[6]*matrix[8];
903 rmatnew[7] = rmat[1]*matrix[6] + rmat[4]*matrix[7] + rmat[7]*matrix[8];
904 rmatnew[8] = rmat[2]*matrix[6] + rmat[5]*matrix[7] + rmat[8]*matrix[8];
Option_t Option_t SetLineWidth
Option_t Option_t SetFillStyle
Option_t Option_t SetLineColor
Option_t Option_t SetFillColor
R__EXTERN TGeometry * gGeometry
static Double_t gRotMatrix[kMAXLEVELS][kMatrixSize]
static Double_t gTranslation[kMAXLEVELS][kVectorSize]
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
virtual void Streamer(TBuffer &)
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void Modify()
Change current fill area attributes if necessary.
TAttFill()
AttFill default constructor.
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.
TAttLine()
AttLine default constructor.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void Modify()
Change current line attributes if necessary.
Using a TBrowser one can browse all ROOT objects.
Generic 3D primitive description class.
Buffer base class used for serializing objects.
const char * GetName() const override
Returns name of object.
void Streamer(TBuffer &) override
Stream an object of class TObject.
const char * GetTitle() const override
Returns title of object.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
virtual void Master2Local(const Double_t *master, Double_t *local)
Convert one point from master system to local reference system.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a Node.
virtual void UpdateTempMatrix(const Double_t *dx1, const Double_t *rmat1, Double_t x, Double_t y, Double_t z, Double_t *matrix, Double_t *dxnew, Double_t *rmatnew)
Compute new translation vector and global matrix.
virtual void UpdateMatrix()
Update global rotation matrix/translation vector for this node this function must be called before in...
virtual TNode * GetParent() const
void SetName(const char *name) override
Change the name of this Node.
virtual Double_t GetY() const
TClass * IsA() const override
void Sizeof3D() const override
Return total size of this 3-D Node with its attributes.
void Draw(Option_t *option="") override
Draw Referenced node with current parameters.
virtual Double_t GetX() const
virtual TRotMatrix * GetMatrix() const
void SetNameTitle(const char *name, const char *title) override
Change the name and title of this Node.
virtual void BuildListOfNodes()
Create the list to support sons of this node.
TNode()
Node default constructor.
void Paint(Option_t *option="") override
Paint Referenced node with current parameters.
virtual void DrawOnly(Option_t *option="")
Draw only Sons of this node.
char * GetObjectInfo(Int_t px, Int_t py) const override
Get object info.
virtual Double_t GetZ() const
TNode & operator=(const TNode &)
assignment operator
TNode(const TNode &)
copy constructor
virtual void Local2Master(const Double_t *local, Double_t *master)
Convert one point from local system to master reference system.
void RecursiveRemove(TObject *obj) override
Recursively remove object from the list of nodes of this node.
virtual void cd(const char *path=nullptr)
Change Current Reference node to this.
Bool_t IsFolder() const override
Return TRUE if node contains nodes, FALSE otherwise.
virtual void SetParent(TNode *parent)
Set the pointer to the parent, keep parents informed about who they have.
~TNode() override
Node default destructor.
void Browse(TBrowser *b) override
Browse.
virtual void ImportShapeAttributes()
Copy shape attributes as node attributes.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
virtual void SetVisibility(Int_t vis=1)
Set visibility for this node and its sons.
void ls(Option_t *option="2") const override
List Referenced object with current parameters.
void Streamer(TBuffer &) override
Stream a class object.
virtual TNode * GetNode(const char *name) const
Return pointer to node with name in the node tree.
Wrapper around a TObject so it can be stored in a TList.
TObject * GetObject() const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
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.
TObject()
TObject constructor.
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
Manages a detector rotation matrix.
virtual Double_t * GetMatrix()
This is the base class for all geometry shapes.
void ToLower()
Change string to lower-case.
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static TView * CreateView(Int_t system=1, const Double_t *rmin=nullptr, const Double_t *rmax=nullptr)
Create a concrete default 3-d view via the plug-in manager.
virtual void SetAutoRange(Bool_t autorange=kTRUE)=0
Abstract 3D shapes viewer.
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=nullptr)=0
R__ALWAYS_INLINE bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.