Logo ROOT   6.16/01
Reference Guide
TVolume.cxx
Go to the documentation of this file.
1// @(#)root/table:$Id$
2// Author: Valery Fine 10/12/98
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "Riostream.h"
13#include <stdlib.h>
14
15#include "TROOT.h"
16#include "TClass.h"
17#include "TVirtualPad.h"
18#include "TView.h"
19#include "TGeometry.h"
20#include "TRotMatrix.h"
21#include "TShape.h"
22#include "TVolume.h"
23#include "TBrowser.h"
24#include "X3DBuffer.h"
25
26#include "TTablePadView3D.h"
27#include "TCanvas.h"
28
29#include "TRotMatrix.h"
30#include "TVolumePosition.h"
31#include "TVirtualViewer3D.h"
32#include "TBuffer3D.h"
33
34#if 0
35const Int_t kVectorSize = 3;
37const Int_t kMAXLEVELS = 20;
38
41static Int_t gGeomLevel = 0;
42
44#endif
45//R__EXTERN Size3D gSize3D;
47
48// Pin vtable
49void TVolume::Add(TDataSet *dataset)
50{
51 TDataSet::Add(dataset);
52}
53
55
56////////////////////////////////////////////////////////////////////////////////
57/// TVolume description
58///
59/// A TVolume object is used to build the geometry hierarchy.
60/// Since TVolume is derived from TDataSet class it may contain other volumes.
61///
62/// A geometry volume has attributes:
63/// - name and title
64/// - pointer to the referenced shape (see TShape).
65/// - list of TVolumePosition object defining the position of the nested volumes
66/// with respect to the mother node.
67///
68///
69/// A volume can be drawn.
70
71
72////////////////////////////////////////////////////////////////////////////////
73//// Volume default constructor
74
76{
77 fShape = 0;
78 fListOfShapes = 0;
80 if (!gGeometry) new TGeometry;
81}
82
83////////////////////////////////////////////////////////////////////////////////
84//// Volume normal constructor
85////
86//// name is the name of the node
87//// title is title
88//// shapename is the name of the referenced shape
89
90TVolume::TVolume(const char *name, const char *title, const char *shapename, Option_t *option)
91 :TObjectSet(name),TAttLine(), TAttFill(),fShape(0),fListOfShapes(0)
92{
93#ifdef WIN32
94/// The color "1" - default produces a very bad 3D image with OpenGL
95 Color_t lcolor = 16;
96 SetLineColor(lcolor);
97#endif
98 static Int_t counter = 0;
99 counter++;
100 SetTitle(title);
101 if(!(counter%1000))std::cout<<"TVolume count="<<counter<<" name="<<name<<std::endl;
102 if (!gGeometry) new TGeometry;
103 Add(gGeometry->GetShape(shapename),kTRUE);
104// fParent = gGeometry->GetCurrenTVolume();
105 fOption = option;
107
109}
110
111////////////////////////////////////////////////////////////////////////////////
112//// Volume normal constructor
113////
114//// name is the name of the node
115//// title is title
116//// shape is the pointer to the shape definition
117
118TVolume::TVolume(const char *name, const char *title, TShape *shape, Option_t *option)
119 :TObjectSet(name),TAttLine(),TAttFill(),fShape(0),fListOfShapes(0)
120{
121#ifdef WIN32
122/// The color "1" - default produces a very bad 3D image with OpenGL
123 Color_t lcolor = 16;
124 SetLineColor(lcolor);
125#endif
126
127 if (!gGeometry) new TGeometry;
128 Add(shape,kTRUE);
129 fOption = option;
131 SetTitle(title);
132 if(shape) ImportShapeAttributes();
133}
134
135////////////////////////////////////////////////////////////////////////////////
136/// ENodeSEEN Visibility flag 00 - everything visible,
137/// 10 - this invisible, but sons are visible
138/// 01 - this visible but sons
139/// 11 - neither this nor its sons are visible
140/// Maps the value of the visibility flag to <a href="https://cern-tex.web.cern.ch/cern-tex/geant_html3/node128.html#SECTION056000000000000000000000">GEANT 3.21 "volume attributes"</a>
141
143{
144 const Int_t mapVis[4] = {1, -2, 0, -1 };
145 return mapVis[vis];
146}
147
148////////////////////////////////////////////////////////////////////////////////
149/// ENodeSEEN TVolume::MapGEANT2StNodeVis(Int_t vis)
150/// Maps the value of <a href="https://cern-tex.web.cern.ch/cern-tex/geant_html3/node128.html#SECTION056000000000000000000000">GEANT 3.21 "volume attributes"</a> to the visibility flag
151
153{
154 const Int_t mapVis[4] = {1, -2, 0, -1 };
155 Int_t i;
156// for (i =0; i<3;i++) if (mapVis[i] == vis) return (ENodeSEEN)i;
157 for (i =0; i<3;i++) if (mapVis[i] == vis) return i;
158 return kBothVisible;
159}
160
161////////////////////////////////////////////////////////////////////////////////
162/// Convert a TNode object into a TVolume
163
164TVolume::TVolume(TNode &rootNode):fShape(0),fListOfShapes(0)
165{
166 SetName(rootNode.GetName());
167 SetTitle(rootNode.GetTitle());
169 fOption = rootNode.GetOption();
170 Add(rootNode.GetShape(),kTRUE);
171
172 SetLineColor(rootNode.GetLineColor());
173 SetLineStyle(rootNode.GetLineStyle());
174 SetLineWidth(rootNode.GetLineWidth());
175 SetFillColor(rootNode.GetFillColor());
176 SetFillStyle(rootNode.GetFillStyle());
177
178 TList *nodes = rootNode.GetListOfNodes();
179 if (nodes) {
180 TIter next(nodes);
181 TNode *node = 0;
182 while ( (node = (TNode *) next()) ){
183 TVolume *nextNode = new TVolume(*node);
184 Add(nextNode,node->GetX(),node->GetY(),node->GetZ(),node->GetMatrix());
185 }
186 }
187}
188
189////////////////////////////////////////////////////////////////////////////////
190///to be documented
191
192void TVolume::Add(TShape *shape, Bool_t IsMaster)
193{
194 if (!shape) return;
196 fListOfShapes->Add(shape);
197 if (IsMaster) fShape = shape;
198}
199
200////////////////////////////////////////////////////////////////////////////////
201/// Convert a TVolume object into a TNode
202
204{
205 Double_t x=0;
206 Double_t y=0;
207 Double_t z=0;
208 const TRotMatrix* matrix = 0;
209 if (position) {
210 x=position->GetX();
211 y=position->GetY();
212 z=position->GetZ();
213 matrix = position->GetMatrix();
214 }
215// const Char_t *path = Path();
216// printf("%s: %s/%s, shape=%s/%s\n",path,GetName(),GetTitle(),GetShape()->GetName(),GetShape()->ClassName());
217 TNode *newNode = new TNode(GetName(),GetTitle(),GetShape(),x,y,z,(TRotMatrix* )matrix,GetOption());
219
220 newNode->SetLineColor(GetLineColor());
221 newNode->SetLineStyle(GetLineStyle());
222 newNode->SetLineWidth(GetLineWidth());
223 newNode->SetFillColor(GetFillColor());
224 newNode->SetFillStyle(GetFillStyle());
225
226 TList *positions = GetListOfPositions();
227 if (positions) {
228 TIter next(positions);
229 TVolumePosition *pos = 0;
230 while ( (pos = (TVolumePosition *) next()) ){
231 TVolume *node = pos->GetNode();
232 if (node) {
233 newNode->cd();
234 node->CreateTNode(pos);
235 }
236 }
237 }
238 newNode->ImportShapeAttributes();
239 return newNode;
240}
241
242////////////////////////////////////////////////////////////////////////////////
243//// Volume default destructor
244
246{
247 // Hmm, here we are in the troubles, in theory we have to find all
248 // place where this node is sitting but we don't (yet :-()
249
250 if (GetListOfPositions()) {
253 }
255
256 // Required since we overload TObject::Hash.
258}
259
260////////////////////////////////////////////////////////////////////////////////
261/// to be documented
262
264{
266 if ( GetListOfPositions()) GetListOfPositions()->Add(position);
267 else Error("Add","Can not create list of positions for the current node <%s>:<%s>",GetName(),GetTitle());
268}
269
270////////////////////////////////////////////////////////////////////////////////
271/// to be documented
272
274{
275 TVolumePosition *position = nodePosition;
276 if (!node) return 0;
277 if (!position) position = new TVolumePosition(node); // Create default position
278 // The object must be placed at once. Check it:
279 if (!(GetCollection() && GetCollection()->FindObject(node)) ) TDataSet::Add(node);
280 Add(position);
281 return position;
282}
283
284////////////////////////////////////////////////////////////////////////////////
285////
286//// volume the pointer to the volume to be placed
287//// x,y,z are the offsets of the volume with respect to his mother
288//// matrix is the pointer to the rotation matrix
289//// id is a unique position id
290
292 TRotMatrix *matrix, UInt_t id, Option_t *)
293{
294 if (!volume) return 0;
295 TRotMatrix *rotation = matrix;
296 if(!rotation) rotation = GetIdentity();
297 TVolumePosition *position = new TVolumePosition(volume,x,y,z,rotation);
298 position->SetId(id);
299 return Add(volume,position);
300}
301
302////////////////////////////////////////////////////////////////////////////////
303////
304//// volume the pointer to the volume to be placed
305//// x,y,z are the offsets of the volume with respect to his mother
306//// matrixname is the name of the rotation matrix
307//// id is a unique position id
308
310 const char *matrixname, UInt_t id, Option_t *)
311{
312 if (!volume) return 0;
313 TRotMatrix *rotation = 0;
314 if (matrixname && strlen(matrixname)) rotation = gGeometry->GetRotMatrix(matrixname);
315 if (!rotation) rotation = GetIdentity();
316 TVolumePosition *position = new TVolumePosition(volume,x,y,z,rotation);
317 position->SetId(id);
318 return Add(volume,position);
319}
320
321////////////////////////////////////////////////////////////////////////////////
322/// to be documented
323
325{
326 if (GetListOfPositions()){
327 TVolumePosition *nodePosition = 0;
329 Int_t posNumber = 0;
330 while ( (nodePosition = (TVolumePosition *)next()) ) {
331 posNumber = nodePosition->GetId();
332 TString posName = "*";
333 posName += nodePosition->GetNode()->GetTitle();
334 char num[10];
335 posName += ";";
336 snprintf(num,10,"%d",posNumber);
337 posName += num;
338 b->Add(nodePosition,posName.Data());
339 }
340 }
341}
342////////////////////////////////////////////////////////////////////////////////
343/// to be documented
344
346{
347 return DistancetoNodePrimitive(px,py);
348}
349
350////////////////////////////////////////////////////////////////////////////////
351//// Compute distance from point px,py to a TVolumeView
352///
353//// Compute the closest distance of approach from point px,py to the position of
354//// this volume.
355//// The distance is computed in pixels units.
356////
357//// It is restricted by 2 levels of TVolumes
358
360{
361 const Int_t big = 9999;
362 if ( GetVisibility() == kNoneVisible ) return big;
363
364 const Int_t inaxis = 7;
365 const Int_t maxdist = 5;
366
367 Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
368 Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
369 Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
370 Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
371
372///- return if point is not in the user area
373 if (px < puxmin - inaxis) return big;
374 if (py > puymin + inaxis) return big;
375 if (px > puxmax + inaxis) return big;
376 if (py < puymax - inaxis) return big;
377
378 TView *view =gPad->GetView();
379 if (!view) return big;
380
381 static TVolumePosition nullPosition;
382 TVolumePosition *position = pos;
383 if (!position) position = &nullPosition;
384 if (pos) position->UpdatePosition();
385 Int_t dist = big;
386 if ( !(GetVisibility() & kThisUnvisible ) ) {
387 TShape *shape = 0;
388 TIter nextShape(fListOfShapes);
389 while ((shape = (TShape *)nextShape())) {
390 ///- Distance to the next referenced shape if visible
391 if (shape->GetVisibility()) {
392 Int_t dshape = shape->DistancetoPrimitive(px,py);
393 if (dshape < maxdist) {
394 gPad->SetSelected(this);
395 return 0;
396 }
397 if (dshape < dist) dist = dshape;
398 }
399 }
400 }
401
402 if ( (GetVisibility() & kSonUnvisible) ) return dist;
403
404///- Loop on all sons
405 TList *posList = GetListOfPositions();
406 Int_t dnode = dist;
407 if (posList && posList->GetSize()) {
409 TVolumePosition *thisPosition;
410 TObject *obj;
411 TIter next(posList);
412 while ((obj = next())) {
413 thisPosition = (TVolumePosition*)obj;
414 TVolume *node = thisPosition->GetNode();
415 dnode = node->DistancetoNodePrimitive(px,py,thisPosition);
416 if (dnode <= 0) break;
417 if (dnode < dist) dist = dnode;
418 if (gGeometry->GeomLevel() > 2) break;
419 }
421 }
422
423 if (gGeometry->GeomLevel()==0 && dnode > maxdist) {
424 gPad->SetSelected(view);
425 return 0;
426 } else
427 return dnode;
428}
429
430////////////////////////////////////////////////////////////////////////////////
431//// Draw Referenced node with current parameters
432
434{
435 TString opt = option;
436 opt.ToLower();
437///- Clear pad if option "same" not given
438 if (!gPad) {
439 gROOT->MakeDefCanvas();
440 }
441 if (!opt.Contains("same")) gPad->Clear();
442
443 // Check geometry level
444
445 Int_t iopt = atoi(option);
446 TDataSet *parent = 0;
447 char buffer[12];
448 if (iopt < 0) {
449 // set the "positive option"
450 snprintf(buffer,12,"%d",-iopt);
451 option = buffer;
452 // select parent to draw
453 parent = this;
454 do parent = parent->GetParent();
455 while (parent && ++iopt);
456 }
457 if (parent) parent->AppendPad(option);
458 else AppendPad(option);
459#if ROOT_VERSION_CODE >= ROOT_VERSION(4,03,05)
460 // the new (4.03/05) way to active 3D viewer
461 // Create a 3-D view
462 TView *view = gPad->GetView();
463 if (!view) {
464 view = TView::CreateView(1,0,0);
465 // Set the view to perform a first autorange (frame) draw.
466 // TViewer3DPad will revert view to normal painting after this
467 view->SetAutoRange(kTRUE);
468 }
469
470 // Create a 3D viewer to draw us
471// gPad->GetViewer3D(option);
472 gPad->GetViewer3D();
473#else
474 Paint(option);
475#endif
476}
477
478
479////////////////////////////////////////////////////////////////////////////////
480//// Draw only Sons of this node
481
483{
485 Draw(option);
486}
487
488
489////////////////////////////////////////////////////////////////////////////////
490//// Execute action corresponding to one event
491////
492//// This member function must be implemented to realize the action
493//// corresponding to the mouse click on the object in the window
494
496{
497// if (gPad->GetView())
498// gPad->GetView()->ExecuteRotateView(event, px, py);
499
500// if (!gPad->GetListOfPrimitives()->FindObject(this)) gPad->SetCursor(kCross);
501 gPad->SetCursor(kHand);
502}
503
504////////////////////////////////////////////////////////////////////////////////
505/// Return a pointer the "identity" matrix
506
508{
509 Double_t *identityMatrix = 0;
510 if (!gIdentity) {
511 gIdentity = gGeometry->GetRotMatrix("Identity");
512 if (!gIdentity) {
513 gIdentity = new TRotMatrix();
514 gIdentity->SetName("Identity");
515 gIdentity->SetTitle("Identity matrix");
517 identityMatrix = gIdentity->GetMatrix();
518 memset(identityMatrix,0,9*sizeof(Double_t));
519 *identityMatrix = 1;
520 identityMatrix += 4; *identityMatrix = 1;
521 identityMatrix += 4; *identityMatrix = 1;
523 }
524 }
525 return gIdentity;
526}
527
528////////////////////////////////////////////////////////////////////////////////
529/// to be documented
530
532{
533 if (!gPad) return 0;
534 static char info[512];
535 snprintf(info,512,"%s/%s",GetName(),GetTitle());
536 Double_t x[3];
537 ((TPad *)gPad)->AbsPixeltoXY(px,py,x[0],x[1]);
538 x[2] = 0;
539 TView *view =gPad->GetView();
540 if (view) view->NDCtoWC(x, x);
541
542 TIter nextShape(fListOfShapes);
543 TShape *shape = 0;
544 while( (shape = (TShape *)nextShape()) ) {
545 Int_t nchi = strlen(info);
546 snprintf(&info[nchi],512-nchi," %6.2f/%6.2f: shape=%s/%s",x[0],x[1],shape->GetName(),shape->ClassName());
547 }
548 return info;
549}
550
551////////////////////////////////////////////////////////////////////////////////
552//// Copy shape attributes as node attributes
553
555{
556 if (fShape) {
562 }
563
564 if (!GetCollection()) return;
565 TVolume *volume;
566 TIter next(GetCollection());
567 while ( (volume = (TVolume *)next()) )
568 volume->ImportShapeAttributes();
569}
570
571////////////////////////////////////////////////////////////////////////////////
572////- Draw Referenced node
573
575{
579 return;
580}
581
582////////////////////////////////////////////////////////////////////////////////
583//// Paint Referenced volume with current parameters
584////
585////
586//// vis = 1 (default) shape is drawn
587//// vis = 0 shape is not drawn but its sons may be not drawn
588//// vis = -1 shape is not drawn. Its sons are not drawn
589//// vis = -2 shape is drawn. Its sons are not drawn
590
592{
593 if ( GetVisibility() == kNoneVisible ) return;
594
595 static TVolumePosition nullPosition;
596
597// restrict the levels for "range" option
598 Int_t level = gGeometry->GeomLevel();
599// if (option && option[0]=='r' && level > 3 && strcmp(option,"range") == 0) return;
600 if ((!(GetVisibility() & kThisUnvisible)) && option && option[0]=='r' && level > 3 ) return;
601 Int_t iopt = 0;
602 if (option) iopt = atoi(option);
603 if ( (0 < iopt) && (iopt <= level) ) return;
604
605 TTablePadView3D *view3D = (TTablePadView3D*)gPad->GetView3D();
606 TVirtualViewer3D * viewer3D = gPad->GetViewer3D();
607
608 TVolumePosition *position = pos;
609 if (!position) position = &nullPosition;
610
611 // PaintPosition does change the current matrix and it MUST be called FIRST !!!
612
613 position->UpdatePosition(option);
614
615 if ( viewer3D && !(GetVisibility() & kThisUnvisible)) PaintShape(option);
616
617 if (GetVisibility() & kSonUnvisible) return;
618
619///- Paint all sons
620 TList *posList = GetListOfPositions();
621 if (posList && posList->GetSize()) {
623 TVolumePosition *thisPosition;
624 TIter next(posList);
625 while ((thisPosition = (TVolumePosition *)next())) {
626 if (view3D) view3D->PushMatrix();
627
628 TVolume *volume = thisPosition->GetNode();
629 if (volume) volume->PaintNodePosition(option,thisPosition);
630
631 if (view3D) view3D->PopMatrix();
632 }
634 }
635}
636
637////////////////////////////////////////////////////////////////////////////////
638/// Paint shape of the volume
639/// To be called from the TObject::Paint method only
640
642{
643 Bool_t rangeView = option && option[0]=='r';
644 if (!rangeView) {
647 }
648
649 if ( (GetVisibility() & kThisUnvisible) ) return;
650
651 TIter nextShape(fListOfShapes);
652 TShape *shape = 0;
653 while( (shape = (TShape *)nextShape()) ) {
654 if (!rangeView) {
655 shape->SetLineColor(GetLineColor());
656 shape->SetLineStyle(GetLineStyle());
657 shape->SetLineWidth(GetLineWidth());
658 shape->SetFillColor(GetFillColor());
659 shape->SetFillStyle(GetFillStyle());
660 TTablePadView3D *view3D = (TTablePadView3D*)gPad->GetView3D();
661 gPad->GetViewer3D();
662 if (view3D)
663 view3D->SetLineAttr(GetLineColor(),GetLineWidth(),option);
664 }
665
666#if ROOT_VERSION_CODE >= ROOT_VERSION(4,03,05)
667 // It MUST be the TShape::Paint method:
668 Bool_t viewerWantsSons = kTRUE;
669 TVirtualViewer3D * viewer3D = gPad->GetViewer3D();
670 if (viewer3D) {
671 // We only provide master frame positions in these shapes
672 // so don't ask viewer preference
673
674 // Ask all shapes for kCore/kBoundingBox/kShapeSpecific
675 // Not all will support the last two - which is fine
676 const TBuffer3D & buffer =
678
679 // TShape sets buffer id based on TNode * gNode
680 // As we not using TNode we need to override this
681 const_cast<TBuffer3D &>(buffer).fID = this;
682
683 Int_t reqSections = viewer3D->AddObject(buffer, &viewerWantsSons);
684 if (reqSections != TBuffer3D::kNone) {
685 fShape->GetBuffer3D(reqSections);
686 viewer3D->AddObject(buffer);
687 }
688 }
689#else
690 shape->Paint(option);
691#endif
692 }
693}
694
695////////////////////////////////////////////////////////////////////////////////
696/// DeletePosition deletes the position of the TVolume *node from this TVolume
697/// and removes that volume from the list of the nodes of this TVolume
698
700{
701 if (!position) return;
702
703 if (GetListOfPositions()) {
705 while (lnk) {
706 TVolumePosition *nextPosition = (TVolumePosition *)(lnk->GetObject());
707 if (nextPosition && nextPosition == position) {
708 TVolume *node = nextPosition->GetNode();
710 delete nextPosition;
711 Remove(node);
712 break;
713 }
714 lnk = lnk->Next();
715 }
716 }
717}
718
719////////////////////////////////////////////////////////////////////////////////
720/// GetRange
721///
722/// Calculates the size of 3 box the volume occupies,
723/// Return:
724/// two floating point arrays with the bound of box
725/// surrounding all shapes of this TVolumeView
726
728{
729 TVirtualPad *savePad = gPad;
730 // Create a dummy TPad;
731 TCanvas dummyPad("--Dumm--","dum",1,1);
732 // Asking 3D TView
733 TView *view = TView::CreateView(1,0,0);
734
737 view->SetAutoRange(kTRUE);
738 Paint("range");
739 view->GetRange(&min[0],&max[0]);
740 delete view;
741 // restore "current pad"
742 if (savePad) savePad->cd();
743}
744
745////////////////////////////////////////////////////////////////////////////////
746//// Set visibility for this volume and its sons
747///
748/// ENodeSEEN Visibility flag 00 - everything visible,
749/// 10 - this invisible, but sons are visible
750/// 01 - this visible but sons
751/// 11 - neither this nor its sons are visible
752
754{
755 fVisibility = vis;
756}
757
758////////////////////////////////////////////////////////////////////////////////
759//// *Return total size of this 3-D volume with its attributes
760
762{
763 if (!(GetVisibility() & kThisUnvisible) ) {
764 TIter nextShape(fListOfShapes);
765 TShape *shape = 0;
766 while( (shape = (TShape *)nextShape()) ) {
767 if (shape->GetVisibility()) shape->Sizeof3D();
768 }
769 }
770
771 if ( GetVisibility() & kSonUnvisible ) return;
772
773 if (!Nodes()) return;
774 TVolume *node;
775 TObject *obj;
776 TIter next(Nodes());
777 while ((obj = next())) {
778 node = (TVolume*)obj;
779 node->Sizeof3D();
780 }
781}
#define SafeDelete(p)
Definition: RConfig.hxx:529
#define b(i)
Definition: RSha256.hxx:100
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
short Color_t
Definition: RtypesCore.h:79
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassImp(name)
Definition: Rtypes.h:363
const Int_t kVectorSize
Definition: TGeometry.h:28
const Int_t kMAXLEVELS
Definition: TGeometry.h:27
const Int_t kMatrixSize
Definition: TGeometry.h:29
R__EXTERN TGeometry * gGeometry
Definition: TGeometry.h:158
static Double_t gRotMatrix[kMAXLEVELS][kMatrixSize]
Definition: TNode.cxx:33
static Double_t gTranslation[kMAXLEVELS][kVectorSize]
Definition: TNode.cxx:32
static Int_t gGeomLevel
Definition: TNode.cxx:34
#define gROOT
Definition: TROOT.h:410
R__EXTERN TNode * gNode
Definition: TShape.h:68
#define gPad
Definition: TVirtualPad.h:286
@ kHand
Definition: TVirtualX.h:46
static TRotMatrix * gIdentity
Definition: TVolume.cxx:46
#define snprintf
Definition: civetweb.c:1540
virtual void Sizeof3D() const
Set total size of this 3D object (used by X3D interface).
Definition: TAtt3D.cxx:27
Fill Area Attributes class.
Definition: TAttFill.h:19
virtual Color_t GetFillColor() const
Return the fill area color.
Definition: TAttFill.h:30
virtual Style_t GetFillStyle() const
Return the fill area style.
Definition: TAttFill.h:31
virtual void Modify()
Change current fill area attributes if necessary.
Definition: TAttFill.cxx:210
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition: TAttFill.h:39
Line Attributes class.
Definition: TAttLine.h:18
virtual Color_t GetLineColor() const
Return the line color.
Definition: TAttLine.h:33
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition: TAttLine.h:42
virtual Width_t GetLineWidth() const
Return the line width.
Definition: TAttLine.h:35
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
virtual Style_t GetLineStyle() const
Return the line style.
Definition: TAttLine.h:34
virtual void Modify()
Change current line attributes if necessary.
Definition: TAttLine.cxx:234
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
Generic 3D primitive description class.
Definition: TBuffer3D.h:18
@ kBoundingBox
Definition: TBuffer3D.h:51
@ kShapeSpecific
Definition: TBuffer3D.h:52
The Canvas class.
Definition: TCanvas.h:31
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
virtual TSeqCollection * GetCollection() const
Definition: TDataSet.h:105
virtual void Remove(TDataSet *set)
Remiove the "set" from this TDataSet.
Definition: TDataSet.cxx:641
virtual TDataSet * GetParent() const
Definition: TDataSet.h:111
TObject * FindObject(const char *name) const
Must be redefined in derived classes.
Definition: TDataSet.h:101
virtual void Add(TDataSet *dataset)
Definition: TDataSet.h:150
TGeometry description.
Definition: TGeometry.h:39
Int_t GeomLevel() const
Definition: TGeometry.h:74
virtual void UpdateTempMatrix(Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=0)
Update temp matrix.
Definition: TGeometry.cxx:661
virtual Int_t PopLevel()
Definition: TGeometry.h:100
virtual void SetGeomLevel(Int_t level=0)
Definition: TGeometry.h:104
THashList * GetListOfMatrices() const
Definition: TGeometry.h:78
TRotMatrix * GetRotMatrix(const char *name) const
Return pointer to RotMatrix with name.
Definition: TGeometry.cxx:356
virtual Int_t PushLevel()
Definition: TGeometry.h:99
TShape * GetShape(const char *name) const
Return pointer to Shape with name.
Definition: TGeometry.cxx:379
void AddFirst(TObject *obj)
Add object at the beginning of the list.
Definition: THashList.cxx:69
A doubly linked list.
Definition: TList.h:44
virtual void Add(TObject *obj)
Definition: TList.h:87
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:818
virtual TObjLink * FirstLink() const
Definition: TList.h:108
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:467
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
TNode description.
Definition: TNode.h:33
virtual Double_t GetY() const
Definition: TNode.h:74
virtual Double_t GetX() const
Definition: TNode.h:73
virtual TRotMatrix * GetMatrix() const
Definition: TNode.h:66
TShape * GetShape() const
Definition: TNode.h:71
virtual Double_t GetZ() const
Definition: TNode.h:75
const Option_t * GetOption() const
Definition: TNode.h:69
Int_t GetVisibility() const
Definition: TNode.h:72
virtual void ImportShapeAttributes()
Copy shape attributes as node attributes.
Definition: TNode.cxx:410
virtual void SetVisibility(Int_t vis=1)
Set visibility for this node and its sons.
Definition: TNode.cxx:759
TList * GetListOfNodes() const
Definition: TNode.h:65
virtual void cd(const char *path=0)
Change Current Reference node to this.
Definition: TNode.cxx:250
Mother of all ROOT objects.
Definition: TObject.h:37
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
Definition: TObject.cxx:186
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:128
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition: TObject.cxx:105
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
The most important graphics class in the ROOT system.
Definition: TPad.h:29
Manages a detector rotation matrix.
Definition: TRotMatrix.h:28
virtual void SetMatrix(const Double_t *matrix)
copy predefined 3x3 matrix into TRotMatrix object
Definition: TRotMatrix.cxx:216
virtual Double_t * GetMatrix()
Definition: TRotMatrix.h:54
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TRotMatrix.h:69
This is the base class for all geometry shapes.
Definition: TShape.h:35
virtual void Paint(Option_t *option="")
This method is used only when a shape is painted outside a TNode.
Definition: TShape.cxx:143
Int_t GetVisibility() const
Definition: TShape.h:58
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections) const
Stub to avoid forcing implementation at this stage.
Definition: TShape.cxx:253
Basic string class.
Definition: TString.h:131
void ToLower()
Change string to lower-case.
Definition: TString.cxx:1100
const char * Data() const
Definition: TString.h:364
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
virtual void SetLineAttr(Color_t color, Int_t width, Option_t *opt="")
virtual void PushMatrix()
virtual void PopMatrix()
See TView3D.
Definition: TView.h:25
virtual void SetAutoRange(Bool_t autorange=kTRUE)=0
virtual void NDCtoWC(const Float_t *pn, Float_t *pw)=0
virtual void GetRange(Float_t *min, Float_t *max)=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.
Definition: TView.cxx:39
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:50
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
Abstract 3D shapes viewer.
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=0)=0
virtual void UpdatePosition(Option_t *option="")
to be documented
virtual Double_t GetZ() const
virtual TVolume * GetNode() const
virtual Double_t GetY() const
virtual Double_t GetX(Int_t indx=0) const
virtual UInt_t GetId() const
virtual void SetId(UInt_t id)
const TRotMatrix * GetMatrix() const
virtual void Draw(Option_t *depth="3")
Default Draw method for all objects.
Definition: TVolume.cxx:433
virtual void Browse(TBrowser *b)
to be documented
Definition: TVolume.cxx:324
static Int_t MapGEANT2StNodeVis(Int_t vis)
ENodeSEEN TVolume::MapGEANT2StNodeVis(Int_t vis) Maps the value of GEANT 3.21 "volume attributes" to ...
Definition: TVolume.cxx:152
virtual void Sizeof3D() const
Set total size of this 3D object (used by X3D interface).
Definition: TVolume.cxx:761
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
to be documented
Definition: TVolume.cxx:345
virtual void Add(TDataSet *dataset)
Definition: TVolume.cxx:49
virtual Int_t DistancetoNodePrimitive(Int_t px, Int_t py, TVolumePosition *position=0)
Compute distance from point px,py to a TVolumeView.
Definition: TVolume.cxx:359
virtual ~TVolume()
Definition: TVolume.cxx:245
virtual void PaintNodePosition(Option_t *option="", TVolumePosition *postion=0)
Definition: TVolume.cxx:591
virtual TNode * CreateTNode(const TVolumePosition *position=0)
Convert a TVolume object into a TNode.
Definition: TVolume.cxx:203
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
Definition: TVolume.cxx:574
virtual void DeletePosition(TVolumePosition *position)
DeletePosition deletes the position of the TVolume *node from this TVolume and removes that volume fr...
Definition: TVolume.cxx:699
virtual void DrawOnly(Option_t *option="")
Definition: TVolume.cxx:482
virtual char * GetObjectInfo(Int_t px, Int_t py) const
to be documented
Definition: TVolume.cxx:531
ENodeSEEN
Definition: TVolume.h:38
@ kNoneVisible
Definition: TVolume.h:41
@ kThisUnvisible
Definition: TVolume.h:40
@ kBothVisible
Definition: TVolume.h:38
@ kSonUnvisible
Definition: TVolume.h:39
TShape * fShape
Definition: TVolume.h:43
ENodeSEEN fVisibility
Definition: TVolume.h:46
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to an event at (px,py).
Definition: TVolume.cxx:495
TShape * GetShape() const
Definition: TVolume.h:79
void SetPositionsList(TList *list=0)
Definition: TVolume.h:55
const Option_t * GetOption() const
Definition: TVolume.h:78
virtual void GetLocalRange(Float_t *min, Float_t *max)
GetRange.
Definition: TVolume.cxx:727
virtual void PaintShape(Option_t *option="")
Paint shape of the volume To be called from the TObject::Paint method only.
Definition: TVolume.cxx:641
virtual TList * GetListOfPositions()
Definition: TVolume.h:83
virtual void ImportShapeAttributes()
Definition: TVolume.cxx:554
TVolume()
TVolume description.
Definition: TVolume.cxx:75
TList * fListOfShapes
Definition: TVolume.h:44
virtual ENodeSEEN GetVisibility() const
Definition: TVolume.h:82
static Int_t MapStNode2GEANTVis(ENodeSEEN vis)
ENodeSEEN Visibility flag 00 - everything visible, 10 - this invisible, but sons are visible 01 - thi...
Definition: TVolume.cxx:142
TString fOption
Definition: TVolume.h:45
static TRotMatrix * GetIdentity()
Return a pointer the "identity" matrix.
Definition: TVolume.cxx:507
virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible)
Set visibility for this volume and its sons.
Definition: TVolume.cxx:753
virtual TList * Nodes() const
Definition: TVolume.h:88
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
double dist(Rotation3D const &r1, Rotation3D const &r2)
Definition: 3DDistances.cxx:48
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition: TROOT.h:399