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);
443 const Int_t big = 9999;
444 const Int_t inaxis = 7;
445 const Int_t maxdist = 5;
455 if (px < puxmin - inaxis)
return big;
456 if (py > puymin + inaxis)
return big;
457 if (px > puxmax + inaxis)
return big;
458 if (py < puymax - inaxis)
return big;
461 if (!view)
return big;
467 thisNode = position->
GetNode();
474 if (dist < maxdist) {
475 gPad->SetSelected(
this);
492 while ((node = (
TVolume *)next())) {
494 if (dnode <= 0)
break;
495 if (dnode < dist) dist = dnode;
502 gPad->SetSelected(view);
517 gROOT->MakeDefCanvas();
527 Int_t iopt = atoi(option);
536 while (parent && ++iopt);
541 #if ROOT_VERSION_CODE >= ROOT_VERSION(4,03,05) 553 gPad->GetViewer3D(option);
584 while ( (nextView = (
TVolumeView *)next(mode)) && nextView !=
this ){}
585 if (nextView ==
this) {
593 for (
Int_t i=0;i<3;i++) {
594 globalMin[i] += offSet[i];
595 globalMax[i] += offSet[i];
616 TCanvas dummyPad(
"--Dumm--",
"dum",1,1);
627 if (savePad) savePad->
cd();
636 static char info[512];
638 ((
TPad *)
gPad)->AbsPixeltoXY(px,py,x[0],x[1]);
643 for (
int i =0; i<3;i++) min[i] = (max[i]+min[i])/2;
645 min[0] = x[0]; min[1] = x[1];
651 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());
664 if (masterName && masterName[0]) masterNode = (
TVolumeView *)
Find(masterName);
667 if (transform(localName)) position = transform[0];
678 if (!masterNode) masterNode =
this;
679 if (masterNode && localNode) {
682 while ((nextNode = (
TVolumeView *)transform()) && nextNode != localNode) { }
683 if (nextNode) position = transform[0];
705 if (masterName && masterName[0]) masterNode = (
TVolumeView *)
Find(masterName);
731 if (!masterNode) masterNode =
this;
732 if (masterNode && localNode) {
735 while ((nextNode = (
TVolumeView *)transform()) && nextNode != localNode) { }
759 if (option[0]==
'r' && level > 3 )
return;
761 Int_t iFirst = atoi(option);
763 const char *delim = strpbrk( option,
":-,");
764 if (delim) iLast = atoi(delim+1);
765 if (iLast < iFirst) {
770 if ( (0 < iLast) && (iLast < level) )
return;
779 thisNode = position->
GetNode();
784 if (level >= iFirst) {
815 Bool_t rangeView = option && option[0]==
'r';
819 while( (shape = (
TShape *)nextShape()) ) {
826 #if ROOT_VERSION_CODE >= ROOT_VERSION(4,03,05) 841 const_cast<TBuffer3D &
>(buffer).fID =
this;
843 Int_t reqSections = viewer3D->
AddObject(buffer, &viewerWantsSons);
850 shape->
Paint(option);
863 str = parent->
PathP();
881 const Char_t *sceleton[] = {
882 "TVolumeView *CreateNodeView(TVolume *topNode) {" 883 ,
" TString thisNodePath = " 884 ,
" UInt_t thisPositionId = " 885 ,
" Double_t thisTranslate[3] = " 887 ,
" TString matrixName = " 888 ,
" Int_t matrixType = " 889 ,
" Double_t thisMatrix[] = { " 893 ,
" return = new TVolumeView(thisTranslate, thisMatrix, thisPositionId, topNode," 894 ,
" thisNodePath.Data(),matrixName.Data(), matrixType);" 898 Int_t sceletonSize =
sizeof(sceleton)/
sizeof(
const Char_t*);
903 UInt_t thisPositionId = thisPosition ? thisPosition->
GetId():0;
909 Int_t matrixType = 2;
911 Double_t thisMatrix[] = { 0,0,0, 0,0,0, 0,0,0 };
913 matrixName = matrix->
GetName();
915 matrixType = matrix->
GetType();
918 for (
Int_t lineNumber =0; lineNumber < sceletonSize; lineNumber++) {
919 out << sceleton[lineNumber];
920 switch (lineNumber) {
921 case 1: out <<
"\"" << thisNodePath.
Data() <<
"\";" ;
923 case 2: out << thisPositionId <<
";" ;
925 case 3: out <<
"{" << thisX <<
", " << thisY <<
", "<< thisZ <<
"};";
927 case 5: out <<
"\"" << matrixName <<
"\";" ;
929 case 6: out << matrixType <<
";" ;
931 case 7: out << thisMatrix[im++] <<
", "; out << thisMatrix[im++] <<
", "; out << thisMatrix[im++] <<
", ";
933 case 8: out << thisMatrix[im++] <<
", "; out << thisMatrix[im++] <<
", "; out << thisMatrix[im++] <<
", ";
935 case 9: out << thisMatrix[im++] <<
", "; out << thisMatrix[im++] <<
", "; out << thisMatrix[im++];
941 out <<
" " << std::endl;
971 while( (shape = (
TShape *)nextShape()) ) {
980 while( (shape = (
TShape *)nextShape()) ) {
981 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.
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.
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