65 SetTitle(viewNode->GetTitle());
100 if (viewNode && topNode) {
109 if (topNode != nextView)
continue;
136 const Char_t *foundName[2] = {nodeName1, nodeName2};
139 if (viewNode && nodeName1 && nodeName1[0]) {
152 if (strcmp(nextView->
GetName(),foundName[i]))
continue;
158 if (!found)
continue;
200 for (i=0;i<nViews;i++) {
202 if (nextView != foundView[i])
continue;
208 if (!found)
continue;
253 if (!list || maxDepLevel == 1 || maxDepLevel < 0)
return;
255 TIter nextPosition(list);
261 Double_t thisTranslation[3] = {0,0,0};
264 for (
int i =0; i< 3; i++) thisTranslation[i]= nodePosition->
GetX(i);
277 if (positionMatrix) {
279 ,position->
GetX(),position->
GetY(),position->
GetZ(),positionMatrix
280 ,newTranslation,newMatrix);
283 TCL::vadd(thisTranslation, newTranslation,newTranslation,3);
295 newTranslation[2], ¤tMatrix);
296 nextPos.
SetId(positionId);
297 if (optMarked && !node->
IsMarked()) {
298 TVolumeView fakeView(*node,maxDepLevel,&nextPos,iopt,rootVolume);
305 if ( parent && (parent != (
TDataSet *)&pattern) )
continue;
310 newTranslation[2], newRotation);
311 nP->
SetId(positionId);
312 rootVolume->
Add(
new TVolumeView(*node,maxDepLevel?maxDepLevel-1:0,nP,iopt));
314 Error(
"TVolumeView ctor",
"Position with NO node attached has been supplied");
349 Error(
"TVolumeView",
"wrong node <%s> on path: \"%s\"",thisNode->
GetName(),thisNodePath);
358 thisPosition =
new TVolumePosition(thisNode,thisX, thisY, thisZ, matrixName);
359 else if (matrixType==2)
362 const Char_t *title =
"rotation";
363 thisRotMatrix =
new TRotMatrix((
char *)matrixName,(
char *)title,rotate);
364 thisPosition =
new TVolumePosition(thisNode,thisX, thisY, thisZ, thisRotMatrix);
366 Error(
"TVolumeView",
" No rotation matrix is defined");
367 if (thisPosition) thisPosition->
SetId(positionId);
404 closedNode->
Add(node);
445 const Int_t big = 9999;
446 const Int_t inaxis = 7;
447 const Int_t maxdist = 5;
457 if (px < puxmin - inaxis)
return big;
458 if (py > puymin + inaxis)
return big;
459 if (px > puxmax + inaxis)
return big;
460 if (py < puymax - inaxis)
return big;
463 if (!view)
return big;
469 thisNode = position->
GetNode();
476 if (dist < maxdist) {
477 gPad->SetSelected(
this);
494 while ((node = (
TVolume *)next())) {
496 if (dnode <= 0)
break;
497 if (dnode < dist) dist = dnode;
504 gPad->SetSelected(view);
520 gROOT->MakeDefCanvas();
530 Int_t iopt = atoi(option);
539 while (parent && ++iopt);
544 #if ROOT_VERSION_CODE >= ROOT_VERSION(4,03,05) 556 gPad->GetViewer3D(option);
587 while ( (nextView = (
TVolumeView *)next(mode)) && nextView !=
this ){}
588 if (nextView ==
this) {
596 for (
Int_t i=0;i<3;i++) {
597 globalMin[i] += offSet[i];
598 globalMax[i] += offSet[i];
619 TCanvas dummyPad(
"--Dumm--",
"dum",1,1);
630 if (savePad) savePad->
cd();
639 static char info[512];
641 ((
TPad *)
gPad)->AbsPixeltoXY(px,py,x[0],x[1]);
646 for (
int i =0; i<3;i++) min[i] = (max[i]+min[i])/2;
648 min[0] = x[0]; min[1] = x[1];
654 snprintf(info,512,
"%6.2f/%6.2f/%6.2f: %s/%s, shape=%s/%s",x[0],x[1],x[2],
GetName(),
GetTitle(),shape->
GetName(),shape->
ClassName());
667 if (masterName && masterName[0]) masterNode = (
TVolumeView *)
Find(masterName);
670 if (transform(localName)) position = transform[0];
681 if (!masterNode) masterNode =
this;
682 if (masterNode && localNode) {
685 while ((nextNode = (
TVolumeView *)transform()) && nextNode != localNode) { }
686 if (nextNode) position = transform[0];
708 if (masterName && masterName[0]) masterNode = (
TVolumeView *)
Find(masterName);
734 if (!masterNode) masterNode =
this;
735 if (masterNode && localNode) {
738 while ((nextNode = (
TVolumeView *)transform()) && nextNode != localNode) { }
765 if (option[0]==
'r' && level > 3 )
return;
767 Int_t iFirst = atoi(option);
769 const char *delim = strpbrk( option,
":-,");
770 if (delim) iLast = atoi(delim+1);
771 if (iLast < iFirst) {
776 if ( (0 < iLast) && (iLast < level) )
return;
785 thisNode = position->
GetNode();
790 if (level >= iFirst) {
821 Bool_t rangeView = option && option[0]==
'r';
825 while( (shape = (
TShape *)nextShape()) ) {
832 #if ROOT_VERSION_CODE >= ROOT_VERSION(4,03,05) 847 const_cast<TBuffer3D &
>(buffer).fID =
this;
849 Int_t reqSections = viewer3D->
AddObject(buffer, &viewerWantsSons);
856 shape->
Paint(option);
869 str = parent->
PathP();
887 const Char_t *sceleton[] = {
888 "TVolumeView *CreateNodeView(TVolume *topNode) {" 889 ,
" TString thisNodePath = " 890 ,
" UInt_t thisPositionId = " 891 ,
" Double_t thisTranslate[3] = " 893 ,
" TString matrixName = " 894 ,
" Int_t matrixType = " 895 ,
" Double_t thisMatrix[] = { " 899 ,
" return = new TVolumeView(thisTranslate, thisMatrix, thisPositionId, topNode," 900 ,
" thisNodePath.Data(),matrixName.Data(), matrixType);" 904 Int_t sceletonSize =
sizeof(sceleton)/
sizeof(
const Char_t*);
909 UInt_t thisPositionId = thisPosition ? thisPosition->
GetId():0;
915 Int_t matrixType = 2;
917 Double_t thisMatrix[] = { 0,0,0, 0,0,0, 0,0,0 };
919 matrixName = matrix->
GetName();
921 matrixType = matrix->
GetType();
924 for (
Int_t lineNumber =0; lineNumber < sceletonSize; lineNumber++) {
925 out << sceleton[lineNumber];
926 switch (lineNumber) {
927 case 1: out <<
"\"" << thisNodePath.
Data() <<
"\";" ;
929 case 2: out << thisPositionId <<
";" ;
931 case 3: out <<
"{" << thisX <<
", " << thisY <<
", "<< thisZ <<
"};";
933 case 5: out <<
"\"" << matrixName <<
"\";" ;
935 case 6: out << matrixType <<
";" ;
937 case 7: out << thisMatrix[im++] <<
", "; out << thisMatrix[im++] <<
", "; out << thisMatrix[im++] <<
", ";
939 case 8: out << thisMatrix[im++] <<
", "; out << thisMatrix[im++] <<
", "; out << thisMatrix[im++] <<
", ";
941 case 9: out << thisMatrix[im++] <<
", "; out << thisMatrix[im++] <<
", "; out << thisMatrix[im++];
947 out <<
" " << std::endl;
978 while( (shape = (
TShape *)nextShape()) ) {
987 while( (shape = (
TShape *)nextShape()) ) {
988 if (shape->GetVisibility()) shape->
Sizeof3D();
virtual Double_t GetY() const
virtual const char * GetName() const
Returns name of object.
virtual UInt_t GetId() const
std::string GetName(const std::string &scope_name)
virtual Double_t * GetMatrix()
virtual Int_t GetDepth() const
double dist(Rotation3D const &r1, Rotation3D const &r2)
virtual ENodeSEEN GetVisibility() const
virtual void SetLineAttributes()
Invoke the DialogCanvas Line attributes.
TRotMatrix * GetRotMatrix(const char *name) const
Return pointer to RotMatrix with name.
virtual void Sizeof3D() const
-*-*-*-*-*-*Return total size of this 3-D Node with its attributes-*-* *-* ==========================...
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual void SetAutoRange(Bool_t autorange=kTRUE)=0
virtual Bool_t DoOwner(Bool_t done=kTRUE)
Set / Reset the ownerships and returns the previous status of the ownerships.
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
virtual TVolume * GetNode() const
to be documented
Use this attribute class when an object should have 3D capabilities.
void ToLower()
Change string to lower-case.
virtual Double_t GetZ() const
TList * GetListOfShapes() const
virtual void SetMatrix(const Double_t *matrix)
copy predefined 3x3 matrix into TRotMatrix object
virtual void NDCtoWC(const Float_t *pn, Float_t *pw)=0
virtual TVolumePosition * GetPosition() const
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual Width_t GetLineWidth() const
Return the line width.
virtual void PaintShape(Option_t *option="")
Paint shape of the volume To be called from the TObject::Paint method only.
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections) const
Stub to avoid forcing implementation at this stage.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
const TRotMatrix * GetMatrix() const
Sequenceable collection abstract base class.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Add(TDataSet *dataset)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
-*-*-*-*-*-*-*-*Compute distance from point px,py to a TVolumeView-*-*-*-*-* *-* ====================...
virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible)
Set visibility for this volume and its sons.
virtual TShape * GetShape() const
virtual TList * GetListOfPositions()
virtual Int_t GetType() const
virtual TVolumePosition * Local2Master(const TVolumeView *localNode, const TVolumeView *masterNode=0)
to be documented
virtual Int_t PushLevel()
Abstract 3D shapes viewer.
virtual void Paint(Option_t *option="")
-*-*-*-*-*-*-*-*-*-*-*Paint Referenced node with current parameters-*-*-* *-* =======================...
static TRotMatrix * GetIdentity()
Return a pointer the "identity" matrix.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
void Error(const char *location, const char *msgfmt,...)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
to be documented
virtual void GetLocalRange(Float_t *min, Float_t *max)
GetRange.
Using a TBrowser one can browse all ROOT objects.
virtual Bool_t IsMarked() const
virtual Double_t GetX(Int_t indx=0) const
virtual void SetObject(TObject *obj)
The depricated method (left here for the sake of the backward compatibility)
This is the base class for all geometry shapes.
Manages a detector rotation matrix.
virtual TVolume * AddNode(TVolume *node)
Add the TVolume in the Tnode data-structure refered by this TVolumeView object Return TVolume * the i...
virtual Double_t * Local2Master(const Double_t *local, Double_t *master, Int_t nPoints=1) const
-*-*-*-*Convert one point from local system to master reference system-*-* *-* ======================...
virtual char * GetObjectInfo(Int_t px, Int_t py) const
to be documented
virtual void Add(TDataSet *dataset)
static int * ucopy(const int *a, int *b, int n)
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void SetLineAttributes()
to be documented
virtual void UpdatePosition(Option_t *option="")
to be documented
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
The most important graphics class in the ROOT system.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TDataSet * Find(const char *path) const
Full description see: TDataSetIter::Find.
Generic 3D primitive description class.
virtual TString Path() const
return the full path of this data set
virtual void SetId(UInt_t id)
virtual Color_t GetLineColor() const
Return the line color.
virtual TList * GetListOfShapes() const
virtual void Paint(Option_t *option="")
This method is used only when a shape is painted outside a TNode.
virtual void Browse(TBrowser *b)
to be documented
virtual void PaintShape(Option_t *option)
Paint shape of the node To be called from the TObject::Paint method only.
void Add(THist< DIMENSIONS, PRECISION_TO, STAT_TO... > &to, const THist< DIMENSIONS, PRECISION_FROM, STAT_FROM... > &from)
Add two histograms.
virtual void Browse(TBrowser *b)
Browse this dataset (called by TBrowser).
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void SetLineAttr(Color_t color, Int_t width, Option_t *opt="")
static float * vadd(const float *b, const float *c, float *a, int n)
virtual void SetGeomLevel(Int_t level=0)
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.
virtual TVolume * GetNode() const
Mother of all ROOT objects.
virtual ~TVolumeView()
default dtor (empty for this class)
virtual void UpdateTempMatrix(Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=0)
Update temp matrix.
virtual const TVolumePosition * GetPosition(Int_t level=0) const
to be documented
virtual void Draw(Option_t *depth="3")
-*-*-*-*-*-*-*-*-*-*-*Draw Referenced node with current parameters-*-*-* *-* ========================...
virtual Bool_t IsMarked() const
TShape * GetShape() const
virtual void Add(TObject *obj)
virtual void GetRange(Float_t *min, Float_t *max)=0
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
virtual Bool_t IsOwner() const
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
to be documented
virtual Int_t GetGlobalRange(const TVolumeView *rootNode, Float_t *min, Float_t *max)
Calculate the position of the vertrex of the outlined cube in repect of the given TVolumeView object...
virtual void Sizeof3D() const
Set total size of this 3D object (used by X3D interface).
virtual Int_t GetSize() const
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
R__EXTERN TGeometry * gGeometry
Int_t GetVisibility() const
virtual TSeqCollection * GetCollection() const
virtual void PushMatrix()
virtual void SetVisibility(Int_t vis=1)
to be documented
virtual const char * GetTitle() const
Returns title of object.
virtual TDataSet * GetParent() const
const char * Data() const
virtual TString PathP() const
return the full path of this data set