I am trying to draw TGeoCompositeShape in GL viewer. But it seems ROOT does not treat translation and rotation.
I have tried also a simple script. It does not work too. TGCompositeShape is located at (0,0,0).
I have attached a patch to tutorial/rootgeom.C for testing.
I am using ROOT 5.11/06.
— rootgeom.C.org 2006-06-23 17:43:07.893322725 +0200
+++ rootgeom.C.new 2006-06-23 17:37:47.269168153 +0200
@@ -54,6 +54,7 @@
//--- make letter 'R'
TGeoVolume *R = geom->MakeBox("R", Vacuum, 25., 25., 5.);
-
R->GetShape()->SetName(“R”);
R->SetVisibility(kFALSE);
TGeoVolume *bar1 = geom->MakeBox(“bar1”, Al, 5., 25, 5.);
bar1->SetLineColor(kRed);
@@ -92,6 +93,7 @@
//— make letter 'T’
TGeoVolume *T = geom->MakeBox(“T”, Vacuum, 25., 25., 5.);
-
T->GetShape()->SetName(“T”);
T->SetVisibility(kFALSE);
TGeoVolume *bar5 = geom->MakeBox(“bar5”, Al, 5., 20., 5.);
bar5->SetLineColor(kBlue);
@@ -100,10 +102,14 @@
bar6->SetLineColor(kBlue);
T->AddNode(bar6, 1, tr9);
-
TGeoCompositeShape *a = new TGeoCompositeShape(“A”,“R+T”);
-
TGeoVolume *b = new TGeoVolume(“B”,a,Al);
-
b->SetVisibility(kTRUE);
rootbox->AddNode(R, 1, tr10);
- rootbox->AddNode(O, 1, tr11);
- rootbox->AddNode(b, 1, tr11);
+// rootbox->AddNode(O, 1, tr11);
rootbox->AddNode(O, 2, tr12);
rootbox->AddNode(T, 1, tr13);
Hi,
In your example, the components R and T of the composite R+T are 2 identical boxes, so what do you expect to get if you make the union and both components are in origin? You will just get something identical to R or T…
Why don’t you better start with an existing example with composites: /tutorials/csgdemo.C, try to understand it and then make your own composite?
Cheers,
Andrei
Sorry, my example was poor.
I have attached a new example. In which I create ‘T’ with using TGeoCompositeShape. Several 'T’s are drawn in normal pads, but only one ‘T’ is drawn in GL viewer.
Ryu
patch.txt (2.83 KB)
[quote]Sorry, my example was poor.
I have attached a new example. In which I create ‘T’ with using TGeoCompositeShape. Several 'T’s are drawn in normal pads, but only one ‘T’ is drawn in GL viewer.
Ryu[/quote]
With the latest ROOT (cvs) I cannot reproduce your problem - I have the same picture in a pad and gl viewer.
Thank you for reply.
I have tested with ROOT v5.10.00. Then there was no probelm, several 'T’s apprear in GL pad.
So this is 5.11.06 specific problem or my compile of ROOT was wrong.
I have compiled ROOT from source.
root-config --config
linux --disable-builtin-freetype --disable-builtin-pcre --disable-builtin-gsl --enable-cern --enable-fftw3 --enable-mathcore --enable-mathmore --enable-minuit2 --enable-reflex --enable-cintex --enable-roofit --enable-qt
Yes, I think it’s the 5.11.06 specific problem. So, if you need TGeoCompositeShape+GL-viewer you’d better change ROOT’s version.
[quote]Thank you for reply.
I have tested with ROOT v5.10.00. Then there was no probelm, several 'T’s apprear in GL pad.
So this is 5.11.06 specific problem or my compile of ROOT was wrong.
[/quote]
I’ve checked the version 5.11.06 - that’s not one ‘T’, these are all your 'T’s in one place (you can move it and you’ll see another ‘T’ in old place). I think, that’s not a gl viewer problem, there were no changes in GL-viewer since 5.11.06 release, but it works OK now (CVS version).