89 static Int_t counter = 0;
108 Printf(
"Error Referenced shape does not exist: %s",shapename);
157 if(!shape) {
Printf(
"Illegal referenced shape");
return;}
263 const Int_t big = 9999;
264 const Int_t inaxis = 7;
265 const Int_t maxdist = 5;
273 if (px < puxmin - inaxis)
return big;
274 if (py > puymin + inaxis)
return big;
275 if (px > puxmax + inaxis)
return big;
276 if (py < puymax - inaxis)
return big;
279 if (!view)
return big;
291 if (dist < maxdist) {
292 gPad->SetSelected(
this);
308 while ((obj = next())) {
311 if (dnode <= 0)
break;
312 if (dnode < dist) dist = dnode;
330 gROOT->MakeDefCanvas();
351 gPad->GetViewer3D(option);
381 TNode *node, *nodefound;
387 nodefound = node->
GetNode(name);
388 if (nodefound)
return nodefound;
400 const char *snull =
"";
401 if (!
gPad)
return (
char*)snull;
404 return const_cast<char*
>(info.
Data());
454 x = bomb*translation[0]
457 + local[2]*matrix[6];
459 y = bomb*translation[1]
462 + local[2]*matrix[7];
464 z = bomb*translation[2]
467 + local[2]*matrix[8];
469 master[0] =
x; master[1] =
y; master[2] =
z;
488 x = bomb*translation[0]
491 + local[2]*matrix[6];
493 y = bomb*translation[1]
496 + local[2]*matrix[7];
498 z = bomb*translation[2]
501 + local[2]*matrix[8];
503 master[0] =
x; master[1] =
y; master[2] =
z;
518 if (opt.
Contains(
"1")) maxlevel = 1;
519 if (opt.
Contains(
"2")) maxlevel = 2;
520 if (opt.
Contains(
"3")) maxlevel = 3;
521 if (opt.
Contains(
"4")) maxlevel = 4;
522 if (opt.
Contains(
"5")) maxlevel = 5;
529 const char *shapename, *matrixname;
531 else shapename =
"????";
538 std::cout<<
" NumPoints="<<
gSize3D.numPoints;
539 std::cout<<
" NumSegs ="<<
gSize3D.numSegs;
540 std::cout<<
" NumPolys ="<<
gSize3D.numPolys;
542 std::cout<<
" X="<<
fX<<
" Y="<<
fY<<
" Z="<<
fZ;
543 if (nsons) std::cout<<
" Sons="<<nsons;
545 else matrixname =
"Identity";
546 if(strcmp(matrixname,
"Identity")) std::cout<<
" Rot="<<matrixname;
548 std::cout<<std::endl;
576 Double_t xms = master[0] - bomb*translation[0];
577 Double_t yms = master[1] - bomb*translation[1];
578 Double_t zms = master[2] - bomb*translation[2];
580 x = xms*matrix[0] + yms*matrix[1] + zms*matrix[2];
581 y = xms*matrix[3] + yms*matrix[4] + zms*matrix[5];
582 z = xms*matrix[6] + yms*matrix[7] + zms*matrix[8];
584 local[0] =
x; local[1] =
y; local[2] =
z;
603 Double_t xms = master[0] - bomb*translation[0];
604 Double_t yms = master[1] - bomb*translation[1];
605 Double_t zms = master[2] - bomb*translation[2];
607 x = xms*matrix[0] + yms*matrix[1] + zms*matrix[2];
608 y = xms*matrix[3] + yms*matrix[4] + zms*matrix[5];
609 z = xms*matrix[6] + yms*matrix[7] + zms*matrix[8];
611 local[0] =
x; local[1] =
y; local[2] =
z;
659 Int_t reqSections = viewer3D->
AddObject(buffer, &viewerWantsSons);
663 viewer3D->
AddObject(buffer, &viewerWantsSons);
670 if(!nsons || !viewerWantsSons)
return;
676 while ((obj = next())) {
728 printf(
"Error: Cannot set parent node to be a child node:%s\n",
GetName());
729 printf(
" Operation not performed!\n");
767 }
else if (vis == -3 ) {
772 }
else if (vis == -2) {
776 }
else if (vis == -1) {
780 }
else if (vis == 0) {
783 }
else if (vis == 1) {
786 }
else if (vis == 2) {
790 }
else if (vis == 3) {
810 while ((obj = next())) {
830 TAttLine::Streamer(b);
831 TAttFill::Streamer(b);
841 else fVisibility = fShape->GetVisibility();
893 dxnew[0] = dx[0] + x*rmat[0] + y*rmat[3] + z*rmat[6];
894 dxnew[1] = dx[1] + x*rmat[1] + y*rmat[4] + z*rmat[7];
895 dxnew[2] = dx[2] + x*rmat[2] + y*rmat[5] + z*rmat[8];
897 rmatnew[0] = rmat[0]*matrix[0] + rmat[3]*matrix[1] + rmat[6]*matrix[2];
898 rmatnew[1] = rmat[1]*matrix[0] + rmat[4]*matrix[1] + rmat[7]*matrix[2];
899 rmatnew[2] = rmat[2]*matrix[0] + rmat[5]*matrix[1] + rmat[8]*matrix[2];
900 rmatnew[3] = rmat[0]*matrix[3] + rmat[3]*matrix[4] + rmat[6]*matrix[5];
901 rmatnew[4] = rmat[1]*matrix[3] + rmat[4]*matrix[4] + rmat[7]*matrix[5];
902 rmatnew[5] = rmat[2]*matrix[3] + rmat[5]*matrix[4] + rmat[8]*matrix[5];
903 rmatnew[6] = rmat[0]*matrix[6] + rmat[3]*matrix[7] + rmat[6]*matrix[8];
904 rmatnew[7] = rmat[1]*matrix[6] + rmat[4]*matrix[7] + rmat[7]*matrix[8];
905 rmatnew[8] = rmat[2]*matrix[6] + rmat[5]*matrix[7] + rmat[8]*matrix[8];
virtual const char * GetName() const
Returns name of object.
virtual Double_t * GetMatrix()
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void Draw(Option_t *option="")
Draw Referenced node with current parameters.
object has not been deleted
static Double_t gTranslation[kMAXLEVELS][kVectorSize]
double dist(Rotation3D const &r1, Rotation3D const &r2)
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
TRotMatrix * GetRotMatrix(const char *name) const
Return pointer to RotMatrix with name.
virtual TRotMatrix * GetMatrix() const
virtual TNode * GetParent() const
TList * GetListOfNodes() const
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from the list of nodes of this node.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
Bool_t IsFolder() const
Return TRUE if node contains nodes, FALSE otherwise.
virtual void Local2Master(const Double_t *local, Double_t *master)
Convert one point from local system to master reference system.
virtual void SetNameTitle(const char *name, const char *title)
Change the name and title of this Node.
Bool_t TestBit(UInt_t f) const
virtual void SetAutoRange(Bool_t autorange=kTRUE)=0
virtual void cd(const char *path=0)
Change Current Reference node to this.
Use this attribute class when an object should have 3D capabilities.
Buffer base class used for serializing objects.
virtual void DrawOnly(Option_t *option="")
Draw only Sons of this node.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
void ToLower()
Change string to lower-case.
virtual Double_t GetX() const
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual ~TNode()
Node default destructor.
virtual void Modify()
Change current line attributes if necessary.
virtual void Sizeof3D() const
Return total size of this 3-D Node with its attributes.
virtual void Paint(Option_t *option="")
Paint Referenced node with current parameters.
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.
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections) const
Stub to avoid forcing implementation at this stage.
virtual Bool_t IsReflection() const
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual Style_t GetLineStyle() const
Return the line style.
TNode * GetCurrentNode() const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Fill Area Attributes class.
virtual void SetVisibility(Int_t vis=1)
Set visibility for this node and its sons.
The TNamed class is the base class for all named ROOT classes.
virtual void Modify()
Change current fill area attributes if necessary.
virtual void SetParent(TNode *parent)
Set the pointer to the parent, keep parents informed about who they have.
virtual Int_t PushLevel()
Abstract 3D shapes viewer.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual TNode * GetNode(const char *name) const
Return pointer to node with name in the node tree.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Using a TBrowser one can browse all ROOT objects.
virtual void UpdateMatrix()
Update global rotation matrix/translation vector for this node this function must be called before in...
This is the base class for all geometry shapes.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
Manages a detector rotation matrix.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual void BuildListOfNodes()
Create the list to support sons of this node.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Get object info.
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
TList * GetListOfNodes() const
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.
Generic 3D primitive description class.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
virtual void ImportShapeAttributes()
Copy shape attributes as node attributes.
virtual TObjLink * FirstLink() const
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetCurrentNode(TNode *node)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual void ls(Option_t *option="") const
List (ls) all objects in this collection.
Wrapper around a TObject so it can be stored in a TList.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Double_t GetY() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
TNode()
Node default constructor.
virtual void SetGeomLevel(Int_t level=0)
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
static TView * CreateView(Int_t system=1, const Double_t *rmin=0, const Double_t *rmax=0)
Create a concrete default 3-d view via the plug-in manager.
Binding & operator=(OUT(*fun)(void))
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a Node.
Mother of all ROOT objects.
you should not use this method at all Int_t Int_t z
virtual void UpdateTempMatrix(Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=0)
Update temp matrix.
TObject * GetObject() const
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
virtual void Add(TObject *obj)
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
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
static Double_t gRotMatrix[kMAXLEVELS][kMatrixSize]
virtual void ls(Option_t *option="2") const
List Referenced object with current parameters.
virtual void Sizeof3D() const
Set total size of this 3D object (used by X3D interface).
virtual void Master2Local(const Double_t *master, Double_t *local)
Convert one point from master system to local reference system.
virtual void Browse(TBrowser *b)
Browse.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual Int_t GetSize() const
virtual Double_t GetZ() const
virtual void SetName(const char *name)
Change the name of this Node.
R__EXTERN TGeometry * gGeometry
TNode & operator=(const TNode &)
assignment operator
Int_t GetVisibility() const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
TShape * GetShape(const char *name) const
Return pointer to Shape with name.
virtual const char * GetTitle() const
Returns title of object.
const char * Data() const