Hi Rene, I looked into it a bit further. Basically my question can be explained by looking at the examples tornado.C and shapes.C in the tutorial. In shapes.C I create some shapes attach them to a a node. And than draw the top node. On the canvas (I don't mean the X3D view) I can rotate the view anywhere in the canvas. If I turn on 'event status', I see that this is because TView is always selected if not one of the shapes is 'near'. This is what I mean with TView beging on the 'background', and it is the effect I want to have. No if I execute tornado.C I get something different. I can only rotate if my mouse is near the tornado. If I am away from the tornado the canvas is selected and NOT the TView. My question is: Why is in the case of tornado not TView 'on the background'? Cheers, Rutger On Sat, 26 Feb 2000, Rene Brun wrote: > Hi Rutger, > The way you create TView is OK. I have to know a bit more about > what your Track class is (how you draw it?) to come with a diagnostic. > Look at $ROOTSYS/tutorials/tornado.C for a simple example. > Did you derive your class from TAtt3D ? > At least one 3-d object must be in the pad to get the view cursor. > > Rene Brun > > > On Fri, 25 Feb 2000, Rutger van der Eijk wrote: > > > Hi, > > > > I want to be able to rotate a track which I draw on a canvas by using a > > TView. > > > > I have some geometry description with the ROOT geometry classes. If I draw > > the geometry on a canvas I am able to rotate it. The rotation is provided > > by TView. I always get the rotation symbol if the TView is 'selected' > > (i.e. shortest distanceToPrimitive; turning on 'Event Status' in canvas > > tells me). > > > > I want to be able to do the same thing (rotate from a TView) with a track > > that I paint. So as done in TNode::Draw() (which is called by > > TGeometry::Draw()) I create a TView: > > > > if (!gPad) { > > if (!gROOT->GetMakeDefCanvas()) return; > > (gROOT->GetMakeDefCanvas())(); > > } > > gPad->Clear(); > > > > TView *view = gPad->GetView(); > > if (!view) { > > view = new TView(1); > > view->SetRange(-100, -250, 300, 100, 250, 1000); > > // where the range is the range where the track can be present > > } > > > > and after that draw by track > > > > The track is correctly painted, but I am not able to rotate the track > > because TView is never 'selected'. Instead of TView the created canvas > > (c1) is selected. > > > > Why doesn't this work? Or better why is TView selected after a geometry > > draw, and in my simple case not? > > > > (I know I can use a TMarker3DBox to get a box which helps me rotate, but I > > want to rotate without having to refer to the TMarker3DBox edges. Which > > works with TView on the 'background', i.e. always 'selected' if no other > > object is.) > > > > I have the feeling I am missing something trivial. But I seem not to be > > able to figure out what. Can anyone show me the light? > > > > Thanks, > > > > Rutger > > > > > >
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:20 MET