106 Printf(
"Error Referenced shape does not exist: %s",shapename);
113 fParent->GetListOfNodes()->Add(
this);
155 if(!shape) {
Printf(
"Illegal referenced shape");
return;}
159 fParent->GetListOfNodes()->Add(
this);
195 TAttLine::operator=(no);
196 TAttFill::operator=(no);
197 TAtt3D::operator=(no);
261 const Int_t big = 9999;
262 const Int_t inaxis = 7;
263 const Int_t maxdist = 5;
271 if (px < puxmin - inaxis)
return big;
272 if (py > puymin + inaxis)
return big;
273 if (px > puxmax + inaxis)
return big;
274 if (py < puymax - inaxis)
return big;
277 if (!view)
return big;
288 dist =
fShape->DistancetoPrimitive(px,py);
289 if (dist < maxdist) {
290 gPad->SetSelected(
this);
306 while ((obj = next())) {
309 if (dnode <= 0)
break;
310 if (dnode < dist) dist = dnode;
328 gROOT->MakeDefCanvas();
349 gPad->GetViewer3D(option);
379 TNode *node, *nodefound;
380 if (!
fNodes)
return nullptr;
386 if (nodefound)
return nodefound;
398 const char *snull =
"";
399 if (!
gPad)
return (
char*)snull;
402 return const_cast<char*
>(info.
Data());
452 x = bomb*translation[0]
455 + local[2]*matrix[6];
457 y = bomb*translation[1]
460 + local[2]*matrix[7];
462 z = bomb*translation[2]
465 + local[2]*matrix[8];
467 master[0] =
x; master[1] =
y; master[2] = z;
486 x = bomb*translation[0]
489 + local[2]*matrix[6];
491 y = bomb*translation[1]
494 + local[2]*matrix[7];
496 z = bomb*translation[2]
499 + local[2]*matrix[8];
501 master[0] =
x; master[1] =
y; master[2] = z;
516 if (opt.
Contains(
"1")) maxlevel = 1;
517 if (opt.
Contains(
"2")) maxlevel = 2;
518 if (opt.
Contains(
"3")) maxlevel = 3;
519 if (opt.
Contains(
"4")) maxlevel = 4;
520 if (opt.
Contains(
"5")) maxlevel = 5;
527 const char *shapename, *matrixname;
529 else shapename =
"????";
536 std::cout<<
" NumPoints="<<
gSize3D.numPoints;
537 std::cout<<
" NumSegs ="<<
gSize3D.numSegs;
538 std::cout<<
" NumPolys ="<<
gSize3D.numPolys;
540 std::cout<<
" X="<<
fX<<
" Y="<<
fY<<
" Z="<<
fZ;
541 if (nsons) std::cout<<
" Sons="<<nsons;
543 else matrixname =
"Identity";
544 if(strcmp(matrixname,
"Identity")) std::cout<<
" Rot="<<matrixname;
546 std::cout<<std::endl;
574 Double_t xms = master[0] - bomb*translation[0];
575 Double_t yms = master[1] - bomb*translation[1];
576 Double_t zms = master[2] - bomb*translation[2];
578 x = xms*matrix[0] + yms*matrix[1] + zms*matrix[2];
579 y = xms*matrix[3] + yms*matrix[4] + zms*matrix[5];
580 z = xms*matrix[6] + yms*matrix[7] + zms*matrix[8];
582 local[0] =
x; local[1] =
y; local[2] = z;
601 Double_t xms = master[0] - bomb*translation[0];
602 Double_t yms = master[1] - bomb*translation[1];
603 Double_t zms = master[2] - bomb*translation[2];
605 x = xms*matrix[0] + yms*matrix[1] + zms*matrix[2];
606 y = xms*matrix[3] + yms*matrix[4] + zms*matrix[5];
607 z = xms*matrix[6] + yms*matrix[7] + zms*matrix[8];
609 local[0] =
x; local[1] =
y; local[2] = z;
657 Int_t reqSections = viewer3D->
AddObject(buffer, &viewerWantsSons);
660 fShape->GetBuffer3D(reqSections);
661 viewer3D->
AddObject(buffer, &viewerWantsSons);
668 if(!nsons || !viewerWantsSons)
return;
674 while ((obj = next())) {
726 printf(
"Error: Cannot set parent node to be a child node:%s\n",
GetName());
727 printf(
" Operation not performed!\n");
734 else gGeometry->GetListOfNodes()->Remove(
this);
740 fParent->GetListOfNodes()->Add(
this);
742 else gGeometry->GetListOfNodes()->Add(
this);
765 }
else if (vis == -3 ) {
770 }
else if (vis == -2) {
774 }
else if (vis == -1) {
778 }
else if (vis == 0) {
781 }
else if (vis == 1) {
784 }
else if (vis == 2) {
788 }
else if (vis == 3) {
808 while ((obj = next())) {
891 dxnew[0] = dx[0] +
x*rmat[0] +
y*rmat[3] + z*rmat[6];
892 dxnew[1] = dx[1] +
x*rmat[1] +
y*rmat[4] + z*rmat[7];
893 dxnew[2] = dx[2] +
x*rmat[2] +
y*rmat[5] + z*rmat[8];
895 rmatnew[0] = rmat[0]*matrix[0] + rmat[3]*matrix[1] + rmat[6]*matrix[2];
896 rmatnew[1] = rmat[1]*matrix[0] + rmat[4]*matrix[1] + rmat[7]*matrix[2];
897 rmatnew[2] = rmat[2]*matrix[0] + rmat[5]*matrix[1] + rmat[8]*matrix[2];
898 rmatnew[3] = rmat[0]*matrix[3] + rmat[3]*matrix[4] + rmat[6]*matrix[5];
899 rmatnew[4] = rmat[1]*matrix[3] + rmat[4]*matrix[4] + rmat[7]*matrix[5];
900 rmatnew[5] = rmat[2]*matrix[3] + rmat[5]*matrix[4] + rmat[8]*matrix[5];
901 rmatnew[6] = rmat[0]*matrix[6] + rmat[3]*matrix[7] + rmat[6]*matrix[8];
902 rmatnew[7] = rmat[1]*matrix[6] + rmat[4]*matrix[7] + rmat[7]*matrix[8];
903 rmatnew[8] = rmat[2]*matrix[6] + rmat[5]*matrix[7] + rmat[8]*matrix[8];
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
short Color_t
Color number (short).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
externTGeometry * 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 SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
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 SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
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
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
bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.