TView on the 'background'

From: Rutger van der Eijk (r36@nikhef.nl)
Date: Fri Feb 25 2000 - 22:33:17 MET


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